Open gnouts opened 4 years ago
I'm now pretty confident this bug is induced by https://github.com/terraform-providers/terraform-provider-aws/issues/11217
If you separate beanstalk and cloudfront in two projects (two folders, two terraform apply
, two tfstates) and provide variables in locals
, Cloudfront doesn't crash.
I tried to used data to pass elb_subnet to cloudfront but somehow the data is marked as changing too. So you have to really use two projects to "lose" the changing state ("known after applied").
Here is the code to test it : https://gist.github.com/gnouts/40a20c986b202633da334a7246e47337
Hey @gnouts 👋 Thank you for taking the time to file this issue and for the additional update. Given that there's been a number of AWS provider releases since your last update, can you confirm whether you're still experiencing this issue?
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/gnouts/1a7581816e3c79a2d6779c28c733d268
Panic Output
Expected Behavior
CloudFront should have been updated correctly.
Actual Behavior
Terraform crashes and does not complete other action.
Steps to Reproduce
terraform init
terraform apply
-> this one should be ok.terraform apply
-> Second run crashes !Important Factoids
In my VPC, I create a public subnet that contains the Beanstalk's ELB and a private subnet that contains the Beanstalk's EC2.
I'm using CloudFront to serve my static front from S3 and redirect API calls to Beanstalk's ELB.
If you comment the second origin (custom origin redirecting to beanstalk) in cloudfront everything work fine.
References
I have reported another issue, which this one is an extension using the same code base, so might be related. https://github.com/terraform-providers/terraform-provider-aws/issues/11217