Conversation
14568b6 to
26e91b8
Compare
liamcervante
left a comment
There was a problem hiding this comment.
LGTM, just some very minor style nits
The import block id field can now reference variables, attributes, and module outputs, as long as the result is a known non-empty string at plan time. A null or unknown value will result in an error. This commit slightly modifies the legacy CLI terraform import code path to construct a synthetic hcl.Expression from the import id passed in from the command line, with no intended change of functionality.
26e91b8 to
207b49b
Compare
|
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch. |
|
Hey, just wondering when this will be released as I will need to import a lot of existing resources into the state in the coming weeks. |
|
Hi @lightpeak, we just released this change today as part of the alpha for v1.6. This will enter general availability within September or October depending on the feedback we get for the alpha and beta release periods. It's worth noting that importing resources via config more generally was made available in the v1.5: https://www.hashicorp.com/blog/terraform-1-5-brings-config-driven-import-and-checks You might be able to make some progress with the v1.5 release for any resources that you don't need |
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
A simple approach permitting the import block id field to reference variables, attributes, and module outputs, as long as the result is a known non-empty string at plan time. A null or unknown value will result in an error.
This PR slightly modifies the legacy CLI terraform import code path to construct a synthetic
hcl.Expressionfrom the import id passed in from the command line, with no intended change of functionality. I thought this was a little better than maintaining two separate versions of theconfigs.Importandterraform.ImportTargetstructs.