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

1 Antwort
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
beantwortet vor 2 Jahren
  • Thanks for the answer, i updated the question with part of my configuration

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen