Skip to content

Create environments/prd/ configuration #35

Description

@asmithml

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

  1. Create environments/prd/ by copying files from environments/dev/:

    • main.tf
    • variables.tf
    • outputs.tf
    • terraform.tfvars.example
  2. 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)
  3. 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)
  4. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions