How to connect to a webserver on ec2 'privately'

后端 未结 4 1990
花落未央
花落未央 2021-01-03 08:41

I have a little web application deployed on an ec2 instance and I\'d like to test it without making it publicly available.

Using an elastic IP does not solve my iss

4条回答
  •  半阙折子戏
    2021-01-03 09:32

    Create a security group that only allows traffic from your IP (the IP of the machine running the browser where you will do the testing) to the web server port (80, probably) and assign this security group to your ec2 instance.

    This way only you can access the web app.

    If you need to work from different locations, write a simple script to update the security group and add your current IP. These changes are applied immediately and do not require a restart. You can grab your current IP from whatismyip and use the Amazon SDK to update the security group.

提交回复
热议问题