I have:
- A web EC2 instance in the private subnet (connected to a NAT gateway)
- A bastion EC2 instance in the public subnet (connected to the internet gateway)
I have tried many things to open the web application from a browser and have not succeeded:
- When I used the bastion instance to access the web instance to create port forwarding [ ssh -i KEY -ND LOCAL-PORT ec2-user@BASTION-PUBLIC-IP ] it asked me for a passphrase which I don't have.
- The key pair created by the AWS Console does not have a passphrase. When I used PuTTY Key Generator to create keys and imported to the console, the console wouldn't accept for a range of reasons e.g. key to long, incompatible format etc.
- I tried to create a load balancer, but the subnets are required to be connected to the internet gateway (which private subnets are not).
Please help!