Skip to content

put_bucket_ownership_controls

Operation

put_bucket_ownership_controls

put_bucket_ownership_controls(request: PutBucketOwnershipControlsInput | PutBucketOwnershipControlsInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[PutBucketOwnershipControlsInputDict]) -> PutBucketOwnershipControlsOutput
Note

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

Warning

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:

Name Type Description Default
request PutBucketOwnershipControlsInput | PutBucketOwnershipControlsInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[PutBucketOwnershipControlsInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
PutBucketOwnershipControlsOutput

An instance of PutBucketOwnershipControlsOutput.

put_bucket_ownership_controls async

put_bucket_ownership_controls(request: PutBucketOwnershipControlsInput | PutBucketOwnershipControlsInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[PutBucketOwnershipControlsInputDict]) -> PutBucketOwnershipControlsOutput
Note

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

Warning

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:

Name Type Description Default
request PutBucketOwnershipControlsInput | PutBucketOwnershipControlsInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[PutBucketOwnershipControlsInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
PutBucketOwnershipControlsOutput

An instance of PutBucketOwnershipControlsOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

PutBucketOwnershipControlsInputDict

Bases: TypedDict

Dictionary form of PutBucketOwnershipControlsInput.

Attributes

bucket instance-attribute
bucket: Required[str]

The name of the Amazon S3 bucket whose OwnershipControls you want to set.

checksum_algorithm instance-attribute
checksum_algorithm: str | None

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.

content_md5 instance-attribute
content_md5: str | None

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.

expected_bucket_owner instance-attribute
expected_bucket_owner: str | None

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).

ownership_controls instance-attribute

The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or ObjectWriter) that you want to apply to this Amazon S3 bucket.

PutBucketOwnershipControlsInput dataclass

Bases: _SerdeShape

Dataclass for PutBucketOwnershipControlsInput structure.

Attributes

bucket class-attribute instance-attribute
bucket: str | None = ...

The name of the Amazon S3 bucket whose OwnershipControls you want to set.

checksum_algorithm class-attribute instance-attribute
checksum_algorithm: str | None = ...

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.

content_md5 class-attribute instance-attribute
content_md5: str | None = ...

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.

expected_bucket_owner class-attribute instance-attribute
expected_bucket_owner: str | None = ...

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).

ownership_controls class-attribute instance-attribute
ownership_controls: OwnershipControls | None = ...

The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or ObjectWriter) that you want to apply to this Amazon S3 bucket.

Output

PutBucketOwnershipControlsOutput dataclass

Bases: _SerdeShape

Dataclass for PutBucketOwnershipControlsOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.