Prompt
What should I use for environment-specific infrastructure without copy-paste?
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
Use infrastructure as code with reusable modules + environment-specific configuration.
A good pattern is:
- One shared codebase for all environments
- Reusable modules/components for common infrastructure
- Separate config per environment for differences like size, regions, instance counts, domains, and secrets
- Promotion flow where the same base config is applied to dev/stage/prod with different inputs
Common approaches:
- Terraform: modules +
*.tfvarsper environment - AWS CDK / Pulumi: shared constructs/components with env config
- CloudFormation/SAM: nested stacks / parameters
- Kubernetes: base manifests + Kustomize overlays, or Helm charts with per-env values
Example idea:
modules/network,modules/app,modules/dbenvs/dev.tfvarsenvs/stage.tfvarsenvs/prod.tfvars
This avoids copy-paste while still letting each environment differ safely.
If you want, I can show a concrete folder structure for Terraform, CDK, or Kubernetes.