

# Setting the default storage class for a bucket

By default, a general purpose bucket uses S3 Standard (`STANDARD`) as its default storage class. You can change the bucket default to S3 Intelligent-Tiering (`INTELLIGENT_TIERING`) or S3 Standard at any time. Amazon S3 uses the bucket default for every new object that you write without the `x-amz-storage-class` request header.

The bucket default storage class applies only to objects that you write after you change it. Amazon S3 doesn't change the storage class of objects that are already in the bucket. To move existing objects to S3 Intelligent-Tiering, add an S3 Lifecycle configuration that transitions them. For more information, see [Transitioning objects using Amazon S3 Lifecycle](lifecycle-transition-general-considerations.md).

## How Amazon S3 applies the bucket default storage class
<a name="bucket-default-storage-class-behavior"></a>

Amazon S3 applies the bucket default storage class as follows:
+ **New object uploads** – `PutObject`, `POST Object`, and `CreateMultipartUpload` requests use the bucket default storage class when the request doesn't include the `x-amz-storage-class` header. If the request includes the header, Amazon S3 uses the storage class in the header.
+ **Copies** – A `CopyObject` request without the `x-amz-storage-class` header uses the default storage class of the destination bucket, not the storage class of the source object. To keep the source storage class, specify it in the request. This also applies to Amazon S3 Batch Operations copy jobs.
+ **Multipart uploads** – Amazon S3 sets the storage class of a multipart upload when you create the upload. If you change the bucket default while an upload is in progress, the upload keeps the storage class it started with.
+ **Replication** – Replicas keep the storage class of the source object, or the storage class that you specify in the replication configuration. Replicas don't use the default storage class of the destination bucket. For more information, see [Replication configuration file elements](replication-add-config.md).
+ **S3 Lifecycle** – Your lifecycle rules apply to these objects the same way they apply to any other object.

**Note**  
Some AWS services specify a storage class when they write objects to your bucket. These objects use the storage class that the service specifies, not the bucket default. To use the bucket default, check the storage class settings of the service.

To set the bucket default storage class, you need the `s3:PutBucketDefaultStorageClass` permission. To view it, you need the `s3:GetBucketDefaultStorageClass` permission. For more information, see [Required permissions for Amazon S3 API operations](using-with-s3-policy-actions.md).

## How to set the default storage class
<a name="bucket-default-storage-class-set"></a>

To set the default storage class for a bucket, you can use the following methods.

### Using the S3 console
<a name="bucket-default-storage-class-console"></a>

To set the default storage class for a bucket in the console:

1. Sign in to the AWS Management Console and open the Amazon S3 console at [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/).

1. In the left navigation pane, choose **General purpose buckets**.

1. In the buckets list, choose the name of the bucket that you want to change.

1. Choose the **Properties** tab.

1. Under **Default storage class**, choose **Edit**.

1. Choose **S3 Intelligent-Tiering** or **S3 Standard**.

1. Choose **Save changes**.

### Using the AWS CLI
<a name="bucket-default-storage-class-cli"></a>

In the following examples, replace {{{{amzn-s3-demo-bucket1}}}} with the name of your bucket.

The following AWS CLI command uses `put-bucket-default-storage-class` to set the default storage class of the bucket to S3 Intelligent-Tiering:

```bash
aws s3api put-bucket-default-storage-class --bucket {{{{amzn-s3-demo-bucket1}}}} --default-storage-class-configuration DefaultStorageClass=INTELLIGENT_TIERING
```

The following AWS CLI command uses `get-bucket-default-storage-class` to view the default storage class of the bucket:

```bash
aws s3api get-bucket-default-storage-class --bucket {{{{amzn-s3-demo-bucket1}}}}
```

### Using the REST API
<a name="bucket-default-storage-class-api"></a>

To set the bucket default storage class, use the [PutBucketDefaultStorageClass](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketDefaultStorageClass.html) API operation. To view it, use the [GetBucketDefaultStorageClass](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketDefaultStorageClass.html) API operation. The request body for `PutBucketDefaultStorageClass` uses the following format:

```xml
<DefaultStorageClassConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<DefaultStorageClass>INTELLIGENT_TIERING</DefaultStorageClass>
</DefaultStorageClassConfiguration>
```

### Using CloudFormation
<a name="bucket-default-storage-class-cfn"></a>

To set the bucket default storage class with CloudFormation, use the `DefaultStorageClass` property of the `AWS::S3::Bucket` resource:

```yaml
MyBucket:
  Type: AWS::S3::Bucket
  Properties:
    DefaultStorageClass: INTELLIGENT_TIERING
```