

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 更新串流
<a name="updating-a-stream"></a>

您可以使用 Kinesis Data Streams 主控台、Kinesis Data Streams API 或 AWS CLI更新串流詳細資料。

**注意**  
您可為現有的串流或最近剛建立的串流啟用伺服器端加密。

## 使用主控台
<a name="update-stream-console"></a>

**使用主控台更新資料串流**

1. 在 [https://console.aws.amazon.com/kinesis](https://console.aws.amazon.com/kinesis/) 上開啟 Amazon Kinesis 主控台。

1. 在導覽列中，展開區域選擇工具，然後選擇一個區域。

1. 從清單中選擇串流的名稱。**Stream Details (串流詳細資訊)** 頁面會顯示串流組態的摘要和監控資訊。

1. 若要在資料串流的隨需和佈建容量模式之間進行切換，請在**組態**索引標籤中選擇**編輯容量模式**。如需詳細資訊，請參閱[選擇要在 中串流的正確模式](how-do-i-size-a-stream.md)。
**重要**  
對於您 AWS 帳戶中的每個資料串流，您可以在 24 小時內在隨需和佈建模式之間切換兩次。

1. 對於具有佈建模式的資料串流，若要編輯碎片數目，請在**組態**索引標籤中選擇**編輯已佈建的碎片**，然後輸入新的碎片計數。

1. 若要對資料記錄啟用伺服器端加密，從 **Server-side encryption (伺服器端加密)** 區段選擇 **Edit (編輯)**。選擇要使用做為加密主金鑰的 KMS 金鑰，或者使用由 Kinesis 管理的預設主金鑰 **aws/kinesis**。如果您啟用串流的加密並使用自己的 AWS KMS 主金鑰，請確定您的生產者和取用者應用程式可存取您使用 AWS KMS 的主金鑰。若要為應用程式指派許可使其能夠存取使用者產生的 AWS KMS 金鑰，請參閱 [使用使用者產生之 KMS 金鑰的許可](permissions-user-key-KMS.md)。

1. 若要編輯資料保留期間，從 **Data retention period (資料保留期間)** 區段選擇 **Edit (編輯)**，然後輸入新的資料保留期間。

1. 若您已對自己的帳戶啟用自訂指標，請從 **Shard level metrics (碎片級指標)** 區段選擇 **Edit (編輯)**，然後為您的串流指定指標。如需詳細資訊，請參閱[使用 Amazon CloudWatch 監控 Amazon Kinesis Data Streams 服務 Amazon CloudWatch](monitoring-with-cloudwatch.md)。

## 使用 API
<a name="update-stream-api"></a>

若要使用 API 更新串流詳細資訊，請參閱下列方法：
+ [AddTagsToStream](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_AddTagsToStream.html)
+ [DecreaseStreamRetentionPeriod](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_DecreaseStreamRetentionPeriod.html)
+ [DisableEnhancedMonitoring](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_DisableEnhancedMonitoring.html)
+ [EnableEnhancedMonitoring](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_EnableEnhancedMonitoring.html)
+ [IncreaseStreamRetentionPeriod](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_IncreaseStreamRetentionPeriod.html)
+ [RemoveTagsFromStream](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_RemoveTagsFromStream.html)
+ [StartStreamEncryption](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_StartStreamEncryption.html)
+ [StopStreamEncryption](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_StopStreamEncryption.html)
+ [UpdateShardCount](https://docs.aws.amazon.com/kinesis/latest/APIReference/API_UpdateShardCount.html)

## 使用 AWS CLI
<a name="update-stream-cli"></a>

如需有關使用 更新串流的資訊 AWS CLI，請參閱 [Kinesis CLI 參考](https://docs.aws.amazon.com/cli/latest/reference/kinesis/index.html)。