本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
設定單一區域叢集
建立叢集
使用 create-cluster命令建立叢集。
注意
叢集建立是非同步操作。呼叫 GetCluster API,直到狀態變更為 為止ACTIVE
。您可以在叢集變成作用中後連線到叢集。
範例 Command
aws dsql create-cluster --region us-east-1
注意
若要在建立期間停用刪除保護,請包含 --no-deletion-protection-enabled
旗標。
範例 回應
{ "identifier": "abc0def1baz2quux3quuux4", "arn": "arn:aws:dsql:us-east-1:111122223333:cluster/abc0def1baz2quux3quuux4", "status": "CREATING", "creationTime": "2024-05-25T16:56:49.784000-07:00", "deletionProtectionEnabled": true, "tag": {}, "encryptionDetails": { "encryptionType": "AWS_OWNED_KMS_KEY", "encryptionStatus": "ENABLED" } }
描述叢集
使用 get-cluster命令取得叢集的相關資訊。
範例 Command
aws dsql get-cluster \ --region us-east-1 \ --identifier
your_cluster_id
範例 回應
{ "identifier": "abc0def1baz2quux3quuux4", "arn": "arn:aws:dsql:us-east-1:111122223333:cluster/abc0def1baz2quux3quuux4", "status": "ACTIVE", "creationTime": "2024-11-27T00:32:14.434000-08:00", "deletionProtectionEnabled": false, "encryptionDetails": { "encryptionType": "CUSTOMER_MANAGED_KMS_KEY", "kmsKeyArn": "arn:aws:kms:us-east-1:111122223333:key/123a456b-c789-01de-2f34-g5hi6j7k8lm9", "encryptionStatus": "ENABLED" } }
更新叢集
使用 update-cluster命令更新現有的叢集。
注意
更新是非同步操作。呼叫 GetCluster API,直到狀態變更為 ACTIVE
為止,查看您的變更。
範例 Command
aws dsql update-cluster \ --region us-east-1 \ --no-deletion-protection-enabled \ --identifier
your_cluster_id
範例 回應
{
"identifier": "abc0def1baz2quux3quuux4",
"arn": "arn:aws:dsql:us-east-1:111122223333:cluster/abc0def1baz2quux3quuux4",
"status": "UPDATING",
"creationTime": "2024-05-24T09:15:32.708000-07:00"
}
刪除叢集
使用 delete-cluster命令刪除現有的叢集。
注意
您只能刪除已停用刪除保護的叢集。根據預設,當您建立新的叢集時,會啟用刪除保護。
範例 Command
aws dsql delete-cluster \ --region us-east-1 \ --identifier
your_cluster_id
範例 回應
{
"identifier": "abc0def1baz2quux3quuux4",
"arn": "arn:aws:dsql:us-east-1:111122223333:cluster/abc0def1baz2quux3quuux4",
"status": "DELETING",
"creationTime": "2024-05-24T09:16:43.778000-07:00"
}
列出叢集
使用 list-clusters命令列出您的叢集。
範例 Command
aws dsql list-clusters --region us-east-1
範例 回應
{ "clusters": [ { "identifier": "abc0def1baz2quux3quux4quuux", "arn": "arn:aws:dsql:us-east-1:111122223333:cluster/abc0def1baz2quux3quux4quuux" }, { "identifier": "abc0def1baz2quux3quux5quuuux", "arn": "arn:aws:dsql:us-east-1:111122223333:cluster/abc0def1baz2quux3quux5quuuux" } ] }