Class CfnBucket
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::S3::Bucket.
The AWS::S3::Bucket resource creates an Amazon S3 bucket in the same AWS Region where you create the AWS CloudFormation stack.
To control how AWS CloudFormation handles the bucket when the stack is deleted, you can set a deletion policy for your bucket. You can choose to retain the bucket or to delete the bucket. For more information, see DeletionPolicy Attribute .
You can only delete empty buckets. Deletion fails for buckets that have contents.
Example:
CfnInclude cfnTemplate;
CfnBucket cfnBucket = (CfnBucket)cfnTemplate.getResource("Bucket");
Role role = Role.Builder.create(this, "Role")
.assumedBy(new AnyPrincipal())
.build();
role.addToPolicy(PolicyStatement.Builder.create()
.actions(List.of("s3:*"))
.resources(List.of(cfnBucket.getAttrArn()))
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceSpecifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload.static interfaceConfigures the transfer acceleration state for an Amazon S3 bucket.static interfaceSpecify this only in a cross-account scenario (where source and destination bucket owners are not the same), and you want to change replica ownership to the AWS account that owns the destination bucket.static interfaceSpecifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.static interfaceSpecifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3) or AWS KMS-managed keys (SSE-KMS) bucket.static final classA fluent builder forCfnBucket.static interfaceDescribes the cross-origin access configuration for objects in an Amazon S3 bucket.static interfaceSpecifies a cross-origin access rule for an Amazon S3 bucket.static interfaceSpecifies how data related to the storage class analysis for an Amazon S3 bucket should be exported.static interfaceThe container element for specifying the default Object Lock retention settings for new objects placed in the specified bucket.static interfaceSpecifies whether Amazon S3 replicates delete markers.static interfaceSpecifies information about where to publish analysis or configuration results for an Amazon S3 bucket.static interfaceSpecifies encryption-related information for an Amazon S3 bucket that is a destination for replicated objects.static interfaceAmazon S3 can send events to Amazon EventBridge whenever certain events happen in your bucket, see Using EventBridge in the Amazon S3 User Guide .static interfaceSpecifies the Amazon S3 object key name to filter on and whether to filter on the suffix or prefix of the key name.static interfaceSpecifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket.static interfaceSpecifies the inventory configuration for an Amazon S3 bucket.static interfaceDescribes the AWS Lambda functions to invoke and the events for which to invoke them.static interfaceSpecifies the lifecycle configuration for objects in an Amazon S3 bucket.static interfaceDescribes where logs are stored and the prefix that Amazon S3 assigns to all log object keys for a bucket.static interfaceSpecifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.static interfaceA container specifying replication metrics-related settings enabling replication metrics and events.static interfaceSpecifies when noncurrent object versions expire.static interfaceContainer for the transition rule that describes when noncurrent objects transition to theSTANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,GLACIER_IR,GLACIER, orDEEP_ARCHIVEstorage class.static interfaceDescribes the notification configuration for an Amazon S3 bucket.static interfaceSpecifies object key name filtering rules.static interfacePlaces an Object Lock configuration on the specified bucket.static interfaceSpecifies the Object Lock rule for the specified object.static interfaceSpecifies the container element for Object Ownership rules.static interfaceSpecifies an Object Ownership rule.static interfaceThe PublicAccessBlock configuration that you want to apply to this Amazon S3 bucket.static interfaceSpecifies the configuration for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified events.static interfaceSpecifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.static interfaceSpecifies how requests are redirected.static interfaceA filter that you can specify for selection for modifications on replicas.static interfaceA container for replication rules.static interfaceA container for information about the replication destination and its configurations including enabling the S3 Replication Time Control (S3 RTC).static interfaceA container for specifying rule filters.static interfaceA filter that identifies the subset of objects to which the replication rule applies.static interfaceSpecifies which Amazon S3 objects to replicate and where to store the replicas.static interfaceA container specifying S3 Replication Time Control (S3 RTC) related information, including whether S3 RTC is enabled and the time when all objects and operations on objects must be replicated.static interfaceA container specifying the time value for S3 Replication Time Control (S3 RTC) and replication metricsEventThreshold.static interfaceA container for describing a condition that must be met for the specified redirect to apply.static interfaceSpecifies the redirect behavior and when a redirect is applied.static interfaceSpecifies lifecycle rules for an Amazon S3 bucket.static interfaceA container for object key name prefix and suffix filtering rules.static interfaceDescribes the default server-side encryption to apply to new objects in the bucket.static interfaceSpecifies the default server-side encryption configuration.static interfaceA container that describes additional filters for identifying the source objects that you want to replicate.static interfaceA container for filter information for the selection of S3 objects encrypted with AWS KMS.static interfaceSpecifies data related to access patterns to be collected and made available to analyze the tradeoffs between different storage classes for an Amazon S3 bucket.static interfaceSpecifies tags to use to identify a subset of objects for an Amazon S3 bucket.static interfaceThe S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost-effective storage access tier, without additional operational overhead.static interfaceA container for specifying the configuration for publication of messages to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects specified events.static interfaceSpecifies when an object transitions to a specified storage class.static interfaceDescribes the versioning state of an Amazon S3 bucket.static interfaceSpecifies website configuration parameters for an Amazon S3 bucket.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a newAWS::S3::Bucket.CfnBucket(Construct scope, String id, CfnBucketProps props) Create a newAWS::S3::Bucket.protectedCfnBucket(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnBucket(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionConfigures the transfer acceleration state for an Amazon S3 bucket.A canned access control list (ACL) that grants predefined permissions to the bucket.Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.Returns the Amazon Resource Name (ARN) of the specified bucket.Returns the IPv4 DNS name of the specified bucket.Returns the IPv6 DNS name of the specified bucket.Returns the regional domain name of the specified bucket.Returns the Amazon S3 website endpoint for the specified bucket.Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3) or AWS KMS-managed keys (SSE-KMS) bucket.A name for the bucket.Describes the cross-origin access configuration for objects in an Amazon S3 bucket.Defines how Amazon S3 handles Intelligent-Tiering storage.Specifies the inventory configuration for an Amazon S3 bucket.Specifies the lifecycle configuration for objects in an Amazon S3 bucket.Settings that define where logs are stored.Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.Configuration that defines how Amazon S3 handles bucket notifications.Places an Object Lock configuration on the specified bucket.Indicates whether this bucket has an Object Lock configuration enabled.Configuration that defines how Amazon S3 handles Object Ownership rules.Configuration that defines how Amazon S3 handles public access.Configuration for replicating objects in an S3 bucket.getTags()An arbitrary set of tags (key-value pairs) for this S3 bucket.Enables multiple versions of all objects in this bucket.Information used to configure the bucket as a static website.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidConfigures the transfer acceleration state for an Amazon S3 bucket.voidConfigures the transfer acceleration state for an Amazon S3 bucket.voidsetAccessControl(String value) A canned access control list (ACL) that grants predefined permissions to the bucket.voidsetAnalyticsConfigurations(List<Object> value) Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.voidSpecifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.voidsetBucketEncryption(IResolvable value) Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3) or AWS KMS-managed keys (SSE-KMS) bucket.voidSpecifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3) or AWS KMS-managed keys (SSE-KMS) bucket.voidsetBucketName(String value) A name for the bucket.voidsetCorsConfiguration(IResolvable value) Describes the cross-origin access configuration for objects in an Amazon S3 bucket.voidDescribes the cross-origin access configuration for objects in an Amazon S3 bucket.voidDefines how Amazon S3 handles Intelligent-Tiering storage.voidDefines how Amazon S3 handles Intelligent-Tiering storage.voidsetInventoryConfigurations(List<Object> value) Specifies the inventory configuration for an Amazon S3 bucket.voidSpecifies the inventory configuration for an Amazon S3 bucket.voidSpecifies the lifecycle configuration for objects in an Amazon S3 bucket.voidSpecifies the lifecycle configuration for objects in an Amazon S3 bucket.voidSettings that define where logs are stored.voidSettings that define where logs are stored.voidsetMetricsConfigurations(List<Object> value) Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.voidSpecifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.voidConfiguration that defines how Amazon S3 handles bucket notifications.voidConfiguration that defines how Amazon S3 handles bucket notifications.voidPlaces an Object Lock configuration on the specified bucket.voidPlaces an Object Lock configuration on the specified bucket.voidsetObjectLockEnabled(Boolean value) Indicates whether this bucket has an Object Lock configuration enabled.voidsetObjectLockEnabled(IResolvable value) Indicates whether this bucket has an Object Lock configuration enabled.voidsetOwnershipControls(IResolvable value) Configuration that defines how Amazon S3 handles Object Ownership rules.voidConfiguration that defines how Amazon S3 handles Object Ownership rules.voidConfiguration that defines how Amazon S3 handles public access.voidConfiguration that defines how Amazon S3 handles public access.voidConfiguration for replicating objects in an S3 bucket.voidConfiguration for replicating objects in an S3 bucket.voidEnables multiple versions of all objects in this bucket.voidEnables multiple versions of all objects in this bucket.voidInformation used to configure the bucket as a static website.voidInformation used to configure the bucket as a static website.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnBucket
protected CfnBucket(software.amazon.jsii.JsiiObjectRef objRef) -
CfnBucket
protected CfnBucket(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnBucket
@Stability(Stable) public CfnBucket(@NotNull Construct scope, @NotNull String id, @Nullable CfnBucketProps props) Create a newAWS::S3::Bucket.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
CfnBucket
Create a newAWS::S3::Bucket.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
Returns the Amazon Resource Name (ARN) of the specified bucket.Example:
arn:aws:s3:::DOC-EXAMPLE-BUCKET -
getAttrDomainName
Returns the IPv4 DNS name of the specified bucket.Example:
DOC-EXAMPLE-BUCKET.s3.amazonaws.com -
getAttrDualStackDomainName
Returns the IPv6 DNS name of the specified bucket.Example:
DOC-EXAMPLE-BUCKET---s3---dualstack---us-east-2.amazonaws.com.rproxy.govskope.caFor more information about dual-stack endpoints, see Using Amazon S3 Dual-Stack Endpoints .
-
getAttrRegionalDomainName
Returns the regional domain name of the specified bucket.Example:
DOC-EXAMPLE-BUCKET.s3.us-east-2.amazonaws.com -
getAttrWebsiteUrl
Returns the Amazon S3 website endpoint for the specified bucket.Example (IPv4):
http://DOC-EXAMPLE-BUCKET---s3-website---us-east-2.amazonaws.com.rproxy.govskope.caExample (IPv6):
http://DOC-EXAMPLE-BUCKET.s3.dualstack.us-east-2.amazonaws.com -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
An arbitrary set of tags (key-value pairs) for this S3 bucket. -
getAccelerateConfiguration
Configures the transfer acceleration state for an Amazon S3 bucket.For more information, see Amazon S3 Transfer Acceleration in the Amazon S3 User Guide .
-
setAccelerateConfiguration
Configures the transfer acceleration state for an Amazon S3 bucket.For more information, see Amazon S3 Transfer Acceleration in the Amazon S3 User Guide .
-
setAccelerateConfiguration
@Stability(Stable) public void setAccelerateConfiguration(@Nullable CfnBucket.AccelerateConfigurationProperty value) Configures the transfer acceleration state for an Amazon S3 bucket.For more information, see Amazon S3 Transfer Acceleration in the Amazon S3 User Guide .
-
getAccessControl
A canned access control list (ACL) that grants predefined permissions to the bucket.For more information about canned ACLs, see Canned ACL in the Amazon S3 User Guide .
Be aware that the syntax for this property differs from the information provided in the Amazon S3 User Guide . The AccessControl property is case-sensitive and must be one of the following values: Private, PublicRead, PublicReadWrite, AuthenticatedRead, LogDeliveryWrite, BucketOwnerRead, BucketOwnerFullControl, or AwsExecRead.
-
setAccessControl
A canned access control list (ACL) that grants predefined permissions to the bucket.For more information about canned ACLs, see Canned ACL in the Amazon S3 User Guide .
Be aware that the syntax for this property differs from the information provided in the Amazon S3 User Guide . The AccessControl property is case-sensitive and must be one of the following values: Private, PublicRead, PublicReadWrite, AuthenticatedRead, LogDeliveryWrite, BucketOwnerRead, BucketOwnerFullControl, or AwsExecRead.
-
getAnalyticsConfigurations
Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket. -
setAnalyticsConfigurations
Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket. -
setAnalyticsConfigurations
Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket. -
getBucketEncryption
Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3) or AWS KMS-managed keys (SSE-KMS) bucket.For information about the Amazon S3 default encryption feature, see Amazon S3 Default Encryption for S3 Buckets in the Amazon S3 User Guide .
-
setBucketEncryption
Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3) or AWS KMS-managed keys (SSE-KMS) bucket.For information about the Amazon S3 default encryption feature, see Amazon S3 Default Encryption for S3 Buckets in the Amazon S3 User Guide .
-
setBucketEncryption
@Stability(Stable) public void setBucketEncryption(@Nullable CfnBucket.BucketEncryptionProperty value) Specifies default encryption for a bucket using server-side encryption with Amazon S3-managed keys (SSE-S3) or AWS KMS-managed keys (SSE-KMS) bucket.For information about the Amazon S3 default encryption feature, see Amazon S3 Default Encryption for S3 Buckets in the Amazon S3 User Guide .
-
getBucketName
A name for the bucket.If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for the bucket name. The bucket name must contain only lowercase letters, numbers, periods (.), and dashes (-) and must follow Amazon S3 bucket restrictions and limitations . For more information, see Rules for naming Amazon S3 buckets in the Amazon S3 User Guide .
If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you need to replace the resource, specify a new name.
-
setBucketName
A name for the bucket.If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for the bucket name. The bucket name must contain only lowercase letters, numbers, periods (.), and dashes (-) and must follow Amazon S3 bucket restrictions and limitations . For more information, see Rules for naming Amazon S3 buckets in the Amazon S3 User Guide .
If you specify a name, you can't perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you need to replace the resource, specify a new name.
-
getCorsConfiguration
Describes the cross-origin access configuration for objects in an Amazon S3 bucket.For more information, see Enabling Cross-Origin Resource Sharing in the Amazon S3 User Guide .
-
setCorsConfiguration
Describes the cross-origin access configuration for objects in an Amazon S3 bucket.For more information, see Enabling Cross-Origin Resource Sharing in the Amazon S3 User Guide .
-
setCorsConfiguration
@Stability(Stable) public void setCorsConfiguration(@Nullable CfnBucket.CorsConfigurationProperty value) Describes the cross-origin access configuration for objects in an Amazon S3 bucket.For more information, see Enabling Cross-Origin Resource Sharing in the Amazon S3 User Guide .
-
getIntelligentTieringConfigurations
Defines how Amazon S3 handles Intelligent-Tiering storage. -
setIntelligentTieringConfigurations
Defines how Amazon S3 handles Intelligent-Tiering storage. -
setIntelligentTieringConfigurations
Defines how Amazon S3 handles Intelligent-Tiering storage. -
getInventoryConfigurations
Specifies the inventory configuration for an Amazon S3 bucket.For more information, see GET Bucket inventory in the Amazon S3 API Reference .
-
setInventoryConfigurations
Specifies the inventory configuration for an Amazon S3 bucket.For more information, see GET Bucket inventory in the Amazon S3 API Reference .
-
setInventoryConfigurations
Specifies the inventory configuration for an Amazon S3 bucket.For more information, see GET Bucket inventory in the Amazon S3 API Reference .
-
getLifecycleConfiguration
Specifies the lifecycle configuration for objects in an Amazon S3 bucket.For more information, see Object Lifecycle Management in the Amazon S3 User Guide .
-
setLifecycleConfiguration
Specifies the lifecycle configuration for objects in an Amazon S3 bucket.For more information, see Object Lifecycle Management in the Amazon S3 User Guide .
-
setLifecycleConfiguration
@Stability(Stable) public void setLifecycleConfiguration(@Nullable CfnBucket.LifecycleConfigurationProperty value) Specifies the lifecycle configuration for objects in an Amazon S3 bucket.For more information, see Object Lifecycle Management in the Amazon S3 User Guide .
-
getLoggingConfiguration
Settings that define where logs are stored. -
setLoggingConfiguration
Settings that define where logs are stored. -
setLoggingConfiguration
@Stability(Stable) public void setLoggingConfiguration(@Nullable CfnBucket.LoggingConfigurationProperty value) Settings that define where logs are stored. -
getMetricsConfigurations
Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.If you're updating an existing metrics configuration, note that this is a full replacement of the existing metrics configuration. If you don't include the elements you want to keep, they are erased. For more information, see PutBucketMetricsConfiguration .
-
setMetricsConfigurations
Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.If you're updating an existing metrics configuration, note that this is a full replacement of the existing metrics configuration. If you don't include the elements you want to keep, they are erased. For more information, see PutBucketMetricsConfiguration .
-
setMetricsConfigurations
Specifies a metrics configuration for the CloudWatch request metrics (specified by the metrics configuration ID) from an Amazon S3 bucket.If you're updating an existing metrics configuration, note that this is a full replacement of the existing metrics configuration. If you don't include the elements you want to keep, they are erased. For more information, see PutBucketMetricsConfiguration .
-
getNotificationConfiguration
Configuration that defines how Amazon S3 handles bucket notifications. -
setNotificationConfiguration
Configuration that defines how Amazon S3 handles bucket notifications. -
setNotificationConfiguration
@Stability(Stable) public void setNotificationConfiguration(@Nullable CfnBucket.NotificationConfigurationProperty value) Configuration that defines how Amazon S3 handles bucket notifications. -
getObjectLockConfiguration
Places an Object Lock configuration on the specified bucket.The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. For more information, see Locking Objects .
- The
DefaultRetentionsettings require both a mode and a period. - The
DefaultRetentionperiod can be eitherDaysorYearsbut you must select one. You cannot specifyDaysandYearsat the same time. - You can only enable Object Lock for new buckets. If you want to turn on Object Lock for an existing bucket, contact AWS Support.
- The
-
setObjectLockConfiguration
Places an Object Lock configuration on the specified bucket.The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. For more information, see Locking Objects .
- The
DefaultRetentionsettings require both a mode and a period. - The
DefaultRetentionperiod can be eitherDaysorYearsbut you must select one. You cannot specifyDaysandYearsat the same time. - You can only enable Object Lock for new buckets. If you want to turn on Object Lock for an existing bucket, contact AWS Support.
- The
-
setObjectLockConfiguration
@Stability(Stable) public void setObjectLockConfiguration(@Nullable CfnBucket.ObjectLockConfigurationProperty value) Places an Object Lock configuration on the specified bucket.The rule specified in the Object Lock configuration will be applied by default to every new object placed in the specified bucket. For more information, see Locking Objects .
- The
DefaultRetentionsettings require both a mode and a period. - The
DefaultRetentionperiod can be eitherDaysorYearsbut you must select one. You cannot specifyDaysandYearsat the same time. - You can only enable Object Lock for new buckets. If you want to turn on Object Lock for an existing bucket, contact AWS Support.
- The
-
getObjectLockEnabled
Indicates whether this bucket has an Object Lock configuration enabled.Enable
ObjectLockEnabledwhen you applyObjectLockConfigurationto a bucket. -
setObjectLockEnabled
Indicates whether this bucket has an Object Lock configuration enabled.Enable
ObjectLockEnabledwhen you applyObjectLockConfigurationto a bucket. -
setObjectLockEnabled
Indicates whether this bucket has an Object Lock configuration enabled.Enable
ObjectLockEnabledwhen you applyObjectLockConfigurationto a bucket. -
getOwnershipControls
Configuration that defines how Amazon S3 handles Object Ownership rules. -
setOwnershipControls
Configuration that defines how Amazon S3 handles Object Ownership rules. -
setOwnershipControls
@Stability(Stable) public void setOwnershipControls(@Nullable CfnBucket.OwnershipControlsProperty value) Configuration that defines how Amazon S3 handles Object Ownership rules. -
getPublicAccessBlockConfiguration
Configuration that defines how Amazon S3 handles public access. -
setPublicAccessBlockConfiguration
Configuration that defines how Amazon S3 handles public access. -
setPublicAccessBlockConfiguration
@Stability(Stable) public void setPublicAccessBlockConfiguration(@Nullable CfnBucket.PublicAccessBlockConfigurationProperty value) Configuration that defines how Amazon S3 handles public access. -
getReplicationConfiguration
Configuration for replicating objects in an S3 bucket.To enable replication, you must also enable versioning by using the
VersioningConfigurationproperty.Amazon S3 can store replicated objects in a single destination bucket or multiple destination buckets. The destination bucket or buckets must already exist.
-
setReplicationConfiguration
Configuration for replicating objects in an S3 bucket.To enable replication, you must also enable versioning by using the
VersioningConfigurationproperty.Amazon S3 can store replicated objects in a single destination bucket or multiple destination buckets. The destination bucket or buckets must already exist.
-
setReplicationConfiguration
@Stability(Stable) public void setReplicationConfiguration(@Nullable CfnBucket.ReplicationConfigurationProperty value) Configuration for replicating objects in an S3 bucket.To enable replication, you must also enable versioning by using the
VersioningConfigurationproperty.Amazon S3 can store replicated objects in a single destination bucket or multiple destination buckets. The destination bucket or buckets must already exist.
-
getVersioningConfiguration
Enables multiple versions of all objects in this bucket.You might enable versioning to prevent objects from being deleted or overwritten by mistake or to archive objects so that you can retrieve previous versions of them.
-
setVersioningConfiguration
Enables multiple versions of all objects in this bucket.You might enable versioning to prevent objects from being deleted or overwritten by mistake or to archive objects so that you can retrieve previous versions of them.
-
setVersioningConfiguration
@Stability(Stable) public void setVersioningConfiguration(@Nullable CfnBucket.VersioningConfigurationProperty value) Enables multiple versions of all objects in this bucket.You might enable versioning to prevent objects from being deleted or overwritten by mistake or to archive objects so that you can retrieve previous versions of them.
-
getWebsiteConfiguration
Information used to configure the bucket as a static website.For more information, see Hosting Websites on Amazon S3 .
-
setWebsiteConfiguration
Information used to configure the bucket as a static website.For more information, see Hosting Websites on Amazon S3 .
-
setWebsiteConfiguration
@Stability(Stable) public void setWebsiteConfiguration(@Nullable CfnBucket.WebsiteConfigurationProperty value) Information used to configure the bucket as a static website.For more information, see Hosting Websites on Amazon S3 .
-