When creating a post, please add:
- Module # must be added in the tags option of the post. (ex: Module-1)
- Link to the classroom item you are referring to:
- Description (include relevant info but please do not post solution code or your entire notebook)
Issue in the Terraform Assignment (Lab):
When attempting to create the SSH tunnel for the newly created RDB, it hangs. As per lab, the instructions are :
<RDS-HOST>
with the output from the commandterraform output db_host
,<DATABASE-PORT>
with the output from the commandterraform output db_port
,<BASTION-HOST-DNS>
with the output from the commandterraform output bastion_host_dns
:
ssh -i de-c2w3lab1-bastion-host-key.pem -L 5432:<RDS-HOST>:<DATABASE-PORT> ec2-user@<BASTION-HOST
My output from terraform output
:
terraform output db_port
5432
this seems suspicious as it’s the same as the local port?
terraform output bastion_host_dns
ec2-54-152-54-145.compute-1.amazonaws.com
terraform output db_host
"de-c2w3lab1-db.cxcsg80ioalq.us-east-1.rds.amazonaws.com"
so the final command for the SSH tunnel is:
ssh -i de-c2w3lab1-bastion-host-key.pem -L 5432:de-c2w3lab1-db.cxcsg80ioalq.us-east-1.rds.amazonaws.com:5432 ec2-user@ec2-54-152-54-145.compute-1.amazonaws.com -N -f
When running the command it hangs for a while and then times out:
ssh: connect to host ec2-54-152-54-145.compute-1.amazonaws.com port 22: Connection timed out
This implies that the local port is the same as the db port, nut I’m not sure how to fix the issue?