

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

# 關閉資料表的 Amazon Keyspaces 自動擴展
<a name="autoscaling.turnoff"></a>

您可以隨時關閉資料表的 Amazon Keyspaces 自動擴展。如果您不再需要擴展資料表的讀取或寫入容量，您應該考慮關閉自動擴展，以便 Amazon Keyspaces 不會繼續修改資料表的讀取或寫入容量設定。您可以使用 主控台、CQL 或 更新資料表 AWS CLI。

關閉自動擴展也會刪除代表您建立的 CloudWatch 警示。

若要刪除 Application Auto Scaling 用來存取 Amazon Keyspaces 資料表的服務連結角色，請遵循中的步驟[刪除 Amazon Keyspaces 的服務連結角色](using-service-linked-roles-app-auto-scaling.md#delete-service-linked-role-app-auto-scaling)。

**注意**  
若要刪除 Application Auto Scaling 使用的服務連結角色，您必須停用帳戶中所有資料表的自動擴展 AWS 區域。

------
#### [ Console ]

**使用主控台關閉資料表的 Amazon Keyspaces 自動擴展**

**使用 Amazon Keyspaces 主控台**

1. 登入 AWS 管理主控台，並在 https：//[https://console.aws.amazon.com/keyspaces/home](https://console.aws.amazon.com/keyspaces/home) 開啟 Amazon Keyspaces 主控台。

1. 選擇您要更新的資料表，然後前往**容量**索引標籤。

1. 在**容量設定**區段中，選擇**編輯**。

1. 若要停用 Amazon Keyspaces 自動擴展，請清除**自動擴展**核取方塊。停用自動調整規模會將資料表取消註冊為 Application Auto Scaling 的可擴展目標。

------
#### [ Cassandra Query Language (CQL) ]

**使用 CQL 關閉資料表的 Amazon Keyspaces 自動擴展**

下列陳述式會關閉資料表 *mytable* 寫入容量的自動擴展。

```
ALTER TABLE mykeyspace.mytable
WITH AUTOSCALING_SETTINGS = {
    'provisioned_write_capacity_autoscaling_update': {
        'autoscaling_disabled': true
    }
};
```

------
#### [ CLI ]

**使用 關閉資料表的 Amazon Keyspaces 自動擴展 AWS CLI**

下列命令會關閉資料表讀取容量的自動擴展。它也會刪除代表您建立的 CloudWatch 警示。

```
aws keyspaces update-table --keyspace-name mykeyspace --table-name mytable 
            \ --auto-scaling-specification readCapacityAutoScaling={autoScalingDisabled=true}
```

------