Skip to content

모듈형 3-tier AWS Terraform 구조 구성 #61

@seonghooncho

Description

@seonghooncho

배경

운영 배포를 고려한 AWS 3-tier 인프라를 Terraform 모듈형 구조로 정리합니다.

요구사항

  • VPC: 2 AZ, Public/Private Subnet
  • Public Subnet에는 ALB, NAT Gateway만 배치
  • Private Subnet에는 App ASG(Spring Boot), RDS(MySQL), ElastiCache(Redis) 배치
  • MongoDB Atlas는 외부(Outbound Only)
  • ECR 사용
  • EC2는 SSM 관리(배스천 없음), SSM VPC Endpoint 우선 사용
  • 모듈 분리: vpc, alb, asg, rds, elasticache, security-group, iam, nat-gateway
  • 환경 분리: dev/prod
  • Remote backend: S3 + DynamoDB locking
  • Provider version pinning, 일관 태깅, 모듈 내 하드코딩 금지

산출물

  • infra/terraform 전체 디렉터리 트리
  • 각 모듈별 main.tf, variables.tf, outputs.tf 스켈레톤
  • environments/dev/main.tf wiring 예시
  • 운영 하드닝 노트

완료 기준

  • SG 체인: alb -> app -> rds/redis
  • ASG Launch Template + CPU 기반 스케일링 정책 예시 포함
  • RDS/Redis private only

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions