Skip to main content

directory_buckets

Creates, updates, deletes or gets a directory_bucket resource or lists directory_buckets in a region

Overview

Namedirectory_buckets
TypeResource
DescriptionResource Type definition for AWS::S3Express::DirectoryBucket.
Idaws.s3express.directory_buckets

Fields

NameDatatypeDescription
bucket_namestringSpecifies 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 or Local Zone. The bucket name must also follow the format 'bucket_base_name--zone_id--x-s3'. The zone_id can be the ID of an Availability Zone or a Local Zone. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the bucket name.
location_namestringSpecifies the Zone ID of the Availability Zone or Local Zone where the directory bucket will be created. An example Availability Zone ID value is 'use1-az5'.
availability_zone_namestringReturns the code for the Availability Zone or Local Zone where the directory bucket was created. An example for the code of an Availability Zone is 'us-east-1f'.
data_redundancystringSpecifies the number of Availability Zone or Local Zone that's used for redundancy for the bucket.
arnstringReturns the Amazon Resource Name (ARN) of the specified bucket.
bucket_encryptionobjectSpecifies default encryption for a bucket using server-side encryption with Amazon S3 managed keys (SSE-S3) or AWS KMS keys (SSE-KMS).
lifecycle_configurationobjectLifecycle rules that define how Amazon S3 Express manages objects during their lifetime.
regionstringAWS region.

For more information, see AWS::S3Express::DirectoryBucket.

Methods

NameAccessible byRequired Params
create_resourceINSERTLocationName, DataRedundancy, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all directory_buckets in a region.

SELECT
region,
bucket_name,
location_name,
availability_zone_name,
data_redundancy,
arn,
bucket_encryption,
lifecycle_configuration
FROM aws.s3express.directory_buckets
WHERE region = 'us-east-1';

Gets all properties from an individual directory_bucket.

SELECT
region,
bucket_name,
location_name,
availability_zone_name,
data_redundancy,
arn,
bucket_encryption,
lifecycle_configuration
FROM aws.s3express.directory_buckets
WHERE region = 'us-east-1' AND data__Identifier = '<BucketName>';

INSERT example

Use the following StackQL query and manifest file to create a new directory_bucket resource, using stack-deploy.

/*+ create */
INSERT INTO aws.s3express.directory_buckets (
LocationName,
DataRedundancy,
region
)
SELECT
'{{ LocationName }}',
'{{ DataRedundancy }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.s3express.directory_buckets
WHERE data__Identifier = '<BucketName>'
AND region = 'us-east-1';

Permissions

To operate on the directory_buckets resource, the following permissions are required:

Create

kms:GenerateDataKey,
kms:Decrypt,
s3express:CreateBucket,
s3express:ListAllMyDirectoryBuckets,
s3express:PutEncryptionConfiguration,
s3express:PutLifecycleConfiguration

Read

s3express:ListAllMyDirectoryBuckets,
ec2:DescribeAvailabilityZones,
s3express:GetEncryptionConfiguration,
s3express:GetLifecycleConfiguration

Update

kms:GenerateDataKey,
kms:Decrypt,
s3express:PutEncryptionConfiguration,
s3express:PutLifecycleConfiguration

Delete

s3express:DeleteBucket,
s3express:ListAllMyDirectoryBuckets

List

s3express:ListAllMyDirectoryBuckets