Modifier and Type | Method and Description |
---|---|
Bucket.Builder |
accessControl(BucketAccessControl accessControl)
(experimental) Specifies a canned ACL that grants predefined permissions to the bucket.
|
Bucket.Builder |
autoDeleteObjects(Boolean autoDeleteObjects)
(experimental) Whether all objects should be automatically deleted when the bucket is removed from the stack or when the stack is deleted.
|
Bucket.Builder |
blockPublicAccess(BlockPublicAccess blockPublicAccess)
(experimental) The block public access configuration of this bucket.
|
Bucket.Builder |
bucketKeyEnabled(Boolean bucketKeyEnabled)
(experimental) Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket.
|
Bucket.Builder |
bucketName(String bucketName)
(experimental) Physical name of this bucket.
|
Bucket |
build() |
Bucket.Builder |
cors(List<? extends CorsRule> cors)
(experimental) The CORS configuration of this bucket.
|
static Bucket.Builder |
create(software.constructs.Construct scope,
String id) |
Bucket.Builder |
encryption(BucketEncryption encryption)
(experimental) The kind of server-side encryption to apply to this bucket.
|
Bucket.Builder |
encryptionKey(IKey encryptionKey)
(experimental) External KMS key to use for bucket encryption.
|
Bucket.Builder |
enforceSsl(Boolean enforceSsl)
(experimental) Enforces SSL for requests.
|
Bucket.Builder |
inventories(List<? extends Inventory> inventories)
(experimental) The inventory configuration of the bucket.
|
Bucket.Builder |
lifecycleRules(List<? extends LifecycleRule> lifecycleRules)
(experimental) Rules that define how Amazon S3 manages objects during their lifetime.
|
Bucket.Builder |
metrics(List<? extends BucketMetrics> metrics)
(experimental) The metrics configuration of this bucket.
|
Bucket.Builder |
objectOwnership(ObjectOwnership objectOwnership)
(experimental) The objectOwnership of the bucket.
|
Bucket.Builder |
publicReadAccess(Boolean publicReadAccess)
(experimental) Grants public read access to all objects in the bucket.
|
Bucket.Builder |
removalPolicy(RemovalPolicy removalPolicy)
(experimental) Policy to apply when the bucket is removed from this stack.
|
Bucket.Builder |
serverAccessLogsBucket(IBucket serverAccessLogsBucket)
(experimental) Destination bucket for the server access logs.
|
Bucket.Builder |
serverAccessLogsPrefix(String serverAccessLogsPrefix)
(experimental) Optional log file prefix to use for the bucket's access logs.
|
Bucket.Builder |
versioned(Boolean versioned)
(experimental) Whether this bucket should have versioning turned on or not.
|
Bucket.Builder |
websiteErrorDocument(String websiteErrorDocument)
(experimental) The name of the error document (e.g.
|
Bucket.Builder |
websiteIndexDocument(String websiteIndexDocument)
(experimental) The name of the index document (e.g.
|
Bucket.Builder |
websiteRedirect(RedirectTarget websiteRedirect)
(experimental) Specifies the redirect behavior of all requests to a website endpoint of a bucket.
|
Bucket.Builder |
websiteRoutingRules(List<? extends RoutingRule> websiteRoutingRules)
(experimental) Rules that define when a redirect is applied and the redirect behavior.
|
@Stability(value=Experimental) public static Bucket.Builder create(software.constructs.Construct scope, String id)
scope
- This parameter is required.id
- This parameter is required.Bucket.Builder
.@Stability(value=Experimental) public Bucket.Builder accessControl(BucketAccessControl accessControl)
Default: BucketAccessControl.PRIVATE
accessControl
- Specifies a canned ACL that grants predefined permissions to the bucket. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder autoDeleteObjects(Boolean autoDeleteObjects)
Requires the removalPolicy
to be set to RemovalPolicy.DESTROY
.
Default: false
autoDeleteObjects
- Whether all objects should be automatically deleted when the bucket is removed from the stack or when the stack is deleted. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder blockPublicAccess(BlockPublicAccess blockPublicAccess)
Default: - CloudFormation defaults will apply. New buckets and objects don't allow public access, but users can modify bucket policies or object permissions to allow public access
blockPublicAccess
- The block public access configuration of this bucket. This parameter is required.this
https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html
@Stability(value=Experimental) public Bucket.Builder bucketKeyEnabled(Boolean bucketKeyEnabled)
Only relevant, when Encryption is set to {@link BucketEncryption.KMS}
Default: - false
bucketKeyEnabled
- Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new objects in the bucket. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder bucketName(String bucketName)
Default: - Assigned by CloudFormation (recommended).
bucketName
- Physical name of this bucket. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder cors(List<? extends CorsRule> cors)
Default: - No CORS configuration.
cors
- The CORS configuration of this bucket. This parameter is required.this
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors.html
@Stability(value=Experimental) public Bucket.Builder encryption(BucketEncryption encryption)
If you choose KMS, you can specify a KMS key via encryptionKey
. If
encryption key is not specified, a key will automatically be created.
Default: - `Kms` if `encryptionKey` is specified, or `Unencrypted` otherwise.
encryption
- The kind of server-side encryption to apply to this bucket. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder encryptionKey(IKey encryptionKey)
The 'encryption' property must be either not specified or set to "Kms". An error will be emitted if encryption is set to "Unencrypted" or "Managed".
Default: - If encryption is set to "Kms" and this property is undefined, a new KMS key will be created and associated with this bucket.
encryptionKey
- External KMS key to use for bucket encryption. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder enforceSsl(Boolean enforceSsl)
S3.5 of the AWS Foundational Security Best Practices Regarding S3.
Default: false
enforceSsl
- Enforces SSL for requests. This parameter is required.this
https://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-ssl-requests-only.html
@Stability(value=Experimental) public Bucket.Builder inventories(List<? extends Inventory> inventories)
Default: - No inventory configuration
inventories
- The inventory configuration of the bucket. This parameter is required.this
https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html
@Stability(value=Experimental) public Bucket.Builder lifecycleRules(List<? extends LifecycleRule> lifecycleRules)
Default: - No lifecycle rules.
lifecycleRules
- Rules that define how Amazon S3 manages objects during their lifetime. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder metrics(List<? extends BucketMetrics> metrics)
Default: - No metrics configuration.
metrics
- The metrics configuration of this bucket. This parameter is required.this
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-metricsconfiguration.html
@Stability(value=Experimental) public Bucket.Builder objectOwnership(ObjectOwnership objectOwnership)
Default: - No ObjectOwnership configuration, uploading account will own the object.
objectOwnership
- The objectOwnership of the bucket. This parameter is required.this
https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html
@Stability(value=Experimental) public Bucket.Builder publicReadAccess(Boolean publicReadAccess)
Similar to calling bucket.grantPublicAccess()
Default: false
publicReadAccess
- Grants public read access to all objects in the bucket. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder removalPolicy(RemovalPolicy removalPolicy)
Default: - The bucket will be orphaned.
removalPolicy
- Policy to apply when the bucket is removed from this stack. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder serverAccessLogsBucket(IBucket serverAccessLogsBucket)
Default: - If "serverAccessLogsPrefix" undefined - access logs disabled, otherwise - log to current bucket.
serverAccessLogsBucket
- Destination bucket for the server access logs. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder serverAccessLogsPrefix(String serverAccessLogsPrefix)
If defined without "serverAccessLogsBucket", enables access logs to current bucket with this prefix.
Default: - No log file prefix
serverAccessLogsPrefix
- Optional log file prefix to use for the bucket's access logs. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder versioned(Boolean versioned)
Default: false
versioned
- Whether this bucket should have versioning turned on or not. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder websiteErrorDocument(String websiteErrorDocument)
Default: - No error document.
websiteErrorDocument
- The name of the error document (e.g. "404.html") for the website. `websiteIndexDocument` must also be set if this is set. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder websiteIndexDocument(String websiteIndexDocument)
Default: - No index document.
websiteIndexDocument
- The name of the index document (e.g. "index.html") for the website. Enables static website hosting for this bucket. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder websiteRedirect(RedirectTarget websiteRedirect)
If you specify this property, you can't specify "websiteIndexDocument", "websiteErrorDocument" nor , "websiteRoutingRules".
Default: - No redirection.
websiteRedirect
- Specifies the redirect behavior of all requests to a website endpoint of a bucket. This parameter is required.this
@Stability(value=Experimental) public Bucket.Builder websiteRoutingRules(List<? extends RoutingRule> websiteRoutingRules)
Default: - No redirection rules.
websiteRoutingRules
- Rules that define when a redirect is applied and the redirect behavior. This parameter is required.this
Copyright © 2021. All rights reserved.