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

aws.s3.BucketObjectLockConfiguration

Explore with Pulumi AI

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

    Provides an S3 bucket Object Lock configuration resource. For more information about Object Locking, go to Using S3 Object Lock in the Amazon S3 User Guide.

    This resource can be used enable Object Lock for new and existing buckets.

    This resource cannot be used with S3 directory buckets.

    Example Usage

    Object Lock configuration for new or existing buckets

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.s3.Bucket("example", {bucket: "mybucket"});
    const exampleBucketVersioning = new aws.s3.BucketVersioning("example", {
        bucket: example.id,
        versioningConfiguration: {
            status: "Enabled",
        },
    });
    const exampleBucketObjectLockConfiguration = new aws.s3.BucketObjectLockConfiguration("example", {
        bucket: example.id,
        rule: {
            defaultRetention: {
                mode: "COMPLIANCE",
                days: 5,
            },
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.s3.Bucket("example", bucket="mybucket")
    example_bucket_versioning = aws.s3.BucketVersioning("example",
        bucket=example.id,
        versioning_configuration={
            "status": "Enabled",
        })
    example_bucket_object_lock_configuration = aws.s3.BucketObjectLockConfiguration("example",
        bucket=example.id,
        rule={
            "default_retention": {
                "mode": "COMPLIANCE",
                "days": 5,
            },
        })
    
    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("mybucket"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = s3.NewBucketVersioning(ctx, "example", &s3.BucketVersioningArgs{
    			Bucket: example.ID(),
    			VersioningConfiguration: &s3.BucketVersioningVersioningConfigurationArgs{
    				Status: pulumi.String("Enabled"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = s3.NewBucketObjectLockConfiguration(ctx, "example", &s3.BucketObjectLockConfigurationArgs{
    			Bucket: example.ID(),
    			Rule: &s3.BucketObjectLockConfigurationRuleArgs{
    				DefaultRetention: &s3.BucketObjectLockConfigurationRuleDefaultRetentionArgs{
    					Mode: pulumi.String("COMPLIANCE"),
    					Days: pulumi.Int(5),
    				},
    			},
    		})
    		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 = "mybucket",
        });
    
        var exampleBucketVersioning = new Aws.S3.BucketVersioning("example", new()
        {
            Bucket = example.Id,
            VersioningConfiguration = new Aws.S3.Inputs.BucketVersioningVersioningConfigurationArgs
            {
                Status = "Enabled",
            },
        });
    
        var exampleBucketObjectLockConfiguration = new Aws.S3.BucketObjectLockConfiguration("example", new()
        {
            Bucket = example.Id,
            Rule = new Aws.S3.Inputs.BucketObjectLockConfigurationRuleArgs
            {
                DefaultRetention = new Aws.S3.Inputs.BucketObjectLockConfigurationRuleDefaultRetentionArgs
                {
                    Mode = "COMPLIANCE",
                    Days = 5,
                },
            },
        });
    
    });
    
    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.BucketObjectLockConfiguration;
    import com.pulumi.aws.s3.BucketObjectLockConfigurationArgs;
    import com.pulumi.aws.s3.inputs.BucketObjectLockConfigurationRuleArgs;
    import com.pulumi.aws.s3.inputs.BucketObjectLockConfigurationRuleDefaultRetentionArgs;
    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("mybucket")
                .build());
    
            var exampleBucketVersioning = new BucketVersioning("exampleBucketVersioning", BucketVersioningArgs.builder()
                .bucket(example.id())
                .versioningConfiguration(BucketVersioningVersioningConfigurationArgs.builder()
                    .status("Enabled")
                    .build())
                .build());
    
            var exampleBucketObjectLockConfiguration = new BucketObjectLockConfiguration("exampleBucketObjectLockConfiguration", BucketObjectLockConfigurationArgs.builder()
                .bucket(example.id())
                .rule(BucketObjectLockConfigurationRuleArgs.builder()
                    .defaultRetention(BucketObjectLockConfigurationRuleDefaultRetentionArgs.builder()
                        .mode("COMPLIANCE")
                        .days(5)
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:s3:Bucket
        properties:
          bucket: mybucket
      exampleBucketVersioning:
        type: aws:s3:BucketVersioning
        name: example
        properties:
          bucket: ${example.id}
          versioningConfiguration:
            status: Enabled
      exampleBucketObjectLockConfiguration:
        type: aws:s3:BucketObjectLockConfiguration
        name: example
        properties:
          bucket: ${example.id}
          rule:
            defaultRetention:
              mode: COMPLIANCE
              days: 5
    

    Create BucketObjectLockConfiguration Resource

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

    Constructor syntax

    new BucketObjectLockConfiguration(name: string, args: BucketObjectLockConfigurationArgs, opts?: CustomResourceOptions);
    @overload
    def BucketObjectLockConfiguration(resource_name: str,
                                      args: BucketObjectLockConfigurationInitArgs,
                                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def BucketObjectLockConfiguration(resource_name: str,
                                      opts: Optional[ResourceOptions] = None,
                                      bucket: Optional[str] = None,
                                      expected_bucket_owner: Optional[str] = None,
                                      object_lock_enabled: Optional[str] = None,
                                      region: Optional[str] = None,
                                      rule: Optional[BucketObjectLockConfigurationRuleArgs] = None,
                                      token: Optional[str] = None)
    func NewBucketObjectLockConfiguration(ctx *Context, name string, args BucketObjectLockConfigurationArgs, opts ...ResourceOption) (*BucketObjectLockConfiguration, error)
    public BucketObjectLockConfiguration(string name, BucketObjectLockConfigurationArgs args, CustomResourceOptions? opts = null)
    public BucketObjectLockConfiguration(String name, BucketObjectLockConfigurationArgs args)
    public BucketObjectLockConfiguration(String name, BucketObjectLockConfigurationArgs args, CustomResourceOptions options)
    
    type: aws:s3:BucketObjectLockConfiguration
    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 BucketObjectLockConfigurationArgs
    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 BucketObjectLockConfigurationInitArgs
    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 BucketObjectLockConfigurationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BucketObjectLockConfigurationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BucketObjectLockConfigurationArgs
    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 bucketObjectLockConfigurationResource = new Aws.S3.BucketObjectLockConfiguration("bucketObjectLockConfigurationResource", new()
    {
        Bucket = "string",
        ExpectedBucketOwner = "string",
        ObjectLockEnabled = "string",
        Region = "string",
        Rule = new Aws.S3.Inputs.BucketObjectLockConfigurationRuleArgs
        {
            DefaultRetention = new Aws.S3.Inputs.BucketObjectLockConfigurationRuleDefaultRetentionArgs
            {
                Days = 0,
                Mode = "string",
                Years = 0,
            },
        },
        Token = "string",
    });
    
    example, err := s3.NewBucketObjectLockConfiguration(ctx, "bucketObjectLockConfigurationResource", &s3.BucketObjectLockConfigurationArgs{
    	Bucket:              pulumi.String("string"),
    	ExpectedBucketOwner: pulumi.String("string"),
    	ObjectLockEnabled:   pulumi.String("string"),
    	Region:              pulumi.String("string"),
    	Rule: &s3.BucketObjectLockConfigurationRuleArgs{
    		DefaultRetention: &s3.BucketObjectLockConfigurationRuleDefaultRetentionArgs{
    			Days:  pulumi.Int(0),
    			Mode:  pulumi.String("string"),
    			Years: pulumi.Int(0),
    		},
    	},
    	Token: pulumi.String("string"),
    })
    
    var bucketObjectLockConfigurationResource = new BucketObjectLockConfiguration("bucketObjectLockConfigurationResource", BucketObjectLockConfigurationArgs.builder()
        .bucket("string")
        .expectedBucketOwner("string")
        .objectLockEnabled("string")
        .region("string")
        .rule(BucketObjectLockConfigurationRuleArgs.builder()
            .defaultRetention(BucketObjectLockConfigurationRuleDefaultRetentionArgs.builder()
                .days(0)
                .mode("string")
                .years(0)
                .build())
            .build())
        .token("string")
        .build());
    
    bucket_object_lock_configuration_resource = aws.s3.BucketObjectLockConfiguration("bucketObjectLockConfigurationResource",
        bucket="string",
        expected_bucket_owner="string",
        object_lock_enabled="string",
        region="string",
        rule={
            "default_retention": {
                "days": 0,
                "mode": "string",
                "years": 0,
            },
        },
        token="string")
    
    const bucketObjectLockConfigurationResource = new aws.s3.BucketObjectLockConfiguration("bucketObjectLockConfigurationResource", {
        bucket: "string",
        expectedBucketOwner: "string",
        objectLockEnabled: "string",
        region: "string",
        rule: {
            defaultRetention: {
                days: 0,
                mode: "string",
                years: 0,
            },
        },
        token: "string",
    });
    
    type: aws:s3:BucketObjectLockConfiguration
    properties:
        bucket: string
        expectedBucketOwner: string
        objectLockEnabled: string
        region: string
        rule:
            defaultRetention:
                days: 0
                mode: string
                years: 0
        token: string
    

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

    Bucket string
    Name of the bucket.
    ExpectedBucketOwner string
    Account ID of the expected bucket owner.
    ObjectLockEnabled string
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Rule BucketObjectLockConfigurationRule
    Configuration block for specifying the Object Lock rule for the specified object. See below.
    Token string
    This argument is deprecated and no longer needed to enable Object Lock. To enable Object Lock for an existing bucket, you must first enable versioning on the bucket and then enable Object Lock. For more details on versioning, see the aws.s3.BucketVersioning resource.
    Bucket string
    Name of the bucket.
    ExpectedBucketOwner string
    Account ID of the expected bucket owner.
    ObjectLockEnabled string
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Rule BucketObjectLockConfigurationRuleArgs
    Configuration block for specifying the Object Lock rule for the specified object. See below.
    Token string
    This argument is deprecated and no longer needed to enable Object Lock. To enable Object Lock for an existing bucket, you must first enable versioning on the bucket and then enable Object Lock. For more details on versioning, see the aws.s3.BucketVersioning resource.
    bucket String
    Name of the bucket.
    expectedBucketOwner String
    Account ID of the expected bucket owner.
    objectLockEnabled String
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    rule BucketObjectLockConfigurationRule
    Configuration block for specifying the Object Lock rule for the specified object. See below.
    token String
    This argument is deprecated and no longer needed to enable Object Lock. To enable Object Lock for an existing bucket, you must first enable versioning on the bucket and then enable Object Lock. For more details on versioning, see the aws.s3.BucketVersioning resource.
    bucket string
    Name of the bucket.
    expectedBucketOwner string
    Account ID of the expected bucket owner.
    objectLockEnabled string
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    rule BucketObjectLockConfigurationRule
    Configuration block for specifying the Object Lock rule for the specified object. See below.
    token string
    This argument is deprecated and no longer needed to enable Object Lock. To enable Object Lock for an existing bucket, you must first enable versioning on the bucket and then enable Object Lock. For more details on versioning, see the aws.s3.BucketVersioning resource.
    bucket str
    Name of the bucket.
    expected_bucket_owner str
    Account ID of the expected bucket owner.
    object_lock_enabled str
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    rule BucketObjectLockConfigurationRuleArgs
    Configuration block for specifying the Object Lock rule for the specified object. See below.
    token str
    This argument is deprecated and no longer needed to enable Object Lock. To enable Object Lock for an existing bucket, you must first enable versioning on the bucket and then enable Object Lock. For more details on versioning, see the aws.s3.BucketVersioning resource.
    bucket String
    Name of the bucket.
    expectedBucketOwner String
    Account ID of the expected bucket owner.
    objectLockEnabled String
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    rule Property Map
    Configuration block for specifying the Object Lock rule for the specified object. See below.
    token String
    This argument is deprecated and no longer needed to enable Object Lock. To enable Object Lock for an existing bucket, you must first enable versioning on the bucket and then enable Object Lock. For more details on versioning, see the aws.s3.BucketVersioning resource.

    Outputs

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

    Get an existing BucketObjectLockConfiguration 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?: BucketObjectLockConfigurationState, opts?: CustomResourceOptions): BucketObjectLockConfiguration
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bucket: Optional[str] = None,
            expected_bucket_owner: Optional[str] = None,
            object_lock_enabled: Optional[str] = None,
            region: Optional[str] = None,
            rule: Optional[BucketObjectLockConfigurationRuleArgs] = None,
            token: Optional[str] = None) -> BucketObjectLockConfiguration
    func GetBucketObjectLockConfiguration(ctx *Context, name string, id IDInput, state *BucketObjectLockConfigurationState, opts ...ResourceOption) (*BucketObjectLockConfiguration, error)
    public static BucketObjectLockConfiguration Get(string name, Input<string> id, BucketObjectLockConfigurationState? state, CustomResourceOptions? opts = null)
    public static BucketObjectLockConfiguration get(String name, Output<String> id, BucketObjectLockConfigurationState state, CustomResourceOptions options)
    resources:  _:    type: aws:s3:BucketObjectLockConfiguration    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 bucket.
    ExpectedBucketOwner string
    Account ID of the expected bucket owner.
    ObjectLockEnabled string
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Rule BucketObjectLockConfigurationRule
    Configuration block for specifying the Object Lock rule for the specified object. See below.
    Token string
    This argument is deprecated and no longer needed to enable Object Lock. To enable Object Lock for an existing bucket, you must first enable versioning on the bucket and then enable Object Lock. For more details on versioning, see the aws.s3.BucketVersioning resource.
    Bucket string
    Name of the bucket.
    ExpectedBucketOwner string
    Account ID of the expected bucket owner.
    ObjectLockEnabled string
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Rule BucketObjectLockConfigurationRuleArgs
    Configuration block for specifying the Object Lock rule for the specified object. See below.
    Token string
    This argument is deprecated and no longer needed to enable Object Lock. To enable Object Lock for an existing bucket, you must first enable versioning on the bucket and then enable Object Lock. For more details on versioning, see the aws.s3.BucketVersioning resource.
    bucket String
    Name of the bucket.
    expectedBucketOwner String
    Account ID of the expected bucket owner.
    objectLockEnabled String
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    rule BucketObjectLockConfigurationRule
    Configuration block for specifying the Object Lock rule for the specified object. See below.
    token String
    This argument is deprecated and no longer needed to enable Object Lock. To enable Object Lock for an existing bucket, you must first enable versioning on the bucket and then enable Object Lock. For more details on versioning, see the aws.s3.BucketVersioning resource.
    bucket string
    Name of the bucket.
    expectedBucketOwner string
    Account ID of the expected bucket owner.
    objectLockEnabled string
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    rule BucketObjectLockConfigurationRule
    Configuration block for specifying the Object Lock rule for the specified object. See below.
    token string
    This argument is deprecated and no longer needed to enable Object Lock. To enable Object Lock for an existing bucket, you must first enable versioning on the bucket and then enable Object Lock. For more details on versioning, see the aws.s3.BucketVersioning resource.
    bucket str
    Name of the bucket.
    expected_bucket_owner str
    Account ID of the expected bucket owner.
    object_lock_enabled str
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    rule BucketObjectLockConfigurationRuleArgs
    Configuration block for specifying the Object Lock rule for the specified object. See below.
    token str
    This argument is deprecated and no longer needed to enable Object Lock. To enable Object Lock for an existing bucket, you must first enable versioning on the bucket and then enable Object Lock. For more details on versioning, see the aws.s3.BucketVersioning resource.
    bucket String
    Name of the bucket.
    expectedBucketOwner String
    Account ID of the expected bucket owner.
    objectLockEnabled String
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    rule Property Map
    Configuration block for specifying the Object Lock rule for the specified object. See below.
    token String
    This argument is deprecated and no longer needed to enable Object Lock. To enable Object Lock for an existing bucket, you must first enable versioning on the bucket and then enable Object Lock. For more details on versioning, see the aws.s3.BucketVersioning resource.

    Supporting Types

    BucketObjectLockConfigurationRule, BucketObjectLockConfigurationRuleArgs

    DefaultRetention BucketObjectLockConfigurationRuleDefaultRetention
    Configuration block for specifying the default Object Lock retention settings for new objects placed in the specified bucket. See below.
    DefaultRetention BucketObjectLockConfigurationRuleDefaultRetention
    Configuration block for specifying the default Object Lock retention settings for new objects placed in the specified bucket. See below.
    defaultRetention BucketObjectLockConfigurationRuleDefaultRetention
    Configuration block for specifying the default Object Lock retention settings for new objects placed in the specified bucket. See below.
    defaultRetention BucketObjectLockConfigurationRuleDefaultRetention
    Configuration block for specifying the default Object Lock retention settings for new objects placed in the specified bucket. See below.
    default_retention BucketObjectLockConfigurationRuleDefaultRetention
    Configuration block for specifying the default Object Lock retention settings for new objects placed in the specified bucket. See below.
    defaultRetention Property Map
    Configuration block for specifying the default Object Lock retention settings for new objects placed in the specified bucket. See below.

    BucketObjectLockConfigurationRuleDefaultRetention, BucketObjectLockConfigurationRuleDefaultRetentionArgs

    Days int
    Number of days that you want to specify for the default retention period.
    Mode string
    Default Object Lock retention mode you want to apply to new objects placed in the specified bucket. Valid values: COMPLIANCE, GOVERNANCE.
    Years int
    Number of years that you want to specify for the default retention period.
    Days int
    Number of days that you want to specify for the default retention period.
    Mode string
    Default Object Lock retention mode you want to apply to new objects placed in the specified bucket. Valid values: COMPLIANCE, GOVERNANCE.
    Years int
    Number of years that you want to specify for the default retention period.
    days Integer
    Number of days that you want to specify for the default retention period.
    mode String
    Default Object Lock retention mode you want to apply to new objects placed in the specified bucket. Valid values: COMPLIANCE, GOVERNANCE.
    years Integer
    Number of years that you want to specify for the default retention period.
    days number
    Number of days that you want to specify for the default retention period.
    mode string
    Default Object Lock retention mode you want to apply to new objects placed in the specified bucket. Valid values: COMPLIANCE, GOVERNANCE.
    years number
    Number of years that you want to specify for the default retention period.
    days int
    Number of days that you want to specify for the default retention period.
    mode str
    Default Object Lock retention mode you want to apply to new objects placed in the specified bucket. Valid values: COMPLIANCE, GOVERNANCE.
    years int
    Number of years that you want to specify for the default retention period.
    days Number
    Number of days that you want to specify for the default retention period.
    mode String
    Default Object Lock retention mode you want to apply to new objects placed in the specified bucket. Valid values: COMPLIANCE, GOVERNANCE.
    years Number
    Number of years that you want to specify for the default retention period.

    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 (,). For example:

    Using pulumi import, import an S3 bucket Object Lock Configuration using one of two forms. If the owner (account ID) of the source bucket is the same account used to configure the AWS Provider, import using the bucket. For example:

    $ pulumi import aws:s3/bucketObjectLockConfiguration:BucketObjectLockConfiguration 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 (,). For example:

    $ pulumi import aws:s3/bucketObjectLockConfiguration:BucketObjectLockConfiguration 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