Step 3: Create an environment group

You are currently viewing version 1.13 of the Apigee hybrid documentation.This version is end of life. You should upgrade to a newer version. For more information, seeSupported versions.

In this step, you will create an environment and an environment group.

In Apigee, API proxies are deployed toenvironments, which provide isolated contexts for your proxies. Environments are organized intoenvironment groups, which provide hostnames for all the proxies deployed to environments within the group. You must have at least one environment and at least one environment group. To learn more, seeAbout environments and environment groups.

Create an environment

Create the environment first before creating the environment group. You can create an environment using the Apigee UI or using the API. You may want to use the UI for these steps to familiarize yourself with it.

Note: There is a new version of the Apigee UI, which is integrated with the Google Cloud console. The new UI is calledApigee in Cloud console. The instructions in the first two tabs below explain how to use either Apigee in Cloud console or classic Apigee UI.

Apigee UI

To create a new environment in the Apigee UI:

  1. In the Apigee UI, go toManagement > Environments.

    Go to Environments

  2. In theEnvironments pane, click+ Create Environment.
  3. In theCreate an environment pane, enter the following:
    • Name: The programmatic environment name. TheName can't be changed after it is created.

      The name must contain between 2 and 32 characters which can be lower-case letters, numbers, or hyphens. The name must begin with a letter and cannot end with a hyphen. The name must be different from any other environment name in your organization.

    • Display Name: The name for the environment that is displayed in the UI.
    • Description: Optional. A description of the environment.
    • Instance: Leave theInstance field blank. Instances do not apply to Apigee hybrid installations.
    • Environment group: Leave theEnvironment group field blank for now. You will create an environment group in the next procedure.
    • Deployment type: For most Apigee hybrid installations, select the option to deploy individual API proxies. You can optionally deploy an archive of your API proxy configuration environment. For more information, seeSupported deployment types.Note: The deployment type used with this environment cannot be changed after the environment is created.
  4. ClickCreate.
Note: This operation to create the environment may take up to five minutes.

Once complete, the new environment is displayed in the table in theEnvironments pane.

Classic Apigee UI

To access the UI and add an environment, perform the following steps:

  1. Open theApigee UI. If this is the first time you are logging in, hybrid displays a consent dialog. If you are prompted to select from more than one account, choose the account that owns the Google Cloud project you are using to install Apigee hybrid. Then clickAllow.
  2. Your browser navigates to the UI main landing page:

    The landing page in the Apigee    UI, which consists of left-hand navigation and large images that are links.

  3. Ensure that your organization is selected from the organization drop-down list. If it is not selected, select it from the drop-down list, as the following example shows:

    A list of organizations that are hybrid enabled

  4. ClickAdmin > Environments > Overview.

    The Apigee UI menu showing Admin, Environments, Overview expanded

    TheEnvironments view is displayed, with no environments (yet):

  5. Click+Environment.

    TheNew environment dialog is displayed:

    The new environment dialog

  6. Enter the following information in theNew Environment dialog:
    1. Display name(Required): A friendly name for the environment that is used in the UI. For example, "My First Environment" or "test". Unlike theEnvironment name, theDisplay name can include uppercase and other special characters.
    2. Environment name(Required): The programmatic name for the environment; also known as theenvironment ID.

      For example, "my-environment" or "test".

      Caution: An environment name can contain only lowercase letters, numbers, and hyphens. You cannot use uppercase letters or any other special characters. In addition, theEnvironment name can be up to a maximum of 32 characters long. For example:my-test-env ormy-test-env-42.

      TheDisplay name and theEnvironment name can be different.

    3. Description (Optional): Additional information about the environment that you want to add as a reminder of the purpose of the environment. For example, "Created during initial installation".
  7. Keep any other defaults and clickCreate.

    Apigee creates the new environment.

    You now need to create an environment group and add your new environment to the group.

Apigee API

