Part of #33
Context
A new production environment directory is needed alongside environments/dev/. The prod environment will own the api.fieldsofthe.world domain and serve production traffic.
Steps
-
Create environments/prd/ by copying files from environments/dev/:
main.tf
variables.tf
outputs.tf
terraform.tfvars.example
-
Update environments/prd/main.tf:
- Change backend key to
prd/terraform.tfstate (same S3 bucket ftw-api-terraform-state-cdf18f31)
- All modules use
environment = var.environment (no hardcoded values)
-
Create environments/prd/terraform.tfvars with:
environment = "prd"
custom_domain_name = "api.fieldsofthe.world"
vpc_cidr_block = "10.1.0.0/16"
instance_type = "g6.2xlarge"
enable_embeddings_instance = false
- Same
external_role_arn and external_role_id as dev (Source Coop cross-account access)
-
Evaluate whether the S3 module is needed for prod. The API stores outputs in Source Coop, not in the local S3 bucket. The S3 bucket in dev is primarily used for embeddings test data. If prod does not need it, make the S3 module conditional or remove it from the prod main.tf.
Validation
cd environments/prd && terraform init succeeds
terraform validate passes
terraform plan shows expected resources (VPC, ALB, EC2 ASG, API Gateway, CloudFront, WAF, DynamoDB, SQS, IAM, Lambda authorizer)
Part of #33
Context
A new production environment directory is needed alongside
environments/dev/. The prod environment will own theapi.fieldsofthe.worlddomain and serve production traffic.Steps
Create
environments/prd/by copying files fromenvironments/dev/:main.tfvariables.tfoutputs.tfterraform.tfvars.exampleUpdate
environments/prd/main.tf:prd/terraform.tfstate(same S3 bucketftw-api-terraform-state-cdf18f31)environment = var.environment(no hardcoded values)Create
environments/prd/terraform.tfvarswith:environment = "prd"custom_domain_name = "api.fieldsofthe.world"vpc_cidr_block = "10.1.0.0/16"instance_type = "g6.2xlarge"enable_embeddings_instance = falseexternal_role_arnandexternal_role_idas dev (Source Coop cross-account access)Evaluate whether the S3 module is needed for prod. The API stores outputs in Source Coop, not in the local S3 bucket. The S3 bucket in dev is primarily used for embeddings test data. If prod does not need it, make the S3 module conditional or remove it from the prod
main.tf.Validation
cd environments/prd && terraform initsucceedsterraform validatepassesterraform planshows expected resources (VPC, ALB, EC2 ASG, API Gateway, CloudFront, WAF, DynamoDB, SQS, IAM, Lambda authorizer)