-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(cloudfront): the auto generated name of cache policy must be unique in the account #13629
Comments
Thanks for the bug report. The autogenerated name should take into account Stack name, but it certainly doesn't take into account region today. We absolutely could add the region to the name though. It's not a bad idea. It would be a relatively straightforward change to alter the below to use something like If you (or anyone else) is up for submitting a PR, I'd be happy to work with you to get the fix merged in. As a work-around, you can specify the new CachePolicy(this, 'defaultCachePolicy', {
cachePolicyName: `MyPolicy-${Stack.of(this).region}`,
defaultTtl: Duration.days(7),
minTtl: Duration.seconds(0),
maxTtl: Duration.days(30),
enableAcceptEncodingGzip: true,
enableAcceptEncodingBrotli: true,
}) |
Hi Nick, The current Another proposal is making the property |
…s-region (#13737) This commit changes the auto-generated name of the `CachePolicy` to include stack name and region, thus providing unique name for the `CachePolicy` account-wide. Closes #13629. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…s-region (aws#13737) This commit changes the auto-generated name of the `CachePolicy` to include stack name and region, thus providing unique name for the `CachePolicy` account-wide. Closes aws#13629. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…s-region (aws#13737) This commit changes the auto-generated name of the `CachePolicy` to include stack name and region, thus providing unique name for the `CachePolicy` account-wide. Closes aws#13629. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Deploying the same application in different regions, the second deployment failed with error message
Internal error reported from downstream service during operation 'AWS::CloudFront::CachePolicy'
. It’s caused by the generated name ofCachePolicy
are same for multiple deployments.Reproduction Steps
Create an app with a distribution like below,
What did you expect to happen?
The auto generated name of policy name is unique in the account, it might depend on the region and name of stack.
What actually happened?
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: