AWS::S3Express::DirectoryBucketThe `AWS::S3Express::DirectoryBucket` resource defines an Amazon S3 directory 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](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html) . > You can only delete empty buckets. Deletion fails for buckets that have contents. - **Permissions** - The required permissions for CloudFormation to use are based on the operations that are performed on the stack. - Create - s3express:CreateBucket - s3express:ListAllMyDirectoryBuckets - Read - s3express:ListAllMyDirectoryBuckets - ec2:DescribeAvailabilityZones - Delete - s3express:DeleteBucket - s3express:ListAllMyDirectoryBuckets - List - s3express:ListAllMyDirectoryBuckets - PutBucketEncryption - s3express:PutEncryptionConfiguration - To set a directory bucket default encryption with SSE-KMS, you must also have the kms:GenerateDataKey and kms:Decrypt permissions in IAM identity-based policies and AWS KMS key policies for the target AWS KMS key. - GetBucketEncryption - s3express:GetBucketEncryption - DeleteBucketEncryption - s3express:PutEncryptionConfiguration The following operations are related to `AWS::S3Express::DirectoryBucket` : - [CreateBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) - [ListDirectoryBuckets](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListDirectoryBuckets.html) - [DeleteBucket](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html)
import { CfnDirectoryBucket } from 'aws-cdk-lib/aws-s3express';Or use the module namespace:
import * as s3express from 'aws-cdk-lib/aws-s3express';
// s3express.CfnDirectoryBucketConfiguration passed to the constructor as CfnDirectoryBucketProps.
dataRedundancyRequiredstringThe number of Zone (Availability Zone or Local Zone) that's used for redundancy for the bucket.
locationNameRequiredstringThe name of the location where the bucket will be created. For directory buckets, the name of the location is the Zone ID of the Availability Zone (AZ) or Local Zone (LZ) where the bucket will be created. An example AZ ID value is `usw2-az1` .
bucketEncryptionOptionalIResolvable | BucketEncryptionPropertySpecifies default encryption for a bucket using server-side encryption with Amazon S3 managed keys (SSE-S3) or AWS KMS keys (SSE-KMS). For information about default encryption for directory buckets, see [Setting and monitoring default encryption for directory buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-bucket-encryption.html) in the *Amazon S3 User Guide* .
bucketNameOptionalstringA name for the bucket. The bucket name must contain only lowercase letters, numbers, and hyphens (-). A directory bucket name must be unique in the chosen Zone (Availability Zone or Local Zone). The bucket name must also follow the format `*bucket_base_name* -- *zone_id* --x-s3` (for example, `*bucket_base_name* -- *usw2-az1* --x-s3` ). If you don't specify a name, AWS CloudFormation generates a unique ID and uses that ID for the bucket name. For information about bucket naming restrictions, see [Directory bucket naming rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html) 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.
lifecycleConfigurationOptionalIResolvable | LifecycleConfigurationPropertyContainer for lifecycle rules. You can add as many as 1000 rules. For more information see, [Creating and managing a lifecycle configuration for directory buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-objects-lifecycle.html ) in the *Amazon S3 User Guide* .
metricsConfigurationsOptionalIResolvable | IResolvable | MetricsConfigurationProperty[]Specifies the metrics configurations for the Amazon S3 Express bucket.
tagsOptionalCfnTag[]An array of tags that you can apply to the S3 directory bucket. Tags are key-value pairs of metadata used to categorize and organize your buckets, track costs, and control access. For more information, see [Using tags with directory buckets](https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-tagging.html) .
This L1 construct maps directly to the following CloudFormation resource type.
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-s3expressAWS::S3Express::DirectoryBucket