1. Packages
  2. AWS
  3. API Docs
  4. s3
  5. BucketVersioning
AWS v7.1.0 published on Monday, Jul 21, 2025 by Pulumi

aws.s3.BucketVersioning

Explore with Pulumi AI

aws logo
AWS v7.1.0 published on Monday, Jul 21, 2025 by Pulumi

    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.Bucket("example", {bucket: "example-bucket"});
    const exampleBucketAcl = new aws.s3.BucketAcl("example", {
        bucket: example.id,
        acl: "private",
    });
    const versioningExample = new aws.s3.BucketVersioning("versioning_example", {
        bucket: example.id,
        versioningConfiguration: {
            status: "Enabled",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.s3.Bucket("example", bucket="example-bucket")
    example_bucket_acl = aws.s3.BucketAcl("example",
        bucket=example.id,
        acl="private")
    versioning_example = aws.s3.BucketVersioning("versioning_example",
        bucket=example.id,
        versioning_configuration={
            "status": "Enabled",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := s3.NewBucket(ctx, "example", &s3.BucketArgs{
    			Bucket: pulumi.String("example-bucket"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = s3.NewBucketAcl(ctx, "example", &s3.BucketAclArgs{
    			Bucket: example.ID(),
    			Acl:    pulumi.String("private"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = s3.NewBucketVersioning(ctx, "versioning_example", &s3.BucketVersioningArgs{
    			Bucket: example.ID(),
    			VersioningConfiguration: &s3.BucketVersioningVersioningConfigurationArgs{
    				Status: pulumi.String("Enabled"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.S3.Bucket("example", new()
        {
            BucketName = "example-bucket",
        });
    
        var exampleBucketAcl = new Aws.S3.BucketAcl("example", new()
        {
            Bucket = example.Id,
            Acl = "private",
        });
    
        var versioningExample = new Aws.S3.BucketVersioning("versioning_example", new()
        {
            Bucket = example.Id,
            VersioningConfiguration = new Aws.S3.Inputs.BucketVersioningVersioningConfigurationArgs
            {
                Status = "Enabled",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.s3.Bucket;
    import com.pulumi.aws.s3.BucketArgs;
    import com.pulumi.aws.s3.BucketAcl;
    import com.pulumi.aws.s3.BucketAclArgs;
    import com.pulumi.aws.s3.BucketVersioning;
    import com.pulumi.aws.s3.BucketVersioningArgs;
    import com.pulumi.aws.s3.inputs.BucketVersioningVersioningConfigurationArgs;
    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 Bucket("example", BucketArgs.builder()
                .bucket("example-bucket")
                .build());
    
            var exampleBucketAcl = new BucketAcl("exampleBucketAcl", BucketAclArgs.builder()
                .bucket(example.id())
                .acl("private")
                .build());
    
            var versioningExample = new BucketVersioning("versioningExample", BucketVersioningArgs.builder()
                .bucket(example.id())
                .versioningConfiguration(BucketVersioningVersioningConfigurationArgs.builder()
                    .status("Enabled")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:s3:Bucket
        properties:
          bucket: example-bucket
      exampleBucketAcl:
        type: aws:s3:BucketAcl
        name: example
        properties:
          bucket: ${example.id}
          acl: private
      versioningExample:
        type: aws:s3:BucketVersioning
        name: versioning_example
        properties:
          bucket: ${example.id}
          versioningConfiguration:
            status: Enabled
    

    With Versioning Disabled

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.s3.Bucket("example", {bucket: "example-bucket"});
    const exampleBucketAcl = new aws.s3.BucketAcl("example", {
        bucket: example.id,
        acl: "private",
    });
    const versioningExample = new aws.s3.BucketVersioning("versioning_example", {
        bucket: example.id,
        versioningConfiguration: {
            status: "Disabled",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.s3.Bucket("example", bucket="example-bucket")
    example_bucket_acl = aws.s3.BucketAcl("example",
        bucket=example.id,
        acl="private")
    versioning_example = aws.s3.BucketVersioning("versioning_example",
        bucket=example.id,
        versioning_configuration={
            "status": "Disabled",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := s3.NewBucket(ctx, "example", &s3.BucketArgs{
    			Bucket: pulumi.String("example-bucket"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = s3.NewBucketAcl(ctx, "example", &s3.BucketAclArgs{
    			Bucket: example.ID(),
    			Acl:    pulumi.String("private"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = s3.NewBucketVersioning(ctx, "versioning_example", &s3.BucketVersioningArgs{
    			Bucket: example.ID(),
    			VersioningConfiguration: &s3.BucketVersioningVersioningConfigurationArgs{
    				Status: pulumi.String("Disabled"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.S3.Bucket("example", new()
        {
            BucketName = "example-bucket",
        });
    
        var exampleBucketAcl = new Aws.S3.BucketAcl("example", new()
        {
            Bucket = example.Id,
            Acl = "private",
        });
    
        var versioningExample = new Aws.S3.BucketVersioning("versioning_example", new()
        {
            Bucket = example.Id,
            VersioningConfiguration = new Aws.S3.Inputs.BucketVersioningVersioningConfigurationArgs
            {
                Status = "Disabled",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.s3.Bucket;
    import com.pulumi.aws.s3.BucketArgs;
    import com.pulumi.aws.s3.BucketAcl;
    import com.pulumi.aws.s3.BucketAclArgs;
    import com.pulumi.aws.s3.BucketVersioning;
    import com.pulumi.aws.s3.BucketVersioningArgs;
    import com.pulumi.aws.s3.inputs.BucketVersioningVersioningConfigurationArgs;
    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 Bucket("example", BucketArgs.builder()
                .bucket("example-bucket")
                .build());
    
            var exampleBucketAcl = new BucketAcl("exampleBucketAcl", BucketAclArgs.builder()
                .bucket(example.id())
                .acl("private")
                .build());
    
            var versioningExample = new BucketVersioning("versioningExample", BucketVersioningArgs.builder()
                .bucket(example.id())
                .versioningConfiguration(BucketVersioningVersioningConfigurationArgs.builder()
                    .status("Disabled")
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:s3:Bucket
        properties:
          bucket: example-bucket
      exampleBucketAcl:
        type: aws:s3:BucketAcl
        name: example
        properties:
          bucket: ${example.id}
          acl: private
      versioningExample:
        type: aws:s3:BucketVersioning
        name: versioning_example
        properties:
          bucket: ${example.id}
          versioningConfiguration:
            status: Disabled
    

    Object Dependency On Versioning

    When you create an object whose version_id you need and an aws.s3.BucketVersioning 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.BucketVersioning 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.Bucket("example", {bucket: "yotto"});
    const exampleBucketVersioning = new aws.s3.BucketVersioning("example", {
        bucket: example.id,
        versioningConfiguration: {
            status: "Enabled",
        },
    });
    const exampleBucketObjectv2 = new aws.s3.BucketObjectv2("example", {
        bucket: exampleBucketVersioning.id,
        key: "droeloe",
        source: new pulumi.asset.FileAsset("example.txt"),
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.s3.Bucket("example", bucket="yotto")
    example_bucket_versioning = aws.s3.BucketVersioning("example",
        bucket=example.id,
        versioning_configuration={
            "status": "Enabled",
        })
    example_bucket_objectv2 = aws.s3.BucketObjectv2("example",
        bucket=example_bucket_versioning.id,
        key="droeloe",
        source=pulumi.FileAsset("example.txt"))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/s3"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := s3.NewBucket(ctx, "example", &s3.BucketArgs{
    			Bucket: pulumi.String("yotto"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleBucketVersioning, err := s3.NewBucketVersioning(ctx, "example", &s3.BucketVersioningArgs{
    			Bucket: example.ID(),
    			VersioningConfiguration: &s3.BucketVersioningVersioningConfigurationArgs{
    				Status: pulumi.String("Enabled"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = s3.NewBucketObjectv2(ctx, "example", &s3.BucketObjectv2Args{
    			Bucket: exampleBucketVersioning.ID(),
    			Key:    pulumi.String("droeloe"),
    			Source: pulumi.NewFileAsset("example.txt"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.S3.Bucket("example", new()
        {
            BucketName = "yotto",
        });
    
        var exampleBucketVersioning = new Aws.S3.BucketVersioning("example", new()
        {
            Bucket = example.Id,
            VersioningConfiguration = new Aws.S3.Inputs.BucketVersioningVersioningConfigurationArgs
            {
                Status = "Enabled",
            },
        });
    
        var exampleBucketObjectv2 = new Aws.S3.BucketObjectv2("example", new()
        {
            Bucket = exampleBucketVersioning.Id,
            Key = "droeloe",
            Source = new FileAsset("example.txt"),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.s3.Bucket;
    import com.pulumi.aws.s3.BucketArgs;
    import com.pulumi.aws.s3.BucketVersioning;
    import com.pulumi.aws.s3.BucketVersioningArgs;
    import com.pulumi.aws.s3.inputs.BucketVersioningVersioningConfigurationArgs;
    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 Bucket("example", BucketArgs.builder()
                .bucket("yotto")
                .build());
    
            var exampleBucketVersioning = new BucketVersioning("exampleBucketVersioning", BucketVersioningArgs.builder()
                .bucket(example.id())
                .versioningConfiguration(BucketVersioningVersioningConfigurationArgs.builder()
                    .status("Enabled")
                    .build())
                .build());
    
            var exampleBucketObjectv2 = new BucketObjectv2("exampleBucketObjectv2", BucketObjectv2Args.builder()
                .bucket(exampleBucketVersioning.id())
                .key("droeloe")
                .source(new FileAsset("example.txt"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:s3:Bucket
        properties:
          bucket: yotto
      exampleBucketVersioning:
        type: aws:s3:BucketVersioning
        name: example
        properties:
          bucket: ${example.id}
          versioningConfiguration:
            status: Enabled
      exampleBucketObjectv2:
        type: aws:s3:BucketObjectv2
        name: example
        properties:
          bucket: ${exampleBucketVersioning.id}
          key: droeloe
          source:
            fn::FileAsset: example.txt
    

    Create BucketVersioning Resource

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

    Constructor syntax

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

    Parameters

    name string
    The unique name of the resource.
    args BucketVersioningArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args BucketVersioningInitArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args BucketVersioningArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BucketVersioningArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BucketVersioningArgs
    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 bucketVersioningResource = new Aws.S3.BucketVersioning("bucketVersioningResource", new()
    {
        Bucket = "string",
        VersioningConfiguration = new Aws.S3.Inputs.BucketVersioningVersioningConfigurationArgs
        {
            Status = "string",
            MfaDelete = "string",
        },
        ExpectedBucketOwner = "string",
        Mfa = "string",
        Region = "string",
    });
    
    example, err := s3.NewBucketVersioning(ctx, "bucketVersioningResource", &s3.BucketVersioningArgs{
    	Bucket: pulumi.String("string"),
    	VersioningConfiguration: &s3.BucketVersioningVersioningConfigurationArgs{
    		Status:    pulumi.String("string"),
    		MfaDelete: pulumi.String("string"),
    	},
    	ExpectedBucketOwner: pulumi.String("string"),
    	Mfa:                 pulumi.String("string"),
    	Region:              pulumi.String("string"),
    })
    
    var bucketVersioningResource = new BucketVersioning("bucketVersioningResource", BucketVersioningArgs.builder()
        .bucket("string")
        .versioningConfiguration(BucketVersioningVersioningConfigurationArgs.builder()
            .status("string")
            .mfaDelete("string")
            .build())
        .expectedBucketOwner("string")
        .mfa("string")
        .region("string")
        .build());
    
    bucket_versioning_resource = aws.s3.BucketVersioning("bucketVersioningResource",
        bucket="string",
        versioning_configuration={
            "status": "string",
            "mfa_delete": "string",
        },
        expected_bucket_owner="string",
        mfa="string",
        region="string")
    
    const bucketVersioningResource = new aws.s3.BucketVersioning("bucketVersioningResource", {
        bucket: "string",
        versioningConfiguration: {
            status: "string",
            mfaDelete: "string",
        },
        expectedBucketOwner: "string",
        mfa: "string",
        region: "string",
    });
    
    type: aws:s3:BucketVersioning
    properties:
        bucket: string
        expectedBucketOwner: string
        mfa: string
        region: string
        versioningConfiguration:
            mfaDelete: string
            status: string
    

    BucketVersioning 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 BucketVersioning resource accepts the following input properties:

    Bucket string
    Name of the S3 bucket.
    VersioningConfiguration BucketVersioningVersioningConfiguration
    Configuration block for the versioning parameters. See below.
    ExpectedBucketOwner 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.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Bucket string
    Name of the S3 bucket.
    VersioningConfiguration BucketVersioningVersioningConfigurationArgs
    Configuration block for the versioning parameters. See below.
    ExpectedBucketOwner 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.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    bucket String
    Name of the S3 bucket.
    versioningConfiguration BucketVersioningVersioningConfiguration
    Configuration block for the versioning parameters. See below.
    expectedBucketOwner 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.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    bucket string
    Name of the S3 bucket.
    versioningConfiguration BucketVersioningVersioningConfiguration
    Configuration block for the versioning parameters. See below.
    expectedBucketOwner 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.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    bucket str
    Name of the S3 bucket.
    versioning_configuration BucketVersioningVersioningConfigurationArgs
    Configuration block for the versioning parameters. See below.
    expected_bucket_owner 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.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    bucket String
    Name of the S3 bucket.
    versioningConfiguration Property Map
    Configuration block for the versioning parameters. See below.
    expectedBucketOwner 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.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the BucketVersioning 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 BucketVersioning Resource

    Get an existing BucketVersioning 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?: BucketVersioningState, opts?: CustomResourceOptions): BucketVersioning
    @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,
            region: Optional[str] = None,
            versioning_configuration: Optional[BucketVersioningVersioningConfigurationArgs] = None) -> BucketVersioning
    func GetBucketVersioning(ctx *Context, name string, id IDInput, state *BucketVersioningState, opts ...ResourceOption) (*BucketVersioning, error)
    public static BucketVersioning Get(string name, Input<string> id, BucketVersioningState? state, CustomResourceOptions? opts = null)
    public static BucketVersioning get(String name, Output<String> id, BucketVersioningState state, CustomResourceOptions options)
    resources:  _:    type: aws:s3:BucketVersioning    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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 string
    Name of the S3 bucket.
    ExpectedBucketOwner 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.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    VersioningConfiguration BucketVersioningVersioningConfiguration
    Configuration block for the versioning parameters. See below.
    Bucket string
    Name of the S3 bucket.
    ExpectedBucketOwner 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.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    VersioningConfiguration BucketVersioningVersioningConfigurationArgs
    Configuration block for the versioning parameters. See below.
    bucket String
    Name of the S3 bucket.
    expectedBucketOwner 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.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    versioningConfiguration BucketVersioningVersioningConfiguration
    Configuration block for the versioning parameters. See below.
    bucket string
    Name of the S3 bucket.
    expectedBucketOwner 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.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    versioningConfiguration BucketVersioningVersioningConfiguration
    Configuration block for the versioning parameters. See below.
    bucket str
    Name of the S3 bucket.
    expected_bucket_owner 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.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    versioning_configuration BucketVersioningVersioningConfigurationArgs
    Configuration block for the versioning parameters. See below.
    bucket String
    Name of the S3 bucket.
    expectedBucketOwner 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.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    versioningConfiguration Property Map
    Configuration block for the versioning parameters. See below.

    Supporting Types

    BucketVersioningVersioningConfiguration, BucketVersioningVersioningConfigurationArgs

    Status 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 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 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 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 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 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/bucketVersioning:BucketVersioning example bucket-name
    

    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/bucketVersioning:BucketVersioning example bucket-name,123456789012
    

    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.
    aws logo
    AWS v7.1.0 published on Monday, Jul 21, 2025 by Pulumi