Virtual Private Cloud (VPC) Open API
Introduction
The API gateway supports taking services in Virtual Private Cloud (VPC) as the backend, to quickly open to the outside in the form of API. The API gateway communicates with the backend of the VPC through the internal network to ensure the security of the backend service to the greatest extent.
Configuration Process
- Create a backend VPC configuration template;
- Use the VPC template to fill in the backend address when editing the API;
- Save and release API.
VPC template: That is, the configuration information of the VPC backend service. Its function is to fill in the API backend address when editing the API, instead of manually filling in the VPC backend configuration every time the API is edited, which can simplify the API configuration process.
Create a VPC Template
In the API Gateway console, click "VPC Template Management" in the sidebar.
After entering the VPC template management interface, click "New VPC Template".
Fill in the VPC template configuration in the pop-up window:
Fill in the template configuration in the following order:
- Fill in the name for the template to be created;
- Select the region where the VPC backend to configure is located;
- Select the VPC instance corresponding to the backend service from the "VPC instance" drop-down box;
- Fill in the intranet IP address of the backend service in the VPC in the IP column;
- Fill in the port corresponding to the backend service.
Click "OK" to complete the creation of the VPC template.
Configure API
For the specific configuration process of API, please refer to [API Management](https://cloud.baidu.com/doc/APIGW/s/Cjx2m51x9#Create api).
When defining the API backend configuration, click the "Backend Service Type" drop-down box and select "VPC".
Then click the "Backend Service Address" drop-down box and select the defined VPC configuration template.
Continue the subsequent process to complete the API configuration.
After completing the API configuration, release the API and you can access the backend services in the VPC through the API gateway.
Update VPC Template
There is no binding relationship between the VPC template and the API. The VPC template used for filling when editing the API will not affect the existing API configuration after being updated.
In the VPC template management interface, you can see a list of defined VPC templates. Click "Edit" in the corresponding template operation bar, and an edit window will pop up.
In the edit window, you can modify the existing VPC template.
Click “OK” to complete the update.
Note: The template update will not affect any existing API configuration. If you need to update the configuration of the API backend VPC, after updating the VPC template, you need to edit the API again, select the updated template, and then save and release it.