BucketAttributes Struct
A reference to a bucket outside this stack.
| Source | aws-s3/lib/bucket.ts |
|---|---|
| Type last changed |
Example
// 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',
// ...
}));
# Deploy an imported S3 bucket from a different account
# stage: codepipeline.IStage
# input: codepipeline.Artifact
stage.add_action(codepipeline_actions.S3DeployAction(
bucket=s3.Bucket.from_bucket_attributes(self, "Bucket",
account="123456789012"
),
input=input,
action_name="s3-deploy-action"
))
// Deploy an imported S3 bucket from a different account
IStage stage;
Artifact input;
stage.addAction(S3DeployAction.Builder.create()
.bucket(Bucket.fromBucketAttributes(this, "Bucket", BucketAttributes.builder()
.account("123456789012")
.build()))
.input(input)
.actionName("s3-deploy-action")
.build());
// Install: dotnet add package Amazon.CDK.Lib
// Deploy an imported S3 bucket from a different account
IStage stage;
Artifact input;
stage.AddAction(new S3DeployAction(new S3DeployActionProps {
Bucket = Bucket.FromBucketAttributes(this, "Bucket", new BucketAttributes {
Account = "123456789012"
}),
Input = input,
ActionName = "s3-deploy-action"
}));
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// Deploy an imported S3 bucket from a different account
var stage IStage
var input Artifact
stage.AddAction(codepipeline_actions.NewS3DeployAction(&S3DeployActionProps{
Bucket: s3.Bucket_FromBucketAttributes(this, jsii.String("Bucket"), &BucketAttributes{
Account: jsii.String("123456789012"),
}),
Input: input,
ActionName: jsii.String("s3-deploy-action"),
}))
Properties
accountoptionalstringaccountoptionalstraccountoptionalStringAccountoptionalstringAccountoptional*string #Default: it's assumed the bucket belongs to the same account as the scope it's being imported into
bucketArnoptionalstringbucket_arnoptionalstrbucketArnoptionalStringBucketArnoptionalstringBucketArnoptional*string #At least one of bucketArn or bucketName must be defined in order to initialize a bucket ref.
bucketDomainNameoptionalstringbucket_domain_nameoptionalstrbucketDomainNameoptionalStringBucketDomainNameoptionalstringBucketDomainNameoptional*string #Default: Inferred from bucket name
bucketDualStackDomainNameoptionalstringbucket_dual_stack_domain_nameoptionalstrbucketDualStackDomainNameoptionalStringBucketDualStackDomainNameoptionalstringBucketDualStackDomainNameoptional*string #bucketNameoptionalstringbucket_nameoptionalstrbucketNameoptionalStringBucketNameoptionalstringBucketNameoptional*string #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.
bucketRegionalDomainNameoptionalstringbucket_regional_domain_nameoptionalstrbucketRegionalDomainNameoptionalStringBucketRegionalDomainNameoptionalstringBucketRegionalDomainNameoptional*string #bucketWebsiteNewUrlFormatoptionalbooleanbucket_website_new_url_formatoptionalboolbucketWebsiteNewUrlFormatoptionalBooleanBucketWebsiteNewUrlFormatoptionalboolBucketWebsiteNewUrlFormatoptional*bool deprecated #Default: inferred from available region information, false otherwise
This should be true for regions launched since 2014.
bucketWebsiteUrloptionalstringbucket_website_urloptionalstrbucketWebsiteUrloptionalStringBucketWebsiteUrloptionalstringBucketWebsiteUrloptional*string #Default: Inferred from bucket name and region
encryptionoptionalBucketEncryptionencryptionoptionalBucketEncryptionencryptionoptionalBucketEncryptionEncryptionoptionalBucketEncryptionEncryptionoptionalBucketEncryption #Default: the encryption mode of the imported bucket is unknown
UNENCRYPTED is reported as S3_MANAGED, because S3 applies SSE-S3 to every bucket that has no default encryption rule.
encryptionKeyoptionalIKeyencryption_keyoptionalIKeyencryptionKeyoptionalIKeyEncryptionKeyoptionalIKeyEncryptionKeyoptionalIKey #Default: no encryption key
isWebsiteoptionalbooleanis_websiteoptionalboolisWebsiteoptionalBooleanIsWebsiteoptionalboolIsWebsiteoptional*bool = false #notificationsHandlerRoleoptionalIRolenotifications_handler_roleoptionalIRolenotificationsHandlerRoleoptionalIRoleNotificationsHandlerRoleoptionalIRoleNotificationsHandlerRoleoptionalIRole #Default: a new role will be created.
regionoptionalstringregionoptionalstrregionoptionalStringRegionoptionalstringRegionoptional*string #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.