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. Environment group names must be up to 63 characters and may only contain lowercase letters, numbers, and hyphens (-).
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:
Version History
Every update to an environment group creates a new version. You can view the full history of an environment group — including who made each change and when — from the Versions tab on the environment group’s page.Reverting to a Previous Version
If a change introduces a bad value or you need to roll back to a known-good configuration, you can revert an environment group to any previous version from the Versions tab.- Open the environment group from the Env Groups tab.
- Switch to the Versions tab.
- Find the version you want to restore and click Revert to v<n>.
- Review the diff between the current version and the target version, then confirm.
All applications synced to the environment group are automatically redeployed with the reverted values, just like a normal update.
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.
