You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AWS CloudFormation SecretsManager动态引用无法解析值求助

问题排查与解决
  • 移除UserName值的单引号:CloudFormation的动态引用{{resolve:...}}被单引号包裹时,会被当作普通字符串处理,不会触发解析逻辑。修改后的模板如下:
AWSTemplateFormatVersion: 2010-09-09
Resources:
   MyIAMUser:
    Type: AWS::IAM::User
    Properties:
      UserName: {{resolve:secretsmanager:fedtest:SecretString:login}}
      LoginProfile:
        Password: 'password'
  • 验证Secret的结构:确认fedtest的SecretString是JSON格式且包含login键,示例结构如下:

    {"login": "target-username"}
    

    如果Secret是纯文本(非JSON格式),则需要去掉引用路径中的:login部分,改为{{resolve:secretsmanager:fedtest:SecretString}}。

  • 检查语法转义问题:确认模板里的{{和}}没有被意外转义(比如误写为{{{或}}}),保证动态引用的语法格式完全正确。

内容的提问来源于stack exchange,提问作者Fed.Ushel

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 02:55:05