buckets
Creates, updates, deletes or gets a bucket resource or lists buckets in a region
Overview
| Name | buckets |
| Type | Resource |
| Description | Resource Type Definition for AWS::S3Outposts::Bucket |
| Id | awscc.s3outposts.buckets |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the specified bucket. |
bucket_name | string | A name for the bucket. |
outpost_id | string | The id of the customer outpost on which the bucket resides. |
tags | array | An arbitrary set of tags (key-value pairs) for this S3Outposts bucket. |
lifecycle_configuration | object | Rules that define how Amazon S3Outposts manages objects during their lifetime. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the specified bucket. |
region | string | AWS region. |
For more information, see AWS::S3Outposts::Bucket.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | buckets | INSERT | BucketName, OutpostId, region |
delete_resource | buckets | DELETE | Identifier, region |
update_resource | buckets | UPDATE | Identifier, PatchDocument, region |
list_resources | buckets_list_only | SELECT | region |
get_resource | buckets | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual bucket.
SELECT
region,
arn,
bucket_name,
outpost_id,
tags,
lifecycle_configuration
FROM awscc.s3outposts.buckets
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all buckets in a region.
SELECT
region,
arn
FROM awscc.s3outposts.buckets_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new bucket resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.s3outposts.buckets (
BucketName,
OutpostId,
region
)
SELECT
'{{ bucket_name }}',
'{{ outpost_id }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.s3outposts.buckets (
BucketName,
OutpostId,
Tags,
LifecycleConfiguration,
region
)
SELECT
'{{ bucket_name }}',
'{{ outpost_id }}',
'{{ tags }}',
'{{ lifecycle_configuration }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: bucket
props:
- name: bucket_name
value: '{{ bucket_name }}'
- name: outpost_id
value: '{{ outpost_id }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: lifecycle_configuration
value:
rules:
- status: '{{ status }}'
id: '{{ id }}'
abort_incomplete_multipart_upload:
days_after_initiation: '{{ days_after_initiation }}'
expiration_date: '{{ expiration_date }}'
expiration_in_days: '{{ expiration_in_days }}'
filter:
prefix: '{{ prefix }}'
tag:
key: '{{ key }}'
value: '{{ value }}'
and_operator: null
UPDATE example
Use the following StackQL query and manifest file to update a bucket resource, using stack-deploy.
/*+ update */
UPDATE awscc.s3outposts.buckets
SET PatchDocument = string('{{ {
"Tags": tags,
"LifecycleConfiguration": lifecycle_configuration
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.s3outposts.buckets
WHERE
Identifier = '{{ arn }}' 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:
| Parameter | Description |
|---|---|
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 buckets resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
s3-outposts:CreateBucket,
s3-outposts:PutBucketTagging,
s3-outposts:PutLifecycleConfiguration
s3-outposts:GetBucket,
s3-outposts:GetBucketTagging,
s3-outposts:GetLifecycleConfiguration
s3-outposts:PutBucketTagging,
s3-outposts:DeleteBucketTagging,
s3-outposts:PutLifecycleConfiguration
s3-outposts:DeleteBucket
s3-outposts:ListRegionalBuckets