directory_buckets
Creates, updates, deletes or gets a directory_bucket resource or lists directory_buckets in a region
Overview
| Name | directory_buckets |
| Type | Resource |
| Description | Resource Type definition for AWS::S3Express::DirectoryBucket. |
| Id | awscc.s3express.directory_buckets |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
bucket_name | string | Specifies 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_name | string | Specifies 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_name | string | Returns 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_redundancy | string | Specifies the number of Availability Zone or Local Zone that's used for redundancy for the bucket. |
arn | string | Returns the Amazon Resource Name (ARN) of the specified bucket. |
bucket_encryption | object | Specifies default encryption for a bucket using server-side encryption with Amazon S3 managed keys (SSE-S3) or AWS KMS keys (SSE-KMS). |
lifecycle_configuration | object | Lifecycle rules that define how Amazon S3 Express manages objects during their lifetime. |
tags | array | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
bucket_name | string | Specifies 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. |
region | string | AWS region. |
For more information, see AWS::S3Express::DirectoryBucket.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | directory_buckets | INSERT | LocationName, DataRedundancy, region |
delete_resource | directory_buckets | DELETE | Identifier, region |
update_resource | directory_buckets | UPDATE | Identifier, PatchDocument, region |
list_resources | directory_buckets_list_only | SELECT | region |
get_resource | directory_buckets | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 = 'us-east-1' AND
Identifier = '{{ bucket_name }}';
Lists all directory_buckets in a region.
SELECT
region,
bucket_name
FROM awscc.s3express.directory_buckets_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new directory_bucket resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.s3express.directory_buckets (
LocationName,
DataRedundancy,
region
)
SELECT
'{{ location_name }}',
'{{ data_redundancy }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.s3express.directory_buckets (
BucketName,
LocationName,
DataRedundancy,
BucketEncryption,
LifecycleConfiguration,
Tags,
region
)
SELECT
'{{ bucket_name }}',
'{{ location_name }}',
'{{ data_redundancy }}',
'{{ bucket_encryption }}',
'{{ lifecycle_configuration }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: directory_bucket
props:
- name: bucket_name
value: '{{ bucket_name }}'
- name: location_name
value: '{{ location_name }}'
- name: data_redundancy
value: '{{ data_redundancy }}'
- name: bucket_encryption
value:
server_side_encryption_configuration:
- bucket_key_enabled: '{{ bucket_key_enabled }}'
server_side_encryption_by_default:
kms_master_key_id: '{{ kms_master_key_id }}'
sse_algorithm: '{{ sse_algorithm }}'
- name: lifecycle_configuration
value:
rules:
- abort_incomplete_multipart_upload:
days_after_initiation: '{{ days_after_initiation }}'
expiration_in_days: '{{ expiration_in_days }}'
id: '{{ id }}'
prefix: '{{ prefix }}'
status: '{{ status }}'
object_size_greater_than: '{{ object_size_greater_than }}'
object_size_less_than: '{{ object_size_less_than }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
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 }}';
DELETE example
/*+ delete */
DELETE FROM awscc.s3express.directory_buckets
WHERE
Identifier = '{{ bucket_name }}' AND
region = 'us-east-1';
Permissions
To operate on the directory_buckets resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
kms:GenerateDataKey,
kms:Decrypt,
s3express:CreateBucket,
s3express:ListAllMyDirectoryBuckets,
s3express:PutEncryptionConfiguration,
s3express:PutLifecycleConfiguration,
s3express:TagResource
s3express:ListAllMyDirectoryBuckets,
ec2:DescribeAvailabilityZones,
s3express:GetEncryptionConfiguration,
s3express:GetLifecycleConfiguration,
s3express:ListTagsForResource
kms:GenerateDataKey,
kms:Decrypt,
s3express:PutEncryptionConfiguration,
s3express:PutLifecycleConfiguration,
s3express:TagResource,
s3express:UntagResource
s3express:DeleteBucket,
s3express:ListAllMyDirectoryBuckets
s3express:ListAllMyDirectoryBuckets