Prerequisites
- An ngrok account with an ngrok API key.
- The ngrok API documentation./docs/guides/migration/modules-to-traffic-policy-actions
- Tools like
curlor Postman (or ngrok’s own API libraries). - Understanding of your existing edge configurations.
- YAML formatting skills for creating Traffic Policies.
- A text editor to prepare YAML payloads.
Important notes
- Dry Run First: Test Traffic Policies without deleting anything.
- Backup Everything: Save JSON exports of your current configurations.
- Check your protocols: Not everything is supported on TCP / TLS.
1. Set up environment
Make sure you have:- NGROK_API_TOKEN (your personal or organization token).
- API Base URL:
https://api.ngrok.com.
2. Retrieve existing endpoint configurations
Get a list of all current endpoint configurations:3. Retrieve reserved domains and addresses
You must associate reserved domains and addresses with endpoint configurations manually. Reserved domains (HTTP / HTTPS):- For domains, check if
http_endpoint_configurationorhttps_endpoint_configurationis populated. - For addresses, check if
endpoint_configurationis populated.
4. Build a Traffic Policy for each endpoint
For each endpoint configuration:-
Analyze features enabled on the endpoint:
- OAuth? OIDC? Webhook verification? TLS termination?
- Request/response header modifications?
- IP restrictions?
- Circuit breaker or compression?
- Translate module configuration to Traffic Policy YAML. 📚 Guide: How to Migrate Each Endpoint Configuration Module to Traffic Policy Actions
5. Create a new Cloud Endpoint
Once your Traffic Policy YAML is ready: Create a new Cloud Endpoint:urlmatches the domain or address associated with the old configuration.traffic_policyis stringified and properly escaped, using third-party tools can help with this.
6. Delete the old endpoint configuration
Once the new endpoint is verified to work:7. Repeat for all endpoint configurations
- Repeat Steps 2-6 for every domain and address you have attached to the endpoint config.
- Be careful if endpoints have multiple domains/addresses attached.
What’s next?
Here are some guides to help get you started with Traffic Policy:- Learn how to take advantage of ngrok’s load balancing and traffic forwarding capabilities with Cloud Endpoints.
- Use Cloud Endpoints for path-based traffic routing and Traffic Policy decentralization.