TL;DR: don’t forget about the default cache policy
I was trying to deploy a CloudFront distribution with CloudFormation. I wanted to follow best practices, so I was trying
to use a cache policy rather than embedding the cache configuration inline with the
I had my cache behaviours defined:
Resources: Distribution: Type: AWS::CloudFront::Distribution Properties: # ... CacheBehaviors: - CachePolicyId: !Ref CachePolicy CachePolicy: Type: AWS::CloudFormation::CachePolicy Properties: # ...
I was deploying and getting the error “The parameter ForwardedValues is required”. I was bashing my head against this,
trying to use
!Ref AWS::NoValue but that didn’t fix things.
I wanted to follow best practices, and defining a cache policy is more powerful.
Finally my googling uncovered the answer:
…I had forgotten to include the
CachePolicyId field in by
One more quick thing - as a brit, I slipped up on typing
Behaviours (extra “u”) all the time. Thanks to
the CloudFormation tools for helping me catch that early!