If an ECS instance in a VPC needs to provide external services, you can bind an Elastic IP (EIP) to the ECS instance.
An EIP is a public IP address resource that you can purchase and possess independently. It can be dynamically bound to a VPC ECS instance without restarting the ECS instance. For more details, refer to EIP overview.
Log on to the EIP console.
Click Apply for Elastic IP.
On the purchase page, configure the EIP and click Buy Now.
Go back to the Log on to the EIP console after completing the purchase, and click Bind next to the target EIP.
In the Bind dialog, select the ECS instance to be bound and then click OK.
Note: Ensure the ECS instance is in the Running or Stopped status, and the ECS instance does not have a system allocated public IP or is bound with any other EIPs.
After binding an EIP, the ECS instance can access the Internet through the EIP. You can unbind and release the EIP whenever there is no need to provide external services. For more information, see Manage an EIP.