To create an environment with theCreate environments API, perform the following steps:

  1. Open a terminal on the device you are using to manage Apigee.
  2. On the command line, get yourgcloud authentication credentials using the following command:

    Linux / MacOS

    export TOKEN=$(gcloud auth print-access-token)

    To check that your token was populated, useecho, as the following example shows:

    echo $TOKEN

    This should display your token as an encoded string.

    Windows

    for /f "tokens=*" %a in ('gcloud auth print-access-token') do set TOKEN=%a

    To check that your token was populated, useecho, as the following example shows:

    echo %TOKEN%

    This should display your token as an encoded string.

  3. Create the following environment variable:

    Linux / MacOS

    export ENV_NAME="YOUR_ENV_NAME"

    Windows

    set ENV_NAME="YOUR_ENV_NAME"

    Where:

    • ENV_NAME(Required) The environment name can contain lowercase letters, dashes, and numbers and must start with a lowercase letter. This name will be used as the identifier and cannot be changed after creation of the environment.
  4. Call the following Apigee API:

    No data residency

    curl -H "Authorization: Bearer$TOKEN" -X POST -H "content-type:application/json"   -d '{    "name": "'"$ENV_NAME"'"  }'   "https://apigee.googleapis.com/v1/organizations/$ORG_NAME/environments"

    Data residency

    curl -H "Authorization: Bearer$TOKEN" -X POST -H "content-type:application/json"   -d '{    "name": "'"$ENV_NAME"'"  }'   "https://$CONTROL_PLANE_LOCATION-apigee.googleapis.com/v1/organizations/$ORG_NAME/environments"

    On a successful creation request, the Environments API should respond with a message similar to the following:

    {"name":"organizations/hybrid-example/operations/c2aee040-7e79-4fd4-b0cf-79ca1b7098a8","metadata":{"@type":"type.googleapis.com/google.cloud.apigee.v1.OperationMetadata","operationType":"INSERT","targetResourceName":"organizations/hybrid-example/environments/example-env","state":"IN_PROGRESS"}}

    As thestate property in the response indicates, Apigee has started to create the new environment, so its state isIN_PROGRESS.

  5. Check to verify the environment was created successfully:

    No data residency

    curl -H "Authorization: Bearer$TOKEN" \          "https://apigee.googleapis.com/v1/organizations/$ORG_NAME/environments"

    Data residency

    curl -H "Authorization: Bearer$TOKEN" \          "https://$CONTROL_PLANE_LOCATION-apigee.googleapis.com/v1/organizations/$ORG_NAME/environments"

    On a successful creation request, the Environments API responds with a message similar to the following:

    [  "your-environment-name"]

Create an environment group

Now create an environment group and assign the environment you just created to it.

Apigee UI

To create a new environment group in the Apigee UI:

  1. In the Apigee UI, go toManagement > Environments > Environment Groups.

    Go to Environment Groups

  2. Click+ Create Environment Group.
  3. Enter the following:
  4. ClickCreate.
Note: This operation may take up to five minutes.

Classic Apigee UI

To create an environment group using the Apigee UI, perform the following steps:

  1. Open theApigee UI.
  2. Your browser navigates to the Apigee UI main landing page.

  3. Ensure that your organization is selected from the organization drop-down list. If it is not selected, select it from the drop-down list.
  4. ClickAdmin > Environments > Groups.

    TheEnvironment Groups Overview view is displayed:

    The Environment groups view

  5. Click+Environment Group.

    TheAdd an Environment Group dialog is displayed.

    Add Environment Group dialog showing blank Name field

  6. Enter a name and clickAdd.
  7. Hold the pointer over the newly-created environment group and clickEdit .

    Add a hostname that all proxies deployed to environments within this group will use. This should be a domain you have management access to. The hostname can be the domain itself, likeexample.com or it can include a subdomain likemy-proxies.example.com.

    If you need to register a domain, see a domain registrar likeGoogle Domains.

    Optionally, you can configure a load balancer for the domain. To learn more about load balancers, seeCloud Load Balancing overview.

    Edit Environment Group window showing no environments assigned

  8. ClickAdd (+) in theEnvironments box.
  9. TheAdd environment dialog displays.

    Add environment dialog listing available environments

  10. Select an environment from the list and clickAdd.
  11. ClickSave.

