SAE application instances do not have public IP addresses and cannot directly access resources or services on the Internet. You can create an Internet NAT gateway in the virtual private cloud (VPC) of your SAE application. This gateway provides a proxy service that allows all SAE application instances to access the Internet.
When an SAE application accesses the Internet through an Internet NAT gateway, the source IP addresses of all application instance requests are converted to a single, static public IP address. This is suitable for most scenarios. For example, you can add the static public IP address to the whitelist of a public database service. Note that you must create an Internet NAT gateway for outbound traffic. This allows SAE application instances to access resources or services on the Internet and is required even if you have configured a Service or Ingress for inbound traffic.
In some scenarios, each SAE application instance may need an independent public IP address to connect to other public services. In this case, an alternative method to enable Internet access is to bind an EIP to each SAE application instance. Note that the public IP address of an application instance is dynamic because instances can be created or destroyed at any time.
Procedure
1. Create an Internet NAT gateway
If the VPC where your SAE application is deployed does not have an Internet NAT gateway, you can follow the steps in this section to create one.
If a gateway already exists, skip this step and proceed to configure the existing Internet NAT gateway instance. To avoid potential route conflicts, create only one Internet NAT gateway instance in a VPC.
- Log on to the NAT Gateway console.
- In the top navigation bar, select the region where you want to create the NAT gateway.
- On the Internet NAT Gateway page, click Create NAT Gateway.
When you create an Internet NAT gateway for the first time, click Create in the Notes on Creating Service-linked Roles section of the buy page to create a service-linked role. After the service-linked role is created, you can create Internet NAT gateways.
For more information, see Service-linked roles. Configure the following parameters, and then click Buy Now and then Activate Now. For more information, see NAT Gateway billing.
Set Region to the region where the SAE application is deployed.
For Network And Zone, select the VPC of the SAE application and the zone where you want to deploy the Internet NAT gateway instance. Then, select an existing vSwitch or create a new one.
Set Network Type to Internet NAT Gateway.
For Elastic IP Address, select Purchase Elastic IP Address and configure Peak Bandwidth, or select Select Existing Elastic IP Address Instance. The Internet NAT gateway instance is automatically attached to the specified EIP instance after the gateway is created.
On the Internet NAT Gateway page, you can view the Internet NAT gateway instance that you created and its attached EIP.
2. Configure an SNAT entry
- On the Internet NAT Gateway page, find the NAT gateway that you want to manage and click Configure SNAT in the Actions column.
On the SNAT Management tab, click Create SNAT Entry.
Configure the following parameters and click OK.
For SNAT Entry Granularity, select VSwitch, and then select all vSwitches where the SAE application instances are deployed.
For Select Elastic IP Address, select the public IP address of the attached EIP instance.
In the SNAT Entry List, you can view the SNAT entry that you created, the source CIDR block, and the public IP address used for translation.