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

标签 amazon-web-services aws-cloudformation

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

我们在 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/

相关文章:

amazon-web-services - 请求 sagemaker 端点给出 "Need to pass custom_attributes=' Accept_eula=true' 作为 header 的一部分“错误

node.js - AWS更新 Node js sdk v3中的凭证

amazon-web-services - 使用 AWS Java SDK 检查云形成堆栈是否存在的最佳方法?

node.js - S3访问私有(private)存储桶文件

python - AWS CLI/Boto3 Cloudsearch 验证冲突

amazon-web-services - 如何将无服务器应用程序模型 (SAM) 模板转换为 Cloudformation?

aws-cloudformation - CloudFormation - 以 Ubuntu 用户身份运行的用户数据

amazon-web-services - CloudFormation !Select with !Split 函数和负载均衡器 arn

amazon-web-services - 为什么不能在 cloudformation aws 的更新堆栈部分直接更新 iam 角色

amazon-web-services - AWS Cloudformation:Fn::GetAtt 转换为 Fn::ImportValue