Skip to content

Commit

Permalink
[DOM-56489] Add CORS configuration for Flyte S3 buckets (#243)
Browse files Browse the repository at this point in the history
* Add CORS configuration to the Flyte data bucket to support the UI directly accessing links
* Use * for the host to allows the browser pointed at the Domino ingress to load content from S3 buckets directly
   via either GET or HEAD requests

---------

Co-authored-by: ddl-ebrown <[email protected]>
Co-authored-by: Ethan Brown (Domino) <[email protected]>
  • Loading branch information
3 people authored Apr 26, 2024
1 parent 730b398 commit 0b94be5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/flyte/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ No modules.
| [aws_iam_role_policy_attachment.flyte_dataplane](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_s3_bucket.flyte_data](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
| [aws_s3_bucket.flyte_metadata](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
| [aws_s3_bucket_cors_configuration.flyte_data](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_cors_configuration) | resource |
| [aws_s3_bucket_policy.flyte_data](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |
| [aws_s3_bucket_policy.flyte_metadata](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_policy) | resource |
| [aws_s3_bucket_server_side_encryption_configuration.flye_metadata_encryption](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_server_side_encryption_configuration) | resource |
Expand Down
11 changes: 11 additions & 0 deletions modules/flyte/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,14 @@ resource "aws_s3_bucket_server_side_encryption_configuration" "flyte_data_encryp
]
}
}

resource "aws_s3_bucket_cors_configuration" "flyte_data" {
bucket = aws_s3_bucket.flyte_data.id

cors_rule {
allowed_headers = []
allowed_methods = ["GET", "HEAD"]
allowed_origins = ["*"]
max_age_seconds = 3000
}
}
1 change: 0 additions & 1 deletion modules/flyte/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ variable "region" {
}
}


variable "use_fips_endpoint" {
description = "Use aws FIPS endpoints"
type = bool
Expand Down
1 change: 1 addition & 0 deletions modules/iam-bootstrap/bootstrap-0.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"s3:*Object",
"s3:PutAccountPublicAccessBlock",
"s3:PutBucketAcl",
"s3:PutBucketCORS",
"s3:PutBucketLogging",
"s3:PutBucketNotification",
"s3:PutBucketOwnershipControls",
Expand Down

0 comments on commit 0b94be5

Please sign in to comment.