Skip to content

Verified cloud accounts across 14 providers

Infrastructure as code for teams running more than one cloud account

Once there is more than one account, console configuration stops scaling. Describing infrastructure in code is what makes several environments stay comparable.

With one cloud account, clicking through the console is defensible. With three, it stops being: the environments drift, nobody can say what differs, and the difference is discovered during an incident. Infrastructure as code solves a narrow but important problem, which is keeping several environments honest about how they are configured.

What the practice actually gives you

  • A readable answer to “what is deployed”. The repository is the answer, and it can be reviewed without credentials.
  • Repeatability. A second or third environment is a parameter change rather than an afternoon of clicking.
  • Review before change. Infrastructure changes go through the same pull request and approval path as application changes.
  • A path back. Reverting a commit is a defined operation. Undoing a console session is not.

Structure the code around the account boundary

The pattern that holds up is a shared definition plus per environment inputs. The modules describing a network, a cluster or a database are written once. Each account gets its own small configuration supplying names, sizes and counts. Development and production then run the same code with different numbers, which is what makes staging a meaningful test.

Keep state separate per account

Whatever tool you use, it keeps a record of what it created. That record should be separate per account and per environment, stored remotely rather than on a laptop, and locked so two people cannot apply at once. Shared state across environments is the failure mode that turns a development change into a production outage.

Credentials for automation, not for people

The pipeline that applies infrastructure changes needs permission to create and destroy resources, which makes it one of the most privileged identities in the account. Three practices keep that manageable: give it its own identity per account rather than one credential spanning all of them, scope it to the resource types it actually manages, and prefer short lived credentials issued at run time over static keys stored in the pipeline.

Expect drift and decide how to handle it

Someone will eventually change something by hand, usually during an incident when that is the right call. The problem is not the change, it is the change going unrecorded. Two habits cover it: run a plan or diff on a schedule so drift is noticed within days, and treat emergency console changes as requiring a follow up commit rather than as something to feel bad about.

What not to put in code

Secrets do not belong in the repository, even encrypted, even in a private one. They belong in a secrets manager that the infrastructure code references. Similarly, data does not belong in infrastructure code: the code should create an empty database and the schema migration should populate it, so the two can be versioned and rolled back independently.

Starting from an existing account

Most teams adopt this with infrastructure already running, which feels like it requires a rebuild. It does not. A workable approach is to import the existing resources into code without changing them, confirm the tool reports no pending changes, and only then begin making changes through the code. That gets the benefit without a migration, and it surfaces how the account is actually configured, which is often the more valuable discovery.

Chat on Telegram
Scroll to Top