published on Wednesday, Mar 11, 2026 by Pulumi
published on Wednesday, Mar 11, 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 dictionaryThe following arguments are supported:
- Bucket string
Name of the bucket.
The following arguments are optional:
- Expected
Bucket stringOwner - 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:
- Expected
Bucket stringOwner - 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:
- expected
Bucket StringOwner - 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:
- expected
Bucket stringOwner - 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_ strowner - 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:
- expected
Bucket StringOwner - 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.
- Object
Lock stringEnabled - Indicates whether this bucket has an Object Lock configuration enabled.
- Region string
- Rules
List<Get
Bucket Object Lock Configuration Rule> - Object lock rule for the specified object. See Rule below.
- Expected
Bucket stringOwner
- Bucket string
- Id string
- The provider-assigned unique ID for this managed resource.
- Object
Lock stringEnabled - Indicates whether this bucket has an Object Lock configuration enabled.
- Region string
- Rules
[]Get
Bucket Object Lock Configuration Rule - Object lock rule for the specified object. See Rule below.
- Expected
Bucket stringOwner
- bucket String
- id String
- The provider-assigned unique ID for this managed resource.
- object
Lock StringEnabled - Indicates whether this bucket has an Object Lock configuration enabled.
- region String
- rules
List<Get
Bucket Object Lock Configuration Rule> - Object lock rule for the specified object. See Rule below.
- expected
Bucket StringOwner
- bucket string
- id string
- The provider-assigned unique ID for this managed resource.
- object
Lock stringEnabled - Indicates whether this bucket has an Object Lock configuration enabled.
- region string
- rules
Get
Bucket Object Lock Configuration Rule[] - Object lock rule for the specified object. See Rule below.
- expected
Bucket stringOwner
- bucket str
- id str
- The provider-assigned unique ID for this managed resource.
- object_
lock_ strenabled - Indicates whether this bucket has an Object Lock configuration enabled.
- region str
- rules
Sequence[Get
Bucket Object Lock Configuration Rule] - Object lock rule for the specified object. See Rule below.
- expected_
bucket_ strowner
- bucket String
- id String
- The provider-assigned unique ID for this managed resource.
- object
Lock StringEnabled - 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.
- expected
Bucket StringOwner
Supporting Types
GetBucketObjectLockConfigurationRule
- Default
Retentions List<GetBucket Object Lock Configuration Rule Default Retention> - Default object lock retention settings for new objects placed in the bucket. See Default Retention below.
- Default
Retentions []GetBucket Object Lock Configuration Rule Default Retention - Default object lock retention settings for new objects placed in the bucket. See Default Retention below.
- default
Retentions List<GetBucket Object Lock Configuration Rule Default Retention> - Default object lock retention settings for new objects placed in the bucket. See Default Retention below.
- default
Retentions GetBucket Object Lock Configuration Rule Default Retention[] - Default object lock retention settings for new objects placed in the bucket. See Default Retention below.
- default_
retentions Sequence[GetBucket Object Lock Configuration Rule Default Retention] - Default object lock retention settings for new objects placed in the bucket. See Default Retention below.
- default
Retentions List<Property Map> - Default object lock retention settings for new objects placed in the bucket. See Default Retention below.
GetBucketObjectLockConfigurationRuleDefaultRetention
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.
published on Wednesday, Mar 11, 2026 by Pulumi
