I am trying to write a cloud formation template which sets up a security group for a load balancer. I have the following to select a VPC for the SecurityGroup:
"Parameters" : {
"VpcId" : {
"Description" : "VPC associated with the provided subnets",
"Type" : "List<AWS::EC2::VPC::Id>"
},
},
And then to create the load balancer security group I have:
"LbSecurityGroup" : {
"Type" : "AWS::EC2::SecurityGroup",
"Properties" : {
"GroupDescription" : "Stack LBs",
"VpcId" : { "Ref" : "VpcId" }
}
},
When I launch the stack it fails with:
CREATE_FAILED AWS::EC2::SecurityGroup LbSecurityGroup
Value of property VpcId must be of type String
First of all, why the heck isn't AWS::EC2::SecurityGroup.VpcId of type AWS::EC2::VPC::Id? And second of all, how do I massage that into a string?
Thanks in advance!