Open OblateSpheroid opened 3 years ago
Maybe linked but using the Beanstalk feature Swap environment URLs cause also the same behavior. https://docs.aws.amazon.com/fr_fr/elasticbeanstalk/latest/dg/using-features.CNAMESwap.html
Once the Swap is over, if you launch an apply terraform try to recreate the resource...
Too bad since we could do Blue green deployment easier if it worked.
Any chance this has a fix incoming any time soon?
It's unfortunately not possible to ignore ONLY that setting, at least that I've found (and opened a bug about, prior to finding this).
Community Note
Terraform CLI and Terraform AWS Provider Version
Have tried on several versions, most recently:
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
terraform apply
creates 2 resources: aws_elastic_beanstalk_application.tftest and aws_elastic_beanstalk_environment.test. A subsequentterraform plan
outputsNo changes. Your infrastructure matches the configuration.
Actual Behavior
A subsequent
terraform plan
gives:Steps to Reproduce
terraform apply
(correctly creates 2 resources)terraform apply
(incorrectly replaces aws_elastic_beanstalk_environment.tftest - very time consuming)The only work-around I have found is to make
cname_prefix
null if the environment already exists. For example, if I amend the above code with:I can then run:
And it will show no changes needed. This seems like a hacky way around a simple problem of Terraform not recognizing the
cname_prefix
does not need to be updated.Important Factoids
Testing this on a gov cloud account.