How to configure CloudFront using CloudFormation to set the 'Headers' property in 'ForwardedValues' to 'all'?

こ雲淡風輕ζ 提交于 2019-12-31 01:57:00

问题


I am setting up CloudFront using CloudFormation, but I need to configure the Headers property of the ForwardedValues property. It should be setup in such a way that all headers are forwarded.

I can't find how to do so on neither the ForwardedValues documentation page nor the page that is linked regarding Caching Content Based on Request Headers.

This is the CloudFormation 'path' to the Header property:

someCloudFrontDistributionName:
    Type: AWS::CloudFront::Distribution
    Properties:
        CacheBehaviors:
            ForwaredValues:
                Headers:
                - # What to put here that will allow all Headers to be forwarded?


回答1:


This is I see in getdistrinbution config:

"ForwardedValues": { "Headers": { "Items": [ "*" ]

You can try it to see if this works.




回答2:


Using Yaml:

    Headers: ["*"]

An example inside the "ForwardedValues" element for some context:

    ForwardedValues:
        Cookies:
          Forward: all
        Headers: ["*"]
        QueryString: true

Please note that this might lead to poor performance (allegedly) due to the caching of "Date" headers as documented [here]



来源:https://stackoverflow.com/questions/57291562/how-to-configure-cloudfront-using-cloudformation-to-set-the-headers-property-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!