Skip to main content

bucket_policies

Creates, updates, deletes or gets a bucket_policy resource or lists bucket_policies in a region

Overview

Namebucket_policies
TypeResource
DescriptionResource Type Definition for AWS::S3Outposts::BucketPolicy
Idaws.s3outposts.bucket_policies

Fields

NameDatatypeDescription
bucketstringThe Amazon Resource Name (ARN) of the specified bucket.
policy_documentobjectA policy document containing permissions to add to the specified bucket.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTBucket, PolicyDocument, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all properties from an individual bucket_policy.

SELECT
region,
bucket,
policy_document
FROM aws.s3outposts.bucket_policies
WHERE region = 'us-east-1' AND data__Identifier = '<Bucket>';

INSERT example

Use the following StackQL query and manifest file to create a new bucket_policy resource, using stack-deploy.

/*+ create */
INSERT INTO aws.s3outposts.bucket_policies (
Bucket,
PolicyDocument,
region
)
SELECT
'{{ Bucket }}',
'{{ PolicyDocument }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.s3outposts.bucket_policies
WHERE data__Identifier = '<Bucket>'
AND region = 'us-east-1';

Permissions

To operate on the bucket_policies resource, the following permissions are required:

Create

s3-outposts:PutBucketPolicy,
s3-outposts:GetBucketPolicy

Read

s3-outposts:GetBucketPolicy

Update

s3-outposts:PutBucketPolicy,
s3-outposts:GetBucketPolicy

Delete

s3-outposts:DeleteBucketPolicy,
s3-outposts:GetBucketPolicy