Skip to content

Commit

Permalink
Merge pull request #1799 from alphagov/add-cors-rule-dgu-bucket
Browse files Browse the repository at this point in the history
Update main.tf datagovuk-organogram bucket
  • Loading branch information
kentsanggds authored Nov 17, 2023
2 parents 0c6eee6 + ad6427c commit 0891443
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions terraform/projects/infra-datagovuk-organogram-bucket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,12 @@ data "terraform_remote_state" "infra_monitoring" {
resource "aws_s3_bucket" "datagovuk-organogram" {
bucket = "datagovuk-${var.aws_environment}-ckan-organogram"

cors_rule {
dynamic "cors_rule" {
for_each = [for s in ["${var.domain}", "https://staging.data.gov.uk", "https://find.eks.${var.aws_environment}.govuk.digital"] : {
allowed_origin = s
}]
allowed_methods = ["GET"]
allowed_origins = "${compact(list(var.domain, var.aws_environment == "production" ? "https://staging.data.gov.uk" : ""))}"
allowed_origins = [cors_rule.value.allowed_origin]
}

tags = {
Expand Down

0 comments on commit 0891443

Please sign in to comment.