Infrastructure as Code (IaC) for deploying the AI Terraform Module Generator on AWS. This repository contains all the Terraform configurations needed to set up the production environment.
- ECS Fargate clusters for containerized services
- RDS PostgreSQL databases
- ElastiCache Redis cluster
- Application Load Balancer
- VPC networking setup
- CloudWatch monitoring
- IAM roles and policies
- S3 buckets for module storage
- Route53 DNS configuration
- AWS CLI configured with appropriate credentials
- Terraform 1.5+
- Docker for building container images
- Clone the repository:
git clone https://github.com/HappyPathway/ai-terraform-module-generator-infrastructure.git- Initialize Terraform:
terraform init- Configure variables:
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your configuration- Deploy:
terraform applyaws_region: AWS region to deploy toenvironment: Deployment environment (dev/staging/prod)vpc_cidr: VPC CIDR rangedomain_name: Domain name for the applicationdb_instance_class: RDS instance typeredis_node_type: ElastiCache node type
See variables.tf for all available variables and their descriptions.
├── environments/ # Environment-specific configurations
│ ├── dev/
│ ├── staging/
│ └── prod/
├── modules/ # Reusable Terraform modules
│ ├── ecs/ # ECS cluster and services
│ ├── rds/ # RDS database
│ ├── redis/ # ElastiCache cluster
│ ├── networking/ # VPC and network resources
│ └── security/ # Security groups and IAM
├── main.tf # Main Terraform configuration
└── outputs.tf # Output definitions
- Configure AWS credentials:
aws configure- Create backend state bucket:
aws s3api create-bucket --bucket your-tf-state-bucket --region your-region- Deploy infrastructure:
terraform init
terraform plan
terraform apply- Make changes to Terraform configurations
- Run:
terraform plan # Review changes
terraform apply # Apply changes- CloudWatch dashboards are available at AWS Console
- Logs are centralized in CloudWatch Logs
- Metrics are available in CloudWatch Metrics
- Regular maintenance tasks are documented in maintenance.md
- All databases are encrypted at rest
- SSL/TLS enabled for all services
- Security groups restrict access appropriately
- IAM roles follow least privilege principle
- Regular security patches via automated updates
MIT License - see LICENSE for details