gpt4 book ai didi

amazon-web-services - 云信息 : parameterize the name of a parameter?

转载 作者:行者123 更新时间:2023-12-03 07:14:38 25 4
gpt4 key购买 nike

我目前正在处理一个恼人的问题:

我们在 SSM 参数存储中存储一些环境(开发/测试/生产/等)特定的参数值,因此它们具有不同的名称。它们经常变化。

环境作为 CF 模板参数传递到 update-stack,我想从中构造实际的 SSM 参数名称(这是我引用的博客文章: https://aws.amazon.com/blogs/mt/integrating-aws-cloudformation-with-aws-systems-manager-parameter-store/ )

我确实想在我的 Cloudformation 模板中使用单个通用参数,但是,这似乎不可能,因为参数的值需要进行硬编码。而且您似乎无法 !Ref !Join 语句。

有人做过类似的事情并找到了一个好的解决方法吗?

最佳答案

不幸的是,内部函数(例如 !Join)只能在 certain parts 中使用CloudFormation 模板的:

You can use intrinsic functions only in specific parts of a template. Currently, you can use intrinsic functions in resource properties, outputs, metadata attributes, and update policy attributes.

这意味着您可能必须在要构建 SSM 参数名称的每个位置使用 !Join

您也许可以使用!Transform进行查找和替换操作,但这取决于您的具体情况。

关于amazon-web-services - 云信息 : parameterize the name of a parameter?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56107622/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com