This section describes how to manage the NAT IPs for Apigee instances.
Apigee provides ephemeral IPs and dedicated IPs. In many cases, ephemeral IPs are sufficient. If your backend doesn't require IP allow-listing, you will not need to manage NAT IPs, and Apigee will automatically allocate ephemeral IPs for egress.
If you require IP allow-listing, you can reserve and activate IPs so that Apigee uses static IPs for egress traffic.
To set NAT IP provisioning for your Apigee instance:
PROJECT_ID=YOUR_PROJECT_IDORG_ID=YOUR_ORG_ID
INSTANCE_NAME=YOUR_INSTANCE_NAME
NAT_ID=1st_NAT_IP_ID
PROJECT_ID=apigee-saas-prodORG_ID=apigee-saas-prod
INSTANCE_NAME=prod-us-west1-instance1
NAT_ID=nat-1
Where:
gcloud projects list
command to find it.nat-1
. The value of this parameter must not exceed 20 characters.On the command line, get your gcloud
authentication credentials, as the following example shows:
TOKEN=$(gcloud auth print-access-token)
To check that your token was populated, use echo
, as the following example shows:
echo $TOKEN
This should display your token as an encoded string.
For more information, see gcloud command-line tool overview.
operation_name
: operation_name=$(curl -H "Authorization: Bearer $TOKEN" \ "https://apigee.googleapis.com/v1/organizations/${ORG_ID}/instances/${INSTANCE_NAME}/natAddresses" \ -X POST -H "content-type:application/json" -d "{\"name\":\"${NAT_ID}\"}" | jq -r '.name')
done: true
by executing the following request: curl -s -H "Authorization: Bearer $TOKEN" "https://apigee.googleapis.com/v1/$operation_name"
operation_name
: operation_name=$(curl -H "Authorization: Bearer $TOKEN" \ "https://apigee.googleapis.com/v1/organizations/${ORG_ID}/instances/${INSTANCE_NAME}/natAddresses/${NAT_ID}:activate" \ -X POST -H "content-type:application/json" -d "{}" | jq -r '.name')
done: true
: curl -s -H "Authorization: Bearer $TOKEN" "https://apigee.googleapis.com/v1/$operation_name"
List the NAT IPs for an instance with the following command:
curl -H "Authorization: Bearer $TOKEN" \ "https://apigee.googleapis.com/v1/organizations/${ORG_ID}/instances/${INSTANCE_NAME}/natAddresses"
An example response would look like:
{ "natAddresses": [ { "name": "nat-1", "ipAddress": "35.203.160.18", "state": "ACTIVE" }, { "name": "nat-2", "ipAddress": "35.230.14.174", "state": "RESERVED" }, { "name": "nat-3", "state": "CREATING" } ] }
CREATING
: The NAT IP creation is pending. Not ready to be used.RESERVED
: The NAT IP has been created but not used. This gives you the opportunity to allow-list this IP before activating it.ACTIVE
: The NAT IP is being used to send egress traffic.DELETING
: The NAT IP is being deleted.You can delete NAT IPs with the following command:
operation_name
." operation_name=$(curl -H "Authorization: Bearer $TOKEN" \ "https://apigee.googleapis.com/v1/organizations/${ORG_ID}/instances/${INSTANCE_NAME}/natAddresses/${NAT_ID}" \ -X DELETE | jq -r '.name')
done: true
. curl -s -H "Authorization: Bearer $TOKEN" "https://apigee.googleapis.com/v1/$operation_name"
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-04-24 UTC.