[英]Managing parameters in Cloudformation template
I was deploying a cloudformation template (pre-build and provided by AWS) and was looking for a way to control the parameters (ie update it on regular basis with new parameters).我正在部署一个 cloudformation 模板(预先构建并由 AWS 提供)并正在寻找一种控制参数的方法(即使用新参数定期更新它)。 I was wondering if there is a programmatic best practice to manage this?
我想知道是否有程序化的最佳实践来管理这个?
Thanks!谢谢!
If you want to update an existing stack, you can use the aws-cli and run the aws cloudformation update-stack
command with an --parameters
argument that specifies the parameters you want.如果要更新现有堆栈,您可以使用 aws-cli 并运行
aws cloudformation update-stack
命令,并使用指定所需参数的--parameters
参数。 You can also update the template itself with --template-body
or --template-url
, if needed.如果需要,您还可以使用
--template-body
或--template-url
更新模板本身。
Documentation: https://docs.aws.amazon.com/cli/latest/reference/cloudformation/update-stack.html文档: https://docs.aws.amazon.com/cli/latest/reference/cloudformation/update-stack.html
Better to use aws cloudformation deploy
Something like this最好使用
aws cloudformation deploy
这样的东西
aws cloudformation deploy \
--template-file ./template.yaml \
--s3-bucket ${s3_bucket_name} \
--s3-prefix ${cf-templates} \
--stack-name ${stackName} \
--capabilities CAPABILITY_NAMED_IAM \
--no-fail-on-empty-changeset \
--parameter-overrides par1=${par1value} par2=${par2value} \
--tags tag1=tag1value tag2=tag2value \
--profile test_profile
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.