UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

128 lines 5.05 kB
"use strict"; // *** 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.BucketIntelligentTieringConfiguration = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides an [S3 Intelligent-Tiering](https://docs.aws.amazon.com/AmazonS3/latest/userguide/intelligent-tiering.html) configuration resource. * * > This resource cannot be used with S3 directory buckets. * * ## Example Usage * * ### Add intelligent tiering configuration for entire S3 bucket * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.s3.Bucket("example", {bucket: "example"}); * const example_entire_bucket = new aws.s3.BucketIntelligentTieringConfiguration("example-entire-bucket", { * bucket: example.id, * name: "EntireBucket", * tierings: [ * { * accessTier: "DEEP_ARCHIVE_ACCESS", * days: 180, * }, * { * accessTier: "ARCHIVE_ACCESS", * days: 125, * }, * ], * }); * ``` * * ### Add intelligent tiering configuration with S3 object filter * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.s3.Bucket("example", {bucket: "example"}); * const example_filtered = new aws.s3.BucketIntelligentTieringConfiguration("example-filtered", { * bucket: example.id, * name: "ImportantBlueDocuments", * status: "Disabled", * filter: { * prefix: "documents/", * tags: { * priority: "high", * "class": "blue", * }, * }, * tierings: [{ * accessTier: "ARCHIVE_ACCESS", * days: 125, * }], * }); * ``` * * ## Import * * Using `pulumi import`, import S3 bucket intelligent tiering configurations using `bucket:name`. For example: * * ```sh * $ pulumi import aws:s3/bucketIntelligentTieringConfiguration:BucketIntelligentTieringConfiguration my-bucket-entire-bucket my-bucket:EntireBucket * ``` */ class BucketIntelligentTieringConfiguration extends pulumi.CustomResource { /** * Get an existing BucketIntelligentTieringConfiguration 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 BucketIntelligentTieringConfiguration(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of BucketIntelligentTieringConfiguration. 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'] === BucketIntelligentTieringConfiguration.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["bucket"] = state?.bucket; resourceInputs["filter"] = state?.filter; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; resourceInputs["status"] = state?.status; resourceInputs["tierings"] = state?.tierings; } else { const args = argsOrState; if (args?.bucket === undefined && !opts.urn) { throw new Error("Missing required property 'bucket'"); } if (args?.tierings === undefined && !opts.urn) { throw new Error("Missing required property 'tierings'"); } resourceInputs["bucket"] = args?.bucket; resourceInputs["filter"] = args?.filter; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["status"] = args?.status; resourceInputs["tierings"] = args?.tierings; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(BucketIntelligentTieringConfiguration.__pulumiType, name, resourceInputs, opts); } } exports.BucketIntelligentTieringConfiguration = BucketIntelligentTieringConfiguration; /** @internal */ BucketIntelligentTieringConfiguration.__pulumiType = 'aws:s3/bucketIntelligentTieringConfiguration:BucketIntelligentTieringConfiguration'; //# sourceMappingURL=bucketIntelligentTieringConfiguration.js.map