-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(variable): change 'value' type to Dynamic (#277)
* fix(variable): change 'value' type to JSON Changes the Variable 'value' type from string to JSON. In PrefectHQ/prefect#13543 and associated changes around May 2024, Variables were updated from simple strings to JSON objects. The Terraform provider has still been treating them as strings, so when folks tried to put JSON-compatible values in them, Terraform would fail to work with them as found in #254 Related to https://linear.app/prefect/issue/PLA-247/changing-variable-to-a-json-value-in-the-ui-makes-next-terraform-run Related to #254 * Datasource: use Dynamic attribute * Change variable attribute type to dynamic The JSON custom type won't work for variables, because they can actually be almost any type - including standalone numbers and strings. * Update test to change value types Goes from a string to a bool in the test to confirm variables can store multiple types. * Correctly test the name change Before, when trying to test a variable resource name change, we were actually creating an entirely new resource because we use the same (randomized) value for the resource name and the attribute 'name'. To ensure we're updating the same resource, this hard-codes the resource name to 'test'. This shouldn't cause any conflicts with other tests because the resource is created in an ephemeral workspace. * Support and test bool, number, and object * Tidy up * Support tuple, correctly test tuple and object * Generate Terraform Docs * Document supported value types * Datasource: break value type checking into func It's big enough that it helps to have it separated out. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
956d9c6
commit e98e2d7
Showing
6 changed files
with
226 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.