-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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 configuring CloudFront cache_behavior precedence #7253
Comments
Hi @randomeizer! Thanks for the detailed explanation. The issue here is that the cache behaviours are incorrectly defined as a Set instead of a List, and so there are no ordering guarantees - the code is here. This should be a relatively easy fix luckily - we'll get it sorted out. |
@jen20 Great! So the precedence order would be defined by the defined order in the .tf? |
Has there been any progress on this? We happen to use terraform for managing a lot of our AWS infrastructure, and whenever a cloudfront distribution is changed, we have to manually go back to ensure that the behavior order has not surprisingly changed, which doesn't give the team confidence in the tooling. |
The most recent instantiation of this wackiness, I took changed a distributions |
Just hit this issue in 0.8.5, where when you have different bahaviours for longer versions of the same path. eg desired precendence:
So if |
After some further testing, it appears that if terraform has to update the resource config on an |
+1 |
3 similar comments
+1 |
+1 |
+1 |
Is there an update on this? |
It's still an issue on 0.8.8 @jochavez. I haven't migrated to 0.9 yet but given the lack of response here and open status of related tickets I'd say it's reasonable to assume there hasn't been a significant change in the status of this issue yet. |
+1 |
1 similar comment
+1 |
+1 |
+1 please.... having to go back to the console to change the order after adding another behavior is quite a drag |
Is anybody in the terraform community going to address this issue? It causes serious problems and gives the impression that terraform is not stable or ready for production. Please fix this, thanks a lot. @jen20 maybe ? |
Would appreciate if this issue is fixed. |
Anyone ever find a fix for this? I'm amazed the linked issue is still open. |
Yeah still being griefed by this in 0.9.11 |
@acejam @edify42 This issue is now over at the provider instead of in the main Terraform repository: hashicorp/terraform-provider-aws#188. |
Cheers @jen20. I noticed that you can manually set the order in the UI and it doesn't affect the state kept in terraform (no changes seen afterwards when you do a terraform plan) |
That probably (I haven't looked at any source and am replying on phone) means that the attribute is defined in the Terraform provider as a |
We're using Terraform v0.10.2 and still facing the same issue. |
Any info on how to invalidate cache for objects via terraform as we have in distributions' "Invalidations" ? |
Just in case people are still looking for a solution, you'll want to use ordered_cache_behavior for this |
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. |
Terraform Version
0.6.16
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Alternately, the order that the cache_behaviour blocks are defined in the config should define the precedence.
Actual Behavior
Cache behaviours are created in random order:
### Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
Important Factoids
Are there anything atypical about your accounts that we should know? For example: Running in EC2 Classic? Custom version of OpenStack? Tight ACLs?
Nothing special.
References
Not that I'm aware of.
The text was updated successfully, but these errors were encountered: