hei*_*pei 7 amazon-web-services amazon-cloudfront terraform hcl terraform-provider-aws
terraform 最近实现了aws_cloudfront_cache_policy资源和数据源(从 aws 提供商版本0.3.28IIRC 开始)。
它最终启用了Brotli压缩,这就是我需要使用它的原因,但我不确定如何将它集成到现有的 terraform 代码库中,也是因为我不太确定 和 之间的aws_cloudfront_cache_policy关系ordered_cache_behavior。
aws_cloudfront_cache_policy- 我可以将其放入我的aws_cloudfront_distribution资源中吗?ordered_cache_behavior?小智 9
这就是我使用 aws_cloudfront_cache_policy 的方式:
data "aws_cloudfront_cache_policy" "cache_policy" {
name = var.cache_policy_name
}
Run Code Online (Sandbox Code Playgroud)
这里,cache_policy_name = Managed-CachingOptimized
resource "aws_cloudfront_distribution" "cfd"{
default_cache_behavior {
cache_policy_id = data.aws_cloudfront_cache_policy.cache_policy.id
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3081 次 |
| 最近记录: |