I found the following API function for IBM Cloud Code Engine to list egress IP addresses.
In a shell and with the IBM Cloud CLI with Code Engine plugin, I performed the following steps:
- log in to IBM Cloud
ibmcloud iam oauth-tokens --output json
to obtain the access token
ibmcloud ce project list
to obtain the Code Engine project ID and region of my project
curl -X GET "https://api.REGION.codeengine.cloud.ibm.com/v2/projects/PROJECT_ID/egress_ips" -H "Authorization: Bearer TOKEN"
replace the parameters and call the API function
The list of returned IP addresses needs to be added in the allowlist.