Created
January 17, 2023 15:20
-
-
Save gungoren/ec4d6c5e866113f289153805b600f45a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "aws_s3_object" "index" { | |
bucket = module.origin_bucket.s3_bucket_id | |
key = "index.html" | |
source = "${path.module}/files/index.html" | |
content_type = "text/html" | |
etag = filemd5("${path.module}/files/index.html") | |
} | |
resource "aws_s3_object" "global" { | |
bucket = module.origin_bucket.s3_bucket_id | |
key = "flag.png" | |
source = "${path.module}/files/flag.png" | |
content_type = "image/png" | |
etag = filemd5("${path.module}/files/flag.png") | |
} | |
locals { | |
countries = toset(["CA", "ES", "IT", "JP", "TR", "US"]) | |
} | |
resource "aws_s3_object" "countries_flag" { | |
for_each = local.countries | |
bucket = module.origin_bucket.s3_bucket_id | |
key = "${each.key}/flag.png" | |
source = "${path.module}/files/flag_${each.key}.png" | |
content_type = "image/png" | |
etag = filemd5("${path.module}/files/flag_${each.key}.png") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment