Skip to content

Commit 5e4417c

Browse files
authored
Add CORS rule to the Pretix s3 media bucket (#4422)
1 parent 307b3f5 commit 5e4417c

File tree

2 files changed

+12
-1
lines changed
  • infrastructure/applications

2 files changed

+12
-1
lines changed

infrastructure/applications/database/db.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ resource "aws_db_instance" "database" {
99
engine = "postgres"
1010
identifier = "pythonit-${terraform.workspace}"
1111
allow_major_version_upgrade = true
12-
engine_version = "14.13"
12+
engine_version = "14.17"
1313
instance_class = "db.t4g.micro"
1414
db_name = local.is_prod ? "${local.normalized_workspace}backend" : "pycon"
1515
username = "root"

infrastructure/applications/pretix/s3.tf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,14 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "media" {
1313
}
1414
}
1515
}
16+
17+
resource "aws_s3_bucket_cors_configuration" "cors" {
18+
bucket = aws_s3_bucket.media.id
19+
20+
cors_rule {
21+
allowed_methods = ["GET"]
22+
allowed_origins = [
23+
"https://${local.alias}"
24+
]
25+
}
26+
}

0 commit comments

Comments
 (0)