Cloudformation CloudFront CachePolicy showing invalid request provided

0

I am using AWS CLI together with a yaml file to deploy my CloudFront resource. I am aiming to add a CachePolicy to my CloudFront distribution but I am always getting an "Invalid request provided" error on Cloudformation in AWS console. Is my yaml wrong or am I missing something?

Here is a snippet of the cache policy and response headers policy I am using:Enter image description here

1 Answer
2
Accepted Answer

If you have provided CookieBehavior, HeaderBehavior, and QueryStringBehavior with whitelist value, then you must also provide a list of values that must be included for those parameters. The values should be listed in the the corresponding Cookies, Headers, and QueryStrings parameter for each config.

Example for HeadersConfig:

          HeadersConfig: 
            HeaderBehavior: whitelist
            Headers:
              - Authorization
profile picture
joahna
answered 2 years ago
profile pictureAWS
EXPERT
Toni_S
reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions