Creating, Editing and Deleting Environments

On the Environments screen, you can set up new environments to deploy your APIs to.

Your Manager comes with a default environment configured. If you want to create a new environment, you must first register a new host for your environment on the Inbound Address page.

You can use the same host for multiple environments, complementing the address of each environment with a unique Inbound URL, following the instructions of this page. Then, all your environments will have their own URL.

Configuring a valid URL is crucial for the environment to function correctly. If you configure a URL forwarding the call to a different domain, the API resource to be consumed will not be found.

Creating an environment

You can set up a new environment by clicking the + on the bottom right corner of the Environments page.

There are two distinct sections to be filled out: the required data fields and the environment variables area.

Required fields

You must fill out the required fields, which comprise basic information and visualisation and deployment permissions.

new environment

Basic information

  • Name: name that identifies the environment.

  • Description: description that helps to identify the environment.

  • Host + Inbound URL: they comprise the URL that will represent the environment and receive requests made to the APIs deployed to it.

    • The Host field is required; you must select a domain registered on the Inbound Address screen.

    • When you select a host, you may complement the address in the Inbound URL field, which is optional. The URL will be displayed on the field for you to complete it (see the image below).
      host url

      You don’t need to complement the host with an inbound URL. However, note that each environment must have a unique URL. Since it’s possible to use the same host for multiple environments, you will need to add a unique inbound URL to all environments that share the same host.
      The security type that is displayed on the list of existing environments (either none, TLS or mTLS) isn’t configured on the Environments screen, but on Inbound Address. That’s where you can configure, then, if the URL will contain http:// or https://.
  • Gateway Pool: field to select which gateway pool in your contracted plan will attend the environment.

    You can always talk to your Business Partner if you want to contract more gateway pools.
    Once the gateway pool of an environment has been selected, it is not possible to edit that gateway pool.

Permissions

The Environment Deployment Permission field is related to the permission to deploy APIs to the environment. The Environment Trace Visibility field, in turn, allows restricting visibility access to Trace (that contains the list of calls to the APIs deployed to the environment at hand).

The visualisation constraints managed here are applied both to General Trace (which refers to all APIs) and API Trace (referring to a specific API and accessed via API card).
You can read more about visibility rules for Manager objects aqui.

For both fields, these are the permission options:

  • Organization: it will allow access to all the company’s users.

  • Teams: it will allows access to the team selected. Click here to learn more about creating teams.

  • Only me: it will allow access only to the user who created the environment.

Selecting the Teams or Only me option will enable the Add Users button. Through it, you can add individual users to give them access as well (see the image below).

users

Environment Variables

Environment variables are variables with unique values within a specific environment. They are used as extra configuration for each environment, allowing customising requests so as to easily alternate between different contexts. They are not required, but they make the process of designing and managing APIs easier.

The API Manager allows creating environment variables that can be used at several points of our platform such as the Target or Timeout at the API Destination, when enablig a Connector or in many different Interceptors (see the table below).

List of interceptors that allow the use of environment variables:

Traffic

Security

Mediation

Transformation

Time allowed
Spike arrest
Rate limit
Payload size
Cache write
Billing hits

XML Threat protection
JSON Threat protection
Time Token
IP Filtering
Encrypt
Data Obfuscation
CSRF Token

Service mashup
Service callout
Internall API Call

Query param
Header
Destination

A practical example: imagine that several APIs deployed to an environment have the same target destination and that, at a given moment, this destination changes. It would be necessary to alter the target destination of each API individually. However, if the destination had been set as an environment variable, all it would take is modifying the variable value in the environment at hand, and this would update the target destination of the APIs.

To register environment variables, you must create a variables map or import an existing one from another environment.

To add a map, click the ADD MAP button. A screen like the image below will pop up. You must insert a name to the map and may add a description.

add map

Now you can create environment variables, as a key-value pair in which both are strings.

new variables

The Type field allows you to change the variable type to one of the options below:

  • DEFAULT: It’s the default type for all variables, and it doesn’t change anything on its behavior.

  • SECURED: This type has its value encrypted. The decryption is only done by a Connector’s flow, adding more security when storing its credentials since the value isn’t retrievable in any other way.

You can also add a certificate, corresponding to the communication between the gateway and the backend, to be applied when the environment variable is used. To do that, click the icon certificate icon. A modal window will pop up for you to select the certificate, which must have been registered on the Certificates screen.

To import a map from another environment, click the IMPORT MAP button. When you start typing the environment name, the system will load the necessary information. Then, select the desired map and click on IMPORT MAP.

import map

The environment variables will be loaded. You can view them by clicking the icon to extend the tab next to the map’s name. You can edit or delete the variables by clicking the respective icons (icon edit or icon delete).

To add more variables, click the icon more info icon and, when the tab opens, click the + icon. On this same tab, you can click to edit the name and description of the map (icon edit) or delete it altogether (icon delete).

map delete

Example of use

As we mentioned before, an environment variable is a key-value pair in which both are strings. In the example below, two variables were created: one named destination, with a valid address, and one named rateLimit, with value 2.

add variable

The environment variable $destination can be used, for example, as an API endpoint. Then, when a request is made to that API, the gateway will direct the call to the address informed.

To set this up, you only need to reference this environment variable as the API’s target destination, as shown in the image below.

The Target Destination of an API is found on the Flows section of an API’s editing or creating process, by clicking the icon backend button on the diagram representing the request and response flows.
As of now the gateway utilizes connection reuse by default, for more information on how to manage it, refer to this page of our FAQs.
config destination variable
All environment variables, when referenced in APIs or interceptors, must be preceded by the $ symbol.

In the image below, we have an example of the $rateLimit environment variable being used in the Rate Limit interceptor. In this scenario, when a request is made to the API, the gateway will replace the number of calls with the value configured in the variable (in this case, the value 2).

rate limit

Editing an environment

The environment editing button is found on the list of existing environments, in the ACTIONS column.

To edit the data, click the icon edit icon and you’ll be redirected to the editing screen.

Deleting an environment

To delete an environment, click the icon delete icon in the ACTIONS column of the existing environments list and confirm the action by clicking the CONFIRM button.

If the environment you wish to delete has active API deployments, you will not be able to delete the environment. To do so, you must first disable the deployments.

Undeploying revisions of an environment

At the bottom of the Environments editing screen, all deployments associated with an environment are listed.

deployments actions

Click on icon delete deploy, in column ACTIONS to undeploy a revision.

When clicked, the following modal will be displayed:

modal undeploy

Click on the button CONFIRM to confirm the action.

When dissociating a revision, it will no longer appear in the list of deployments.
If you have Adaptive Governance enabled and have undeployed using the above method, you can enable it again using API Deployment on the Environments screen.
Thanks for your feedback!
EDIT

Share your suggestions with us!
Click here and then [+ Submit idea]