I am using the following code of Parameters to select the latest AMI. It works as execpted.
"Parameters" : {
"LatestAmiId" : {
"Type" : "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
"Default" : "/aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-ebs"
}},
Is there a similar way to select the subnet of default security group? I do not want to mention the subnet (or security group) like this...
"SubnetId": "subnet-e8ecf09c, subnet-aa9dfc90, subnet-ce083188, subnet-718bd259",
Update:
I am using the following code and it fails with an error " Value of property SubnetId must be of type String"
{
"Parameters": {
"LatestAmiId": {
"Type": "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
"Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-ebs"
},
"myKeyPair" : {
"Description" : "Amazon EC2 Key Pair",
"Type" : "AWS::EC2::KeyPair::KeyName"
},
"mySubnetIDs" : {
"Description" : "Subnet IDs",
"Type" : "List<AWS::EC2::Subnet::Id>"
},
"Oksoftaccess":{
"Type":"AWS::SSM::Parameter::Value<String>",
"Default":"myEC2TypeDev"
},
"Oksoftsecret":{
"Type":"String",
"Default":"mysecret1"
}
},