Struct bonsaidb::keystorage::s3::aws_sdk_s3::operation::create_bucket::builders::CreateBucketFluentBuilder
pub struct CreateBucketFluentBuilder { /* private fields */ }Expand description
Fluent builder constructing a request to CreateBucket.
Creates a new S3 bucket. To create a bucket, you must register with 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.
Not every string is an acceptable bucket name. For information about bucket naming restrictions, see Bucket naming rules.
If you want to create an Amazon S3 on Outposts bucket, see Create Bucket.
By default, the bucket is created in the US East (N. Virginia) Region. You can optionally specify a Region in the request body. To constrain the bucket creation to a specific Region, you can use LocationConstraint condition key. You might choose a Region to optimize latency, minimize costs, or address regulatory requirements. For example, if you reside in Europe, you will probably find it advantageous to create buckets in the Europe (Ireland) Region. For more information, see Accessing a bucket.
If you send your create bucket request to the s3.amazonaws.com endpoint, the request goes to the us-east-1 Region. Accordingly, the signature calculations in Signature Version 4 must use us-east-1 as the Region, even if the location constraint in the request specifies another Region where the bucket is to be created. If you create a bucket in a Region other than US East (N. Virginia), your application must be able to handle 307 redirect. For more information, see Virtual hosting of buckets.
- Permissions
-
In addition to
s3:CreateBucket, the following permissions are required when yourCreateBucketrequest includes specific headers:-
Access control lists (ACLs) - If your
CreateBucketrequest specifies access control list (ACL) permissions and the ACL is public-read, public-read-write, authenticated-read, or if you specify access permissions explicitly through any other ACL, boths3:CreateBucketands3:PutBucketAclpermissions are needed. If the ACL for theCreateBucketrequest is private or if the request doesn't specify any ACLs, onlys3:CreateBucketpermission is needed. -
Object Lock - If
ObjectLockEnabledForBucketis set to true in yourCreateBucketrequest,s3:PutBucketObjectLockConfigurationands3:PutBucketVersioningpermissions are required. -
S3 Object Ownership - If your
CreateBucketrequest includes thex-amz-object-ownershipheader, then thes3:PutBucketOwnershipControlspermission is required. By default,ObjectOwnershipis set toBucketOWnerEnforcedand ACLs are disabled. We recommend keeping ACLs disabled, except in uncommon use cases where you must control access for each object individually. If you want to change theObjectOwnershipsetting, you can use thex-amz-object-ownershipheader in yourCreateBucketrequest to set theObjectOwnershipsetting of your choice. For more information about S3 Object Ownership, see Controlling object ownership in the Amazon S3 User Guide. -
S3 Block Public Access - If your specific use case requires granting public access to your S3 resources, you can disable Block Public Access. You can create a new bucket with Block Public Access enabled, then separately call the
DeletePublicAccessBlockAPI. To use this operation, you must have thes3:PutBucketPublicAccessBlockpermission. By default, all Block Public Access settings are enabled for new buckets. To avoid inadvertent exposure of your resources, we recommend keeping the S3 Block Public Access settings enabled. For more information about S3 Block Public Access, see Blocking public access to your Amazon S3 storage in the Amazon S3 User Guide.
-
If your CreateBucket request sets BucketOwnerEnforced for Amazon S3 Object Ownership and specifies a bucket ACL that provides access to an external Amazon Web Services account, your request fails with a 400 error and returns the InvalidBucketAcLWithObjectOwnership error code. For more information, see Setting Object Ownership on an existing bucket in the Amazon S3 User Guide.
The following operations are related to CreateBucket:
Implementations§
§impl CreateBucketFluentBuilder
impl CreateBucketFluentBuilder
pub fn as_input(&self) -> &CreateBucketInputBuilder
pub fn as_input(&self) -> &CreateBucketInputBuilder
Access the CreateBucket as a reference.
pub async fn send(
self
) -> Result<CreateBucketOutput, SdkError<CreateBucketError, Response<SdkBody>>>
pub async fn send( self ) -> Result<CreateBucketOutput, SdkError<CreateBucketError, Response<SdkBody>>>
Sends the request and returns the response.
If an error occurs, an SdkError will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
pub async fn customize(
self
) -> Result<CustomizableOperation<CreateBucketOutput, CreateBucketError, CreateBucketFluentBuilder>, SdkError<CreateBucketError>>
pub async fn customize( self ) -> Result<CustomizableOperation<CreateBucketOutput, CreateBucketError, CreateBucketFluentBuilder>, SdkError<CreateBucketError>>
Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn acl(self, input: BucketCannedAcl) -> CreateBucketFluentBuilder
pub fn acl(self, input: BucketCannedAcl) -> CreateBucketFluentBuilder
The canned ACL to apply to the bucket.
pub fn set_acl(
self,
input: Option<BucketCannedAcl>
) -> CreateBucketFluentBuilder
pub fn set_acl( self, input: Option<BucketCannedAcl> ) -> CreateBucketFluentBuilder
The canned ACL to apply to the bucket.
pub fn get_acl(&self) -> &Option<BucketCannedAcl>
pub fn get_acl(&self) -> &Option<BucketCannedAcl>
The canned ACL to apply to the bucket.
pub fn bucket(self, input: impl Into<String>) -> CreateBucketFluentBuilder
pub fn bucket(self, input: impl Into<String>) -> CreateBucketFluentBuilder
The name of the bucket to create.
pub fn set_bucket(self, input: Option<String>) -> CreateBucketFluentBuilder
pub fn set_bucket(self, input: Option<String>) -> CreateBucketFluentBuilder
The name of the bucket to create.
pub fn get_bucket(&self) -> &Option<String>
pub fn get_bucket(&self) -> &Option<String>
The name of the bucket to create.
pub fn create_bucket_configuration(
self,
input: CreateBucketConfiguration
) -> CreateBucketFluentBuilder
pub fn create_bucket_configuration( self, input: CreateBucketConfiguration ) -> CreateBucketFluentBuilder
The configuration information for the bucket.
pub fn set_create_bucket_configuration(
self,
input: Option<CreateBucketConfiguration>
) -> CreateBucketFluentBuilder
pub fn set_create_bucket_configuration( self, input: Option<CreateBucketConfiguration> ) -> CreateBucketFluentBuilder
The configuration information for the bucket.
pub fn get_create_bucket_configuration(
&self
) -> &Option<CreateBucketConfiguration>
pub fn get_create_bucket_configuration( &self ) -> &Option<CreateBucketConfiguration>
The configuration information for the bucket.
pub fn grant_full_control(
self,
input: impl Into<String>
) -> CreateBucketFluentBuilder
pub fn grant_full_control( self, input: impl Into<String> ) -> CreateBucketFluentBuilder
Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.
pub fn set_grant_full_control(
self,
input: Option<String>
) -> CreateBucketFluentBuilder
pub fn set_grant_full_control( self, input: Option<String> ) -> CreateBucketFluentBuilder
Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.
pub fn get_grant_full_control(&self) -> &Option<String>
pub fn get_grant_full_control(&self) -> &Option<String>
Allows grantee the read, write, read ACP, and write ACP permissions on the bucket.
pub fn grant_read(self, input: impl Into<String>) -> CreateBucketFluentBuilder
pub fn grant_read(self, input: impl Into<String>) -> CreateBucketFluentBuilder
Allows grantee to list the objects in the bucket.
pub fn set_grant_read(self, input: Option<String>) -> CreateBucketFluentBuilder
pub fn set_grant_read(self, input: Option<String>) -> CreateBucketFluentBuilder
Allows grantee to list the objects in the bucket.
pub fn get_grant_read(&self) -> &Option<String>
pub fn get_grant_read(&self) -> &Option<String>
Allows grantee to list the objects in the bucket.
pub fn grant_read_acp(
self,
input: impl Into<String>
) -> CreateBucketFluentBuilder
pub fn grant_read_acp( self, input: impl Into<String> ) -> CreateBucketFluentBuilder
Allows grantee to read the bucket ACL.
pub fn set_grant_read_acp(
self,
input: Option<String>
) -> CreateBucketFluentBuilder
pub fn set_grant_read_acp( self, input: Option<String> ) -> CreateBucketFluentBuilder
Allows grantee to read the bucket ACL.
pub fn get_grant_read_acp(&self) -> &Option<String>
pub fn get_grant_read_acp(&self) -> &Option<String>
Allows grantee to read the bucket ACL.
pub fn grant_write(self, input: impl Into<String>) -> CreateBucketFluentBuilder
pub fn grant_write(self, input: impl Into<String>) -> CreateBucketFluentBuilder
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.
pub fn set_grant_write(self, input: Option<String>) -> CreateBucketFluentBuilder
pub fn set_grant_write(self, input: Option<String>) -> CreateBucketFluentBuilder
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.
pub fn get_grant_write(&self) -> &Option<String>
pub fn get_grant_write(&self) -> &Option<String>
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.
pub fn grant_write_acp(
self,
input: impl Into<String>
) -> CreateBucketFluentBuilder
pub fn grant_write_acp( self, input: impl Into<String> ) -> CreateBucketFluentBuilder
Allows grantee to write the ACL for the applicable bucket.
pub fn set_grant_write_acp(
self,
input: Option<String>
) -> CreateBucketFluentBuilder
pub fn set_grant_write_acp( self, input: Option<String> ) -> CreateBucketFluentBuilder
Allows grantee to write the ACL for the applicable bucket.
pub fn get_grant_write_acp(&self) -> &Option<String>
pub fn get_grant_write_acp(&self) -> &Option<String>
Allows grantee to write the ACL for the applicable bucket.
pub fn object_lock_enabled_for_bucket(
self,
input: bool
) -> CreateBucketFluentBuilder
pub fn object_lock_enabled_for_bucket( self, input: bool ) -> CreateBucketFluentBuilder
Specifies whether you want S3 Object Lock to be enabled for the new bucket.
pub fn set_object_lock_enabled_for_bucket(
self,
input: Option<bool>
) -> CreateBucketFluentBuilder
pub fn set_object_lock_enabled_for_bucket( self, input: Option<bool> ) -> CreateBucketFluentBuilder
Specifies whether you want S3 Object Lock to be enabled for the new bucket.
pub fn get_object_lock_enabled_for_bucket(&self) -> &Option<bool>
pub fn get_object_lock_enabled_for_bucket(&self) -> &Option<bool>
Specifies whether you want S3 Object Lock to be enabled for the new bucket.
pub fn object_ownership(
self,
input: ObjectOwnership
) -> CreateBucketFluentBuilder
pub fn object_ownership( self, input: ObjectOwnership ) -> CreateBucketFluentBuilder
The container element for object ownership for a bucket's ownership controls.
BucketOwnerPreferred - Objects uploaded to the bucket change ownership to the bucket owner if the objects are uploaded with the bucket-owner-full-control canned ACL.
ObjectWriter - The uploading account will own the object if the object is uploaded with the bucket-owner-full-control canned ACL.
BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer affect permissions. The bucket owner automatically owns and has full control over every object in the bucket. The bucket only accepts PUT requests that don't specify an ACL or bucket owner full control ACLs, such as the bucket-owner-full-control canned ACL or an equivalent form of this ACL expressed in the XML format.
pub fn set_object_ownership(
self,
input: Option<ObjectOwnership>
) -> CreateBucketFluentBuilder
pub fn set_object_ownership( self, input: Option<ObjectOwnership> ) -> CreateBucketFluentBuilder
The container element for object ownership for a bucket's ownership controls.
BucketOwnerPreferred - Objects uploaded to the bucket change ownership to the bucket owner if the objects are uploaded with the bucket-owner-full-control canned ACL.
ObjectWriter - The uploading account will own the object if the object is uploaded with the bucket-owner-full-control canned ACL.
BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer affect permissions. The bucket owner automatically owns and has full control over every object in the bucket. The bucket only accepts PUT requests that don't specify an ACL or bucket owner full control ACLs, such as the bucket-owner-full-control canned ACL or an equivalent form of this ACL expressed in the XML format.
pub fn get_object_ownership(&self) -> &Option<ObjectOwnership>
pub fn get_object_ownership(&self) -> &Option<ObjectOwnership>
The container element for object ownership for a bucket's ownership controls.
BucketOwnerPreferred - Objects uploaded to the bucket change ownership to the bucket owner if the objects are uploaded with the bucket-owner-full-control canned ACL.
ObjectWriter - The uploading account will own the object if the object is uploaded with the bucket-owner-full-control canned ACL.
BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer affect permissions. The bucket owner automatically owns and has full control over every object in the bucket. The bucket only accepts PUT requests that don't specify an ACL or bucket owner full control ACLs, such as the bucket-owner-full-control canned ACL or an equivalent form of this ACL expressed in the XML format.
Trait Implementations§
§impl Clone for CreateBucketFluentBuilder
impl Clone for CreateBucketFluentBuilder
§fn clone(&self) -> CreateBucketFluentBuilder
fn clone(&self) -> CreateBucketFluentBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more