Terraform (AWS)
Terraform scaffolding for AWS with S3 backend, per-environment configs, and common tagging.
What create-faster adds
A complete infra/ directory with AWS provider configuration, S3 remote state backend, and per-environment variable files. No npm dependencies are added -- Terraform is installed separately.
Files created:
infra/
├── providers.tf # AWS provider ~> 6.0, required_version >= 1.10, common tags
├── backend.tf # S3 backend declaration
├── variables.tf # region, project_name, env (dev/staging/prod validation)
├── variables.auto.tfvars # Defaults pre-filled with project name
├── secrets.auto.tfvars # Placeholder for sensitive values (gitignored)
├── outputs.tf # Empty placeholder for resource outputs
├── main.tf # Empty placeholder for your resources
└── backend/
├── dev.hcl # Dev environment S3 backend config
└── prod.hcl # Prod environment S3 backend configproviders.tf
Configures the AWS provider with:
- AWS provider
~> 6.0 - Terraform
>= 1.10.0(required for native state locking) local.resource_namecomputed as{project_name}-{env}local.common_tagsapplied to all resources viadefault_tags(Project, Env, ManagedBy)
backend.tf
Declares an empty S3 backend. Configuration is injected at init time via -backend-config:
terraform init -backend-config=backend/dev.hclvariables.tf
Three variables:
region-- AWS regionproject_name-- used in resource naming and tagsenv-- validated todev,staging, orprod
variables.auto.tfvars
Pre-filled with the project name, default region eu-west-3, and env = "dev".
secrets.auto.tfvars
Empty placeholder for sensitive values. Gitignored so secrets never reach the repository.
backend/ configs
Per-environment S3 backend configs with use_lockfile = true (Terraform >= 1.10 native file locking, no DynamoDB table needed). Fill in <BUCKET_NAME> and <AWS_PROFILE_*> placeholders before first use.
main.tf
Empty file where you add your infrastructure resources.
.gitignore
.terraform/, *.tfstate*, and secrets.auto.tfvars are added to .gitignore.
TanStack Start on Lambda
infra/ provisions no resource for any stack, TanStack Start included. When the project has a TanStack Start app, the generated AGENTS.md documents how to run it on AWS Lambda with Nitro's aws-lambda preset:
- Select the preset for the deploy build only (
NITRO_PRESET=aws-lambda npm run build, or thebun/pnpmequivalent, run from the app directory). Anaws-lambdabuild does not listen, so keep it out ofvite.config.tsand out of thebuildscript thatstartrelies on. - Zip
.output/serverand set the Lambda handler toindex.handler. - The preset does not serve
.output/public: serve it from S3 behind CloudFront, or embed it withserveStatic: 'inline'. - A buffered Lambda response is capped at 6 MB, so inlined assets suit a starter, not large media.
To get the function, bucket and CloudFront provisioned for you, use the SST deployment instead.
CLI usage
bunx create-faster myproject \
--app myproject:nextjs \
--deployment terraform-aws \
--pm bunInitialize and plan:
cd infra
terraform init -backend-config=backend/dev.hcl
terraform plan
