Things I do when provisioning my Linux AWS EC2 instances
Things I do when provisioning my Linux AWS EC2 instances
Things I do when provisioning my Linux AWS EC2 instances:
- Have proper networking: own VPC, separate subnets and security groups (no defaults).
- Enable SSM management and Tailscale in some cases, no need to expose the SSH service.
- Add a second disk with application data: this allows for easier migrations to newer operating systems by detaching and reattaching the data volume.
- Snapshot automatically (once or twice a day) with Data Lifecycle Manager and just a tag.
- Since “untested backup is no backup”: restore a snapshot into a throwaway instance on a schedule. This idea can be pushed a bit by standing up the backup instance and doing some basic checks on it.
- Tag the instance, use as many as you want, for ex with “Infra=True” to denote critical services, so it’s easy to filter in scripts or Terraform manifests or to group systems. Tags help keep track of costs as well.
- For prod instances, enable protection against stopping or termination.
- Set up CloudWatch agent and alarms for CPU, memory and disk space.
