Creating a bucket
To upload your data to Amazon S3, you must first create an Amazon S3 bucket in one of the AWS Regions. When you create a bucket, you must choose a bucket name and Region. You can optionally choose other storage management options for the bucket. After you create a bucket, you cannot change the bucket name or Region. For information about naming buckets, see Bucket naming rules.
The AWS account that creates the bucket owns it. You can upload any number of objects to the bucket. By default, you can create up to 100 buckets in each of your AWS accounts. If you need more buckets, you can increase your account bucket limit to a maximum of 1,000 buckets by submitting a service limit increase. To learn how to submit a bucket limit increase, see AWS service quotas in the AWS General Reference. You can store any number of objects in a bucket.
S3 Object Ownership is an Amazon S3 bucket-level setting that you can use to disable access control lists (ACLs) and take ownership of every object in your bucket, simplifying access management for data stored in Amazon S3. By default, when another AWS account uploads an object to your Amazon S3 bucket, that account (the object writer) owns the object, has access to it, and can grant other users access to it through ACLs. When you create a bucket, you can apply the bucket owner enforced setting for Object Ownership to change this default behavior so that ACLs are disabled and you, as the bucket owner, automatically own every object in your bucket. As a result, access control for your data is based on policies. For more information, see Controlling ownership of objects and disabling ACLs for your bucket.
Starting in April 2023, Amazon S3 will change the default settings for S3 Block Public Access and
Object Ownership (ACLs disabled) for all new S3 buckets. For new
buckets created after this update, all S3 Block Public Access settings will be enabled,
and S3 access control lists (ACLs) will be disabled. These defaults are the recommended
best practices for securing data in Amazon S3. You can adjust these settings after creating
your bucket.
For more information, see Default settings for new S3 buckets FAQ and Heads-Up: Amazon S3 Security Changes Are Coming in April of 2023
You can use the Amazon S3 console, Amazon S3 APIs, AWS CLI, or AWS SDKs to create a bucket. For more information about the permissions required to create a bucket, see CreateBucket in the Amazon Simple Storage Service API Reference.
Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/
. -
Choose Create bucket.
The Create bucket wizard opens.
-
In Bucket name, enter a DNS-compliant name for your bucket.
The bucket name must:
-
Be unique across all of Amazon S3.
-
Be between 3 and 63 characters long.
-
Not contain uppercase characters.
-
Start with a lowercase letter or number.
After you create the bucket, you cannot change its name. For information about naming buckets, see Bucket naming rules.
Important Avoid including sensitive information, such as account number, in the bucket name. The bucket name is visible in the URLs that point to the objects in the bucket.
-
-
In Region, choose the AWS Region where you want the bucket to reside.
Choose a Region close to you to minimize latency and costs and address regulatory requirements. Objects stored in a Region never leave that Region unless you explicitly transfer them to another Region. For a list of Amazon S3 AWS Regions, see AWS service endpoints in the Amazon Web Services General Reference.
-
Under Object Ownership, to disable or enable ACLs and control ownership of objects uploaded in your bucket, choose one of the following settings:
ACLs disabled
-
Bucket owner enforced – ACLs are disabled, and the bucket owner automatically owns and has full control over every object in the bucket. ACLs no longer affect permissions to data in the S3 bucket. The bucket uses policies to define access control.
To require that all new buckets are created with ACLs disabled by using IAM or AWS Organizations policies, see Disabling ACLs for all new buckets (bucket owner enforced).
ACLs enabled
-
Bucket owner preferred – The bucket owner owns and has full control over new objects that other accounts write to the bucket with the
bucket-owner-full-control
canned ACL.If you apply the bucket owner preferred setting, to require all Amazon S3 uploads to include the
bucket-owner-full-control
canned ACL, you can add a bucket policy that only allows object uploads that use this ACL. -
Object writer – The AWS account that uploads an object owns the object, has full control over it, and can grant other users access to it through ACLs.
Note To apply the Bucket owner enforced setting or the Bucket owner preferred setting, you must have the following permission:
s3:CreateBucket
ands3:PutBucketOwnershipControls
. -
-
In Bucket settings for Block Public Access, choose the Block Public Access settings that you want to apply to the bucket.
We recommend that you keep all settings enabled unless you know that you need to turn off one or more of them for your use case, such as to host a public website. Block Public Access settings that you enable for the bucket are also enabled for all access points that you create on the bucket. For more information about blocking public access, see Blocking public access to your Amazon S3 storage.
-
(Optional) Under Bucket Versioning, you can choose if you wish to keep variants of objects in your bucket. For more information about versioning, see Using versioning in S3 buckets.
To disable or enable versioning on your bucket, choose either Disable or Enable.
-
(Optional) Under Tags, you can choose to add tags to your bucket. Tags are key-value pairs used to categorize storage.
To add a bucket tag, enter a Key and optionally a Value and choose Add Tag.
-
(Optional) Under Default encryption, you can choose to configure your bucket to use server-side encryption with either Amazon S3-managed keys (SSE-S3) or AWS KMS keys stored in AWS Key Management Service (AWS KMS) (SSE-KMS). For more information, see Setting default server-side encryption behavior for Amazon S3 buckets.
To disable or enable encryption, choose either Disable or Enable.
-
(Optional) If you want to enable S3 Object Lock, do the following:
-
Choose Advanced settings.
Important You can only enable Object Lock for a bucket when you create it, and you cannot disable it later. Enabling Object Lock also enables versioning for the bucket. After enabling you must configure the Object Lock default retention and legal hold settings to protect new objects from being deleted or overwritten.
-
If you want to enable Object Lock, choose Enable, read the warning that appears, and acknowledge it.
For more information, see Using S3 Object Lock.
Note To create an Object Lock enabled bucket, you must have the following permissions:
s3:CreateBucket
,s3:PutBucketVersioning
ands3:PutBucketObjectLockConfiguration
. -
-
Choose Create bucket.
When you use the AWS SDKs to create a bucket, you must create a client and then use the client to send a request to create a bucket. As a best practice, you should create your client and bucket in the same AWS Region. If you don't specify a Region when you create a client or a bucket, Amazon S3 uses the default Region US East (N. Virginia).
To create a client to access a dual-stack endpoint, you must specify an AWS Region. For more information, see Dual-stack endpoints. For a list of available AWS Regions, see Regions and endpoints in the AWS General Reference.
When you create a client, the Region maps to the Region-specific endpoint. The
client uses this endpoint to communicate with Amazon S3:
s3.
. If
your Region launched after March 20, 2019, your client and bucket must be in the
same Region. However, you can use a client in the US East (N. Virginia) Region to
create a bucket in any Region that launched before March 20, 2019. For more
information, see Legacy endpoints.<region>
.amazonaws.com
These AWS SDK code examples perform the following tasks:
-
Create a client by explicitly specifying an AWS Region — In the example, the client uses the
s3.us-west-2.amazonaws.com
endpoint to communicate with Amazon S3. You can specify any AWS Region. For a list of AWS Regions, see Regions and endpoints in the AWS General Reference. -
Send a create bucket request by specifying only a bucket name — The client sends a request to Amazon S3 to create the bucket in the Region where you created a client.
-
Retrieve information about the location of the bucket — Amazon S3 stores bucket location information in the location subresource that is associated with the bucket.
You can also use the AWS Command Line Interface (AWS CLI) to create an S3 bucket. For more
information, see create-bucket
For information about the AWS CLI, see What is the AWS Command Line Interface? in the AWS Command Line Interface User Guide.