Amazon recently introduced CloudFront Cache Policy, Origin Request Policy. In short, caching configuration can be factored out of distribution config. Distribution can then reference existing, shared, policy. Several important features were added as well. Like decoupling headers contributing to caching key from the headers in origin request. New "Viewer" headers were added as well.
# custom policy
resource "aws_cloudfront_cache_policy" "test1" {
name = "test1"
comment = ".."
...
}
resource "aws_cloudfront_distribution" "foo" {
..
ordered_cache_behavior {
..
cache_policy = aws_cloudfront_cache_policy.test1.name
origin_request_policy = "Managed-AllViewer" # AWS-managed policy
}
}
I'll pick this up.
are aws_cloudfront_cache_policy and aws_cloudfront_origin_request_policy ready to use?
Come across the need for this at work recently. Any word on when cache policies will be able to Terraform?
I need both OriginRequesPolicies AND CachePolicies.
Any updates on this?
Would be nice to know when this change will be ready for use :)
It would be great if can share details about it, as this is one of the most important features for CloudFront automation for maintaining multiple behaviors cache(via pre-defined cache policies ids- available in cloud formation) via terraform.
One more waiting for this feature
also looking forward to it.
Waiting for this
Hi all! :wave: Just wanted to direct you to our public roadmap for this quarter (Nov-Jan) in which this item has been mentioned.
Due to the significant community interest in support for this feature, we will be looking at merging existing contributions soon.聽
We appreciate all the contributions and feedback thus far.
Look out for support in the provider soon!
Most helpful comment
Hi all! :wave: Just wanted to direct you to our public roadmap for this quarter (Nov-Jan) in which this item has been mentioned.
Due to the significant community interest in support for this feature, we will be looking at merging existing contributions soon.聽
We appreciate all the contributions and feedback thus far.
Look out for support in the provider soon!