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

From wikieduonline
Jump to navigation Jump to search
 
(13 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
Arguments:
 
Arguments:
* versioning_configuration
+
* <code>[[bucket]]</code>
* mfa_delete
+
* <code>versioning_configuration: status (required), [[mfa_delete]] (optional)</code>
 +
* <code>[[mfa]]</code> (optional) mfa device's [[serial number]]
 +
* <code>[[expected_bucket_owner]]</code> (optional)
  
 
== 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 ==
 
* <code>[[aws_s3_bucket]]</code>
 
* <code>[[aws_s3_bucket]]</code>
 +
* <code>[[aws s3api put-bucket-versioning]]</code>
  
 
== See also ==
 
== See also ==
 +
* {{AWS S3 versioning}}
 
* {{aws s3}}
 
* {{aws s3}}
* {{S3}}
 
  
 
[[Category:AWS]]
 
[[Category:AWS]]

Latest revision as of 05:20, 11 July 2024

Arguments:

Official example[edit]

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[edit]

See also[edit]

Advertising: