Interface BucketAttributes
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
BucketAttributes.Jsii$Proxy
Example:
Function myLambda;
IBucket bucket = Bucket.fromBucketAttributes(this, "ImportedBucket", BucketAttributes.builder()
.bucketArn("arn:aws:s3:::amzn-s3-demo-bucket")
.build());
// now you can just call methods on the bucket
bucket.addEventNotification(EventType.OBJECT_CREATED, new LambdaDestination(myLambda), NotificationKeyFilter.builder()
.prefix("home/myusername/*")
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forBucketAttributesstatic final classAn implementation forBucketAttributes -
Method Summary
Modifier and TypeMethodDescriptionstatic BucketAttributes.Builderbuilder()default StringThe account this existing bucket belongs to.default StringThe ARN of the bucket.default StringThe domain name of the bucket.default StringThe IPv6 DNS name of the specified bucket.default StringThe name of the bucket.default StringThe regional domain name of the specified bucket.default BooleanDeprecated.default StringThe website URL of the bucket (if static web hosting is enabled).default IKeyKMS encryption key associated with this bucket.default BooleanIf this bucket has been configured for static website hosting.default IRoleThe role to be used by the notifications handler.default StringThe region this existing bucket is in.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getAccount
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
-
getBucketArn
The ARN of the bucket.At least one of bucketArn or bucketName must be defined in order to initialize a bucket ref.
-
getBucketDomainName
The domain name of the bucket.Default: - Inferred from bucket name
-
getBucketDualStackDomainName
The IPv6 DNS name of the specified bucket. -
getBucketName
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.
-
getBucketRegionalDomainName
The regional domain name of the specified bucket. -
getBucketWebsiteNewUrlFormat
Deprecated.The correct website url format can be inferred automatically from the bucketregion. Always provide the bucket region if thebucketWebsiteUrlwill be used. Alternatively provide the fullbucketWebsiteUrlmanually.(deprecated) Force the format of the website URL of the bucket.This should be true for regions launched since 2014.
Default: - inferred from available region information, `false` otherwise
-
getBucketWebsiteUrl
The website URL of the bucket (if static web hosting is enabled).Default: - Inferred from bucket name and region
-
getEncryptionKey
KMS encryption key associated with this bucket.Default: - no encryption key
-
getIsWebsite
If this bucket has been configured for static website hosting.Default: false
-
getNotificationsHandlerRole
The role to be used by the notifications handler.Default: - a new role will be created.
-
getRegion
The region this existing bucket is in.Features that require the region (e.g.
bucketWebsiteUrl) won't fully work if the region cannot be correctly inferred.Default: - it's assumed the bucket is in the same region as the scope it's being imported into
-
builder
- Returns:
- a
BucketAttributes.BuilderofBucketAttributes
-
region.