Working with environments

This page applies to Apigee and Apigee hybrid.

View Apigee Edge documentation.

This section describes how to create, edit, and delete environments with Apigee.

About environments

An environment is an isolated area within an organization where you can create and deploy API proxies. You create an environment during provisioning, and can later add more environments to your organization.

Environments and instances

Each environment must be attached to at least one Apigee instance. An instance is a region-specific virtual machine. Attaching an environment to an instance means the instance loads, deploys, and serves proxies for the environment.

The instance or instances an environment is attached to should match the region or regions with the most traffic for the environment. You can add the environment to an instance or move it to a different instance if more of the traffic is in the new instance's region.

To set and change the environment's instance, see Attaching or removing an environment from an instance.

Creating environments

You can create a new environment using the Apigee UI or the Apigee API, as described in the following sections. Before you begin, it is important to note that Apigee and Apigee hybrid have limits on the number of environments and environment groups you can create per organization and per region. For details, see Limits: Environment and organization.

Creating a new environment in the UI

To create a new environment in Apigee Apigee UI:

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

    Go to Environments

  2. In the Environments pane, click + Create Environment.
  3. In the Create an environment pane, enter the following:
    • Select environment type: If you are a Pay-as-you-go customer, click Select to choose the type of environment you want to create: Base, Intermediate, or Comprehensive.

      The selection of environment type does not apply to Subscription customers and will not appear in the 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.

    • Display Name: The name for the environment that is displayed in the UI.
    • Description: Optional. A description of the environment.
    • Instance: Optional. Select the Apigee instance that will load, deploy, and serve traffic for the environment.
    • Environment group: Optional. Select a checkbox to add the new environment to an existing environment group. Click OK.
    • Deployment type: Select whether you want to deploy individual API proxies or an archive of your API proxy configuration environment. For more information, see Supported deployment types.
  4. Click Create.

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

Every new environment must be attached to an Apigee instance and an environment group.

If you did not attach your environment to an instance during creation, you can do this step in the Instances UI or using the Instances attachment create API. For an example of how to do this using the API, see Create an environment in the command-line provisioning documentation.

If you did not assign the new environment to a group during creation, you can follow the steps in Adding environments to an environment group. Environments not assigned to groups have no hostnames pointing to them, and therefore they are not accessible. For more information, see Creating environment groups.

If you have an Apigee organization with Pay-as-you-go billing, you may want to enable the Apigee API Analytics add-on in your new environment. For more information, see Manage the Apigee API Analytics add-on.

Creating a new environment with the Apigee API

This section describes how to create a new environment using the Apigee API.

Most steps in this process trigger long-running operations that can take several minutes.

To create a new environment with the Apigee API:

  1. Create the new environment with the Create environments API.
  2. Attach the environment to the runtime instance using the Instances attachment API.
  3. Create an environment group if you do not already have one. To do this, use the Create environment groups API.
  4. Attach the new environment to the environment group using the Environment group attachment API.

    Attaching an environment to the group makes the proxies in that environment routable via the hostnames in the group.

For detailed information and examples on using the Apigee APIs to create and attach new environments, see Create an environment in the command-line provisioning instructions.

Editing environments

This section describes how to edit existing environments in the Apigee UI and with the Apigee API.

Edit environments in the Apigee UI

You can change the following properties of an existing environment in the Apigee UI:

  • Display name: Enter a new display name for the environment.
  • Description: Enter a new description for the environment.
  • Environment group: Clear the previously selected checkbox and select the checkbox for the new environment group.

To edit environment in the Apigee Apigee UI:

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

    Go to Environments

  2. Select the project with the environments you want to update.
  3. Locate the row of the environment you want to edit, click Actions > Edit. The Edit environment dialog is displayed.
  4. Select environment type: If you are a Pay-as-you-go customer, choose an option under Select environment type to change the environment type. Options include Base, Intermediate, or Comprehensive.

    The selection of environment type does not apply to Subscription customers and will not appear in the UI.

  5. You can make any changes required in either the Display name or Description fields.
  6. In the Environment group listbox, you can clear the previously selected checkbox and select the checkbox for the new environment group.
  7. Click Update to save your changes.

Edit environments with the Apigee API

To edit an existing environment with the Apigee API, use the Get environments API to get the list of current properties that you can modify, and the Update environments API to set or change them.

Configure forward proxying on an environment

To configure forward proxying, set the forwardProxyUri value for the environment using the environments API.

Disable forward proxying for a proxy in the environment

If the traffic for a specific target of an API proxy should go directly to the backend target, bypassing the forward proxy, then set the following property in the TargetEndpoint to override the HTTP forward proxy:

<Property name="use.proxy">false</Property>

For more information on setting the TargetEndpoint properties, including how to configure the connection to the target endpoint, see Endpoint properties reference.

Set use.proxy to "true" for any TargetEndpoint that you want to go through an HTTP forward proxy:

<Property name="use.proxy">true</Property>

Deleting environments

Before deleting an environment, make sure to consider the following key points:

  • You must delete all key value maps and key value entries before you delete an environment. Otherwise, if you re-create the environment the key value map entry operations will encounter encryption/decryption discrepancies.
  • When you delete an environment with the Apigee API Analytics add-on enabled, the analytics data for the environment is also deleted. If you wish to retain analytics data for any environment, we recommend that you export and save your data in another location. For more information on saving your data, see Exporting data from Analytics. To learn more about the impact of environment deletion on Apigee API Analytics data, see Manage your Apigee API Analytics data

Deleting an environment with the Apigee UI

To delete an environment in the Apigee Apigee UI:

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

    Go to Environments

  2. Select the project with the environments you want to delete.
  3. Locate the row of the environment you want to delete, click Actions > Delete.

Deleting an environment with the Apigee API

To delete an environment, use the Delete environments API.