Supported versions:
Unsupported versions:
In this step, you will create an environment and an environment group.
In Apigee, API proxies are deployed to environments, which provide isolated contexts for your proxies. Environments are organized into environment 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, see About environments and environment groups.
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.
To create a new environment in the Apigee UI:
Name: The programmatic environment name. The Name 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.
Once complete, the new environment is displayed in the table in the Environments pane.
To create an environment with the Create environments API, perform the following steps:
On the command line, get your gcloud authentication
credentials using the following command:
export TOKEN=$(gcloud auth print-access-token)
To check that your token was populated, use echo, as the
following example shows:
echo $TOKEN
This should display your token as an encoded string.
for /f "tokens=*" %a in ('gcloud auth print-access-token') do set TOKEN=%aTo check that your token was populated, use echo, as the
following example shows:
echo %TOKEN%
This should display your token as an encoded string.
export ENV_NAME="YOUR_ENV_NAME"
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.
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"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 the state property in the response indicates, Apigee has started to create
the new environment, so its state is IN_PROGRESS.
curl -H "Authorization: Bearer $TOKEN" \
"https://apigee.googleapis.com/v1/organizations/$ORG_NAME/environments"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" ]
Now create an environment group and assign the environment you just created to it.
To create a new environment group in the Apigee UI:
Hostames: A list of host names that can be used to call proxies. Each host name must be on a separate line.
You also have the option to click Configure Google Load Balancer with these domains. This opens the Load balancing page in the Cloud console, where you can configure load balancing for the host names.
To create an environment group using the Apigee API:
On the command line, get your gcloud authentication
credentials using the following command:
TOKEN=$(gcloud auth print-access-token)
for /f "tokens=*" %a in ('gcloud auth print-access-token') do set TOKEN=%aexport DOMAIN="YOUR_DOMAIN"
export ENV_GROUP="YOUR_ENVIRONMENT_GROUP" 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, like example.com or it can include a
subdomain like my-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.
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"
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"
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"
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"
curl -H "Authorization: Bearer $TOKEN" \ "https://apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups"
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"
}
]
}
curl -H "Authorization: Bearer $TOKEN" \ "https://apigee.googleapis.com/v1/organizations/$ORG_NAME/envgroups/$ENV_GROUP/attachments"
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"
}
]
}
To continue with the installation, go to Part 2: Hybrid runtime setup.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-06-11 UTC.