I'm just starting to play with AWS services, more specific with CloudFormation. I'm following some of the AWS tutorials, and so far so good, but I'm stuck at one thing: once I generate the template as follows:
AWSTemplateFormatVersion: 2010-09-09
Resources:
Ec2Instance:
Type: AWS::EC2::Instance
Properties:
InstanceType:
Ref: InstanceTypeParameter1
ImageId: ami-07d02ee1eeb0c996c
Parameters:
InstanceTypeParameter1:
Type: String
Default: t2.micro
AllowedValues:
- t2.micro
- m1.small
- m1.large
Description: Choose the ec2 instance type
myKeyPair:
Description: Amazon EC2 Key Pair
Type: "AWS::EC2::KeyPair::KeyName"
Once I upload the template, and click on Next, I can choose the Amazon EC2 Key Pair as you can see in the pict:
And then I go to the EC2 console, I look the instance the CloudFromation just created, but I can't log-in using SSH protocol. As you can see in the image
I would like to log in in my EC2 instances created by CloudFormation, I thought that using the myKeyPair parameter:
myKeyPair:
Description: Amazon EC2 Key Pair
Type: "AWS::EC2::KeyPair::KeyName"
Would do the magic, but it doesn't. So: how can I?
