How to configure CloudFront using CloudFormation t

2020-03-24 09:07发布

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?

2条回答
何必那么认真
2楼-- · 2020-03-24 09:37

This is I see in getdistrinbution config:

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

You can try it to see if this works.

查看更多
仙女界的扛把子
3楼-- · 2020-03-24 09:40

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]

查看更多
登录 后发表回答