Environment variables configured directly on an application always take precedence over values from an environment group. This override applies on a per-variable basis — if an app sets
API_KEY=xyz and a synced environment group has API_KEY=abc, the app-level value (xyz) is used.How Secrets Are Stored
Environment group secrets are automatically synced to the secret manager of every cloud account linked to your project that has a running cluster:- AWS — AWS Secrets Manager
- GCP — GCP Secret Manager
- Azure — Azure Key Vault
Creating an Environment Group
You can create a new environment group from the Env Groups tab on the Porter dashboard. Click New Env Group, enter a name, and add your variables and secrets. You can also create environment groups from the CLI:Variables and Secrets
Environment groups support two types of values:| Type | Description | Visibility |
|---|---|---|
| Variables | Non-sensitive configuration values (max 25 KB per value) | Visible in the dashboard and CLI after creation |
| Secrets | Sensitive values such as API keys, passwords, and tokens (max 25 KB per value) | Hidden after creation; stored in your cloud provider’s secret manager |
-s flag in the CLI) to mark a value as a secret.
Files
Environment groups can also contain files for sensitive data such as certificates or configuration files. Files are managed through the Porter dashboard and are injected into your application’s container at the path:Syncing Environment Groups to Applications
Environment groups can be synced to applications so that when the group is updated, all synced applications are automatically redeployed with the new values.From the Dashboard
You can sync an environment group to an application during app creation or by navigating to the application’s Env Groups tab and adding the group. Click Update app to apply.From porter.yaml
Add theenvGroups field to your porter.yaml:
envGroups must already exist in the project before deploying.
Updating an Environment Group
When you update an environment group, all applications synced to it are automatically redeployed with the new values.From the Dashboard
Navigate to the Env Groups tab, click the environment group you want to update, make your changes, and click Update.From the CLI
Useporter env set to add or update variables, and porter env unset to remove them:
Pulling Environment Variables Locally
You can pull the contents of an environment group to your local machine for development:The
--variables (-v) and --secrets (-s) flags are mutually exclusive. If neither is specified, both variables and secrets are included in the output.
