Skip to main content

buckets

Creates, updates, deletes or gets a bucket resource or lists buckets in a region

Overview

Namebuckets
TypeResource
DescriptionResource Type definition for AWS::Lightsail::Bucket
Idaws.lightsail.buckets

Fields

NameDatatypeDescription
bucket_namestringThe name for the bucket.
bundle_idstringThe ID of the bundle to use for the bucket.
bucket_arnstring
object_versioningbooleanSpecifies whether to enable or disable versioning of objects in the bucket.
access_rulesobjectAn object that sets the public accessibility of objects in the specified bucket.
resources_receiving_accessarrayThe names of the Lightsail resources for which to set bucket access.
read_only_access_accountsarrayAn array of strings to specify the AWS account IDs that can access the bucket.
tagsarrayAn array of key-value pairs to apply to this resource.
urlstringThe URL of the bucket.
able_to_update_bundlebooleanIndicates 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.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTBucketName, BundleId, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.lightsail.buckets (
BucketName,
BundleId,
region
)
SELECT
'{{ BucketName }}',
'{{ BundleId }}',
'{{ region }}';

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