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
Modifier and TypeInterfaceDescriptionstatic final class
A builder forBucketAttributes
static final class
An implementation forBucketAttributes
-
Method Summary
Modifier and TypeMethodDescriptionstatic BucketAttributes.Builder
builder()
default String
The account this existing bucket belongs to.default String
The ARN of the bucket.default String
The domain name of the bucket.default String
The IPv6 DNS name of the specified bucket.default String
The name of the bucket.default String
The regional domain name of the specified bucket.default Boolean
Deprecated.default String
The website URL of the bucket (if static web hosting is enabled).default IKey
KMS encryption key associated with this bucket.default Boolean
If this bucket has been configured for static website hosting.default IRole
The role to be used by the notifications handler.default String
The 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 thebucketWebsiteUrl
will be used. Alternatively provide the fullbucketWebsiteUrl
manually.(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.Builder
ofBucketAttributes
-
region
.