Skip to main content

bucket_policy_status

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

Overview

Namebucket_policy_status
TypeResource
Idaws.s3.bucket_policy_status

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
is_publicbooleanThe policy status for this bucket. TRUE indicates that this bucket is public. FALSE indicates that the bucket is not public.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_bucket_policy_statusselectbucket, regionx-amz-expected-bucket-ownerThis operation is not supported for directory buckets. Retrieves the policy status for an Amazon S3 bucket, indicating whether the bucket is public. In order to use this operation, you must have the s3:GetBucketPolicyStatus permission. For more information about Amazon S3 permissions, see Specifying Permissions in a Policy. For more information about when Amazon S3 considers a bucket public, see The Meaning of "Public". The following operations are related to GetBucketPolicyStatus: Using Amazon S3 Block Public Access GetPublicAccessBlock PutPublicAccessBlock DeletePublicAccessBlock You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.

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
bucketstringThe name of the Amazon S3 bucket whose policy status you want to retrieve.
regionstringAWS region (default: us-east-1)
x-amz-expected-bucket-ownerstringThe account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

SELECT examples

This operation is not supported for directory buckets. Retrieves the policy status for an Amazon S3 bucket, indicating whether the bucket is public. In order to use this operation, you must have the s3:GetBucketPolicyStatus permission. For more information about Amazon S3 permissions, see Specifying Permissions in a Policy. For more information about when Amazon S3 considers a bucket public, see The Meaning of "Public". The following operations are related to GetBucketPolicyStatus: Using Amazon S3 Block Public Access GetPublicAccessBlock PutPublicAccessBlock DeletePublicAccessBlock You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.

SELECT
is_public
FROM aws.s3.bucket_policy_status
WHERE bucket = '{{ bucket }}' -- required
AND region = '{{ region }}' -- required
AND `x-amz-expected-bucket-owner` = '{{ x-amz-expected-bucket-owner }}'
;