File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
deployments/stacks/dpe-k8s Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -54,4 +54,5 @@ module "synapse_dataset_to_crossiant_metadata" {
5454 cluster_name = var. cluster_name
5555 cluster_oidc_provider_arn = module. sage-aws-eks . cluster_oidc_provider_arn
5656 public_access = true
57+ enable_cors = true
5758}
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ resource "aws_s3_bucket_policy" "my_bucket_policy" {
4141 count = var. public_access ? 1 : 0
4242 bucket = aws_s3_bucket. bucket . bucket
4343
44+ depends_on = [ aws_s3_bucket_acl . bucket_acl , aws_s3_bucket_public_access_block . access_block ]
45+
4446 policy = jsonencode ({
4547 Version = " 2012-10-17" ,
4648 Statement = [
@@ -54,6 +56,16 @@ resource "aws_s3_bucket_policy" "my_bucket_policy" {
5456 })
5557}
5658
59+ resource "aws_s3_bucket_cors_configuration" "example" {
60+ count = var. enable_cors ? 1 : 0
61+ bucket = aws_s3_bucket. bucket . id
62+
63+ cors_rule {
64+ allowed_methods = [" GET" ]
65+ allowed_origins = [" *" ]
66+ }
67+ }
68+
5769resource "aws_s3_bucket_versioning" "versioning" {
5870 bucket = aws_s3_bucket. bucket . id
5971 versioning_configuration {
Original file line number Diff line number Diff line change @@ -36,4 +36,10 @@ variable "public_access" {
3636 description = " Enable/block public access to the bucket"
3737 type = bool
3838 default = false
39+ }
40+
41+ variable "enable_cors" {
42+ description = " Enable CORS on the bucket"
43+ type = bool
44+ default = false
3945}
You can’t perform that action at this time.
0 commit comments