Isolating Apigee Environment URLs with Environment Groups

PCD By islever Editorial Last updated

Short answer

D Attach orders-test to the test environment group and orders-prod to the production environment group so each Apigee environment serves only its assigned URL.

Question

You work for an ecommerce company. You are designing a new Orders API that will be exposed through Apigee. In your Apigee organization, you created two new environments named orders-test and orders-prod.
You plan to use unique URLs named test.lnk-42.com/api/v1/orders and Ink-42.com/api/v1/orders for each environment. You need to ensure that each environment only uses the assigned URL. What should you do?
    1. Attach orders-test and orders-prod to the orders environment group.
    1. Attach orders-test and orders-prod to the orders environment group.
    1. Attach orders-test to the test environment group, and attach orders-prod to the production environment group.
    1. Attach orders-test to the test environment group, and attach orders-prod to the production environment group.
    Correct Answer

Key Takeaways

Apigee environment groups bind hostnames and base paths to environments. Option D is correct because attaching orders-test to the test environment group and orders-prod to the production environment group ensures each Orders API environment uses only its assigned URL.

Expert Analysis

D. API key authentication is simplest for B2B API access, where each partner gets a unique key. OAuth (B) is for user auth.

The decisive control is the environment-group binding, not the API proxy deployment or authentication policy. Apigee exposes an API through a hostname and base path that are associated with an environment group. When orders-test and orders-prod must answer only on test.lnk-42.com/api/v1/orders and lnk-42.com/api/v1/orders, each environment needs to be attached to the environment group that owns the corresponding hostname/base path. Option D describes that separation: attach orders-test to the test environment group and orders-prod to the production environment group. This gives each environment a distinct routing context and prevents the production URL from resolving to the test environment or the test URL from resolving to production.

Why the other choices fail

Options A and B attach both orders-test and orders-prod to the same orders environment group. A shared environment group places both environments under one hostname/base path context, so the requirement that each environment use only its assigned URL is not enforced. If the orders group is configured for the production host, the test environment could be exposed through the production URL; if it is configured for the test host, the production environment could be exposed through the test URL. Either way, the single group collapses the intended isolation.

Option C repeats the same action as D; D is the correct choice.

Applying the rule to the Orders API

A clean design would create two environment groups rather than one shared orders group. The first group would use the hostname test.lnk-42.com and the base path /api/v1/orders, with orders-test attached. The second group would use the hostname lnk-42.com and the same base path, with orders-prod attached. This keeps the proxy path stable while making the external URL the environment selector. It also makes the intent auditable: an operator can inspect the environment-group attachment to confirm that the test environment is not reachable through the production hostname and that the production environment is not reachable through the test hostname.

The underlying Apigee mechanism

An environment group is the object that maps external request URLs to environments. The hostname and base path are not properties of the API proxy itself; they are properties of the environment group and the environments attached to it. Therefore, the design should treat the URL as the routing boundary. The test URL is a boundary for orders-test, and the production URL is a boundary for orders-prod. The Orders API proxy can be deployed in both environments, but the environment-group attachment determines which external address reaches which environment.

This also explains why authentication choices do not solve the problem. API keys, OAuth, JWT, or service-account credentials can protect the API after a request reaches the correct environment, but they do not prevent the request from being routed to the wrong environment. The requirement is URL isolation, so the answer must be the configuration that separates the environments by their assigned hostnames and base paths.

Exam Strategy

For Apigee URL-isolation items, first identify whether the constraint is about routing or protection. If the requirement says each environment must use a unique hostname or base path, choose separate environment groups and attach one environment to each group. If the requirement says only authorized partners may call the API, choose authentication or policy enforcement. This prevents selecting an auth answer when the deciding word is URL.

Practice All PCD Questions

Access 84 questions with complete answers and detailed explanations.

View Full PCD Practice Test →

← Back to PCD Study Guide