Veyra is an expert AI business mentor that helps you solve problems in your company, discover opportunities, and guides you step by step.
This repository contains Terraform code to manage Veyra's AWS infrastructure.
- Two environments:
developmentandproduction(underenvironments/). - Re-usable modules live under
modules/(common networking & IAM, backend service, EventBridge scheduler, Step Functions). - Terraform provider: AWS (~> 6.7). Terraform required version >= 1.11.0.
-
environments/
- development/
- locals.tf -> sets local.environment to "dev"
- variables.tf -> environment-specific variable defaults (region, backend_domain)
- main.tf -> wires modules for the development environment
- terraform.tfstate* -> (currently present in the repo; see State & Git notes)
- production/
- locals.tf -> sets local.environment to "prod"
- variables.tf -> environment-specific variable defaults
- main.tf -> wires modules for the production environment
- terraform.tfstate* -> (currently present in the repo; see State & Git notes)
- development/
-
modules/
- common/ -> VPC, subnets, security group, ECS task execution role and related IAM policies
- backend/ -> ECR, ECS cluster/service/task, ALB, RDS (postgres), S3 bucket, secrets, autoscaling, and related wiring
- eventbridge/business_research_scheduler/ -> IAM, Lambda placeholder, EventBridge Scheduler supporting resources
- step_functions/research_handler/ -> Step Functions state machine, IAM roles and access keys
- Terraform configuration in each environment declares:
- required_version = ">= 1.11.0"
- required_providers { aws = { source = "hashicorp/aws" version = "~> 6.7" } }
All environment Terraform configurations are self-contained under environments/<env>/ and use local relative module sources (e.g. ../../modules/*). The general workflow per environment is:
- cd into the environment directory
cd environments/development- Initialize (this will download providers and modules)
terraform init- Optionally upgrade provider/plugins (if you need newer provider versions allowed by the constraints)
terraform init -upgrade- Review a plan before applying
terraform plan- Apply the plan
terraform apply- Inspect outputs (after apply)
terraform output
terraform output -json-
Format files
terraform fmt -recursive
-
Validate configuration
terraform validate
-
See the dependency graph
terraform graph | dot -Tpng > graph.png
-
Refresh state only
terraform refresh
-
Show resource(s) in state
terraform state list
-
Get detailed state for a resource
terraform state show <resource_address>
-
Import existing resources (useful when bringing resources under Terraform control)
terraform import <address> <id>
-
Destroy everything in an environment
terraform destroy