buckets
Creates, updates, deletes, gets or lists a buckets resource.
Overview
| Name | buckets |
| Type | Resource |
| Id | aws.lightsail.buckets |
Fields
The following fields are returned by SELECT queries:
- get_buckets
| Name | Datatype | Description |
|---|---|---|
account_level_bpa_sync | object | An 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. |
buckets | array | An array of objects that describe buckets. |
next_page_token | string | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_buckets | select | region | 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. | |
create_bucket | insert | region, bucketName, bundleId | 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. | |
set_resource_access_for_bucket | update | region, resourceName, bucketName, access | 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_bucket | update | region, bucketName | Updates 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_bucket | delete | region | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- get_buckets
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
- create_bucket
- Manifest
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
;
# Description fields are for documentation purposes
- name: buckets
props:
- name: region
value: "{{ region }}"
description: Required parameter for the buckets resource.
- name: bucketName
value: "{{ bucketName }}"
description: |
The name for the bucket. For more information about bucket names, see Bucket naming rules in Amazon Lightsail in the Amazon Lightsail Developer Guide.
- name: bundleId
value: "{{ bundleId }}"
description: |
The ID of the bundle to use for the bucket. A bucket bundle specifies the monthly cost, storage space, and data transfer quota for a bucket. Use the GetBucketBundles action to get a list of bundle IDs that you can specify. Use the UpdateBucketBundle action to change the bundle after the bucket is created.
- name: tags
description: |
The tag keys and optional values to add to the bucket during creation. Use the TagResource action to tag the bucket after it's created.
value:
- key: "{{ key }}"
value: "{{ value }}"
- name: enableObjectVersioning
value: {{ enableObjectVersioning }}
description: |
A Boolean value that indicates whether to enable versioning of objects in the bucket. For more information about versioning, see Enabling and suspending object versioning in a bucket in Amazon Lightsail in the Amazon Lightsail Developer Guide.
UPDATE examples
- set_resource_access_for_bucket
- update_bucket
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;
Updates 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.
UPDATE aws.lightsail.buckets
SET
bucketName = '{{ bucketName }}',
accessRules = '{{ accessRules }}',
versioning = '{{ versioning }}',
readonlyAccessAccounts = '{{ readonlyAccessAccounts }}',
accessLogConfig = '{{ accessLogConfig }}',
cors = '{{ cors }}'
WHERE
region = '{{ region }}' --required
AND bucketName = '{{ bucketName }}' --required
RETURNING
bucket,
operations;
DELETE examples
- delete_bucket
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
;