Skip to main content

Server inventory

What it is​

One table, in the project's infra repo, listing every server and managed service: what it runs, how it is reached, how it is deployed, backed up and monitored, who owns it, and when it should be deleted. Plus the same facts as tags on the AWS resources.

Why we do it​

We found stacks running for weeks with no DNS pointing at them, a bastion left on for a month, and a dev box running past its delete-after date. Each was found by accident. An inventory reviewed monthly finds them on purpose.

Steps​

1. Create INVENTORY.md in the infra repo​

NameKindEnvRunsAccessDeployTLSBackupMonitorOwnerDelete after
acme-prod-apiECS FargateprodAPInone (tasks)Pipeline on v-* tagACM on ALBn/aAlarms, SentryTech leadnever
acme-prod-dbAurora PostgreSQL 16prodMain databaseOne-off task in app subnetsTerraformin transit, RDS CA14-day PITR + monthly drillAlarmsTech leadnever
acme-toolsEC2 t4g.smallsharedFeature flags, ComposeSSM onlyBundle via S3 + SSMCaddyNightly pg_dump to S3Uptime + disk alarmDevOps ownernever
acme-demoEC2sandboxSales demoSSM onlyManualCaddynone (rebuildable)noneProject lead2026-12-31

Fill every column. "None" is an allowed answer if it is a decision, not a gap.

2. Tag every AWS resource​

TagExampleWhy
ProjectacmeCost by project
EnvironmentprodCost and access by environment
Ownertech-lead@example.comWho to ask
ManagedByterraform or manualManual resources are drift risks
DeleteAfter2026-12-31Temporary resources; a monthly check lists the overdue ones

Set default tags once in the Terraform AWS provider (default_tags), so nothing is forgotten.

3. Self-hosted servers outside AWS​

For a VPS or a client server, also record: provider, region, OS and version, SSH or VPN method, who holds the access, and where credentials are kept (the vault, never a file).

Check it worked​

# resources whose DeleteAfter date has passed
aws resourcegroupstaggingapi get-resources --tag-filters Key=DeleteAfter \
--query 'ResourceTagMappingList[].[ResourceARN, Tags[?Key==`DeleteAfter`].Value | [0]]' \
--output text | awk -v today=$(date +%F) '$2 < today'

Rules​

Rule

Server passwords and SSH keys live in the team vault, never in text files on a laptop or in a shared folder. A folder of server.txt files and private keys is one stolen laptop away from every server.

Rule

A resource created by hand gets ManagedBy = manual and a line in the inventory the same day, or it is deleted.

Done when​

  • INVENTORY.md lists every server and managed service, every column filled.
  • Default tags set in Terraform; manual resources tagged.
  • Credentials for self-hosted servers are in the vault only.