-3

There are some servers that are in private subnet and some are in public subnet. I want to remove nat gateway and make all instances that were in private subnet to get access through internet gateway. Please suggest me the procedure.

When I have added internet gateway and removed Natgateway then started getting API timeout, please suggest me the possible reason for the same.

Or Assayag
  • 5,662
  • 13
  • 57
  • 93
  • Are you saying that you are using AWS API Gateway, but requests are timing out? Is an associated AWS Lambda function being invoked? – John Rotenstein Dec 18 '20 at 07:54

1 Answers1

2

A "Public Subnet" is defined as a subnet that has a Route Table entry that points to an Internet Gateway.

Thus, if you want instances in the private subnet to have direct access to the Internet via the Internet Gateway, you will need to convert the private subnet into a public subnet. This can be done by adding a Route to the subnet's Route Table that directs traffic with a destination of 0.0.0.0/0 to the Internet Gateway.

Resources in the VPC that need to communicate with the Internet will need to be assigned Public IP addresses. This can be done for existing resources by assigning an Elastic IP address (which is a static IP address). However, there is a limit on the number of Elastic IP addresses available in each region.

Any new Amazon EC2 instances launched can be given a public IP address during launch, so they won't need an Elastic IP address.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470