I'm creating a CloudFormation template for an EC2 instance that I'll be using to manage Active Directory servers I already have deployed in my VPC. I'm having an issue while defining the AWS::EC2::Instance
resource. It may be a YAML syntax issue, but I'm having trouble seeing the problem.
When the stack is being created it rolls back with error "Value of property SsmAssociations must be of type List". The documentation is somewhat sparse in terms of examples. Amazon EC2 Instance SsmAssociations
Here's the snippet of YAML that's in question:
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
Thanks for your help.