feat(terraform): Add main Terraform configuration
This commit is contained in:
50
terraform/aws-infrastructure/main.tf
Normal file
50
terraform/aws-infrastructure/main.tf
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user