From f9d033a7f3052148abba12e730b61b3bcd9e05da Mon Sep 17 00:00:00 2001 From: Santiago Aguiar Date: Tue, 9 Jan 2024 17:55:19 -0300 Subject: [PATCH] add CORS configuration for bucket --- main.tf | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.tf b/main.tf index 2e24904..b93e395 100644 --- a/main.tf +++ b/main.tf @@ -91,6 +91,17 @@ resource "aws_s3_bucket_lifecycle_configuration" "mcd_agent_store_lifecycle" { } } +resource "aws_s3_bucket_cors_configuration" "mcd_agent_store_cors" { + bucket = aws_s3_bucket.mcd_agent_store.id + + cors_rule { + allowed_methods = ["GET"] + allowed_origins = ["https://*.getmontecarlo.com"] + allowed_headers = ["*"] + max_age_seconds = 3000 + } +} + resource "aws_s3_bucket_public_access_block" "mcd_agent_store_block_public_access" { bucket = aws_s3_bucket.mcd_agent_store.id block_public_acls = true