iac: failsafe cloudfront origin id string

This commit is contained in:
bdeshi 2024-05-17 08:13:47 +06:00
parent 25e68e059f
commit 8ff78e2fa5
Signed by: bdeshi
GPG Key ID: 410D03DA9A3468E0

View File

@ -3,7 +3,7 @@ data "aws_cloudfront_cache_policy" "caching_optimized" {
}
locals {
cloudfront_s3_origin_id = "s3origin"
cloudfront_s3_origin_id = "S3-${aws_s3_bucket.created.id}"
}
resource "aws_cloudfront_distribution" "created" {
@ -42,7 +42,8 @@ resource "aws_cloudfront_distribution" "created" {
}
resource "aws_cloudfront_origin_access_control" "s3_access" {
name = "${var.domain_name}_s3"
name = "S3_${aws_s3_bucket.created.id}"
description = "S3:${aws_s3_bucket.created.id}"
origin_access_control_origin_type = "s3"
signing_behavior = "always"
signing_protocol = "sigv4"