variable "instance_type" { type = string default = "t3.micro" } variable "subnet_id" { type = string }
Enter fullscreen mode
Exit fullscreen mode
7. terraform.tfvars
subnet_id = "subnet-0abc123456789def"
Enter fullscreen mode
Exit fullscreen mode
Subnet comes from:
Networking team
AWS console
Or remote state output
8. Commands App Team Runs (Real Production Flow)
terraform init terraform validate terraform plan terraform apply
Enter fullscreen mode
Exit fullscreen mode
No dependency on other teams’ pipelines.
9. Why This Is REAL Production Design
Separation of ownership
Team
Owns
Networking
VPC, Subnets
Security
Security Groups
App Team
EC2, ECS, ALB
Safety
App team cannot destroy VPC
App team cannot modify SG rules
Least privilege IAM
Scalability
50 teams → 50 Terraform states
Parallel deployments
Zero coordination overhead
10. Interview-Ready Explanation (Use This)
In production, each team owns its own Terraform project and state. Shared infrastructure like VPC and security groups are created by core teams and consumed using data sources or remote state. This prevents accidental deletion, enables parallel deployments, and enforces clear ownership boundaries.
11. Why Ubuntu AMI via Data Source Is Mandatory in Prod
❌ Hard-coded AMI ✔️ Dynamic AMI lookup
Benefits:
Automatic security patches
Zero code change for OS updates
CIS / SOC2 compliance
12. What This Demonstrates
Real DevOps ownership model
Data source vs resource
Production safety patterns
Terraform used as companies use it
For further actions, you may consider blocking this person and/or reporting abuse
Залишити відповідь