

# Update a topic in an Amazon MSK cluster
<a name="msk-update-topic"></a>

Update the partition count or topic-level configurations for an existing topic. This operation modifies the topic without requiring recreation.

**Note**  
You can update either the partition count or the topic configurations in a single API call, but not both simultaneously. To update both, make separate API calls.

**Topics**
+ [Update a topic using the AWS Management Console](update-topic-console.md)
+ [Update a topic using the AWS CLI](update-topic-cli.md)
+ [Update a topic using the API](update-topic-api.md)

# Update a topic using the AWS Management Console
<a name="update-topic-console"></a>

1. Sign in to the AWS Management Console, and open the Amazon MSK console at [https://console.aws.amazon.com/msk/home?region=us-east-1\$1/home/](https://console.aws.amazon.com/msk/home?region=us-east-1#/home/).

1. In the list of clusters, choose the name of the cluster containing the topic you want to update.

1. On the cluster details page, choose the **Topics** tab.

1. Select the topic you want to update, then choose either **Edit partition settings** or **Edit configurations** from **Actions**.

1. Update the partition count or configurations as needed.

1. Choose **Save**.

# Update a topic using the AWS CLI
<a name="update-topic-cli"></a>

Run the following command, replacing *ClusterArn* with the Amazon Resource Name (ARN) of your cluster and *TopicName* with the name of the topic you want to update.

```
aws kafka update-topic --cluster-arn ClusterArn --topic-name TopicName --partition-count 6
```

The output of this command looks like the following JSON example.

```
{
    "topicArn": "arn:aws:kafka:us-east-1:123456789012:topic/MyCluster/abcd1234-abcd-dcba-4321-a1b2abcd9f9f-2/MyTopic",
    "topicName": "MyTopic",
    "status": "UPDATING"
}
```

# Update a topic using the API
<a name="update-topic-api"></a>

To update a topic using the API, see [UpdateTopic](https://docs.aws.amazon.com//msk/1.0/apireference/v1-clusters-clusterarn-topics-topicname.html#UpdateTopic).