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::Lightsail::Bucket |
Id | aws.lightsail.buckets |
Fields
Name | Datatype | Description |
---|---|---|
bucket_name | string | The name for the bucket. |
bundle_id | string | The ID of the bundle to use for the bucket. |
bucket_arn | string | |
object_versioning | boolean | Specifies whether to enable or disable versioning of objects in the bucket. |
access_rules | object | An object that sets the public accessibility of objects in the specified bucket. |
resources_receiving_access | array | The names of the Lightsail resources for which to set bucket access. |
read_only_access_accounts | array | An array of strings to specify the AWS account IDs that can access the bucket. |
tags | array | An array of key-value pairs to apply to this resource. |
url | string | The URL of the bucket. |
able_to_update_bundle | boolean | Indicates whether the bundle that is currently applied to a bucket can be changed to another bundle. You can update a bucket's bundle only one time within a monthly AWS billing cycle. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | BucketName, BundleId, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all buckets
in a region.
SELECT
region,
bucket_name,
bundle_id,
bucket_arn,
object_versioning,
access_rules,
resources_receiving_access,
read_only_access_accounts,
tags,
url,
able_to_update_bundle
FROM aws.lightsail.buckets
WHERE region = 'us-east-1';
Gets all properties from an individual bucket
.
SELECT
region,
bucket_name,
bundle_id,
bucket_arn,
object_versioning,
access_rules,
resources_receiving_access,
read_only_access_accounts,
tags,
url,
able_to_update_bundle
FROM aws.lightsail.buckets
WHERE region = 'us-east-1' AND data__Identifier = '<BucketName>';
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 aws.lightsail.buckets (
BucketName,
BundleId,
region
)
SELECT
'{{ BucketName }}',
'{{ BundleId }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.lightsail.buckets (
BucketName,
BundleId,
ObjectVersioning,
AccessRules,
ResourcesReceivingAccess,
ReadOnlyAccessAccounts,
Tags,
region
)
SELECT
'{{ BucketName }}',
'{{ BundleId }}',
'{{ ObjectVersioning }}',
'{{ AccessRules }}',
'{{ ResourcesReceivingAccess }}',
'{{ ReadOnlyAccessAccounts }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: bucket
props:
- name: BucketName
value: '{{ BucketName }}'
- name: BundleId
value: '{{ BundleId }}'
- name: ObjectVersioning
value: '{{ ObjectVersioning }}'
- name: AccessRules
value:
GetObject: '{{ GetObject }}'
AllowPublicOverrides: '{{ AllowPublicOverrides }}'
- name: ResourcesReceivingAccess
value:
- '{{ ResourcesReceivingAccess[0] }}'
- name: ReadOnlyAccessAccounts
value:
- '{{ ReadOnlyAccessAccounts[0] }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.lightsail.buckets
WHERE data__Identifier = '<BucketName>'
AND region = 'us-east-1';
Permissions
To operate on the buckets
resource, the following permissions are required:
Create
lightsail:CreateBucket,
lightsail:GetBuckets,
lightsail:GetInstance,
lightsail:UpdateBucket,
lightsail:UpdateBucketBundle,
lightsail:SetResourceAccessForBucket,
lightsail:TagResource,
lightsail:UntagResource
Read
lightsail:GetBuckets
Delete
lightsail:DeleteBucket,
lightsail:GetBuckets
List
lightsail:GetBuckets
Update
lightsail:GetBuckets,
lightsail:GetInstance,
lightsail:UpdateBucket,
lightsail:UpdateBucketBundle,
lightsail:SetResourceAccessForBucket,
lightsail:TagResource,
lightsail:UntagResource