Apigee API

To create an environment group using the Apigee API:

  1. On the command line, get yourgcloud authentication credentials using the following command:

    Linux / MacOS

    TOKEN=$(gcloud auth print-access-token)

    Windows

    for /f "tokens=*" %a in ('gcloud auth print-access-token') do set TOKEN=%a
  2. Create the following environment variables:

    Linux / MacOS

    export DOMAIN="YOUR_DOMAIN"export ENV_GROUP="YOUR_ENVIRONMENT_GROUP"

    Windows

     data-terminal-prefix=">">set ENV_GROUP="YOUR_ENVIRONMENT_GROUP" data-terminal-prefix=">">set DOMAIN="YOUR_DOMAIN"

    Where:

    • DOMAIN(Required) This is the hostname that all proxies deployed to environments within this group will use. This should be a domain you manage. The address can be the domain itself, likeexample.com or it can include a subdomain likemy-proxies.example.com. If you don't have a managed domain, you can enter a placeholder for now. You can change the domain address later.
    • ENV_GROUP(Required) The environment name can contain lowercase letters, dashes, and numbers and must start with a lowercase letter. This name will be used as the identifier and cannot be changed after creation.
  3. Create the environment group:

    No data residency

    curl -H "Authorization: Bearer$TOKEN" -X POST -H "content-type:application/json" \   -d '{     "name": "'"$ENV_GROUP"'",     "hostnames":["'"$DOMAIN"'"]   }' \   "https://apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups"

    Data residency

    curl -H "Authorization: Bearer$TOKEN" -X POST -H "content-type:application/json" \   -d '{     "name": "'"$ENV_GROUP"'",     "hostnames":["'"$DOMAIN"'"]   }' \   "https://$CONTROL_PLANE_LOCATION-apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups"
  4. Assign the environment to the new group:

    No data residency

    curl -H "Authorization: Bearer$TOKEN" -X POST -H "content-type:application/json" \   -d '{     "environment": "'"$ENV_NAME"'",   }' \   "https://apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups/$ENV_GROUP/attachments"

    Data residency

    curl -H "Authorization: Bearer$TOKEN" -X POST -H "content-type:application/json" \   -d '{     "environment": "'"$ENV_NAME"'",   }' \   "https://$CONTROL_PLANE_LOCATION-apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups/$ENV_GROUP/attachments"
  5. Verify whether the environment group was created successfully with the following CURL command:

    No data residency

    curl -H "Authorization: Bearer$TOKEN" \  "https://apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups"

    Data residency

    curl -H "Authorization: Bearer$TOKEN" \  "https://$CONTROL_PLANE_LOCATION-apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups"

    On a successful creation request, the Environments Group API responds with a message similar to the following:

          {        "environmentGroups": [          {            "name": "your_envgroup_hybrid",            "hostnames": [              "apigee.hybrid.com"            ],            "createdAt": "1677826235324",            "lastModifiedAt": "1677826235324",            "state": "ACTIVE"          }        ]      }
  6. Fetch the latest attachments for the newly created environment group by using following CURL command:

    No data residency

    curl -H "Authorization: Bearer$TOKEN" \  "https://apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups/$ENV_GROUP/attachments"

    Data residency

    curl -H "Authorization: Bearer$TOKEN" \  "https://$CONTROL_PLANE_LOCATION-apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups/$ENV_GROUP/attachments"

    The environment group creation and attachment were successful if the result shows a unique hash value, as shown in the below sample response output:

            {          "environmentGroupAttachments": [            {              "name": "c27046d1-b83e-4cba-xxxx-caaa660b2bd6",              "environment": "your_envtest_hybrid",              "createdAt": "1677826263567",              "environmentGroupId": "your_envgroup_hybrid"            }          ]        }

Next step

To continue with the installation, go toPart 2: Hybrid runtime setup.

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 2026-02-19 UTC.