I started using AWS a couple days ago.
I would like to use the Cloud Formation service to deploy a stack, then be able to SSH into the deployed instance. While creating the template, I did not see an option to include a key pair.
According to this, I need to have a key pair from the start.
How can I deploy a stack with a key pair, so that I may SSH into it once it has been deployed?
I also tried altering the template in a text file by adding a KeyName section under parameters:
"Parameters" : {
"AccessControl" : {
"Description" : " The IP address range that can be used to access the CloudFormer tool. NOTE: We highly recommend that you specify a customized address range to lock down the tool.",
"Type": "String",
"MinLength": "9",
"MaxLength": "18",
"Default": "0.0.0.0/0",
"AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
"ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
}
"KeyName" : {
"Description" : " Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type": "String",
"MinLength": "1",
"MaxLength": "64",
"AllowedPattern": "[-_ a-zA-Z0-9]*",
"ConstraintDescription": "Can contain only alphanumeric characters, spaces, dashes, and underscores."
}
This results in the following error: "Template validation error: Template format error: JSON not well-formed."
I want to be able to remote into both Linux and Windows instances.