gpt4 book ai didi

amazon-web-services - AWS::EC2::Instance/Metadata 不支持 SSM 安全引用

转载 作者:行者123 更新时间:2023-12-04 11:30:46 25 4
gpt4 key购买 nike

我尝试在云形成模板的元数据部分使用 SecureString,但它会引发以下错误:

SSM Secure reference is not supported in: [AWS::EC2::Instance/Metadata/AWS::CloudFormation::Init/config/files/~/.ssh/content]

这是我的代码:

Resources:
LinuxEC2Instance:
Type: AWS::EC2::Instance
Metadata:
AWS::CloudFormation::Init:
config:
files:
~/.ssh:
content: !Sub |
'{{resolve:ssm-secure:/credentials/ansible:1}}'
mode: "000644"
owner: "ansible"
group: "ansible"

为什么这不起作用?我希望安全字符串引用能够在 Cloud Formation 模板中工作?

最佳答案

Why does this not work?

它不起作用,因为AWS::EC2::Instance不支持ssm-secure。支持的资源列表为here它包括:

AWS::DirectoryService::MicrosoftAD
AWS::DirectoryService::SimpleAD
AWS::ElastiCache::ReplicationGroup
AWS::IAM::User
AWS::KinesisFirehose::DeliveryStream
AWS::OpsWorks::App
AWS::OpsWorks::Stack
AWS::OpsWorks::Stack
AWS::RDS::DBCluster
AWS::RDS::DBInstance
AWS::Redshift::Cluster

关于amazon-web-services - AWS::EC2::Instance/Metadata 不支持 SSM 安全引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62305957/

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