UNPKG

@pulumi/aws

Version:

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

138 lines 7.84 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.BucketV2 = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a S3 bucket resource. * * > This resource provides functionality for managing S3 general purpose buckets in an AWS Partition. To manage Amazon S3 Express directory buckets, use the `awsDirectoryBucket` resource. To manage [S3 on Outposts](https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html), use the `aws.s3control.Bucket` resource. * * > Object Lock can be enabled by using the `objectLockEnable` attribute or by using the `aws.s3.BucketObjectLockConfiguration` resource. Please note, that by using the resource, Object Lock can be enabled/disabled without destroying and recreating the bucket. * * ## Example Usage * * ### Private Bucket With Tags * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.s3.Bucket("example", { * bucket: "my-tf-test-bucket", * tags: { * Name: "My bucket", * Environment: "Dev", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import S3 bucket using the `bucket`. For example: * * ```sh * $ pulumi import aws:s3/bucketV2:BucketV2 bucket bucket-name * ``` * * @deprecated s3.BucketV2 has been deprecated in favor of s3.Bucket */ class BucketV2 extends pulumi.CustomResource { /** * Get an existing BucketV2 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) { pulumi.log.warn("BucketV2 is deprecated: s3.BucketV2 has been deprecated in favor of s3.Bucket"); return new BucketV2(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of BucketV2. 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'] === BucketV2.__pulumiType; } /** @deprecated s3.BucketV2 has been deprecated in favor of s3.Bucket */ constructor(name, argsOrState, opts) { pulumi.log.warn("BucketV2 is deprecated: s3.BucketV2 has been deprecated in favor of s3.Bucket"); let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["accelerationStatus"] = state ? state.accelerationStatus : undefined; resourceInputs["acl"] = state ? state.acl : undefined; resourceInputs["arn"] = state ? state.arn : undefined; resourceInputs["bucket"] = state ? state.bucket : undefined; resourceInputs["bucketDomainName"] = state ? state.bucketDomainName : undefined; resourceInputs["bucketPrefix"] = state ? state.bucketPrefix : undefined; resourceInputs["bucketRegion"] = state ? state.bucketRegion : undefined; resourceInputs["bucketRegionalDomainName"] = state ? state.bucketRegionalDomainName : undefined; resourceInputs["corsRules"] = state ? state.corsRules : undefined; resourceInputs["forceDestroy"] = state ? state.forceDestroy : undefined; resourceInputs["grants"] = state ? state.grants : undefined; resourceInputs["hostedZoneId"] = state ? state.hostedZoneId : undefined; resourceInputs["lifecycleRules"] = state ? state.lifecycleRules : undefined; resourceInputs["loggings"] = state ? state.loggings : undefined; resourceInputs["objectLockConfiguration"] = state ? state.objectLockConfiguration : undefined; resourceInputs["objectLockEnabled"] = state ? state.objectLockEnabled : undefined; resourceInputs["policy"] = state ? state.policy : undefined; resourceInputs["region"] = state ? state.region : undefined; resourceInputs["replicationConfigurations"] = state ? state.replicationConfigurations : undefined; resourceInputs["requestPayer"] = state ? state.requestPayer : undefined; resourceInputs["serverSideEncryptionConfigurations"] = state ? state.serverSideEncryptionConfigurations : undefined; resourceInputs["tags"] = state ? state.tags : undefined; resourceInputs["tagsAll"] = state ? state.tagsAll : undefined; resourceInputs["versionings"] = state ? state.versionings : undefined; resourceInputs["websiteDomain"] = state ? state.websiteDomain : undefined; resourceInputs["websiteEndpoint"] = state ? state.websiteEndpoint : undefined; resourceInputs["websites"] = state ? state.websites : undefined; } else { const args = argsOrState; resourceInputs["accelerationStatus"] = args ? args.accelerationStatus : undefined; resourceInputs["acl"] = args ? args.acl : undefined; resourceInputs["bucket"] = args ? args.bucket : undefined; resourceInputs["bucketPrefix"] = args ? args.bucketPrefix : undefined; resourceInputs["corsRules"] = args ? args.corsRules : undefined; resourceInputs["forceDestroy"] = args ? args.forceDestroy : undefined; resourceInputs["grants"] = args ? args.grants : undefined; resourceInputs["lifecycleRules"] = args ? args.lifecycleRules : undefined; resourceInputs["loggings"] = args ? args.loggings : undefined; resourceInputs["objectLockConfiguration"] = args ? args.objectLockConfiguration : undefined; resourceInputs["objectLockEnabled"] = args ? args.objectLockEnabled : undefined; resourceInputs["policy"] = args ? args.policy : undefined; resourceInputs["region"] = args ? args.region : undefined; resourceInputs["replicationConfigurations"] = args ? args.replicationConfigurations : undefined; resourceInputs["requestPayer"] = args ? args.requestPayer : undefined; resourceInputs["serverSideEncryptionConfigurations"] = args ? args.serverSideEncryptionConfigurations : undefined; resourceInputs["tags"] = args ? args.tags : undefined; resourceInputs["tagsAll"] = args ? args.tagsAll : undefined; resourceInputs["versionings"] = args ? args.versionings : undefined; resourceInputs["websites"] = args ? args.websites : undefined; resourceInputs["arn"] = undefined /*out*/; resourceInputs["bucketDomainName"] = undefined /*out*/; resourceInputs["bucketRegion"] = undefined /*out*/; resourceInputs["bucketRegionalDomainName"] = undefined /*out*/; resourceInputs["hostedZoneId"] = undefined /*out*/; resourceInputs["websiteDomain"] = undefined /*out*/; resourceInputs["websiteEndpoint"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(BucketV2.__pulumiType, name, resourceInputs, opts); } } exports.BucketV2 = BucketV2; /** @internal */ BucketV2.__pulumiType = 'aws:s3/bucketV2:BucketV2'; //# sourceMappingURL=bucketV2.js.map