Difference between revisions of "Terraform resource: aws s3 bucket cors configuration"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
− | + | https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_cors_configuration | |
== Official example == | == Official example == | ||
Line 8: | Line 8: | ||
resource "aws_s3_bucket_cors_configuration" "example" { | resource "aws_s3_bucket_cors_configuration" "example" { | ||
− | bucket = aws_s3_bucket.example.id | + | bucket = aws_s3_bucket.example[[.id]] |
cors_rule { | cors_rule { |
Revision as of 11:47, 8 March 2024
Official example
resource "aws_s3_bucket" "example" { bucket = "mybucket" } resource "aws_s3_bucket_cors_configuration" "example" { bucket = aws_s3_bucket.example.id cors_rule { allowed_headers = ["*"] allowed_methods = ["PUT", "POST"] allowed_origins = ["https://s3-website-test.hashicorp.com"] expose_headers = ["ETag"] max_age_seconds = 3000 } cors_rule { allowed_methods = ["GET"] allowed_origins = ["*"] } }
Related
See also
- Terraform S3 resources:
aws_s3_bucket, aws_s3_object, aws_s3_bucket_policy, aws_s3_bucket_acl, aws_s3_bucket_website_configuration, aws_s3_bucket cors_configuration, aws_s3_account_public_access_block
, Terraform module: s3-bucket,aws_s3_bucket_versioning, aws_s3_bucket_server_side_encryption_configuration, aws_s3_bucket_logging
- CORS, HSTS,
Access-Control-Allow-Origin
, Enabling CORS for a REST API resource, Lighthouse bn --http --http-allow-origin,Caddyfile, gsutil cors, cors_rule, aws_s3_bucket_cors_configuration
Advertising: