Class BucketAttributes.Builder
java.lang.Object
software.amazon.awscdk.services.s3.BucketAttributes.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<BucketAttributes>
- Enclosing interface:
BucketAttributes
@Stability(Stable)
public static final class BucketAttributes.Builder
extends Object
implements software.amazon.jsii.Builder<BucketAttributes>
A builder for
BucketAttributes-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the value ofBucketAttributes.getAccount()Sets the value ofBucketAttributes.getBucketArn()bucketDomainName(String bucketDomainName) Sets the value ofBucketAttributes.getBucketDomainName()bucketDualStackDomainName(String bucketDualStackDomainName) Sets the value ofBucketAttributes.getBucketDualStackDomainName()bucketName(String bucketName) Sets the value ofBucketAttributes.getBucketName()bucketRegionalDomainName(String bucketRegionalDomainName) Sets the value ofBucketAttributes.getBucketRegionalDomainName()bucketWebsiteNewUrlFormat(Boolean bucketWebsiteNewUrlFormat) Deprecated.The correct website url format can be inferred automatically from the bucket `region`.bucketWebsiteUrl(String bucketWebsiteUrl) Sets the value ofBucketAttributes.getBucketWebsiteUrl()build()Builds the configured instance.encryptionKey(IKey encryptionKey) Sets the value ofBucketAttributes.getEncryptionKey()Sets the value ofBucketAttributes.getIsWebsite()notificationsHandlerRole(IRole notificationsHandlerRole) Sets the value ofBucketAttributes.getNotificationsHandlerRole()Sets the value ofBucketAttributes.getRegion()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
account
Sets the value ofBucketAttributes.getAccount()- Parameters:
account- The account this existing bucket belongs to.- Returns:
this
-
bucketArn
Sets the value ofBucketAttributes.getBucketArn()- Parameters:
bucketArn- The ARN of the bucket. At least one of bucketArn or bucketName must be defined in order to initialize a bucket ref.- Returns:
this
-
bucketDomainName
Sets the value ofBucketAttributes.getBucketDomainName()- Parameters:
bucketDomainName- The domain name of the bucket.- Returns:
this
-
bucketDualStackDomainName
@Stability(Stable) public BucketAttributes.Builder bucketDualStackDomainName(String bucketDualStackDomainName) Sets the value ofBucketAttributes.getBucketDualStackDomainName()- Parameters:
bucketDualStackDomainName- The IPv6 DNS name of the specified bucket.- Returns:
this
-
bucketName
Sets the value ofBucketAttributes.getBucketName()- Parameters:
bucketName- 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.- Returns:
this
-
bucketRegionalDomainName
@Stability(Stable) public BucketAttributes.Builder bucketRegionalDomainName(String bucketRegionalDomainName) Sets the value ofBucketAttributes.getBucketRegionalDomainName()- Parameters:
bucketRegionalDomainName- The regional domain name of the specified bucket.- Returns:
this
-
bucketWebsiteNewUrlFormat
@Stability(Deprecated) @Deprecated public BucketAttributes.Builder bucketWebsiteNewUrlFormat(Boolean bucketWebsiteNewUrlFormat) Deprecated.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.Sets the value ofBucketAttributes.getBucketWebsiteNewUrlFormat()- Parameters:
bucketWebsiteNewUrlFormat- Force the format of the website URL of the bucket. This should be true for regions launched since 2014.- Returns:
this
-
bucketWebsiteUrl
Sets the value ofBucketAttributes.getBucketWebsiteUrl()- Parameters:
bucketWebsiteUrl- The website URL of the bucket (if static web hosting is enabled).- Returns:
this
-
encryptionKey
Sets the value ofBucketAttributes.getEncryptionKey()- Parameters:
encryptionKey- KMS encryption key associated with this bucket.- Returns:
this
-
isWebsite
Sets the value ofBucketAttributes.getIsWebsite()- Parameters:
isWebsite- If this bucket has been configured for static website hosting.- Returns:
this
-
notificationsHandlerRole
@Stability(Stable) public BucketAttributes.Builder notificationsHandlerRole(IRole notificationsHandlerRole) Sets the value ofBucketAttributes.getNotificationsHandlerRole()- Parameters:
notificationsHandlerRole- The role to be used by the notifications handler.- Returns:
this
-
region
Sets the value ofBucketAttributes.getRegion()- Parameters:
region- 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.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<BucketAttributes>- Returns:
- a new instance of
BucketAttributes - Throws:
NullPointerException- if any required attribute was not provided
-