1. Packages
  2. AWS
  3. API Docs
  4. s3
  5. getBucketObjectLockConfiguration
AWS v7.20.0 published on Thursday, Feb 19, 2026 by Pulumi
aws logo
AWS v7.20.0 published on Thursday, Feb 19, 2026 by Pulumi

    Provides details about an AWS S3 (Simple Storage) Bucket Object Lock Configuration.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.s3.getBucketObjectLockConfiguration({
        bucket: "example-bucket",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.s3.get_bucket_object_lock_configuration(bucket="example-bucket")
    
    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 {
    		_, err := s3.LookupBucketObjectLockConfiguration(ctx, &s3.LookupBucketObjectLockConfigurationArgs{
    			Bucket: "example-bucket",
    		}, nil)
    		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 = Aws.S3.GetBucketObjectLockConfiguration.Invoke(new()
        {
            Bucket = "example-bucket",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.s3.S3Functions;
    import com.pulumi.aws.s3.inputs.GetBucketObjectLockConfigurationArgs;
    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) {
            final var example = S3Functions.getBucketObjectLockConfiguration(GetBucketObjectLockConfigurationArgs.builder()
                .bucket("example-bucket")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: aws:s3:getBucketObjectLockConfiguration
          arguments:
            bucket: example-bucket
    

    Using getBucketObjectLockConfiguration

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getBucketObjectLockConfiguration(args: GetBucketObjectLockConfigurationArgs, opts?: InvokeOptions): Promise<GetBucketObjectLockConfigurationResult>
    function getBucketObjectLockConfigurationOutput(args: GetBucketObjectLockConfigurationOutputArgs, opts?: InvokeOptions): Output<GetBucketObjectLockConfigurationResult>
    def get_bucket_object_lock_configuration(bucket: Optional[str] = None,
                                             expected_bucket_owner: Optional[str] = None,
                                             region: Optional[str] = None,
                                             opts: Optional[InvokeOptions] = None) -> GetBucketObjectLockConfigurationResult
    def get_bucket_object_lock_configuration_output(bucket: Optional[pulumi.Input[str]] = None,
                                             expected_bucket_owner: Optional[pulumi.Input[str]] = None,
                                             region: Optional[pulumi.Input[str]] = None,
                                             opts: Optional[InvokeOptions] = None) -> Output[GetBucketObjectLockConfigurationResult]
    func LookupBucketObjectLockConfiguration(ctx *Context, args *LookupBucketObjectLockConfigurationArgs, opts ...InvokeOption) (*LookupBucketObjectLockConfigurationResult, error)
    func LookupBucketObjectLockConfigurationOutput(ctx *Context, args *LookupBucketObjectLockConfigurationOutputArgs, opts ...InvokeOption) LookupBucketObjectLockConfigurationResultOutput

    > Note: This function is named LookupBucketObjectLockConfiguration in the Go SDK.

    public static class GetBucketObjectLockConfiguration 
    {
        public static Task<GetBucketObjectLockConfigurationResult> InvokeAsync(GetBucketObjectLockConfigurationArgs args, InvokeOptions? opts = null)
        public static Output<GetBucketObjectLockConfigurationResult> Invoke(GetBucketObjectLockConfigurationInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBucketObjectLockConfigurationResult> getBucketObjectLockConfiguration(GetBucketObjectLockConfigurationArgs args, InvokeOptions options)
    public static Output<GetBucketObjectLockConfigurationResult> getBucketObjectLockConfiguration(GetBucketObjectLockConfigurationArgs args, InvokeOptions options)
    
    fn::invoke:
      function: aws:s3/getBucketObjectLockConfiguration:getBucketObjectLockConfiguration
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Bucket string

    Name of the bucket.

    The following arguments are optional:

    ExpectedBucketOwner string
    Account ID of the expected bucket owner.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Bucket string

    Name of the bucket.

    The following arguments are optional:

    ExpectedBucketOwner string
    Account ID of the expected bucket owner.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    bucket String

    Name of the bucket.

    The following arguments are optional:

    expectedBucketOwner String
    Account ID of the expected bucket owner.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    bucket string

    Name of the bucket.

    The following arguments are optional:

    expectedBucketOwner string
    Account ID of the expected bucket owner.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    bucket str

    Name of the bucket.

    The following arguments are optional:

    expected_bucket_owner str
    Account ID of the expected bucket owner.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    bucket String

    Name of the bucket.

    The following arguments are optional:

    expectedBucketOwner String
    Account ID of the expected bucket owner.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.

    getBucketObjectLockConfiguration Result

    The following output properties are available:

    Bucket string
    Id string
    The provider-assigned unique ID for this managed resource.
    ObjectLockEnabled string
    Indicates whether this bucket has an Object Lock configuration enabled.
    Region string
    Rules List<GetBucketObjectLockConfigurationRule>
    Object lock rule for the specified object. See Rule below.
    ExpectedBucketOwner string
    Bucket string
    Id string
    The provider-assigned unique ID for this managed resource.
    ObjectLockEnabled string
    Indicates whether this bucket has an Object Lock configuration enabled.
    Region string
    Rules []GetBucketObjectLockConfigurationRule
    Object lock rule for the specified object. See Rule below.
    ExpectedBucketOwner string
    bucket String
    id String
    The provider-assigned unique ID for this managed resource.
    objectLockEnabled String
    Indicates whether this bucket has an Object Lock configuration enabled.
    region String
    rules List<GetBucketObjectLockConfigurationRule>
    Object lock rule for the specified object. See Rule below.
    expectedBucketOwner String
    bucket string
    id string
    The provider-assigned unique ID for this managed resource.
    objectLockEnabled string
    Indicates whether this bucket has an Object Lock configuration enabled.
    region string
    rules GetBucketObjectLockConfigurationRule[]
    Object lock rule for the specified object. See Rule below.
    expectedBucketOwner string
    bucket str
    id str
    The provider-assigned unique ID for this managed resource.
    object_lock_enabled str
    Indicates whether this bucket has an Object Lock configuration enabled.
    region str
    rules Sequence[GetBucketObjectLockConfigurationRule]
    Object lock rule for the specified object. See Rule below.
    expected_bucket_owner str
    bucket String
    id String
    The provider-assigned unique ID for this managed resource.
    objectLockEnabled String
    Indicates whether this bucket has an Object Lock configuration enabled.
    region String
    rules List<Property Map>
    Object lock rule for the specified object. See Rule below.
    expectedBucketOwner String

    Supporting Types

    GetBucketObjectLockConfigurationRule

    DefaultRetentions List<GetBucketObjectLockConfigurationRuleDefaultRetention>
    Default object lock retention settings for new objects placed in the bucket. See Default Retention below.
    DefaultRetentions []GetBucketObjectLockConfigurationRuleDefaultRetention
    Default object lock retention settings for new objects placed in the bucket. See Default Retention below.
    defaultRetentions List<GetBucketObjectLockConfigurationRuleDefaultRetention>
    Default object lock retention settings for new objects placed in the bucket. See Default Retention below.
    defaultRetentions GetBucketObjectLockConfigurationRuleDefaultRetention[]
    Default object lock retention settings for new objects placed in the bucket. See Default Retention below.
    default_retentions Sequence[GetBucketObjectLockConfigurationRuleDefaultRetention]
    Default object lock retention settings for new objects placed in the bucket. See Default Retention below.
    defaultRetentions List<Property Map>
    Default object lock retention settings for new objects placed in the bucket. See Default Retention below.

    GetBucketObjectLockConfigurationRuleDefaultRetention

    Days int
    Default retention period in days.
    Mode string
    Default object lock retention mode. Valid values are GOVERNANCE and COMPLIANCE.
    Years int
    Default retention period in years.
    Days int
    Default retention period in days.
    Mode string
    Default object lock retention mode. Valid values are GOVERNANCE and COMPLIANCE.
    Years int
    Default retention period in years.
    days Integer
    Default retention period in days.
    mode String
    Default object lock retention mode. Valid values are GOVERNANCE and COMPLIANCE.
    years Integer
    Default retention period in years.
    days number
    Default retention period in days.
    mode string
    Default object lock retention mode. Valid values are GOVERNANCE and COMPLIANCE.
    years number
    Default retention period in years.
    days int
    Default retention period in days.
    mode str
    Default object lock retention mode. Valid values are GOVERNANCE and COMPLIANCE.
    years int
    Default retention period in years.
    days Number
    Default retention period in days.
    mode String
    Default object lock retention mode. Valid values are GOVERNANCE and COMPLIANCE.
    years Number
    Default retention period in years.

    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.20.0 published on Thursday, Feb 19, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate