Skip to content

Commit

Permalink
Update: cors example
Browse files Browse the repository at this point in the history
  • Loading branch information
hoanglm committed Nov 18, 2024
1 parent b28f2bd commit 983b3fc
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
resource "fptcloud_object_storage_bucket_cors" "example_bucket_cors" {
vpc_id = "1b413c55-b752-4183-abad-06c4b5aca6ad"
region_name = "HCM-02"
bucket_name = "a-hoanglm32-test"

# Option 1: Load cors config from file
cors_config_file = file("${path.module}/your_bucket_cors_config.json")

# Option 2: Inline cors_config
# cors_config = jsonencode({
# {
# "ID": "a9099",
# "AllowedOrigins": ["http://www.example.com", "http://www.example2.com"],
# "AllowedMethods": ["GET", "PUT", "DELETE"],
# "MaxAgeSeconds": 3000,
# "ExposeHeaders": ["Etag", "x-amz"],
# "AllowedHeaders": ["*", "demo"]
# }
# })
}
output "bucket_cors" {
value = fptcloud_object_storage_bucket_cors.example_bucket_cors.status
}

0 comments on commit 983b3fc

Please sign in to comment.