API / APIGEE Gateway Interview Questions
What are Environment Groups and how does routing work in Apigee?
Environment Groups define the hostnames that route incoming API traffic to a set of environments. They are the mechanism by which Apigee maps a public URL hostname to one or more environments for request routing.
| Concept | Description |
|---|---|
| Environment Group | A named group of environments sharing a set of hostnames |
| Hostname | A domain name (e.g. api.example.com) that clients use to reach proxies in the group |
| Routing | Apigee routes inbound requests to environments based on the hostname in the request |
| Multiple environments | A group can contain multiple environments; Apigee routes to the one with the matching deployed proxy |
# Create an environment group with a hostname: gcloud apigee envgroups create prod-group \ --hostnames="api.example.com" \ --organization=my-org # Attach environments to the group: gcloud apigee envgroups attachments create \ --envgroup=prod-group \ --environment=prod \ --organization=my-org # DNS configuration: # api.example.com CNAME <apigee-external-ip>.nip.io # Or: create an A record pointing to the Apigee instance IP # Virtual host and base path routing: # Apigee routes requests using: # 1. The hostname in the HTTP Host header (maps to environment group) # 2. The base path in the request URL (maps to specific proxy) # # Example: # https://api.example.com/orders/v1/... -> orders-proxy (base path /orders/v1) # https://api.example.com/products/v1/... -> products-proxy (base path /products/v1)
More Related questions...