【问题标题】:AWS CLI nuancesAWS CLI 细微差别
【发布时间】:2015-09-04 05:00:27
【问题描述】:

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

作为模板,我使用了MongoDB-VPC.template,它提供了多个副本集成员和分片选项的变体。如果我使用 AWS GUI,一切都部署得很好,但是当我尝试部署 VIA CLI 时,我得到的只是 NAT 实例 + Prime。

下面你可以看到我的提示。

问题是如何指定replicaSet成员的数量,两个或更多。

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

【问题讨论】:

    标签: mongodb amazon-web-services command-line-interface amazon-cloudformation


    【解决方案1】:

    您需要像通过 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 脚本的其他输入参数)

    (脚本为一行。为了更好的可读性,将其改为多行。)

    来源: Passing Parameters to CloudFormation Stacks with the AWS CLI and Powershell

    【讨论】:

      猜你喜欢
      • 2011-04-26
      • 1970-01-01
      • 1970-01-01
      • 2020-12-13
      • 2011-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多