3

I am trying to setup Lambda@Edge but getting the following error on clicking Deploy to Lambda@Edge button.

You cannot update the specified distribution using this API version because it is associated with a cache policy.

My CloudFront distribution is already ready and is in Deployed state.

Can someone please help me with this issue?

enter image description here

Suresh
  • 627
  • 6
  • 16
  • AWS is amazing sometimes. Is there seriously no way to solve this that does no rely on going back to using LEGACY settings? – csvan Dec 16 '20 at 06:29

3 Answers3

3

I was able to solve this by switching to 'Legacy cache settings'. I got the lead from this link: https://forums.aws.amazon.com/message.jspa?messageID=950582

enter image description here

Suresh
  • 627
  • 6
  • 16
1

Had this error :

You cannot update the specified distribution using this API version because it is associated with a cache policy. 
(Service: AmazonCloudFront; Status Code: 400; 
Error Code: IllegalUpdate;
 Request ID: xxxxxxxxxxx-xxxxx-49c2-b15e-6xxxxxxxxx; Proxy: null)

To solve :

  • I had cached policy already at 'Legacy cache settings'
  • Switched it back to managed optimised cache policy
  • Switched again to 'Legacy cache settings'

After this, error was gone.

Vladyslav Didenko
  • 1,352
  • 1
  • 14
  • 19
1

Had same error trying to make some changes with terraform, you need to follow this steps to solve it:

  • Go to Cloudfront on the AWS console.
  • Choose your Cloudfront distribution.
  • Click on the Behaviours and choose edit on your origin.
  • On Cache and origin request settings choose Use legacy cache settings
  • Now you can customise the cache TTL values (Recommended: Minimum TTL: 0. Maximum TTL: 31536000, Default TTL: 86400).
Fabián Bertetto
  • 1,721
  • 17
  • 14