Working with environment groups

This pageapplies toApigee andApigee hybrid.

View Apigee Edge documentation.

This section describes how to create and edit environment groups, which includes addingenvironments or host names to a group, or removing them, with Apigee. Formore information about what an environment group is and how it works, seeEnvironments andenvironment group overview.

Creating environment groups

You can create new environment groups using the Apigee UI or theApigee API. Thissection describes how to do both.

When you first create an environment group, it does not contain any environments. It does,however, define a default hostname: example.group-name. To addenvironments to an environment group, seeAdding environments to an environmentgroup.

Apigee hybrid users: Every environment group you create with anattached environment must be included in all override files where the environment is used.

Apigee in Cloud console

To create a new environment group in Apigee in Cloud console:

  1. In the Google Cloud console, go to theManagement> Environments page.

    Go to Environments

  2. In theEnvironments pane, selectEnvironment Groups.
  3. Click+ Create Environment Group.
  4. Enter the following:
  5. ClickCreate.
Note: This operation may take up to five minutes to complete.

Classic Apigee

To create a new environment group in the classic Apigee UI:

  1. In theApigee UI, selectAdmin > Environments > Groups.
  2. Click+Environment Group:

    Add environment button

    TheAdd an Environment Group dialog displays.

  3. Enter a name for your new environment group:

    Add environment group

    The name can contain onlylower case letters, numbers, and hyphens. In addition, it must start with a letter, be at least two characters long, and cannot end with a hyphen. Valid names includemy-env-group andprod2.

  4. ClickAdd.

    Apigee creates a new environment group. This is usually a very quick operation.

    On a successful operation, Apigee confirms that the group has been created with a banner that looks like the following:

    Group confirmation banner

    Apigee also assigns a default host name to the new group.

  5. (Optional) Assign additional host names to the new group by clicking for that group.

    Apigee displays theEnvironment group details pane:

    Environment group details

  6. Add host names to theHostnames field. Each host name must be on a separate line.
  7. ClickSave when you're done.

    You can add and remove host names to this list at any time using the same procedure.

Apigee API

To create a new environment group using the Apigee API, send aPOST request to theCreate environment groups API. Before calling the API, be sure that you have a valid token, as describedinObtaining an OAuth 2.0 access token.

The following examplecurl command shows the syntax to create a new group:

curl -i $TOKEN -X POST \  https://apigee.googleapis.com/v1/organizations/ORG_NAME/envgroups?name=new-group-name

When specifying the new group's name, you must use only lower case letters, numbers, and hyphens(a-z,A-Z, and-). You cannot use upper case letters or anyspecial characters other than hyphens. You must also start the name with a lower case letter.

If you don't specify any additional parameters, this command creates a new group with no hostnames assigned to it.

You can also assign host names when you create the group by specifying them as an array in thebody of the request.

The following example creates a new groupmy-group and assigns three new host names tothe new group:

curl -i $TOKEN -X POST \  https://apigee.googleapis.com/v1/organizations/org_name/envgroups?name=my-group \  -d '{ \    "hostnames": ["server1.mycompany.com", "server2.mycompany.com", "10.1.142.8"] \  }'

You can later change the host names in the list by sending aPATCH request to thePatch environment groups API.

Adding environments to an environment group

Environments that are not in a group cannot be accessed because there is no host name associatedwith them. Host names are defined on the environment group, not the environment. When you create an environment using the Apigee UI in Google Cloud console, you have the option to assign the environment to an existing environment group. For more information, see Creating a new environment in the UI.

If you did not assign your environment to a group during environment creation, this sectiondescribes how to add an unassigned environment to an environment group using theApigee UI or the Apigee API.

Apigee in Cloud console

To add an environment to an environment group in the Apigee in Cloud console:

  1. Create the environment, as described inCreating environments.
  2. In the Google Cloud console, go to theManagement> Environments page.

    Go to Environments

  3. In theEnvironments pane, selectEnvironment Groups.
  4. In the environment group row, clickActions, and selectEdit.
  5. In theEdit Environment Group pane, underEnvironments (Optional), select the environment you want to add to the environment group.
  6. ClickUpdate.
Note: This operation may take up to five minutes to complete.

Classic Apigee

To add an environment to an environment group in the classic Apigee UI:

  1. Create the environment, as described inCreating environments.
  2. In theApigee UI, selectAdmin > Environments > Groups.
  3. Look underUnassigned to see a list of environments that are not part of an environment group:

    View unassigned environments

    Note which environments are unassigned as you want to assign them.
  4. Click next to the environment group to which you want to add environments.

    TheEnvironment Group Details pane displays:

    Group details pane

  5. To add a new environment to this group, click+ in theEnvironments list.

    TheAdd environment pane displays:

    Add environment to group dialog

  6. Select the environment you want to add to the group and clickAdd.

    Apigee adds the environment to the group.

Apigee API

To add a new environment to an environment group using the Apigee API, send aPOST request to theEnvironment group attachment API, as the following example shows:

curl -H "Authorization: Bearer $TOKEN" -X POST  "https://apigee.googleapis.com/v1/organizations/my-org/envgroups/test-group/attachments"  -d '{    "name": "my-attachment",    "environment": "test"  }'

Where:

  • $TOKEN is set to your OAuth 2.0 access token, as described inObtaining an OAuth 2.0 access token.
  • The body of the request contains the name of the attachment as well as the name of the new environment.

The body of the request contains an instance of anEnvironmentGroupAttachment resource, which is a simple wrapper around a single environment.

If successful, the response contains details about the new attachment, including the timestamp atwhich it was created; for example:

{  "name": "my-attachment",  "environment": "test"  "createdAt": "42"}

