Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Has been cancelled
Deploy to Testnet / deploy-testnet (push) Has been cancelled
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
- Create main.tf with VPC, security groups, ECS, ALB, RDS, Redis, S3 - Add provider.tf with AWS provider configuration - Create variables.tf for infrastructure configuration - Add outputs.tf for infrastructure outputs - Implement ecs.tf with ECS task definitions and services - Add ecs_variables.tf for ECS-specific variables - Create comprehensive README.md with usage instructions - Implement state management with S3 backend and DynamoDB locking - Add security best practices (private subnets, encryption, secrets manager)
149 lines
3.2 KiB
HCL
149 lines
3.2 KiB
HCL
# Terraform variables for AITBC infrastructure
|
|
|
|
variable "project_name" {
|
|
description = "Project name"
|
|
type = string
|
|
default = "aitbc"
|
|
}
|
|
|
|
variable "environment" {
|
|
description = "Environment name (dev, staging, prod)"
|
|
type = string
|
|
validation {
|
|
condition = contains(["dev", "staging", "prod"], var.environment)
|
|
error_message = "Environment must be dev, staging, or prod."
|
|
}
|
|
}
|
|
|
|
variable "aws_region" {
|
|
description = "AWS region"
|
|
type = string
|
|
default = "us-east-1"
|
|
}
|
|
|
|
variable "vpc_cidr" {
|
|
description = "VPC CIDR block"
|
|
type = string
|
|
default = "10.0.0.0/16"
|
|
}
|
|
|
|
variable "availability_zones" {
|
|
description = "Availability zones"
|
|
type = list(string)
|
|
default = ["us-east-1a", "us-east-1b", "us-east-1c"]
|
|
}
|
|
|
|
variable "private_subnet_cidrs" {
|
|
description = "Private subnet CIDR blocks"
|
|
type = list(string)
|
|
default = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
|
|
}
|
|
|
|
variable "public_subnet_cidrs" {
|
|
description = "Public subnet CIDR blocks"
|
|
type = list(string)
|
|
default = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
|
|
}
|
|
|
|
variable "allowed_cidr_blocks" {
|
|
description = "Allowed CIDR blocks for security groups"
|
|
type = list(string)
|
|
default = ["0.0.0.0/0"]
|
|
}
|
|
|
|
variable "acm_certificate_arn" {
|
|
description = "ACM certificate ARN for HTTPS"
|
|
type = string
|
|
default = ""
|
|
}
|
|
|
|
variable "db_instance_class" {
|
|
description = "RDS instance class"
|
|
type = string
|
|
default = "db.t3.medium"
|
|
}
|
|
|
|
variable "db_allocated_storage" {
|
|
description = "RDS allocated storage in GB"
|
|
type = number
|
|
default = 20
|
|
}
|
|
|
|
variable "db_max_allocated_storage" {
|
|
description = "RDS max allocated storage in GB"
|
|
type = number
|
|
default = 100
|
|
}
|
|
|
|
variable "db_name" {
|
|
description = "Database name"
|
|
type = string
|
|
default = "aitbc"
|
|
}
|
|
|
|
variable "db_username" {
|
|
description = "Database username"
|
|
type = string
|
|
sensitive = true
|
|
}
|
|
|
|
variable "db_password" {
|
|
description = "Database password"
|
|
type = string
|
|
sensitive = true
|
|
}
|
|
|
|
variable "db_multi_az" {
|
|
description = "Enable multi-AZ for RDS"
|
|
type = bool
|
|
default = false
|
|
}
|
|
|
|
variable "db_backup_retention_period" {
|
|
description = "RDS backup retention period in days"
|
|
type = number
|
|
default = 7
|
|
}
|
|
|
|
variable "db_backup_window" {
|
|
description = "RDS backup window"
|
|
type = string
|
|
default = "03:00-04:00"
|
|
}
|
|
|
|
variable "db_maintenance_window" {
|
|
description = "RDS maintenance window"
|
|
type = string
|
|
default = "sun:04:00-sun:05:00"
|
|
}
|
|
|
|
variable "redis_node_type" {
|
|
description = "Redis node type"
|
|
type = string
|
|
default = "cache.t3.medium"
|
|
}
|
|
|
|
variable "redis_num_nodes" {
|
|
description = "Number of Redis nodes"
|
|
type = number
|
|
default = 2
|
|
}
|
|
|
|
variable "redis_snapshot_retention_limit" {
|
|
description = "Redis snapshot retention limit"
|
|
type = number
|
|
default = 5
|
|
}
|
|
|
|
variable "redis_snapshot_window" {
|
|
description = "Redis snapshot window"
|
|
type = string
|
|
default = "05:00-06:00"
|
|
}
|
|
|
|
variable "log_retention_days" {
|
|
description = "CloudWatch log retention in days"
|
|
type = number
|
|
default = 30
|
|
}
|