put-bucket-versioning

Sets the versioning state of an existing bucket. To set the versioning state, you must be the bucket owner.

See also: PUT Bucket Versioning.

Synopsis

put-bucket-versioning
  --bucket <value>
  [--content-md5 <value>]
  [--mfa <value>]
  --versioning-configuration <value>
  [--cli-input-json <value>]

Options

--bucket (string)

--content-md5 (string)

--mfa (string)

The concatenation of the authentication device’s serial number, a space, and the value that is displayed on your authentication device.

--versioning-configuration (structure)

Shorthand Syntax:

MFADelete=string,Status=string

JSON Syntax:

{
  "MFADelete": "Enabled"|"Disabled",
  "Status": "Enabled"|"Suspended"
}

--cli-input-json (string)

Operates a service or services based on the provided JSON string. If other arguments are provided on the command line, the CLI values override the JSON-provided values. You cannot pass arbitrary binary values using a JSON-provided value, because the string is taken literally.

Examples

The following command enables versioning on a bucket named “my-bucket”:

$ aws s3api put-bucket-versioning --bucket my-bucket --versioning-configuration Status=Enabled

The following command enables versioning, and uses an mfa code

$ aws s3api put-bucket-versioning --bucket my-bucket --versioning-configuration Status=Enabled --mfa "SERIAL 123456"

Output

None