Difference between revisions of "Terraform resource: aws s3 bucket cors configuration"

From wikieduonline
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_cors_configuration
  
 +
== 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 ==
 
* [[Terraform resource: aws_s3_bucket_website_configuration]]
 
* [[Terraform resource: aws_s3_bucket_website_configuration]]
 +
* [[.bucket]]
  
 
== See also ==
 
== See also ==
 
* {{tf s3}}
 
* {{tf s3}}
 +
* {{CORS}}
  
 
[[Category:AWS]]
 
[[Category:AWS]]

Latest revision as of 11:48, 8 March 2024

Advertising: