Can't SSH into AWS CloudFormation Stack Instance

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












I have a scalable load balancer set up right now that was mostly followed from this template:



https://github.com/satterly/AWSCloudFormation-samples/blob/master/LAMP_Multi_AZ.template



After adjusting the AWS::AutoScaling::AutoScalingGroup.CreationPolicy.ResourceSignal.Count key to 0 (basically allows for stack to load with no success signals received) I was able to load the stack and I can see all resources available.



I can see the public DNS of the keys being created, but I cannot SSH into the instance.



I have a opened up SSH access to everyone within my instance rules, I can confirm this within the AWS console.



I also configured a route for my VPC as recommended within the official AWS docs: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-ssh-troubleshooting/



I can see the instances exist, but it seems that I am restricting myself access somewhere. However within the AWS EC2 console, the settings seem to look the same as when I am able to SSH into an instance.



Here is my JSON template I'm using where you can view all my settings including my VPC, subnets, Security Groups, etc.: https://gist.github.com/dambrogia/e4cd93a64ae6f3a79d4a58d466f144f8



I am receiving a timeout error from the following command: (my id_rsa key is valid within ec2)



ssh -i ~/.ssh/id_rsa ec2-user@<ec2_instance>



How can I SSH into my instances? Thanks in advance for the help!










share|improve this question



















  • 2




    Thumbs up for including your actual CFN template! It really helps :)
    – MLu
    43 mins ago














up vote
3
down vote

favorite












I have a scalable load balancer set up right now that was mostly followed from this template:



https://github.com/satterly/AWSCloudFormation-samples/blob/master/LAMP_Multi_AZ.template



After adjusting the AWS::AutoScaling::AutoScalingGroup.CreationPolicy.ResourceSignal.Count key to 0 (basically allows for stack to load with no success signals received) I was able to load the stack and I can see all resources available.



I can see the public DNS of the keys being created, but I cannot SSH into the instance.



I have a opened up SSH access to everyone within my instance rules, I can confirm this within the AWS console.



I also configured a route for my VPC as recommended within the official AWS docs: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-ssh-troubleshooting/



I can see the instances exist, but it seems that I am restricting myself access somewhere. However within the AWS EC2 console, the settings seem to look the same as when I am able to SSH into an instance.



Here is my JSON template I'm using where you can view all my settings including my VPC, subnets, Security Groups, etc.: https://gist.github.com/dambrogia/e4cd93a64ae6f3a79d4a58d466f144f8



I am receiving a timeout error from the following command: (my id_rsa key is valid within ec2)



ssh -i ~/.ssh/id_rsa ec2-user@<ec2_instance>



How can I SSH into my instances? Thanks in advance for the help!










share|improve this question



















  • 2




    Thumbs up for including your actual CFN template! It really helps :)
    – MLu
    43 mins ago












up vote
3
down vote

favorite









up vote
3
down vote

favorite











I have a scalable load balancer set up right now that was mostly followed from this template:



https://github.com/satterly/AWSCloudFormation-samples/blob/master/LAMP_Multi_AZ.template



After adjusting the AWS::AutoScaling::AutoScalingGroup.CreationPolicy.ResourceSignal.Count key to 0 (basically allows for stack to load with no success signals received) I was able to load the stack and I can see all resources available.



I can see the public DNS of the keys being created, but I cannot SSH into the instance.



I have a opened up SSH access to everyone within my instance rules, I can confirm this within the AWS console.



I also configured a route for my VPC as recommended within the official AWS docs: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-ssh-troubleshooting/



I can see the instances exist, but it seems that I am restricting myself access somewhere. However within the AWS EC2 console, the settings seem to look the same as when I am able to SSH into an instance.



Here is my JSON template I'm using where you can view all my settings including my VPC, subnets, Security Groups, etc.: https://gist.github.com/dambrogia/e4cd93a64ae6f3a79d4a58d466f144f8



I am receiving a timeout error from the following command: (my id_rsa key is valid within ec2)



