-
Notifications
You must be signed in to change notification settings - Fork 4k
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): failed to deploy Distribution to AWS China caused by unsupported 'CachePolicyId' #13584
Comments
Thanks for the bug report, @zxkane. This is because we always default to using a Cache Policy, even if one is not specified.
I can't find any documentation stating that cache policies aren't supported in CN, but from the console experience and the above report, it appears they are not (yet) supported. As a temporary work-around, you might be able to use escape hatches to remove the cache policy id. Can you try this as a work-around and see if it works? const distribution = new Distribution(this, 'Distribution', {
defaultBehavior: {
origin: new S3Origin(websiteBucket),
viewerProtocolPolicy: ViewerProtocolPolicy.REDIRECT_TO_HTTPS,
allowedMethods: AllowedMethods.ALLOW_GET_HEAD,
},
defaultRootObject: 'index.html',
enableIpv6: false,
priceClass: PriceClass.PRICE_CLASS_ALL,
enableLogging: true,
});
const cfnDist = (dist.node.defaultChild as CfnDistribution);
cfnDist.addPropertyDeletionOverride('DistributionConfig.DefaultCacheBehavior.CachePolicyId'); |
Hi Nick, Thanks for your workaround. Per the doc, one of I have to add below overriding for a working workaround, cfnDist.addPropertyOverride('DistributionConfig.DefaultCacheBehavior.ForwardedValues', {
"QueryString": false
}); Also The old CloudFrontWebDistribution is still maintained, is it recommended for creating distribution in China regions? |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
still relevant |
closing as the workaround #31033 (comment) is relevant. |
Comments on closed issues and PRs are hard for our team to see. |
The deployment failed with error message,
Reproduction Steps
Create a distribution like below, then deploy it AWS China,
What did you expect to happen?
The new CloudFront distribution can be deployed to AWS China regions.
What actually happened?
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: