@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
162 lines (161 loc) • 7.47 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Provides an S3 bucket Object Lock configuration resource. For more information about Object Locking, go to [Using S3 Object Lock](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html) 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
*
* ```typescript
* 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
*
* 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:
*
* ```sh
* $ 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:
*
* ```sh
* $ pulumi import aws:s3/bucketObjectLockConfiguration:BucketObjectLockConfiguration example bucket-name,123456789012
* ```
*/
export declare class BucketObjectLockConfiguration extends pulumi.CustomResource {
/**
* Get an existing BucketObjectLockConfiguration resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: BucketObjectLockConfigurationState, opts?: pulumi.CustomResourceOptions): BucketObjectLockConfiguration;
/**
* Returns true if the given object is an instance of BucketObjectLockConfiguration. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is BucketObjectLockConfiguration;
/**
* Name of the bucket.
*/
readonly bucket: pulumi.Output<string>;
/**
* Account ID of the expected bucket owner.
*/
readonly expectedBucketOwner: pulumi.Output<string | undefined>;
/**
* Indicates whether this bucket has an Object Lock configuration enabled. Defaults to `Enabled`. Valid values: `Enabled`.
*/
readonly objectLockEnabled: pulumi.Output<string | undefined>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
readonly region: pulumi.Output<string>;
/**
* Configuration block for specifying the Object Lock rule for the specified object. See below.
*/
readonly rule: pulumi.Output<outputs.s3.BucketObjectLockConfigurationRule | undefined>;
/**
* 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.
*/
readonly token: pulumi.Output<string | undefined>;
/**
* Create a BucketObjectLockConfiguration resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: BucketObjectLockConfigurationArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering BucketObjectLockConfiguration resources.
*/
export interface BucketObjectLockConfigurationState {
/**
* Name of the bucket.
*/
bucket?: pulumi.Input<string>;
/**
* Account ID of the expected bucket owner.
*/
expectedBucketOwner?: pulumi.Input<string>;
/**
* Indicates whether this bucket has an Object Lock configuration enabled. Defaults to `Enabled`. Valid values: `Enabled`.
*/
objectLockEnabled?: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* Configuration block for specifying the Object Lock rule for the specified object. See below.
*/
rule?: pulumi.Input<inputs.s3.BucketObjectLockConfigurationRule>;
/**
* 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.
*/
token?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a BucketObjectLockConfiguration resource.
*/
export interface BucketObjectLockConfigurationArgs {
/**
* Name of the bucket.
*/
bucket: pulumi.Input<string>;
/**
* Account ID of the expected bucket owner.
*/
expectedBucketOwner?: pulumi.Input<string>;
/**
* Indicates whether this bucket has an Object Lock configuration enabled. Defaults to `Enabled`. Valid values: `Enabled`.
*/
objectLockEnabled?: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* Configuration block for specifying the Object Lock rule for the specified object. See below.
*/
rule?: pulumi.Input<inputs.s3.BucketObjectLockConfigurationRule>;
/**
* 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.
*/
token?: pulumi.Input<string>;
}