【问题标题】:AWS sam deploy return error invalid choiceAWS sam deploy 返回错误无效选择
【发布时间】:2019-06-10 00:13:00
【问题描述】:

我正在按照指示 here 使用 AWS CodeDeploy 将代码从 GitHub 推送到 AWS。

我遇到了这个错误:

$ sam deploy -template-file packaged.yaml –stack-name mySafeDeployStack –capabilities CAPABILITY_IAM
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help
aws: error: argument subcommand: Invalid choice, valid choices are:

push                                     | register                                
deregister                               | install                                 
uninstall                               

我之前已经成功运行过这个命令:

$ sam package --template-file template.yaml --s3-bucket my-bucket --output-template-file packaged.yaml
Uploading to ...  (100.00%)
Successfully packaged artifacts and wrote output template to file packaged.yaml.
Execute the following command to deploy the packaged template
aws cloudformation deploy --template-file .../packaged.yaml --stack-name <YOUR STACK NAME>

$ sam --version
SAM CLI, version 0.6.0

我已经尝试了推荐的命令:

aws cloudformation deploy ...

但它返回相同的错误。

【问题讨论】:

    标签: amazon-web-services aws-lambda aws-code-deploy


    【解决方案1】:

    当标志需要两个时,您似乎在使用单个破折号。 sam package 命令成功,因为您使用了两个破折号。

    这应该可行:

    sam deploy --template-file packaged.yaml --stack-name mySafeDeployStack --capabilities CAPABILITY_IAM
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-08-18
      • 2022-10-04
      • 1970-01-01
      • 2021-06-16
      • 1970-01-01
      • 2015-08-28
      • 1970-01-01
      相关资源
      最近更新 更多