Acquia Copilot is a conversational AI connected into our product documentation and knowledge base. Ask Copilot about product features, technical details, troubleshooting and how to get started with Acquia products.
In addition to the environment variables provided by Cloud Platform, you can also create custom environment variables for your application using the Cloud Platform user interface or using the Cloud Platform API. These custom environment variables are set globally (on a per-application basis) and can be used to define anything your application may need to work with, including Drupal APIs and environments.
The Cloud Platform user interface enables you to add, edit, and delete custom environment variables quickly and easily. Since working with custom variables is restricted by permissions, the Cloud Platform interface contains the appropriate items for working with variables only if you have adequate permissions.
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:
Limit each variable value to a maximum of 5000 bytes.
Limit each variable name to a maximum of 255 bytes.
Limit the total size at 100 kilobytes, including all variables with their names and values.
Do not include tabs, spaces, or quotation marks in variable names and values.
Do not start variable names with "AH" or "ACQUIA".
Note
After changing a custom environment variable, you must start a new SSH session to see the updates to those variables.
In Cloud Next, modifying custom environment variables initiates the provisioning of new Drupal pods.
Additional environment variables are available for Pipelines.
Security considerations for custom variables
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:
Find the variable that you want to change, and click Edit.
Replace the information in the Value text box with your updated data.
Click Update.
After your environment restarts, an item appears in the task log and the variable’s new value is displayed in the Environment Variables list.
Calling a custom variable
Custom environment variables are available in both the $_ENV and $_SERVERsuperglobals. To call a custom variable, add the following code to your settings.php file, modifying variable_name to meet your application’s needs:
Find the variable that you want to delete, and click Remove.
Click Update.
After your environment restarts, an item appears in the task log and Cloud Platform removes the variable from the Environment Variables list.
Filtering for specific variables
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.
Custom variables in the Cloud Platform API
The Cloud Platform API provides the following endpoints for working with custom environment variables:
In addition to the environment variables provided by Cloud Platform, you can also create custom environment variables for your application using the Cloud Platform user interface or using the Cloud Platform API. These custom environment variables are set globally (on a per-application basis) and can be used to define anything your application may need to work with, including Drupal APIs and environments.
The Cloud Platform user interface enables you to add, edit, and delete custom environment variables quickly and easily. Since working with custom variables is restricted by permissions, the Cloud Platform interface contains the appropriate items for working with variables only if you have adequate permissions.
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:
Limit each variable value to a maximum of 5000 bytes.
Limit each variable name to a maximum of 255 bytes.
Limit the total size at 100 kilobytes, including all variables with their names and values.
Do not include tabs, spaces, or quotation marks in variable names and values.
Do not start variable names with "AH" or "ACQUIA".
Note
After changing a custom environment variable, you must start a new SSH session to see the updates to those variables.
In Cloud Next, modifying custom environment variables initiates the provisioning of new Drupal pods.
Additional environment variables are available for Pipelines.
Security considerations for custom variables
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:
Find the variable that you want to change, and click Edit.
Replace the information in the Value text box with your updated data.
Click Update.
After your environment restarts, an item appears in the task log and the variable’s new value is displayed in the Environment Variables list.
Calling a custom variable
Custom environment variables are available in both the $_ENV and $_SERVERsuperglobals. To call a custom variable, add the following code to your settings.php file, modifying variable_name to meet your application’s needs:
Find the variable that you want to delete, and click Remove.
Click Update.
After your environment restarts, an item appears in the task log and Cloud Platform removes the variable from the Environment Variables list.
Filtering for specific variables
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.
Custom variables in the Cloud Platform API
The Cloud Platform API provides the following endpoints for working with custom environment variables: