Skip to content
v2.274.0

BucketAttributes Struct ​

A reference to a bucket outside this stack.

Example ​

ts
// Deploy an imported S3 bucket from a different account
declare const stage: codepipeline.IStage;
declare const input: codepipeline.Artifact;
stage.addAction(new codepipeline_actions.S3DeployAction({
  bucket: s3.Bucket.fromBucketAttributes(this, 'Bucket', {
    account: '123456789012',
    // ...
  }),
  input: input,
  actionName: 's3-deploy-action',
  // ...
}));

Properties ​

accountstringaccountstraccountStringAccountstringAccount*string#
The account this existing bucket belongs to.

Default: it's assumed the bucket belongs to the same account as the scope it's being imported into

bucketArnstringbucket_arnstrbucketArnStringBucketArnstringBucketArn*string#
The ARN of the bucket.

At least one of bucketArn or bucketName must be defined in order to initialize a bucket ref.

bucketDomainNamestringbucket_domain_namestrbucketDomainNameStringBucketDomainNamestringBucketDomainName*string#
The domain name of the bucket.

Default: Inferred from bucket name

bucketDualStackDomainNamestringbucket_dual_stack_domain_namestrbucketDualStackDomainNameStringBucketDualStackDomainNamestringBucketDualStackDomainName*string#
The IPv6 DNS name of the specified bucket.
bucketNamestringbucket_namestrbucketNameStringBucketNamestringBucketName*string#
The name of the bucket.

If the underlying value of ARN is a string, the name will be parsed from the ARN. Otherwise, the name is optional, but some features that require the bucket name such as auto-creating a bucket policy, won't work.

bucketRegionalDomainNamestringbucket_regional_domain_namestrbucketRegionalDomainNameStringBucketRegionalDomainNamestringBucketRegionalDomainName*string#
The regional domain name of the specified bucket.
bucketWebsiteNewUrlFormatbooleanbucket_website_new_url_formatboolbucketWebsiteNewUrlFormatBooleanBucketWebsiteNewUrlFormatboolBucketWebsiteNewUrlFormat*booldeprecated#
The correct website url format can be inferred automatically from the bucket `region`. Always provide the bucket region if the `bucketWebsiteUrl` will be used. Alternatively provide the full `bucketWebsiteUrl` manually.

Default: inferred from available region information, false otherwise

This should be true for regions launched since 2014.

bucketWebsiteUrlstringbucket_website_urlstrbucketWebsiteUrlStringBucketWebsiteUrlstringBucketWebsiteUrl*string#
The website URL of the bucket (if static web hosting is enabled).

Default: Inferred from bucket name and region

encryptionKeyIKeyencryption_keyIKeyencryptionKeyIKeyEncryptionKeyIKeyEncryptionKeyIKey#
KMS encryption key associated with this bucket.

Default: no encryption key

isWebsitebooleanis_websiteboolisWebsiteBooleanIsWebsiteboolIsWebsite*bool= false#
If this bucket has been configured for static website hosting.
notificationsHandlerRoleIRolenotifications_handler_roleIRolenotificationsHandlerRoleIRoleNotificationsHandlerRoleIRoleNotificationsHandlerRoleIRole#
The role to be used by the notifications handler.

Default: a new role will be created.

regionstringregionstrregionStringRegionstringRegion*string#
The region this existing bucket is in.

Default: it's assumed the bucket is in the same region as the scope it's being imported into

Features that require the region (e.g. bucketWebsiteUrl) won't fully work if the region cannot be correctly inferred.