Skip to content

Commit 255e5d5

Browse files
committed
build(terraform): remove tags from frontend S3 bucket resource
Updated S3 bucket configuration by removing unnecessary tags to streamline resource management. This change simplifies the infrastructure code without altering functionality.
1 parent 9956eeb commit 255e5d5

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

infrastructure/terraform/cloudfront.tf

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# S3 Bucket for Frontend (Static Website Hosting)
22
resource "aws_s3_bucket" "frontend" {
33
bucket = "${local.name_prefix}-frontend-${local.account_id}"
4-
5-
tags = local.tags
64
}
75

86
resource "aws_s3_bucket_website_configuration" "frontend" {
@@ -13,7 +11,7 @@ resource "aws_s3_bucket_website_configuration" "frontend" {
1311
}
1412

1513
error_document {
16-
key = "index.html" # Fallback for client-side routing
14+
key = "index.html" # Fallback for client-side routing
1715
}
1816
}
1917

@@ -60,7 +58,7 @@ resource "aws_cloudfront_distribution" "frontend" {
6058
is_ipv6_enabled = true
6159
comment = "${var.project_name} ${var.environment} frontend"
6260
default_root_object = "index.html"
63-
price_class = "PriceClass_100" # North America + Europe only (most cost-effective)
61+
price_class = "PriceClass_100" # North America + Europe only (most cost-effective)
6462

6563
origin {
6664
domain_name = aws_s3_bucket.frontend.bucket_regional_domain_name
@@ -83,8 +81,8 @@ resource "aws_cloudfront_distribution" "frontend" {
8381
}
8482

8583
min_ttl = 0
86-
default_ttl = 86400 # 1 day for static assets
87-
max_ttl = 31536000 # 1 year max
84+
default_ttl = 86400 # 1 day for static assets
85+
max_ttl = 31536000 # 1 year max
8886
}
8987

9088
# Cache behavior for HTML files (shorter cache for client-side routing)
@@ -134,8 +132,6 @@ resource "aws_cloudfront_distribution" "frontend" {
134132
# acm_certificate_arn = aws_acm_certificate.frontend.arn
135133
# ssl_support_method = "sni-only"
136134
}
137-
138-
tags = local.tags
139135
}
140136

141137
# Update S3 bucket policy to allow CloudFront OAC

0 commit comments

Comments
 (0)