0

Does anyone know how to connect to an AWS Cloud9 Node.js application from the internet?

I have set up the Security Group and the Subnets as per the instructions.

I just don't know how to bind the server to the EC2 instance public DNS and port.

Any help appreciated.

Tom
  • 1,447
  • 1
  • 12
  • 26

1 Answers1

1

If you mean getting the Public IP, you would first make one using these steps based on if you need a permanent one or not.

Auto-Assigning Public IPv4 Address (Temporary IPv4 Address) (instructions here). This normal type of public IP will be changed upon every EC2 stop or termination, so if you want a permanent public IP, you would need to make an Elastic IP.

Elastic IPv4 (Permanent IPv4 Address) (instructions here). Do keep in mind that Elastic IP's have requirements that need to be met in order to remain free (requirements here)

To get your public IPv4 for your EC2 instance afterward, you would:

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. In the navigation pane, choose Instances.
  3. Select your instance. In the details pane, get the public IP address from the IPv4 Public IP field, and get the external DNS hostname from the Public DNS (IPv4) field.
  4. If one or more Elastic IP addresses have been associated with the instance, get the Elastic IP addresses from the Elastic IPs field.

Please let me know if this isn't what you meant.

  • 1
    Thanks. That's useful info and I'll mark it as an answer. The problem I was having was specific to AWS Cloud 9. I was previously running the Node server on Cloud9 using the shell command, something like NODE_ENV=development node index.js. For whatever reason, this was not working. Instead I used the node.js runner and set the environment variables in the run configuration and that worked. One of the many irritating differences when migrating from Cloud9 to AWS Cloud9. – Tom Apr 25 '19 at 05:24