-
Notifications
You must be signed in to change notification settings - Fork 4.5k
(cloudfront): the auto generated name of cache policy must be unique in the account #13629
Copy link
Copy link
Closed
Labels
@aws-cdk/aws-cloudfrontRelated to Amazon CloudFrontRelated to Amazon CloudFrontbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1
Description
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 of CachePolicy are same for multiple deployments.
Reproduction Steps
Create an app with a distribution like below,
new Distribution(this, 'Distribution', {
defaultBehavior: {
origin: new S3Origin(websiteBucket),
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
allowedMethods: AllowedMethods.ALLOW_GET_HEAD,
cachePolicy: new CachePolicy(this, 'defaultCachePolicy', {
defaultTtl: Duration.days(7),
minTtl: Duration.seconds(0),
maxTtl: Duration.days(30),
enableAcceptEncodingGzip: true,
enableAcceptEncodingBrotli: true,
}),
},
defaultRootObject: 'index.html',
});
}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
- CDK CLI Version : 1.91.0
- Framework Version:
- Node.js Version:
- OS :
- Language (Version):
Other
This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-cloudfrontRelated to Amazon CloudFrontRelated to Amazon CloudFrontbugThis issue is a bug.This issue is a bug.effort/smallSmall work item – less than a day of effortSmall work item – less than a day of effortp1