@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:41.729Z") @Stability(value=Stable) public class Bucket extends BucketBase
This bucket does not yet have all features that exposed by the underlying BucketResource.
Example:
// Example automatically generated from non-compiling source. May contain errors.
Bucket.Builder.create(scope, "Bucket")
.blockPublicAccess(BlockPublicAccess.getBLOCK_ALL())
.encryption(BucketEncryption.getS3_MANAGED())
.enforceSSL(true)
.versioned(true)
.removalPolicy(RemovalPolicy.getRETAIN())
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
Bucket.Builder
A fluent builder for
Bucket. |
software.amazon.jsii.JsiiObject.InitializationModeIBucket.Jsii$Default| Modifier | Constructor and Description |
|---|---|
|
Bucket(software.constructs.Construct scope,
String id) |
|
Bucket(software.constructs.Construct scope,
String id,
BucketProps props) |
protected |
Bucket(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Bucket(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCorsRule(CorsRule rule)
Adds a cross-origin access configuration for objects in an Amazon S3 bucket.
|
void |
addInventory(Inventory inventory)
Add an inventory configuration.
|
void |
addLifecycleRule(LifecycleRule rule)
Add a lifecycle rule to the bucket.
|
void |
addMetric(BucketMetrics metric)
Adds a metrics configuration for the CloudWatch request metrics from the bucket.
|
static IBucket |
fromBucketArn(software.constructs.Construct scope,
String id,
String bucketArn) |
static IBucket |
fromBucketAttributes(software.constructs.Construct scope,
String id,
BucketAttributes attrs)
Creates a Bucket construct that represents an external bucket.
|
static IBucket |
fromBucketName(software.constructs.Construct scope,
String id,
String bucketName) |
static IBucket |
fromCfnBucket(CfnBucket cfnBucket)
|
protected Boolean |
getAutoCreatePolicy()
Indicates if a bucket resource policy should automatically created upon the first call to `addToResourcePolicy`.
|
String |
getBucketArn()
The ARN of the bucket.
|
String |
getBucketDomainName()
The IPv4 DNS name of the specified bucket.
|
String |
getBucketDualStackDomainName()
The IPv6 DNS name of the specified bucket.
|
String |
getBucketName()
The name of the bucket.
|
String |
getBucketRegionalDomainName()
The regional domain name of the specified bucket.
|
String |
getBucketWebsiteDomainName()
The Domain name of the static website.
|
String |
getBucketWebsiteUrl()
The URL of the static website.
|
protected Boolean |
getDisallowPublicAccess()
Whether to disallow public access.
|
IKey |
getEncryptionKey()
Optional KMS encryption key associated with this bucket.
|
Boolean |
getIsWebsite()
If this bucket has been configured for static website hosting.
|
BucketPolicy |
getPolicy()
The resource policy associated with this bucket.
|
protected void |
setAutoCreatePolicy(Boolean value)
Indicates if a bucket resource policy should automatically created upon the first call to `addToResourcePolicy`.
|
protected void |
setDisallowPublicAccess(Boolean value)
Whether to disallow public access.
|
void |
setPolicy(BucketPolicy value)
The resource policy associated with this bucket.
|
static void |
validateBucketName(String physicalName)
Thrown an exception if the given bucket name is not valid.
|
addEventNotification, addObjectCreatedNotification, addObjectRemovedNotification, addToResourcePolicy, arnForObjects, enableEventBridgeNotification, getNotificationsHandlerRole, grantDelete, grantDelete, grantPublicAccess, grantPut, grantPut, grantPutAcl, grantPutAcl, grantRead, grantRead, grantReadWrite, grantReadWrite, grantWrite, grantWrite, onCloudTrailEvent, onCloudTrailEvent, onCloudTrailPutObject, onCloudTrailPutObject, onCloudTrailWriteObject, onCloudTrailWriteObject, s3UrlForObject, s3UrlForObject, setNotificationsHandlerRole, transferAccelerationUrlForObject, transferAccelerationUrlForObject, transferAccelerationUrlForObject, urlForObject, urlForObject, virtualHostedUrlForObject, virtualHostedUrlForObject, virtualHostedUrlForObjectapplyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackprotected Bucket(software.amazon.jsii.JsiiObjectRef objRef)
protected Bucket(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public Bucket(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@Nullable
BucketProps props)
scope - This parameter is required.id - This parameter is required.props - @Stability(value=Stable)
public Bucket(@NotNull
software.constructs.Construct scope,
@NotNull
String id)
scope - This parameter is required.id - This parameter is required.@Stability(value=Stable) @NotNull public static IBucket fromBucketArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String bucketArn)
scope - This parameter is required.id - This parameter is required.bucketArn - This parameter is required.@Stability(value=Stable) @NotNull public static IBucket fromBucketAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull BucketAttributes attrs)
scope - The parent creating construct (usually `this`). This parameter is required.id - The construct's name. This parameter is required.attrs - A `BucketAttributes` object. This parameter is required.@Stability(value=Stable) @NotNull public static IBucket fromBucketName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String bucketName)
scope - This parameter is required.id - This parameter is required.bucketName - This parameter is required.@Stability(value=Stable) @NotNull public static IBucket fromCfnBucket(@NotNull CfnBucket cfnBucket)
cfnBucket - This parameter is required.@Stability(value=Stable)
public static void validateBucketName(@NotNull
String physicalName)
physicalName - name of the bucket. This parameter is required.@Stability(value=Stable)
public void addCorsRule(@NotNull
CorsRule rule)
rule - The CORS configuration rule to add. This parameter is required.@Stability(value=Stable)
public void addInventory(@NotNull
Inventory inventory)
inventory - configuration to add. This parameter is required.@Stability(value=Stable)
public void addLifecycleRule(@NotNull
LifecycleRule rule)
rule - The rule to add. This parameter is required.@Stability(value=Stable)
public void addMetric(@NotNull
BucketMetrics metric)
metric - The metric configuration to add. This parameter is required.@Stability(value=Stable) @NotNull public String getBucketArn()
getBucketArn in interface IBucketgetBucketArn in class BucketBase@Stability(value=Stable) @NotNull public String getBucketDomainName()
getBucketDomainName in interface IBucketgetBucketDomainName in class BucketBase@Stability(value=Stable) @NotNull public String getBucketDualStackDomainName()
getBucketDualStackDomainName in interface IBucketgetBucketDualStackDomainName in class BucketBase@Stability(value=Stable) @NotNull public String getBucketName()
getBucketName in interface IBucketgetBucketName in class BucketBase@Stability(value=Stable) @NotNull public String getBucketRegionalDomainName()
getBucketRegionalDomainName in interface IBucketgetBucketRegionalDomainName in class BucketBase@Stability(value=Stable) @NotNull public String getBucketWebsiteDomainName()
getBucketWebsiteDomainName in interface IBucketgetBucketWebsiteDomainName in class BucketBase@Stability(value=Stable) @NotNull public String getBucketWebsiteUrl()
getBucketWebsiteUrl in interface IBucketgetBucketWebsiteUrl in class BucketBase@Stability(value=Stable) @Nullable public IKey getEncryptionKey()
getEncryptionKey in interface IBucketgetEncryptionKey in class BucketBase@Stability(value=Stable) @Nullable public Boolean getIsWebsite()
getIsWebsite in interface IBucketgetIsWebsite in class BucketBase@Stability(value=Stable) @NotNull protected Boolean getAutoCreatePolicy()
getAutoCreatePolicy in class BucketBase@Stability(value=Stable)
protected void setAutoCreatePolicy(@NotNull
Boolean value)
setAutoCreatePolicy in class BucketBase@Stability(value=Stable) @Nullable protected Boolean getDisallowPublicAccess()
getDisallowPublicAccess in class BucketBase@Stability(value=Stable)
protected void setDisallowPublicAccess(@Nullable
Boolean value)
setDisallowPublicAccess in class BucketBase@Stability(value=Stable) @Nullable public BucketPolicy getPolicy()
If autoCreatePolicy is true, a BucketPolicy will be created upon the
first call to addToResourcePolicy(s).
getPolicy in interface IBucketgetPolicy in class BucketBase@Stability(value=Stable)
public void setPolicy(@Nullable
BucketPolicy value)
If autoCreatePolicy is true, a BucketPolicy will be created upon the
first call to addToResourcePolicy(s).
setPolicy in interface IBucketsetPolicy in class BucketBaseCopyright © 2022. All rights reserved.