Removing an environment from an environment group

You can remove an environment from an environment group with the Apigee UI or theApigee API.

Apigee in Cloud console

To remove an environment from an environment group in the Apigee in Cloud console:

  1. In the Google Cloud console, go to theManagement> Environments page.

    Go to Environments

  2. In theEnvironments pane, selectEnvironment Groups.
  3. In the environment group row, clickActions, and selectEdit.
  4. In theEdit Environment Group pane, underEnvironments (Optional), deselect the environment you want to remove from the environment group.
  5. ClickUpdate.
Note: This operation may take up to five minutes to complete.

Classic Apigee

To remove an environment from an environment group in the classic Apigee UI:

  1. In theApigee UI, selectAdmin > Environments > Overview.
  2. Select the environment you want to remove.
  3. In theGroups pane, move the cursor to the end of the row for the group from which you want to remove the environment and clickTrash icon.
Note: Alternatively, if you are viewing theEnvironment groups page,you can the select the environment you want to remove in any pane where it appearsto open it in theGroups pane of theEnvironments page.

Apigee API

To remove an environment from an environment group using the Apigee API,use thedelete method in theEnvironmentGroupAttachment resource to delete the attachment corresponding tothe environment.

Deleting an environment group

You can delete an environment group using either the Apigee UI or the API.

Apigee in Cloud console

To delete an environment group in the Apigee in Cloud console:

  1. In the Google Cloud console, go to theManagement> Environments page.

    Go to Environments

  2. In theEnvironments pane, selectEnvironment Groups.
  3. In the environment group row, clickActions, and selectEdit.
Note: This operation may take up to five minutes to complete.

Classic Apigee

To delete an environment group in the classic Apigee UI:

  1. In theApigee UI, selectAdmin > Environments > Groups.
  2. Move the cursor to the pane for the group you want to delete.
  3. Click theTrash icon icon.

Apigee API

To delete an environment group using the Apigee API, use thedeletemethod in theEnvironmentGroup resource.

Adding host names to a group

When you create a group, Apigee adds the default hostnameexample.GROUP_NAME. Youcan add your host names to the group using the instructions in this section.

The hostnames that you define on an environment group:

  • Must be unique across all environment groups in an organization; they cannot be used by more than one group
  • Do not support wildcards
  • Base paths must be unique within a host (no two proxies can have the same base path within a host)

Apigee in Cloud console

To add a host name to an environment group in the Apigee in Cloud console:

  1. In the Google Cloud console, go to theManagement> Environments page.

    Go to Environments

  2. In theEnvironments pane, selectEnvironment Groups.
  3. In the environment group row, clickActions, and selectEdit.
  4. In theEdit Environment Group pane, underHostnames, enter the host name name you want to add to the environment group.
  5. ClickUpdate.
Note: This operation may take up to five minutes to complete.

Classic Apigee

To add a host name to an environment group in the classic Apigee UI:

  1. In theApigee UI, selectAdmin > Environments > Groups.
  2. Hover over the group's card and select.

    TheEnvironment group details pane displays:

    Group details pane

  3. In theHostnames field, enter your new hosts.
  4. ClickSave to add the new hosts to the group.
Note: This operation may take up to five minutes to complete.

Apigee API

To add host names to an environment group using theApigee API, send aPATCH requestto thePatch environment groups API. Be sure to set theupdateMask parameter tohostnames and specify the entire list of host names that you want: the value of thatfield in your requestreplaces the existing list.

The following example sets the host names for the test environment:

curl -H "Authorization: Bearer $TOKEN" -X PATCH  "https://apigee.googleapis.com/v1/organizations/my-org/envgroups/test-group?updateMask=hostnames"  -d '{    "name": "my-hostnames",    "hostnames": [      "test-1.example.com",      "test-2.example.com",      "test-3.example.com"    ]  }'

Where:

  • $TOKEN is set to your OAuth 2.0 access token, as described inObtaining an OAuth 2.0 access token.
  • The payload of the request specifies a name for the array of hostname attachments, plus the array of names themselves.

If the request was successful, the response contains anOperation resource.

Determining whether the Cloud Load Balancer is configured for a hostname

You can call a proxy with the following command:

curl -v https://YOUR_ENV_GROUP_HOSTNAME/myproxy

whereYOUR_ENV_GROUP_HOSTNAME is the hostname of an environment groupthat contains the environment in which the proxy is deployed. To do so, theCloud Load Balancermust be configured for the environment group hostname. Usually, the Load Balancer is configured whenApigee is firstprovisioned.To determine whether the Load Balancer is configured for the hostname:

  1. In the Google Cloud console, go to theApigee Management> Environments> Environment Groups page.

    Go to Environment Groups

  2. ClickMore,Edit next to an environment group.
  3. ClickConfigure Google Load Balancer with these domains This opens the Google Cloud Platform Load balancing page.
  4. Load balancing page in the Google Cloud Platform

  5. Click the name of the load balancer in theName column. If Apigee was provisioned with theProvisioning Wizard, the name of the load balancer will beapigee-proxy-url-map. If you don't see that name, contact the system administrator in your organization who provisioned Apigee.

    When you click the name, theLoad balancer details page is displayed:

    Load balancer details page in the Google Cloud Platform

  6. In theFrontend table, click an SSL certificate in theCertificate column and look for an SSL certificate that matches the hostname:
    • If theCertificate type isMANAGED, check whether theDNS Hostnames field of the certificate matches the hostname.
    • If the certificate is not managed, you may need to download the certificate and check whether its Common Name matches the hostname.

If you don't find the hostname in any certificate, contact your system administrator forfurther assistance.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.