使用 設定 Aurora DSQL 叢集 AWS CloudFormation - Amazon Aurora DSQL

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

使用 設定 Aurora DSQL 叢集 AWS CloudFormation

您可以使用相同的 AWS CloudFormation 資源AWS::DSQL::Cluster來部署和管理單一區域和多區域 Aurora DSQL 叢集。

如需如何使用 資源建立、修改和管理叢集的詳細資訊,請參閱 Amazon Aurora DSQL 資源類型參考AWS::DSQL::Cluster

建立初始叢集組態

首先,建立 AWS CloudFormation 範本以定義多區域叢集:

--- Resources: MRCluster: Type: AWS::DSQL::Cluster Properties: DeletionProtectionEnabled: true MultiRegionProperties: WitnessRegion: us-west-2

使用下列 CLI AWS 命令在兩個區域中建立堆疊:

aws cloudformation create-stack --region us-east-2 \ --stack-name MRCluster \ --template-body file://mr-cluster.yaml
aws cloudformation create-stack --region us-east-1 \ --stack-name MRCluster \ --template-body file://mr-cluster.yaml

尋找叢集識別符

擷取叢集的實體資源 IDs:

aws cloudformation describe-stack-resources -region us-east-2 \ --stack-name MRCluster \ --query 'StackResources[].PhysicalResourceId' [ "auabudrks5jwh4mjt6o5xxhr4y" ]
aws cloudformation describe-stack-resources -region us-east-1 \ --stack-name MRCluster \ --query 'StackResources[].PhysicalResourceId' [ "imabudrfon4p2z3nv2jo4rlajm" ]

更新叢集組態

更新您的 AWS CloudFormation 範本以包含兩個叢集 ARNs:

--- Resources: MRCluster: Type: AWS::DSQL::Cluster Properties: DeletionProtectionEnabled: true MultiRegionProperties: WitnessRegion: us-west-2 Clusters: - arn:aws:dsql:us-east-2:123456789012:cluster/auabudrks5jwh4mjt6o5xxhr4y - arn:aws:dsql:us-east-1:123456789012:cluster/imabudrfon4p2z3nv2jo4rlajm

將更新的組態套用至兩個區域:

aws cloudformation update-stack --region us-east-2 \ --stack-name MRCluster \ --template-body file://mr-cluster.yaml
aws cloudformation update-stack --region us-east-1 \ --stack-name MRCluster \ --template-body file://mr-cluster.yaml