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

importing aws_cloudfront_distribution should come with the default retain_on_delete setting. #10969

Closed
kitsunde opened this issue Dec 30, 2016 · 1 comment · Fixed by #13209
Closed

Comments

@kitsunde
Copy link
Contributor

terraform import on aws_cloudfront_distribution should probably import with defaults for retain_on_delete. My .tf doesn't have this setting configured.

Also I think retain_on_delete is a terraform internal setting and isn't set on AWS. However terraform will still make a remote call to apply changes if this is the only value that has changed which currently causes this behaviour: #10938, that seems unnecessary.

Terraform Version

0.8.2

Affected Resource(s)

  • aws_cloudfront_distribution

Output

$ terraform plan -target aws_cloudfront_distribution.staging
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but
will not be persisted to local or remote state storage.

aws_instance.web: Refreshing state... (ID: i-c8b0a946)
aws_cloudfront_distribution.staging: Refreshing state... (ID: EEHH5D6X39BEL)

No changes. Infrastructure is up-to-date. This means that Terraform
could not detect any differences between your configuration and
the real physical resources that exist. As a result, Terraform
doesn't need to do anything.
$ terraform state rm aws_cloudfront_distribution.staging
Item removal successful.
$ terraform import aws_cloudfront_distribution.staging EEHH5D6X39BEL
aws_cloudfront_distribution.staging: Importing from ID "EEHH5D6X39BEL"...
aws_cloudfront_distribution.staging: Import complete!
  Imported aws_cloudfront_distribution (ID: EEHH5D6X39BEL)
aws_cloudfront_distribution.staging: Refreshing state... (ID: EEHH5D6X39BEL)

Import success! The resources imported are shown above. These are
now in your Terraform state. Import does not currently generate
configuration, so you must do this next. If you do not create configuration
for the above resources, then the next `terraform plan` will mark
them for destruction.
$ terraform plan -target aws_cloudfront_distribution.staging
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but
will not be persisted to local or remote state storage.

aws_instance.web: Refreshing state... (ID: i-c8b0a946)
aws_cloudfront_distribution.staging: Refreshing state... (ID: EEHH5D6X39BEL)

The Terraform execution plan has been generated and is shown below.
Resources are shown in alphabetical order for quick scanning. Green resources
will be created (or destroyed and then created if an existing resource
exists), yellow resources are being changed in-place, and red resources
will be destroyed. Cyan entries are data sources to be read.

Note: You didn't specify an "-out" parameter to save this plan, so when
"apply" is called, Terraform can't guarantee this is what will execute.

~ aws_cloudfront_distribution.staging
    retain_on_delete: "" => "false"


Plan: 0 to add, 1 to change, 0 to destroy.

Expected Behavior

retain_on_delete is optional, but importing doesn't absorb the default behaviour.

Actual Behavior

It appears to have changed.

@kitsunde kitsunde changed the title aws_cloudfront_distribution should have a retain_on_delete setting. importing aws_cloudfront_distribution should have a retain_on_delete setting. Dec 30, 2016
@kitsunde kitsunde changed the title importing aws_cloudfront_distribution should have a retain_on_delete setting. importing aws_cloudfront_distribution should come with the default retain_on_delete setting. Dec 30, 2016
@ghost
Copy link

ghost commented Apr 14, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants