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.
Idawscc.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.
tagsarray
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourcedirectory_bucketsINSERTLocationName, DataRedundancy, region
delete_resourcedirectory_bucketsDELETEIdentifier, region
update_resourcedirectory_bucketsUPDATEIdentifier, PatchDocument, region
list_resourcesdirectory_buckets_list_onlySELECTregion
get_resourcedirectory_bucketsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual directory_bucket.

SELECT
region,
bucket_name,
location_name,
availability_zone_name,
data_redundancy,
arn,
bucket_encryption,
lifecycle_configuration,
tags
FROM awscc.s3express.directory_buckets
WHERE
region = '{{ region }}' AND
Identifier = '{{ bucket_name }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.s3express.directory_buckets (
LocationName,
DataRedundancy,
region
)
SELECT
'{{ location_name }}',
'{{ data_redundancy }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

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

/*+ update */
UPDATE awscc.s3express.directory_buckets
SET PatchDocument = string('{{ {
"BucketEncryption": bucket_encryption,
"LifecycleConfiguration": lifecycle_configuration,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ bucket_name }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.s3express.directory_buckets
WHERE
Identifier = '{{ bucket_name }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

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