Complete the code to enable versioning on an S3 bucket using AWS CLI.
aws s3api put-bucket-versioning --bucket my-bucket --versioning-configuration Status=[1]To enable versioning on an S3 bucket, the Status must be set to Enabled.
Complete the AWS CLI command to check the versioning status of a bucket.
aws s3api get-bucket-versioning --bucket [1]The bucket name must be specified to check its versioning status. Here, my-bucket is used as the example bucket.
Fix the error in the JSON configuration to enable versioning in a CloudFormation template.
"VersioningConfiguration": {"Status": "[1]"}
The correct value to enable versioning in CloudFormation is Enabled. Other values either disable or suspend versioning.
Fill both blanks to create a Python boto3 snippet that enables versioning on a bucket.
s3 = boto3.client('s3') s3.put_bucket_versioning(Bucket='my-bucket', VersioningConfiguration={'[1]': '[2]'})
The key must be Status and the value to enable versioning is Enabled.
Fill all three blanks to write a Terraform resource block that enables versioning on an S3 bucket.
resource "aws_s3_bucket" "my_bucket" { bucket = "my-bucket" versioning { [1] = [2] [3] = false } }
In Terraform, to enable versioning you set enabled = true. The mfa_delete option controls multi-factor authentication delete and is often set to false.