Learn R Programming

paws.storage (version 0.1.7)

s3_put_bucket_versioning: Sets the versioning state of an existing bucket

Description

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

Usage

s3_put_bucket_versioning(Bucket, ContentMD5, MFA,
  VersioningConfiguration)

Arguments

Bucket

[required] The bucket name.

ContentMD5

\>The base64-encoded 128-bit MD5 digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see RFC 1864.

MFA

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

VersioningConfiguration

[required] Container for setting the versioning state.

Request syntax

svc$put_bucket_versioning(
  Bucket = "string",
  ContentMD5 = "string",
  MFA = "string",
  VersioningConfiguration = list(
    MFADelete = "Enabled"|"Disabled",
    Status = "Enabled"|"Suspended"
  )
)

Details

You can set the versioning state with one of the following values:

Enabled---Enables versioning for the objects in the bucket. All objects added to the bucket receive a unique version ID.

Suspended---Disables versioning for the objects in the bucket. All objects added to the bucket receive the version ID null.

If the versioning state has never been set on a bucket, it has no versioning state; a GetBucketVersioning request does not return a versioning state value.

If the bucket owner enables MFA Delete in the bucket versioning configuration, the bucket owner must include the x-amz-mfa request header and the Status and the MfaDelete request elements in a request to set the versioning state of the bucket.

If you have an object expiration lifecycle policy in your non-versioned bucket and you want to maintain the same permanent delete behavior when you enable versioning, you must add a noncurrent expiration policy. The noncurrent expiration lifecycle policy will manage the deletes of the noncurrent object versions in the version-enabled bucket. (A version-enabled bucket maintains one current and zero or more noncurrent object versions.) For more information, see Lifecycle and Versioning.

Related Resources

  • CreateBucket

  • DeleteBucket

  • GetBucketVersioning

Examples

Run this code
# NOT RUN {
# The following example sets versioning configuration on bucket. The
# configuration enables versioning on the bucket.
# }
# NOT RUN {
svc$put_bucket_versioning(
  Bucket = "examplebucket",
  VersioningConfiguration = list(
    MFADelete = "Disabled",
    Status = "Enabled"
  )
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab