【发布时间】:2019-04-22 05:27:08
【问题描述】:
我正在为一个 EC2 实例创建一个 CloudFormation 模板,我将使用它来管理我已经在我的 VPC 中部署的 Active Directory 服务器。我在定义 AWS::EC2::Instance 资源时遇到问题。这可能是 YAML 语法问题,但我无法看到问题。
创建堆栈时,它会回滚并出现错误“属性 SsmAssociations 的值必须是列表类型”。文档在示例方面有些稀疏。 Amazon EC2 Instance SsmAssociations
这是有问题的 YAML 的 sn-p:
Resources:
EC2Instance:
Type: AWS::EC2::Instance
Properties:
IamInstanceProfile: !Ref InstanceProfile
SsmAssociations:
DocumentName: !Ref InstanceProfile
AssociationParameters:
-
Key: "directoryId"
Value:
-
Fn::ImportValue:
Fn::Join:
- ''
- - !Ref ADStackName
- '-'
- 'DirectoryId'
-
Key: "directoryName"
Value:
-
Fn::ImportValue:
Fn::Join:
- ''
- - !Ref ADStackName
- '-'
- 'DirectoryName'
-
Key: "dnsIpAddresses"
Value:
-
Fn::ImportValue:
Fn::Join:
- ''
- - !Ref ADStackName
- '-'
- 'ADServer1PrivateIP'
-
Fn::ImportValue:
Fn::Join:
- ''
- - !Ref ADStackName
- '-'
- 'ADServer2PrivateIP'
KeyName: !Ref EC2KeyPair
感谢您的帮助。
【问题讨论】:
标签: amazon-web-services amazon-ec2 yaml amazon-cloudformation