bucket_ownership_controls
Creates, updates, deletes, gets or lists a bucket_ownership_controls resource.
Overview
| Name | bucket_ownership_controls |
| Type | Resource |
| Id | aws.s3.bucket_ownership_controls |
Fields
The following fields are returned by SELECT queries:
- get_bucket_ownership_controls
| Name | Datatype | Description |
|---|---|---|
rules | string | The container element for an ownership control rule. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_bucket_ownership_controls | select | bucket, region | x-amz-expected-bucket-owner | This operation is not supported for directory buckets. Retrieves OwnershipControls for an Amazon S3 bucket. To use this operation, you must have the s3:GetBucketOwnershipControls permission. For more information about Amazon S3 permissions, see Specifying permissions in a policy. A bucket doesn't have OwnershipControls settings in the following cases: The bucket was created before the BucketOwnerEnforced ownership setting was introduced and you've never explicitly applied this value You've manually deleted the bucket ownership control value using the DeleteBucketOwnershipControls API operation. By default, Amazon S3 sets OwnershipControls for all newly created buckets. For information about Amazon S3 Object Ownership, see Using Object Ownership. The following operations are related to GetBucketOwnershipControls: PutBucketOwnershipControls DeleteBucketOwnershipControls 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. |
put_bucket_ownership_controls | replace | bucket, region, OwnershipControls | Content-MD5, x-amz-expected-bucket-owner, x-amz-sdk-checksum-algorithm | This operation is not supported for directory buckets. Creates or modifies OwnershipControls for an Amazon S3 bucket. To use this operation, you must have the s3:PutBucketOwnershipControls permission. For more information about Amazon S3 permissions, see Specifying permissions in a policy. For information about Amazon S3 Object Ownership, see Using object ownership. The following operations are related to PutBucketOwnershipControls: GetBucketOwnershipControls DeleteBucketOwnershipControls 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. |
delete_bucket_ownership_controls | delete | bucket, region | x-amz-expected-bucket-owner | This operation is not supported for directory buckets. Removes OwnershipControls for an Amazon S3 bucket. To use this operation, you must have the s3:PutBucketOwnershipControls permission. For more information about Amazon S3 permissions, see Specifying Permissions in a Policy. For information about Amazon S3 Object Ownership, see Using Object Ownership. The following operations are related to DeleteBucketOwnershipControls: GetBucketOwnershipControls PutBucketOwnershipControls 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.
| Name | Datatype | Description |
|---|---|---|
bucket | string | The Amazon S3 bucket whose OwnershipControls you want to delete. |
region | string | AWS region (default: us-east-1) |
Content-MD5 | string | The MD5 hash of the OwnershipControls request body. For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically. |
x-amz-expected-bucket-owner | string | The 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). |
x-amz-sdk-checksum-algorithm | string | Indicates the algorithm used to create the checksum for the object when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum-algorithm header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter. |
SELECT examples
- get_bucket_ownership_controls
This operation is not supported for directory buckets. Retrieves OwnershipControls for an Amazon S3 bucket. To use this operation, you must have the s3:GetBucketOwnershipControls permission. For more information about Amazon S3 permissions, see Specifying permissions in a policy. A bucket doesn't have OwnershipControls settings in the following cases: The bucket was created before the BucketOwnerEnforced ownership setting was introduced and you've never explicitly applied this value You've manually deleted the bucket ownership control value using the DeleteBucketOwnershipControls API operation. By default, Amazon S3 sets OwnershipControls for all newly created buckets. For information about Amazon S3 Object Ownership, see Using Object Ownership. The following operations are related to GetBucketOwnershipControls: PutBucketOwnershipControls DeleteBucketOwnershipControls 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
rules
FROM aws.s3.bucket_ownership_controls
WHERE bucket = '{{ bucket }}' -- required
AND region = '{{ region }}' -- required
AND `x-amz-expected-bucket-owner` = '{{ x-amz-expected-bucket-owner }}'
;
REPLACE examples
- put_bucket_ownership_controls
This operation is not supported for directory buckets. Creates or modifies OwnershipControls for an Amazon S3 bucket. To use this operation, you must have the s3:PutBucketOwnershipControls permission. For more information about Amazon S3 permissions, see Specifying permissions in a policy. For information about Amazon S3 Object Ownership, see Using object ownership. The following operations are related to PutBucketOwnershipControls: GetBucketOwnershipControls DeleteBucketOwnershipControls 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.
REPLACE aws.s3.bucket_ownership_controls
SET
OwnershipControls = '{{ OwnershipControls }}'
WHERE
bucket = '{{ bucket }}' --required
AND region = '{{ region }}' --required
AND OwnershipControls = '{{ OwnershipControls }}' --required
AND `Content-MD5` = '{{ Content-MD5}}'
AND `x-amz-expected-bucket-owner` = '{{ x-amz-expected-bucket-owner}}'
AND `x-amz-sdk-checksum-algorithm` = '{{ x-amz-sdk-checksum-algorithm}}';
DELETE examples
- delete_bucket_ownership_controls
This operation is not supported for directory buckets. Removes OwnershipControls for an Amazon S3 bucket. To use this operation, you must have the s3:PutBucketOwnershipControls permission. For more information about Amazon S3 permissions, see Specifying Permissions in a Policy. For information about Amazon S3 Object Ownership, see Using Object Ownership. The following operations are related to DeleteBucketOwnershipControls: GetBucketOwnershipControls PutBucketOwnershipControls 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.
DELETE FROM aws.s3.bucket_ownership_controls
WHERE bucket = '{{ bucket }}' --required
AND region = '{{ region }}' --required
AND `x-amz-expected-bucket-owner` = '{{ x-amz-expected-bucket-owner }}'
;