Files
2026-01-06 14:22:43 +00:00

2.1 KiB

🚀 Quick Start Guide

5-Minute Setup

Step 1: Clone Repository

git clone http://git.thedevops.dev/admin/k3s-gitops.git
cd k3s-gitops/terraform/aws-infrastructure

Step 2: Configure AWS

export AWS_ACCESS_KEY_ID="your-key"
export AWS_SECRET_ACCESS_KEY="your-secret"
export AWS_DEFAULT_REGION="us-east-1"

Step 3: Create Configuration

cp environments/dev.tfvars terraform.tfvars
vim terraform.tfvars

Required variables:

project_name = "myapp"
environment  = "dev"
db_username  = "admin"
db_password  = "SecurePassword123!"

Step 4: Deploy

terraform init
terraform plan
terraform apply

Deployment time: 15-20 minutes
Cost: ~$50-100/month (dev)


Post-Deployment

Get ALB DNS

terraform output alb_dns_name

Test Application

curl http://$(terraform output -raw alb_dns_name)/health

View All Outputs

terraform output
terraform output -json > outputs.json

Common Tasks

Update Infrastructure

vim terraform.tfvars  # Make changes
terraform plan
terraform apply

Scale Application

# Edit terraform.tfvars
asg_desired_capacity = 5

terraform apply

View Logs

# CloudWatch Console
open https://console.aws.amazon.com/cloudwatch

# Or AWS CLI
aws logs tail /aws/ec2/dev/system --follow

Cleanup

Development

terraform destroy -var-file="environments/dev.tfvars"

Production (⚠️ Dangerous)

# Create backup first!
terraform destroy -var-file="environments/production.tfvars"

Troubleshooting

Issue: "Error creating VPC"
Solution: Check AWS limits

Issue: "Insufficient permissions"
Solution: Ensure IAM user has required permissions

Issue: "State lock timeout"
Solution: terraform force-unlock <LOCK_ID>


Next Steps

  1. Read README.md
  2. Review security best practices
  3. Setup CI/CD pipeline
  4. Configure monitoring

Getting Help