Skip to main content

buckets

Creates, updates, deletes, gets or lists a buckets resource.

Overview

Namebuckets
TypeResource
Idaws.lightsail.buckets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
account_level_bpa_syncobjectAn object that describes the synchronization status of the Amazon S3 account-level block public access feature for your Lightsail buckets. For more information about this feature and how it affects Lightsail buckets, see Block public access for buckets in Amazon Lightsail.
bucketsarrayAn array of objects that describe buckets.
next_page_tokenstringThe token to advance to the next page of results from your request. A next page token is not returned if there are no more results to display. To get the next page of results, perform another GetBuckets request and specify the next page token using the pageToken parameter.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_bucketsselectregionReturns information about one or more Amazon Lightsail buckets. The information returned includes the synchronization status of the Amazon Simple Storage Service (Amazon S3) account-level block public access feature for your Lightsail buckets. For more information about buckets, see Buckets in Amazon Lightsail in the Amazon Lightsail Developer Guide.
create_bucketinsertregion, bucketName, bundleIdCreates an Amazon Lightsail bucket. A bucket is a cloud storage resource available in the Lightsail object storage service. Use buckets to store objects such as data and its descriptive metadata. For more information about buckets, see Buckets in Amazon Lightsail in the Amazon Lightsail Developer Guide.
set_resource_access_for_bucketupdateregion, resourceName, bucketName, accessSets the Amazon Lightsail resources that can access the specified Lightsail bucket. Lightsail buckets currently support setting access for Lightsail instances in the same Amazon Web Services Region.
update_bucketupdateregion, bucketNameUpdates an existing Amazon Lightsail bucket. Use this action to update the configuration of an existing bucket, such as versioning, public accessibility, and the Amazon Web Services accounts that can access the bucket.
delete_bucketdeleteregionDeletes a Amazon Lightsail bucket. When you delete your bucket, the bucket name is released and can be reused for a new bucket in your account or another Amazon Web Services account.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Returns information about one or more Amazon Lightsail buckets. The information returned includes the synchronization status of the Amazon Simple Storage Service (Amazon S3) account-level block public access feature for your Lightsail buckets. For more information about buckets, see Buckets in Amazon Lightsail in the Amazon Lightsail Developer Guide.

SELECT
account_level_bpa_sync,
buckets,
next_page_token
FROM aws.lightsail.buckets
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates an Amazon Lightsail bucket. A bucket is a cloud storage resource available in the Lightsail object storage service. Use buckets to store objects such as data and its descriptive metadata. For more information about buckets, see Buckets in Amazon Lightsail in the Amazon Lightsail Developer Guide.

INSERT INTO aws.lightsail.buckets (
bucketName,
bundleId,
tags,
enableObjectVersioning,
region
)
SELECT
'{{ bucketName }}' /* required */,
'{{ bundleId }}' /* required */,
'{{ tags }}',
{{ enableObjectVersioning }},
'{{ region }}'
RETURNING
bucket,
operations
;

UPDATE examples

Sets the Amazon Lightsail resources that can access the specified Lightsail bucket. Lightsail buckets currently support setting access for Lightsail instances in the same Amazon Web Services Region.

UPDATE aws.lightsail.buckets
SET
resourceName = '{{ resourceName }}',
bucketName = '{{ bucketName }}',
access = '{{ access }}'
WHERE
region = '{{ region }}' --required
AND resourceName = '{{ resourceName }}' --required
AND bucketName = '{{ bucketName }}' --required
AND access = '{{ access }}' --required
RETURNING
operations;

DELETE examples

Deletes a Amazon Lightsail bucket. When you delete your bucket, the bucket name is released and can be reused for a new bucket in your account or another Amazon Web Services account.

DELETE FROM aws.lightsail.buckets
WHERE region = '{{ region }}' --required
;