Manage environments
Add, rename, recolour, reorder and delete the environments secrets are kept in.
Replace qa with the environment's slug and 7c6d5e4f-3a2b-4c1d-9e8f-7a6b5c4d3e2f with its id.
Prerequisites
- Permission for
secrets:CreateSecretEnvironmentto add,secrets:UpdateSecretEnvironmentto change,secrets:DeleteSecretEnvironmentto delete. In the console, alsosecrets:ListSecretEnvironmentsto open Environments; without it the page says your policies do not grant it. - A free unit of the environments quota to add one; see Quotas.
Add an environment
- Open Environments (in the Secrets navigation), and choose Manage environments.
- Choose Add environment.
- For Name, enter
QA. - For Slug, enter qa. It cannot be changed later.
- (Optional) Under Colour, choose a colour, or keep Automatic.
- Choose Add environment.
The console adds it last in the promotion order.
dcloud secrets environments create --slug qa --name QA --position 15POST /secrets/api/environments
{ "slug": "qa", "name": "QA", "position": 15 }resource "dcloud_secrets_environment" "qa" {
slug = "qa"
name = "QA"
position = 15
}The slug is lower-case letters, digits and hyphens, at most 63 characters, and unique in the
organization. Without position, it goes after the last environment (its position plus 10).
Rename, recolour or reorder
- In Manage environments, choose the pencil beside the environment.
- Change Name or Colour.
- Choose Save.
The console does not change the order; use the CLI, the API or Terraform.
dcloud secrets environments update 7c6d5e4f-3a2b-4c1d-9e8f-7a6b5c4d3e2f --color violet --position 25PATCH /secrets/api/environments/7c6d5e4f-3a2b-4c1d-9e8f-7a6b5c4d3e2f
{ "color": "violet" }{ "color": null } goes back to the automatic colour.
Change name, position or color on the dcloud_secrets_environment.
Delete an environment
In Manage environments, choose the bin beside the environment. It is shown only for an environment with no secrets and no apps, and deletes at once.
dcloud secrets environments delete 7c6d5e4f-3a2b-4c1d-9e8f-7a6b5c4d3e2fDELETE /secrets/api/environments/7c6d5e4f-3a2b-4c1d-9e8f-7a6b5c4d3e2fRemove the dcloud_secrets_environment and run terraform apply.
Refusals
409"An environment qa already exists".409"QA still holds 2 secret(s) and 1 app(s). Move or delete them first".409when the environments quota is full.