Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions PROJECT_STRUCTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Project File Layout

## Root-level files
- `main.tf` — provider + terraform block
- `backend.tf` — S3+DynamoDB remote state config
- `environment-vars.tf` — root variables consumed by *-usage.tf files
- `*-usage.tf` — one file per module call (vpc, alb, asg, rds, github-oidc). Each wires that module into the overall stack.
- `ansible-ssm-bucket.tf` — supporting S3 bucket for Ansible's SSM connection plugin (transient, 1-day lifecycle)

## modules/
- `vpc/` — networking foundation
- `alb/` — load balancer
- `asg/` — compute (autoscaling)
- `rds/` — database
- `github-oidc/` — CI identity federation
- `app-instance/`, `ec2/` — DEPRECATED (superseded by asg/ on Aug 17, kept for module-refactoring practice history, not called from root)

## environments/
Per-environment tfvars — dev.tfvars, prod.tfvars

## tests/
Native `.tftest.hcl` coverage (Aug 13)

## packer/, ansible/
Separate tool workflows, not Terraform-managed directly
8 changes: 0 additions & 8 deletions alb-usage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,4 @@ module "alb" {
Project = "terraform-mastery"
Environment = terraform.workspace
}
}

output "alb_url" {
value = "http://${module.alb.alb_dns_name}"
}

output "alb_target_group_arn" {
value = module.alb.target_group_arn
}
20 changes: 0 additions & 20 deletions asg-usage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,4 @@ module "asg" {
Project = "terraform-mastery"
Environment = var.environment_name
}
}

output "app_security_group_id" {
description = "ID of the application security group"
value = module.asg.app_security_group_id
}

output "asg_name" {
description = "Name of the application Auto Scaling Group"
value = module.asg.asg_name
}

output "launch_template_id" {
description = "ID of the application Launch Template"
value = module.asg.launch_template_id
}

output "target_group_arn" {
description = "ARN of the ALB target group used by the Auto Scaling Group"
value = module.alb.target_group_arn
}
3 changes: 3 additions & 0 deletions console-imports.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource "aws_s3_bucket" "june_website" {
bucket = "tanay-website-june-2026"
}
31 changes: 31 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Networking

output "vpc_id" {
value = module.main_vpc.vpc_id
}

# Compute

output "asg_name" {
value = module.asg.asg_name
}

output "app_security_group_id" {
value = module.asg.app_security_group_id
}

# Load Balancer

output "alb_url" {
value = "http://${module.alb.alb_dns_name}"
}

# Database

output "rds_endpoint" {
value = module.rds.db_endpoint
}

output "rds_secret_arn" {
value = module.rds.secret_arn
}
14 changes: 1 addition & 13 deletions rds-usage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,4 @@ module "rds" {
Environment = terraform.workspace
ManagedBy = "Terraform"
}
}

output "rds_endpoint" {
value = module.rds.db_endpoint
}

output "rds_secret_arn" {
value = module.rds.secret_arn
}

output "rds_security_group_id" {
value = module.rds.rds_security_group_id
}
}
14 changes: 1 addition & 13 deletions vpc-usage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,4 @@ module "main_vpc" {
Project = "terraform-mastery"
Environment = var.environment_name
}
}

output "vpc_id" {
value = module.main_vpc.vpc_id
}

output "public_subnets" {
value = module.main_vpc.public_subnet_ids
}

output "private_subnets" {
value = module.main_vpc.private_subnet_ids
}
}
Loading