@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
105 lines • 4.29 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.BucketLifecycleConfiguration = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides a resource to manage an S3 Control Bucket Lifecycle Configuration.
*
* > **NOTE:** Each S3 Control Bucket can only have one Lifecycle Configuration. Using multiple of this resource against the same S3 Control Bucket will result in perpetual differences each provider run.
*
* > This functionality is for managing [S3 on Outposts](https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html). To manage S3 Bucket Lifecycle Configurations in an AWS Partition, see the `aws.s3.Bucket` resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.s3control.BucketLifecycleConfiguration("example", {
* bucket: exampleAwsS3controlBucket.arn,
* rules: [
* {
* expiration: {
* days: 365,
* },
* filter: {
* prefix: "logs/",
* },
* id: "logs",
* },
* {
* expiration: {
* days: 7,
* },
* filter: {
* prefix: "temp/",
* },
* id: "temp",
* },
* ],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import S3 Control Bucket Lifecycle Configurations using the Amazon Resource Name (ARN). For example:
*
* ```sh
* $ pulumi import aws:s3control/bucketLifecycleConfiguration:BucketLifecycleConfiguration example arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-12345678/bucket/example
* ```
*/
class BucketLifecycleConfiguration extends pulumi.CustomResource {
/**
* Get an existing BucketLifecycleConfiguration 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, id, state, opts) {
return new BucketLifecycleConfiguration(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of BucketLifecycleConfiguration. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === BucketLifecycleConfiguration.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["bucket"] = state?.bucket;
resourceInputs["region"] = state?.region;
resourceInputs["rules"] = state?.rules;
}
else {
const args = argsOrState;
if (args?.bucket === undefined && !opts.urn) {
throw new Error("Missing required property 'bucket'");
}
if (args?.rules === undefined && !opts.urn) {
throw new Error("Missing required property 'rules'");
}
resourceInputs["bucket"] = args?.bucket;
resourceInputs["region"] = args?.region;
resourceInputs["rules"] = args?.rules;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(BucketLifecycleConfiguration.__pulumiType, name, resourceInputs, opts);
}
}
exports.BucketLifecycleConfiguration = BucketLifecycleConfiguration;
/** @internal */
BucketLifecycleConfiguration.__pulumiType = 'aws:s3control/bucketLifecycleConfiguration:BucketLifecycleConfiguration';
//# sourceMappingURL=bucketLifecycleConfiguration.js.map