Jenkins aws cloudformation部署在添加--tags时失败
我尝试使用Jenkins aws cloudformation部署在添加--tags时失败,jenkins,amazon-cloudformation,Jenkins,Amazon Cloudformation,我尝试使用--tags选项运行aws cloudformation deploy,但出现以下错误: Error in jenkins pipeline console: usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run: aws help aws <command> help
--tags
选项运行aws cloudformation deploy
,但出现以下错误:
Error in jenkins pipeline console:
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
在删除--tags key=value时成功上载了Cloudformation模板。可能您使用的是旧版本的aws cli。仅在2018年1月才合并(参见拉取请求)。因此,请检查您的版本,并在需要时进行更新。当我收到“
aws:error:argument子命令:无效选择时,有效选择为:
”aws命令错误,通常是因为我的参数名有误,例如--模板体
与--模板文件
”,用于cloudformation deploy
。首先尝试删除任何无关选项,以减少问题选项。谢谢@biruk1230。我使用的是旧版本1.11。升级cli版本修复了此问题。
sh "aws cloudformation deploy --region=us-east-1 --template-file template.yaml --stack-name template-stack --parameter-overrides parameter1=value1 --tags keyname=keyvalue"