1. Packages
  2. AWS
  3. API Docs
  4. s3
  5. BucketVersioningV2
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.s3.BucketVersioningV2

Explore with Pulumi AI

Provides a resource for controlling versioning on an S3 bucket. Deleting this resource will either suspend versioning on the associated S3 bucket or simply remove the resource from state if the associated S3 bucket is unversioned.

For more information, see How S3 versioning works.

NOTE: If you are enabling versioning on the bucket for the first time, AWS recommends that you wait for 15 minutes after enabling versioning before issuing write operations (PUT or DELETE) on objects in the bucket.

This resource cannot be used with S3 directory buckets.

Example Usage

With Versioning Enabled

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.s3.BucketV2("example", {bucket: "example-bucket"});
const exampleBucketAclV2 = new aws.s3.BucketAclV2("example", {
    bucket: example.id,
    acl: "private",
});
const versioningExample = new aws.s3.BucketVersioningV2("versioning_example", {
    bucket: example.id,
    versioningConfiguration: {
        status: "Enabled",
    },
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.s3.BucketV2("example", bucket="example-bucket")
example_bucket_acl_v2 = aws.s3.BucketAclV2("example",
    bucket=example.id,
    acl="private")
versioning_example = aws.s3.BucketVersioningV2("versioning_example",
    bucket=example.id,
    versioning_configuration={
        "status": "Enabled",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{
			Bucket: pulumi.String("example-bucket"),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketAclV2(ctx, "example", &s3.BucketAclV2Args{
			Bucket: example.ID(),
			Acl:    pulumi.String("private"),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketVersioningV2(ctx, "versioning_example", &s3.BucketVersioningV2Args{
			Bucket: example.ID(),
			VersioningConfiguration: &s3.BucketVersioningV2VersioningConfigurationArgs{
				Status: pulumi.String("Enabled"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketV2("example", new()
    {
        Bucket = "example-bucket",
    });

    var exampleBucketAclV2 = new Aws.S3.BucketAclV2("example", new()
    {
        Bucket = example.Id,
        Acl = "private",
    });

    var versioningExample = new Aws.S3.BucketVersioningV2("versioning_example", new()
    {
        Bucket = example.Id,
        VersioningConfiguration = new Aws.S3.Inputs.BucketVersioningV2VersioningConfigurationArgs
        {
            Status = "Enabled",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketV2;
import com.pulumi.aws.s3.BucketV2Args;
import com.pulumi.aws.s3.BucketAclV2;
import com.pulumi.aws.s3.BucketAclV2Args;
import com.pulumi.aws.s3.BucketVersioningV2;
import com.pulumi.aws.s3.BucketVersioningV2Args;
import com.pulumi.aws.s3.inputs.BucketVersioningV2VersioningConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new BucketV2("example", BucketV2Args.builder()
            .bucket("example-bucket")
            .build());

        var exampleBucketAclV2 = new BucketAclV2("exampleBucketAclV2", BucketAclV2Args.builder()
            .bucket(example.id())
            .acl("private")
            .build());

        var versioningExample = new BucketVersioningV2("versioningExample", BucketVersioningV2Args.builder()
            .bucket(example.id())
            .versioningConfiguration(BucketVersioningV2VersioningConfigurationArgs.builder()
                .status("Enabled")
                .build())
            .build());

    }
}
Copy
resources:
  example:
    type: aws:s3:BucketV2
    properties:
      bucket: example-bucket
  exampleBucketAclV2:
    type: aws:s3:BucketAclV2
    name: example
    properties:
      bucket: ${example.id}
      acl: private
  versioningExample:
    type: aws:s3:BucketVersioningV2
    name: versioning_example
    properties:
      bucket: ${example.id}
      versioningConfiguration:
        status: Enabled
Copy

With Versioning Disabled

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.s3.BucketV2("example", {bucket: "example-bucket"});
const exampleBucketAclV2 = new aws.s3.BucketAclV2("example", {
    bucket: example.id,
    acl: "private",
});
const versioningExample = new aws.s3.BucketVersioningV2("versioning_example", {
    bucket: example.id,
    versioningConfiguration: {
        status: "Disabled",
    },
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.s3.BucketV2("example", bucket="example-bucket")
example_bucket_acl_v2 = aws.s3.BucketAclV2("example",
    bucket=example.id,
    acl="private")
versioning_example = aws.s3.BucketVersioningV2("versioning_example",
    bucket=example.id,
    versioning_configuration={
        "status": "Disabled",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{
			Bucket: pulumi.String("example-bucket"),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketAclV2(ctx, "example", &s3.BucketAclV2Args{
			Bucket: example.ID(),
			Acl:    pulumi.String("private"),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketVersioningV2(ctx, "versioning_example", &s3.BucketVersioningV2Args{
			Bucket: example.ID(),
			VersioningConfiguration: &s3.BucketVersioningV2VersioningConfigurationArgs{
				Status: pulumi.String("Disabled"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketV2("example", new()
    {
        Bucket = "example-bucket",
    });

    var exampleBucketAclV2 = new Aws.S3.BucketAclV2("example", new()
    {
        Bucket = example.Id,
        Acl = "private",
    });

    var versioningExample = new Aws.S3.BucketVersioningV2("versioning_example", new()
    {
        Bucket = example.Id,
        VersioningConfiguration = new Aws.S3.Inputs.BucketVersioningV2VersioningConfigurationArgs
        {
            Status = "Disabled",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketV2;
import com.pulumi.aws.s3.BucketV2Args;
import com.pulumi.aws.s3.BucketAclV2;
import com.pulumi.aws.s3.BucketAclV2Args;
import com.pulumi.aws.s3.BucketVersioningV2;
import com.pulumi.aws.s3.BucketVersioningV2Args;
import com.pulumi.aws.s3.inputs.BucketVersioningV2VersioningConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new BucketV2("example", BucketV2Args.builder()
            .bucket("example-bucket")
            .build());

        var exampleBucketAclV2 = new BucketAclV2("exampleBucketAclV2", BucketAclV2Args.builder()
            .bucket(example.id())
            .acl("private")
            .build());

        var versioningExample = new BucketVersioningV2("versioningExample", BucketVersioningV2Args.builder()
            .bucket(example.id())
            .versioningConfiguration(BucketVersioningV2VersioningConfigurationArgs.builder()
                .status("Disabled")
                .build())
            .build());

    }
}
Copy
resources:
  example:
    type: aws:s3:BucketV2
    properties:
      bucket: example-bucket
  exampleBucketAclV2:
    type: aws:s3:BucketAclV2
    name: example
    properties:
      bucket: ${example.id}
      acl: private
  versioningExample:
    type: aws:s3:BucketVersioningV2
    name: versioning_example
    properties:
      bucket: ${example.id}
      versioningConfiguration:
        status: Disabled
Copy

Object Dependency On Versioning

When you create an object whose version_id you need and an aws.s3.BucketVersioningV2 resource in the same configuration, you are more likely to have success by ensuring the s3_object depends either implicitly (see below) or explicitly (i.e., using depends_on = [aws_s3_bucket_versioning.example]) on the aws.s3.BucketVersioningV2 resource.

NOTE: For critical and/or production S3 objects, do not create a bucket, enable versioning, and create an object in the bucket within the same configuration. Doing so will not allow the AWS-recommended 15 minutes between enabling versioning and writing to the bucket.

This example shows the aws_s3_object.example depending implicitly on the versioning resource through the reference to aws_s3_bucket_versioning.example.bucket to define bucket:

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.s3.BucketV2("example", {bucket: "yotto"});
const exampleBucketVersioningV2 = new aws.s3.BucketVersioningV2("example", {
    bucket: example.id,
    versioningConfiguration: {
        status: "Enabled",
    },
});
const exampleBucketObjectv2 = new aws.s3.BucketObjectv2("example", {
    bucket: exampleBucketVersioningV2.id,
    key: "droeloe",
    source: new pulumi.asset.FileAsset("example.txt"),
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.s3.BucketV2("example", bucket="yotto")
example_bucket_versioning_v2 = aws.s3.BucketVersioningV2("example",
    bucket=example.id,
    versioning_configuration={
        "status": "Enabled",
    })
example_bucket_objectv2 = aws.s3.BucketObjectv2("example",
    bucket=example_bucket_versioning_v2.id,
    key="droeloe",
    source=pulumi.FileAsset("example.txt"))
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := s3.NewBucketV2(ctx, "example", &s3.BucketV2Args{
			Bucket: pulumi.String("yotto"),
		})
		if err != nil {
			return err
		}
		exampleBucketVersioningV2, err := s3.NewBucketVersioningV2(ctx, "example", &s3.BucketVersioningV2Args{
			Bucket: example.ID(),
			VersioningConfiguration: &s3.BucketVersioningV2VersioningConfigurationArgs{
				Status: pulumi.String("Enabled"),
			},
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketObjectv2(ctx, "example", &s3.BucketObjectv2Args{
			Bucket: exampleBucketVersioningV2.ID(),
			Key:    pulumi.String("droeloe"),
			Source: pulumi.NewFileAsset("example.txt"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketV2("example", new()
    {
        Bucket = "yotto",
    });

    var exampleBucketVersioningV2 = new Aws.S3.BucketVersioningV2("example", new()
    {
        Bucket = example.Id,
        VersioningConfiguration = new Aws.S3.Inputs.BucketVersioningV2VersioningConfigurationArgs
        {
            Status = "Enabled",
        },
    });

    var exampleBucketObjectv2 = new Aws.S3.BucketObjectv2("example", new()
    {
        Bucket = exampleBucketVersioningV2.Id,
        Key = "droeloe",
        Source = new FileAsset("example.txt"),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketV2;
import com.pulumi.aws.s3.BucketV2Args;
import com.pulumi.aws.s3.BucketVersioningV2;
import com.pulumi.aws.s3.BucketVersioningV2Args;
import com.pulumi.aws.s3.inputs.BucketVersioningV2VersioningConfigurationArgs;
import com.pulumi.aws.s3.BucketObjectv2;
import com.pulumi.aws.s3.BucketObjectv2Args;
import com.pulumi.asset.FileAsset;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new BucketV2("example", BucketV2Args.builder()
            .bucket("yotto")
            .build());

        var exampleBucketVersioningV2 = new BucketVersioningV2("exampleBucketVersioningV2", BucketVersioningV2Args.builder()
            .bucket(example.id())
            .versioningConfiguration(BucketVersioningV2VersioningConfigurationArgs.builder()
                .status("Enabled")
                .build())
            .build());

        var exampleBucketObjectv2 = new BucketObjectv2("exampleBucketObjectv2", BucketObjectv2Args.builder()
            .bucket(exampleBucketVersioningV2.id())
            .key("droeloe")
            .source(new FileAsset("example.txt"))
            .build());

    }
}
Copy
resources:
  example:
    type: aws:s3:BucketV2
    properties:
      bucket: yotto
  exampleBucketVersioningV2:
    type: aws:s3:BucketVersioningV2
    name: example
    properties:
      bucket: ${example.id}
      versioningConfiguration:
        status: Enabled
  exampleBucketObjectv2:
    type: aws:s3:BucketObjectv2
    name: example
    properties:
      bucket: ${exampleBucketVersioningV2.id}
      key: droeloe
      source:
        fn::FileAsset: example.txt
Copy

Create BucketVersioningV2 Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new BucketVersioningV2(name: string, args: BucketVersioningV2Args, opts?: CustomResourceOptions);
@overload
def BucketVersioningV2(resource_name: str,
                       args: BucketVersioningV2Args,
                       opts: Optional[ResourceOptions] = None)

@overload
def BucketVersioningV2(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       bucket: Optional[str] = None,
                       versioning_configuration: Optional[BucketVersioningV2VersioningConfigurationArgs] = None,
                       expected_bucket_owner: Optional[str] = None,
                       mfa: Optional[str] = None)
func NewBucketVersioningV2(ctx *Context, name string, args BucketVersioningV2Args, opts ...ResourceOption) (*BucketVersioningV2, error)
public BucketVersioningV2(string name, BucketVersioningV2Args args, CustomResourceOptions? opts = null)
public BucketVersioningV2(String name, BucketVersioningV2Args args)
public BucketVersioningV2(String name, BucketVersioningV2Args args, CustomResourceOptions options)
type: aws:s3:BucketVersioningV2
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. BucketVersioningV2Args
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. BucketVersioningV2Args
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. BucketVersioningV2Args
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. BucketVersioningV2Args
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. BucketVersioningV2Args
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var bucketVersioningV2Resource = new Aws.S3.BucketVersioningV2("bucketVersioningV2Resource", new()
{
    Bucket = "string",
    VersioningConfiguration = new Aws.S3.Inputs.BucketVersioningV2VersioningConfigurationArgs
    {
        Status = "string",
        MfaDelete = "string",
    },
    ExpectedBucketOwner = "string",
    Mfa = "string",
});
Copy
example, err := s3.NewBucketVersioningV2(ctx, "bucketVersioningV2Resource", &s3.BucketVersioningV2Args{
	Bucket: pulumi.String("string"),
	VersioningConfiguration: &s3.BucketVersioningV2VersioningConfigurationArgs{
		Status:    pulumi.String("string"),
		MfaDelete: pulumi.String("string"),
	},
	ExpectedBucketOwner: pulumi.String("string"),
	Mfa:                 pulumi.String("string"),
})
Copy
var bucketVersioningV2Resource = new BucketVersioningV2("bucketVersioningV2Resource", BucketVersioningV2Args.builder()
    .bucket("string")
    .versioningConfiguration(BucketVersioningV2VersioningConfigurationArgs.builder()
        .status("string")
        .mfaDelete("string")
        .build())
    .expectedBucketOwner("string")
    .mfa("string")
    .build());
Copy
bucket_versioning_v2_resource = aws.s3.BucketVersioningV2("bucketVersioningV2Resource",
    bucket="string",
    versioning_configuration={
        "status": "string",
        "mfa_delete": "string",
    },
    expected_bucket_owner="string",
    mfa="string")
Copy
const bucketVersioningV2Resource = new aws.s3.BucketVersioningV2("bucketVersioningV2Resource", {
    bucket: "string",
    versioningConfiguration: {
        status: "string",
        mfaDelete: "string",
    },
    expectedBucketOwner: "string",
    mfa: "string",
});
Copy
type: aws:s3:BucketVersioningV2
properties:
    bucket: string
    expectedBucketOwner: string
    mfa: string
    versioningConfiguration:
        mfaDelete: string
        status: string
Copy

BucketVersioningV2 Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The BucketVersioningV2 resource accepts the following input properties:

Bucket
This property is required.
Changes to this property will trigger replacement.
string
Name of the S3 bucket.
VersioningConfiguration This property is required. BucketVersioningV2VersioningConfiguration
Configuration block for the versioning parameters. See below.
ExpectedBucketOwner Changes to this property will trigger replacement. string
Account ID of the expected bucket owner.
Mfa string
Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
Bucket
This property is required.
Changes to this property will trigger replacement.
string
Name of the S3 bucket.
VersioningConfiguration This property is required. BucketVersioningV2VersioningConfigurationArgs
Configuration block for the versioning parameters. See below.
ExpectedBucketOwner Changes to this property will trigger replacement. string
Account ID of the expected bucket owner.
Mfa string
Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
bucket
This property is required.
Changes to this property will trigger replacement.
String
Name of the S3 bucket.
versioningConfiguration This property is required. BucketVersioningV2VersioningConfiguration
Configuration block for the versioning parameters. See below.
expectedBucketOwner Changes to this property will trigger replacement. String
Account ID of the expected bucket owner.
mfa String
Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
bucket
This property is required.
Changes to this property will trigger replacement.
string
Name of the S3 bucket.
versioningConfiguration This property is required. BucketVersioningV2VersioningConfiguration
Configuration block for the versioning parameters. See below.
expectedBucketOwner Changes to this property will trigger replacement. string
Account ID of the expected bucket owner.
mfa string
Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
bucket
This property is required.
Changes to this property will trigger replacement.
str
Name of the S3 bucket.
versioning_configuration This property is required. BucketVersioningV2VersioningConfigurationArgs
Configuration block for the versioning parameters. See below.
expected_bucket_owner Changes to this property will trigger replacement. str
Account ID of the expected bucket owner.
mfa str
Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
bucket
This property is required.
Changes to this property will trigger replacement.
String
Name of the S3 bucket.
versioningConfiguration This property is required. Property Map
Configuration block for the versioning parameters. See below.
expectedBucketOwner Changes to this property will trigger replacement. String
Account ID of the expected bucket owner.
mfa String
Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.

Outputs

All input properties are implicitly available as output properties. Additionally, the BucketVersioningV2 resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing BucketVersioningV2 Resource

Get an existing BucketVersioningV2 resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: BucketVersioningV2State, opts?: CustomResourceOptions): BucketVersioningV2
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bucket: Optional[str] = None,
        expected_bucket_owner: Optional[str] = None,
        mfa: Optional[str] = None,
        versioning_configuration: Optional[BucketVersioningV2VersioningConfigurationArgs] = None) -> BucketVersioningV2
func GetBucketVersioningV2(ctx *Context, name string, id IDInput, state *BucketVersioningV2State, opts ...ResourceOption) (*BucketVersioningV2, error)
public static BucketVersioningV2 Get(string name, Input<string> id, BucketVersioningV2State? state, CustomResourceOptions? opts = null)
public static BucketVersioningV2 get(String name, Output<String> id, BucketVersioningV2State state, CustomResourceOptions options)
resources:  _:    type: aws:s3:BucketVersioningV2    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Bucket Changes to this property will trigger replacement. string
Name of the S3 bucket.
ExpectedBucketOwner Changes to this property will trigger replacement. string
Account ID of the expected bucket owner.
Mfa string
Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
VersioningConfiguration BucketVersioningV2VersioningConfiguration
Configuration block for the versioning parameters. See below.
Bucket Changes to this property will trigger replacement. string
Name of the S3 bucket.
ExpectedBucketOwner Changes to this property will trigger replacement. string
Account ID of the expected bucket owner.
Mfa string
Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
VersioningConfiguration BucketVersioningV2VersioningConfigurationArgs
Configuration block for the versioning parameters. See below.
bucket Changes to this property will trigger replacement. String
Name of the S3 bucket.
expectedBucketOwner Changes to this property will trigger replacement. String
Account ID of the expected bucket owner.
mfa String
Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
versioningConfiguration BucketVersioningV2VersioningConfiguration
Configuration block for the versioning parameters. See below.
bucket Changes to this property will trigger replacement. string
Name of the S3 bucket.
expectedBucketOwner Changes to this property will trigger replacement. string
Account ID of the expected bucket owner.
mfa string
Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
versioningConfiguration BucketVersioningV2VersioningConfiguration
Configuration block for the versioning parameters. See below.
bucket Changes to this property will trigger replacement. str
Name of the S3 bucket.
expected_bucket_owner Changes to this property will trigger replacement. str
Account ID of the expected bucket owner.
mfa str
Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
versioning_configuration BucketVersioningV2VersioningConfigurationArgs
Configuration block for the versioning parameters. See below.
bucket Changes to this property will trigger replacement. String
Name of the S3 bucket.
expectedBucketOwner Changes to this property will trigger replacement. String
Account ID of the expected bucket owner.
mfa String
Concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device.
versioningConfiguration Property Map
Configuration block for the versioning parameters. See below.

Supporting Types

BucketVersioningV2VersioningConfiguration
, BucketVersioningV2VersioningConfigurationArgs

Status This property is required. string
Versioning state of the bucket. Valid values: Enabled, Suspended, or Disabled. Disabled should only be used when creating or importing resources that correspond to unversioned S3 buckets.
MfaDelete string
Specifies whether MFA delete is enabled in the bucket versioning configuration. Valid values: Enabled or Disabled.
Status This property is required. string
Versioning state of the bucket. Valid values: Enabled, Suspended, or Disabled. Disabled should only be used when creating or importing resources that correspond to unversioned S3 buckets.
MfaDelete string
Specifies whether MFA delete is enabled in the bucket versioning configuration. Valid values: Enabled or Disabled.
status This property is required. String
Versioning state of the bucket. Valid values: Enabled, Suspended, or Disabled. Disabled should only be used when creating or importing resources that correspond to unversioned S3 buckets.
mfaDelete String
Specifies whether MFA delete is enabled in the bucket versioning configuration. Valid values: Enabled or Disabled.
status This property is required. string
Versioning state of the bucket. Valid values: Enabled, Suspended, or Disabled. Disabled should only be used when creating or importing resources that correspond to unversioned S3 buckets.
mfaDelete string
Specifies whether MFA delete is enabled in the bucket versioning configuration. Valid values: Enabled or Disabled.
status This property is required. str
Versioning state of the bucket. Valid values: Enabled, Suspended, or Disabled. Disabled should only be used when creating or importing resources that correspond to unversioned S3 buckets.
mfa_delete str
Specifies whether MFA delete is enabled in the bucket versioning configuration. Valid values: Enabled or Disabled.
status This property is required. String
Versioning state of the bucket. Valid values: Enabled, Suspended, or Disabled. Disabled should only be used when creating or importing resources that correspond to unversioned S3 buckets.
mfaDelete String
Specifies whether MFA delete is enabled in the bucket versioning configuration. Valid values: Enabled or Disabled.

Import

If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, import using the bucket and expected_bucket_owner separated by a comma (,):

Using pulumi import to import S3 bucket versioning using the bucket or using the bucket and expected_bucket_owner separated by a comma (,). For example:

If the owner (account ID) of the source bucket is the same account used to configure the AWS Provider, import using the bucket:

$ pulumi import aws:s3/bucketVersioningV2:BucketVersioningV2 example bucket-name
Copy

If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, import using the bucket and expected_bucket_owner separated by a comma (,):

$ pulumi import aws:s3/bucketVersioningV2:BucketVersioningV2 example bucket-name,123456789012
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.