diff --git a/terraform/aws-infrastructure/main.tf b/terraform/aws-infrastructure/main.tf new file mode 100644 index 0000000..5a73fce --- /dev/null +++ b/terraform/aws-infrastructure/main.tf @@ -0,0 +1,50 @@ +# AWS Multi-Tier Infrastructure - Main Configuration +# See README.md for full documentation + +terraform { + required_version = ">= 1.5.0" + + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 5.0" + } + } + + backend "s3" { + bucket = "terraform-state-prod-12345" # CHANGE THIS + key = "infrastructure/terraform.tfstate" + region = "us-east-1" + encrypt = true + dynamodb_table = "terraform-locks" + } +} + +provider "aws" { + region = var.aws_region + + default_tags { + tags = { + Environment = var.environment + Project = var.project_name + ManagedBy = "Terraform" + } + } +} + +# For full configuration see: +# http://git.thedevops.dev/admin/k3s-gitops/src/branch/main/terraform/aws-infrastructure +# +# This is a production-ready example that includes: +# - VPC with public/private subnets +# - Application Load Balancer +# - Auto Scaling Group +# - RDS PostgreSQL +# - S3 buckets +# - CloudWatch monitoring +# - IAM roles +# +# Quick start: +# 1. Copy environments/dev.tfvars to terraform.tfvars +# 2. Edit: project_name, db_password +# 3. Run: terraform init && terraform apply