51 lines
1.1 KiB
HCL
51 lines
1.1 KiB
HCL
# 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
|