amazon-web-services - 如何获取yaml文件中的ssm参数?

标签 amazon-web-services aws-cloudformation

我有一个 yaml 云形成文件,它需要一个存储在 ssm 参数中的变量。 yaml 文件是 CFT 模板。下面是示例代码,

AWSTemplateFormatVersion: 2010-09-09
Description: 'Fully Automated OT Archival Data Migration'
Parameters:
 Environment:
  Description: 'Stage type (for Tags)'
  Type: String
  Default: dev

Resources:
S3Bucket:
 Type: 'AWS::S3::Bucket'
 Properties:
  BucketName: '{{resolve:ssm:/opentext/config/automated-ot-archival-data-migration/migration.bucket.name:1}}-${Environment}'

当我将代码上传到 AWS 控制台中的 cloudformation 时,出现错误。我想知道 ssm 参数引用是否正确。

如果您发现任何问题,请告诉我。

谢谢

最佳答案

您缺少 {Environment} 变量的 !Sub 函数。

BucketName: !Sub '{{resolve:ssm:/opentext/config/automated-ot-archival-data-migration/migration.bucket.name:1}}-${Environment}'

关于amazon-web-services - 如何获取yaml文件中的ssm参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67804390/

相关文章:

php - AWS S3、速度和服务器负载

amazon-web-services - Serverless框架中的yml配置文件和SAM有什么区别?

amazon-web-services - AWS CloudFormation 模板将 IP 地址添加到 Route 53 记录,而不是 URL

amazon-s3 - AWS - SAM cli yaml 模板不适用于 cloudformation 堆栈

amazon-web-services - 如何将 api 网关(带有 api key )添加到现有的 lambda cloudformation 模板?

amazon-web-services - CloudFormation - 从存储库获取模板

python - 如何在python中获取当前ec2实例的公共(public)ip?

python - 是否可以在 python 中过滤 DynamoDB 查询结果?

python - 如何验证重启发生?

amazon-web-services - 如何在 .ebextensions 中获取负载均衡器的 ARN?