By default, the value of the custom variable is hidden for security. Click Show to display the value, or Hide to hide it from view again.
While creating custom variables in Cloud Platform, ensure that you:
Custom environment variables aren’t encrypted, and aren’t a substitute for secure credentials. Custom environment variables can be exposed in your application’s Drupal watchdog logs. Acquia recommends you do not include sensitive items, like the following examples, in a custom variable:
To add a custom environment variable:
In the left menu, select Variables > Add Environment Variable.
Drupal_API_URLhttp://mydrupalsite.com/apiAfter your environment restarts, an item appears in the task log and the new variable is included in the Environment Variables list.
To update an existing custom variable:
After your environment restarts, an item appears in the task log and the variable’s new value is displayed in the Environment Variables list.
Custom environment variables are available in both the $_ENV and $_SERVER superglobals. To call a custom variable, add the following code to your settings.php file, modifying variable_name to meet your application’s needs:
$myVariable = $_ENV['variable_name'] ?? getenv('variable_name');To remove a custom environment variable from use:
After your environment restarts, an item appears in the task log and Cloud Platform removes the variable from the Environment Variables list.
To locate a specific custom environment variable, use the Filter Variables field in the upper-right corner of the webpage to filter your displayed variables based on your entered text.
The Cloud Platform API provides the following endpoints for working with custom environment variables:
| Function | Endpoint |
|---|---|
| Return a list of environment variables | GET /environments/{environmentId}/variables |
| Add a new environment variable | POST /environments/{environmentId}/variables |
| Retrieve an environment variable | GET /environments/{environmentId}/variables/{environmentVariableName} |
| Delete an environment variable | DELETE /environments/{environmentId}/variables/{environmentVariableName} |
| Update an existing environment variable | PUT /environments/{environmentId}/variables/{environmentVariableName} |
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Drupal_API_URLhttp://mydrupalsite.com/apiAfter your environment restarts, an item appears in the task log and the new variable is included in the Environment Variables list.
To update an existing custom variable:
After your environment restarts, an item appears in the task log and the variable’s new value is displayed in the Environment Variables list.
Custom environment variables are available in both the $_ENV and $_SERVER superglobals. To call a custom variable, add the following code to your settings.php file, modifying variable_name to meet your application’s needs:
$myVariable = $_ENV['variable_name'] ?? getenv('variable_name');To remove a custom environment variable from use:
After your environment restarts, an item appears in the task log and Cloud Platform removes the variable from the Environment Variables list.
To locate a specific custom environment variable, use the Filter Variables field in the upper-right corner of the webpage to filter your displayed variables based on your entered text.
The Cloud Platform API provides the following endpoints for working with custom environment variables:
| Function | Endpoint |
|---|---|
| Return a list of environment variables | GET /environments/{environmentId}/variables |
| Add a new environment variable | POST /environments/{environmentId}/variables |
| Retrieve an environment variable | GET /environments/{environmentId}/variables/{environmentVariableName} |
| Delete an environment variable | DELETE /environments/{environmentId}/variables/{environmentVariableName} |
| Update an existing environment variable | PUT /environments/{environmentId}/variables/{environmentVariableName} |
If this content did not answer your questions, try searching or contacting our support team for further assistance.