Difference between revisions of "Terraform resource: aws s3 versioning"

From wikieduonline
Jump to navigation Jump to search
Line 6: Line 6:
  
 
== Official example ==
 
== Official example ==
<pre>
 
resource "aws_s3_bucket" "example" {
 
  bucket = "example-bucket"
 
}
 
 
resource "aws_s3_bucket_acl" "example" {
 
  bucket = aws_s3_bucket.example.id
 
  acl    = "private"
 
}
 
 
resource "aws_s3_bucket_versioning" "versioning_example" {
 
  bucket = aws_s3_bucket.example.id
 
  versioning_configuration {
 
    status = "Enabled"
 
  }
 
}
 
</pre>
 
  
 +
resource "aws_s3_bucket" "example" {
 +
  bucket = "example-bucket"
 +
}
 +
 +
resource "[[aws_s3_bucket_acl]]" "example" {
 +
  bucket = aws_s3_bucket.example.id
 +
  acl    = "private"
 +
}
 +
 +
resource "aws_s3_bucket_versioning" "versioning_example" {
 +
  bucket = aws_s3_bucket.example.id
 +
  versioning_configuration {
 +
    status = "Enabled"
 +
  }
 +
}
  
 
== Related ==
 
== Related ==

Revision as of 09:40, 3 September 2023

Arguments:

  • versioning_configuration
  • mfa_delete

Official example

resource "aws_s3_bucket" "example" {
  bucket = "example-bucket"
}

resource "aws_s3_bucket_acl" "example" {
  bucket = aws_s3_bucket.example.id
  acl    = "private"
}

resource "aws_s3_bucket_versioning" "versioning_example" {
  bucket = aws_s3_bucket.example.id
  versioning_configuration {
    status = "Enabled"
  }
}

Related

See also

Advertising: