AWS::S3Express::DirectoryBucket - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


The AWS::S3Express::DirectoryBucket resource creates an Amazon S3 directory bucket in the same Amazon Region where you create the Amazon CloudFormation stack.

To control how Amazon 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.


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

  • Delete

    • s3express:DeleteBucket

    • s3express:ListAllMyDirectoryBuckets

  • List

    • s3express:ListAllMyDirectoryBuckets

The following operations are related to AWS::S3Express::DirectoryBucket:


To declare this entity in your Amazon CloudFormation template, use the following syntax:


{ "Type" : "AWS::S3Express::DirectoryBucket", "Properties" : { "BucketName" : String, "DataRedundancy" : String, "LocationName" : String } }


Type: AWS::S3Express::DirectoryBucket Properties: BucketName: String DataRedundancy: String LocationName: String



A 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 Availability Zone. The bucket name must also follow the format bucket_base_name--az_id--x-s3 (for example, DOC-EXAMPLE-BUCKET--usw2-az1--x-s3). If you don't specify a name, Amazon CloudFormation generates a unique ID and uses that ID for the bucket name. For information about bucket naming restrictions, see Directory bucket naming rules 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.

Required: No

Type: String

Pattern: ^[a-z0-9][a-z0-9//.//-]*[a-z0-9]$

Maximum: 63

Update requires: Replacement


The number of Availability Zone that's used for redundancy for the bucket.

Required: Yes

Type: String

Allowed values: SingleAvailabilityZone

Update requires: Replacement


The name of the location where the bucket will be created.

For directory buckets, the name of the location is the AZ ID of the Availability Zone where the bucket will be created. An example AZ ID value is usw2-az1.

Required: Yes

Type: String

Update requires: Replacement

Return values


When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the bucket name.

Example: DOC-EXAMPLE-BUCKET--usw2-az1--x-s3

For more information about using the Ref function, see Ref.


The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.


Returns the Amazon Resource Name (ARN) of the specified bucket.

Example: arn:aws:s3express:us-west-2:account_id:bucket/DOC-EXAMPLE-BUCKET--usw2-az1--x-s3