Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying fields which API doesn't expose during import #16494

Open
radeksimko opened this issue Oct 30, 2017 · 1 comment
Open

Allow specifying fields which API doesn't expose during import #16494

radeksimko opened this issue Oct 30, 2017 · 1 comment
Labels
cli enhancement import Importing resources providers/protocol Potentially affecting the Providers Protocol and SDKs

Comments

@radeksimko
Copy link
Member

As described in hashicorp/terraform-provider-aws#1807

It's currently non-intuitive/tricky to import resources which have fields that were passed as part of creation, but Read API doesn't expose the field anymore, so it's impossible for Terraform to reconstruct the full state.

One possible solution would be to either read those fields from the config (we AFAIK already read the provider config during imports) and copy values to state or let the user specify them as CLI flags, e.g.

$ terraform import aws_cloudformation_stack stackID -set-field=on_failure=DELETE

I'm creating the issue here in core as it's IMO a provider-wide problem impacting any resource which has create-only fields which API doesn't expose.

@BlessJah
Copy link

My understanding is that argument that is passed on creation, but cannot be read or changed later is either:

  • hidden (e.g. volume encryption key that cannot be retrieved or changed)
  • discarded (e.g. on_failure which only affects stack creation)

I do believe that my issue is caused by terraform-provider-aws not distinguishing those two cases. I do also believe that problem of non-readable, non-updatable attributes has to be resolved on case-by-case basis, not by exposing API/CLI flag to change them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli enhancement import Importing resources providers/protocol Potentially affecting the Providers Protocol and SDKs
Projects
None yet
Development

No branches or pull requests

4 participants