ssh -i ~/.ssh/id_rsa ec2-user@<ec2_instance>



How can I SSH into my instances? Thanks in advance for the help!










share|improve this question















I have a scalable load balancer set up right now that was mostly followed from this template:



https://github.com/satterly/AWSCloudFormation-samples/blob/master/LAMP_Multi_AZ.template



After adjusting the AWS::AutoScaling::AutoScalingGroup.CreationPolicy.ResourceSignal.Count key to 0 (basically allows for stack to load with no success signals received) I was able to load the stack and I can see all resources available.



I can see the public DNS of the keys being created, but I cannot SSH into the instance.



I have a opened up SSH access to everyone within my instance rules, I can confirm this within the AWS console.



I also configured a route for my VPC as recommended within the official AWS docs: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-ssh-troubleshooting/



I can see the instances exist, but it seems that I am restricting myself access somewhere. However within the AWS EC2 console, the settings seem to look the same as when I am able to SSH into an instance.



Here is my JSON template I'm using where you can view all my settings including my VPC, subnets, Security Groups, etc.: https://gist.github.com/dambrogia/e4cd93a64ae6f3a79d4a58d466f144f8



I am receiving a timeout error from the following command: (my id_rsa key is valid within ec2)



ssh -i ~/.ssh/id_rsa ec2-user@<ec2_instance>



How can I SSH into my instances? Thanks in advance for the help!







amazon-web-services amazon-ec2 load-balancing amazon-cloudformation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 42 mins ago









MLu

3,7131632




3,7131632










asked 2 hours ago









domdambrogia

1367




1367







  • 2




    Thumbs up for including your actual CFN template! It really helps :)
    – MLu
    43 mins ago












  • 2




    Thumbs up for including your actual CFN template! It really helps :)
    – MLu
    43 mins ago







2




2




Thumbs up for including your actual CFN template! It really helps :)
– MLu
43 mins ago




Thumbs up for including your actual CFN template! It really helps :)
– MLu
43 mins ago










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










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.



enter image description here



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 ...



enter image description here



And re-check the Route Table



enter image description here



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 :)






share|improve this answer




















  • Thank you so much for the in-depth answer and explanation. It worked like a charm!
    – domdambrogia
    6 mins ago










Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f938237%2fcant-ssh-into-aws-cloudformation-stack-instance%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
3
down vote



accepted










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.



enter image description here



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 ...



enter image description here



And re-check the Route Table



enter image description here



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 :)






share|improve this answer




















  • Thank you so much for the in-depth answer and explanation. It worked like a charm!
    – domdambrogia
    6 mins ago














up vote
3
down vote



accepted










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.



enter image description here



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 ...



enter image description here



And re-check the Route Table



enter image description here



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 :)






share|improve this answer




















  • Thank you so much for the in-depth answer and explanation. It worked like a charm!
    – domdambrogia
    6 mins ago












up vote
3
down vote



accepted







up vote
3
down vote



accepted






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.



enter image description here



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 ...



enter image description here



And re-check the Route Table



enter image description here



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 :)






share|improve this answer












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.



enter image description here



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 ...



enter image description here



And re-check the Route Table



enter image description here



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 :)







share|improve this answer












share|improve this answer



share|improve this answer










answered 44 mins ago









MLu

3,7131632




3,7131632











  • Thank you so much for the in-depth answer and explanation. It worked like a charm!
    – domdambrogia
    6 mins ago
















  • Thank you so much for the in-depth answer and explanation. It worked like a charm!
    – domdambrogia
    6 mins ago















Thank you so much for the in-depth answer and explanation. It worked like a charm!
– domdambrogia
6 mins ago




Thank you so much for the in-depth answer and explanation. It worked like a charm!
– domdambrogia
6 mins ago

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f938237%2fcant-ssh-into-aws-cloudformation-stack-instance%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

Long meetings (6-7 hours a day): Being “babysat” by supervisor

Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

Confectionery