Skip to main content

Environment model

Atlas uses three Terraform roots with the same file structure and mostly the same module graph:

  • terraform/staging
  • terraform/staging2
  • terraform/prod

The design goal is parity by structure and divergence by inputs, with one intentional shared-foundation exception for staging2.

Root comparison

Concernstaging rootstaging2 rootprod root
Folderterraform/stagingterraform/staging2terraform/prod
Current naming defaultsproject_name = "poc-atlas", environment = "dev"project_name = "poc-atlas", environment = "dev" with duplicated workload resources suffixed by 2project_name = "atlas", environment = "prod"
State keystaging/terraform.tfstatestaging2/terraform.tfstateprod/terraform.tfstate
Foundation ownershipowns its own VPC, subnets, security groups, MSK, and application ECR repositoriesreuses the staging VPC, subnets, approved security groups, MSK, and application ECR repositoriesowns its own independent production foundation
ALB and ECS planefirst staging workload planesecond staging workload plane with its own ALB and ECS clusterindependent production workload plane
MSK placementmsk_subnet_type = "public" in example valuesreuses the staging MSK placementmsk_subnet_type = "public" in committed prod values while public access is enabled
MSK connectivitymsk_enable_public_access = true, msk_enable_multi_vpc_connectivity = falsereuses the staging shared IAM + TLS path on 9098msk_enable_public_access = true, msk_enable_multi_vpc_connectivity = true
RDS placementdashboard and Camunda RDS use public subnet groups and public accessibilityits duplicated RDS instances attach to the shared staging subnets and shared approved security groupsdashboard and Camunda RDS use private subnet groups and no public accessibility
RDS durabilitysingle-AZ, easy teardown defaultssame durability defaults as staging unless overridden in terraform/staging2/terraform.tfvarsMulti-AZ and deletion protection enabled
Scheduled operationsenabled: start weekdays at 08:00, stop daily at 20:00, cleanup Lambda kept for manual use; DevOps Agent investigation Lambda exists only as test wiringnot provisioned from this rootdisabled by default
Image registry modelowns the shared staging application ECR repositoriesreuses the same staging application ECR repositories and allows base task definitions to stay staleowns its own production application ECR repositories
Log retention1 day defaults in active staging valuessame 1 day defaults unless the root values override them3 day application and collector values in production, with 7 days for the events New Relic sidecar

What stays aligned

  • Both roots use the same shared modules under terraform/modules.
  • All roots use the same shared modules under terraform/modules.
  • All roots provision the same application functional areas: ALB, ECS services, RDS, secrets, internal service discovery, and monitoring.
  • The operational pattern stays the same: bootstrap backend, initialize the root, make sure the correct application images already exist, apply infrastructure, then populate secrets.

What changes by environment

  • Naming prefixes and hostnames
  • ACM certificate IDs
  • Network shape and allowed CIDRs
  • MSK broker class and connectivity mode
  • RDS placement, durability, and access
  • Log retention and operational hardening
  • Whether the root owns the foundation directly or consumes shared outputs from another root
note

The staging directory name reflects the environment role, while the default input values inside that root still preserve the older poc-atlas-dev naming convention. Treat that as current reality, not as an inconsistency to paper over in docs.