Mongodb AWS CLI细微差别

Mongodb AWS CLI细微差别,mongodb,amazon-web-services,command-line-interface,amazon-cloudformation,Mongodb,Amazon Web Services,Command Line Interface,Amazon Cloudformation,我正在尝试使用AWS CLI部署MongoDB群集 作为我使用的模板,它提供了副本集成员和碎片选项的几个变体。如果我使用的是AWS GUI,那么部署一切都很好,但是当我试图通过CLI进行部署时,我只得到NAT instance+Prime 下面你可以看到我的提示 问题是如何指定两个或更多复制集成员的数量 aws cloudformation create-stack --stack-name i --template-url https://s3.amazonaws.com/quickstart

我正在尝试使用AWS CLI部署MongoDB群集

作为我使用的模板,它提供了副本集成员和碎片选项的几个变体。如果我使用的是AWS GUI,那么部署一切都很好,但是当我试图通过CLI进行部署时,我只得到NAT instance+Prime

下面你可以看到我的提示

问题是如何指定两个或更多复制集成员的数量

aws cloudformation create-stack --stack-name i --template-url https://s3.amazonaws.com/quickstart-reference/mongodb/latest/templates/MongoDB-VPC.template --parameters ParameterKey=KeyName,ParameterValue=some-key  --capabilities CAPABILITY_IAM

您需要传递脚本的参数,就像通过webUI上的表单发送脚本一样:

aws cloudformation create-stack 
--stack-name i 
--template-url https://s3.amazonaws.com/quickstart-reference/mongodb/latest/templates/MongoDB-VPC.template 
--parameters ParameterKey=KeyName,ParameterValue=some-key  
ParameterKey=ClusterReplicaSetCount,ParameterValue=4  
ParameterKey=ClusterReplicaSetCount,ParameterValue=4  
ParameterKey=ClusterReplicaSetCount,ParameterValue=4  
ParameterKey=ClusterReplicaSetCount,ParameterValue=4 
--capabilities CAPABILITY_IAM
(显然,只设置一次,只是显示了在哪里可以为CloudFormation脚本设置其他输入参数)

(脚本只有一行。为了更好的可读性,将其设置为多行。)

资料来源: