There's more...

The public IP associated with the instance is transient. If we stop and start the instance, the IP will change. We can attach the Elastic IP to the instance in the same way we attached the Elastic IP to the NAT instance in Chapter 1, Getting Started with AWS Networking Components. In that case, the IP will not be changed if the instance is stopped and started.

If we had created an instance in a private subnet, it could not have been connected as there is no inbound route available from the internet. However, we can connect to it from the instance in the public instance. For that, we need to add an SG of the public subnet instance to the inbound rules of an SG of the private instance. Once we log into the private subnet instance, ...

Get AWS Networking Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.