Skip to content

S3Client.create_bucket

rboto-s3==0.4.0 · Service index · Types

Model summary (excerpt): This action creates an Amazon S3 bucket. To create an Amazon S3 on Outposts bucket, see CreateBucket . Creates a new S3 bucket. To create a bucket, you must set up Amazon S3 and have a valid Amazon Web Services Access Key ID to authenticate requests. Anonymous requests are never allowed to create buckets. By creating the bucket, you become the bucket owner. There are two types of buckets:...

Install and imports

python -m pip install "rboto[s3]==0.4.0"
from rboto import S3Client
from rboto_s3.types import (
    BucketCannedACL,
    BucketNamespace,
    CreateBucketConfiguration,
    CreateBucketOutput,
    ObjectOwnership,
)

Signature

async def create_bucket(
    *,
    bucket: str,
    acl: BucketCannedACL | None = None,
    create_bucket_configuration: CreateBucketConfiguration | None = None,
    grant_full_control: str | None = None,
    grant_read: str | None = None,
    grant_read_acp: str | None = None,
    grant_write: str | None = None,
    grant_write_acp: str | None = None,
    object_lock_enabled_for_bucket: bool | None = None,
    object_ownership: ObjectOwnership | None = None,
    bucket_namespace: BucketNamespace | None = None,
) -> CreateBucketOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
bucket Yes The name of the bucket to create. General purpose buckets - For information about bucket naming restrictions, see Bucket naming rules in the Amazon S3 User Guide . Directory buckets - When you use this operation with a directory bucket, you must use path-style requests in the format https://s3express-control. region-code .amazonaws.com/ bucket-name . Virtual-hosted-style requests aren't...
acl No The canned ACL to apply to the bucket. This functionality is not supported for directory buckets.
create_bucket_configuration No The configuration information for the bucket.
grant_full_control No Allows grantee the read, write, read ACP, and write ACP permissions on the bucket. This functionality is not supported for directory buckets.
grant_read No Allows grantee to list the objects in the bucket. This functionality is not supported for directory buckets.
grant_read_acp No Allows grantee to read the bucket ACL. This functionality is not supported for directory buckets.
grant_write No Allows grantee to create new objects in the bucket. For the bucket and object owners of existing objects, also allows deletions and overwrites of those objects. This functionality is not supported for directory buckets.
grant_write_acp No Allows grantee to write the ACL for the applicable bucket. This functionality is not supported for directory buckets.
object_lock_enabled_for_bucket No Specifies whether you want S3 Object Lock to be enabled for the new bucket. This functionality is not supported for directory buckets.
object_ownership No
bucket_namespace No Specifies the namespace where you want to create your general purpose bucket. When you create a general purpose bucket, you can choose to create a bucket in the shared global namespace or you can choose to create a bucket in your account regional namespace. Your account regional namespace is a subdivision of the global namespace that only your account can create buckets in. For more...

Output

CreateBucketOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
location str | None Always present —
bucket_arn str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

BucketCannedACL, BucketNamespace, CreateBucketConfiguration, CreateBucketOutput, ObjectOwnership

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_s3.exceptions:

BucketAlreadyExistsError, BucketAlreadyOwnedByYouError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model