Can't SSH into AWS CloudFormation Stack Instance
The problem is that the CloudFormation template creates a RouteTable
with the default route 0.0.0.0/0 correctly pointing to the IGW, however you don't associate the RouteTable
with your subnets.
What you need to do is add these two Route Table Associations to the template:
"Subnet1RT":{
"Type" : "AWS::EC2::SubnetRouteTableAssociation",
"Properties" : {
"RouteTableId" : { "Ref": "RouteTable" },
"SubnetId" : { "Ref": "Subnet1" }
}
},
"Subnet2RT":{
"Type" : "AWS::EC2::SubnetRouteTableAssociation",
"Properties" : {
"RouteTableId" : { "Ref": "RouteTable" },
"SubnetId" : { "Ref": "Subnet2" }
}
},
Then Update the stack ...
And re-check the Route Table
Now you should be able to SSH to the instances:
~ $ ssh 54.209.123.119
Last login: Thu Nov 1 18:54:54 2018 from ...
__| __|_ )
_| ( / Amazon Linux AMI
___|\___|___|
https://aws.amazon.com/amazon-linux-ami/2018.03-release-notes/
[ec2-user@ip-10-0-2-229 ~]$
Hope that helps :)