I found this post: https://forums.aws.amazon.com/thread.jspa?threadID=347842,
now i found myself in the same spot but cannot make it work. I get this message:
UPDATE_FAILED: CloudFrontDistribution (AWS::CloudFront::Distribution)
Property validation failure: [Encountered unsupported properties in {/DistributionConfig/DefaultCacheBehavior}: [ResponseHeadersPolicyId]]
I'm in the eu-south-1 regiono, if that can help.
Thanks
edit: i add part of my configuration as example:
CloudFrontDistribution:
Type: AWS::CloudFront::Distribution
DependsOn: [ CloudFrontCustomNoCachePolicy ]
Properties:
DistributionConfig:
HttpVersion: http2
Enabled: true
DefaultCacheBehavior:
ViewerProtocolPolicy: redirect-to-https
AllowedMethods:
- GET
- HEAD
- OPTIONS
- PUT
- PATCH
- POST
- DELETE
CachedMethods:
- GET
- HEAD
- OPTIONS
CachePolicyId: { Ref: CloudFrontCustomNoCachePolicy }
Compress: true
OriginRequestPolicyId: 59781a5b-3903-41f3-afcb-af62929ccde1 # ID of managed Managed-CORS-CustomOrigin
# dosnt work... why? it is needed tho
ResponseHeadersPolicyId: 5cc3b908-e619-4b99-88e5-2cf7f45965bd # ID of managed Managed-CORS-With-Preflight
TargetOriginId: XXX
if i comment out ResponseHeadersPolicyId it works
Thanks for the answer, i updated the question with part of my configuration