Unable to set ResponseHeadersPolicyId via CloudFormation

0

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

Nemolo
질문됨 2년 전1353회 조회
1개 답변
0

Maybe you did some typo or is putting this property in the wrong place?

Here you can find my code with this field which works :)

profile picture
MG
답변함 2년 전
  • Thanks for the answer, i updated the question with part of my configuration

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