Environments
Give each environment its own account, build them all from the same code, change staging before production, and delete preview copies on time.
- Required 4
- Recommended 2
An environment is one full copy of the service, such as development, staging or production. The rules here keep the copies alike, so a change that works in staging works in production. They also keep them apart, so a mistake in one cannot reach the others. Test data and the staging copy itself are covered in Keep a staging copy with fake data.
Required
Give each environment its own account
RequiredRun production in its own cloud account, project or subscription. Development, staging and previews each live in another one.
Build every environment from the same code
RequiredBuild all environments from the same modules. Let them differ only in values such as sizes, counts and names, kept in one file per environment.
Change staging before production
RequiredApply every infrastructure change to staging first. Apply the same commit to production only after the staging apply and its smoke tests pass.
Start every account from one baseline
RequiredCreate every new account from code with the same baseline. That means an audit log, a budget, blocked public storage, default encryption and the allowed regions.
Recommended
Delete preview environments on time
RecommendedGive each pull request its own short-lived environment from the same code. Delete it when the pull request closes, and after 72 hours at most.
Turn on threat detection in every account
RecommendedTurn on the cloud's managed threat detection in every account and region you use. Send high and critical findings to the on-call team within 15 minutes.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers infrastructure playbook: https://agentwranglers.se/playbook/infrastructure/environments.