1. Go to AWS API Gateway console.
2. In the left sidebar,
3. In the API details section,
awsome-books
.4. Click Create method.
5. In the Method details section,
${stageVariables.vpcLinkId}
. You define the vpcLinkId stage variable after deploying the API to a stage and set its value to the ID of the VpcLink.6. Scroll down to the bottom, click Create method.
7. Click Deploy API.
8. In the Deploy API modal,
prod
.9. Under the Stage details section, note the resulting Invoke URL. You need it to invoke the API. Before doing that, you must set up the vpcLinkId stage variable.
10. Scroll down to the bottom, in the Stage variables tab, click Manage variables.
11. In the Stage variables section, click Add stage variable.
vpcLinkId
.12. To view the results, use the URL you obtained in step 9. If you try to invoke more than once, you should see 2 internal IP addresses in 2 seperate subnets (Yours could be different from mine).
You can access the internal Network Load Balancer in a totally private VPC via AWS API Gateway with the VPC Link setting, which is incredible!