Skip to content

Week4: Terraform으로 AWS 인프라 프로비저닝 (VPC, EKS, ECR)#4

Merged
hjklo0220 merged 9 commits intomainfrom
feat/terraform
Apr 18, 2026
Merged

Week4: Terraform으로 AWS 인프라 프로비저닝 (VPC, EKS, ECR)#4
hjklo0220 merged 9 commits intomainfrom
feat/terraform

Conversation

@hjklo0220
Copy link
Copy Markdown
Collaborator

Summary

  • Terraform 루트 설정 및 .gitignore 추가
  • VPC 모듈: public/private 서브넷, NAT Gateway, S3 Gateway Endpoint
  • EKS 모듈: 클러스터(K8s 1.35), 노드그룹(t3.medium×2), IRSA, 애드온(ebs-csi, coredns, kube-proxy, vpc-cni)
  • ECR 모듈: devopsim/api 리포지토리
  • Interface VPC Endpoint 제거 (비용 절감, S3 Gateway만 유지)
  • EKS 배포용 PostgreSQL EBS 마운트 수정 및 production values 추가
  • CLAUDE.md AWS 인프라 현황 업데이트

Test plan

  • terraform plan 오류 없음 확인
  • EKS 클러스터 정상 접속 (aws eks update-kubeconfig)
  • kubectl get nodes Ready 상태 확인
  • Helm으로 api + db 배포 및 /health, /ready 응답 확인

🤖 Generated with Claude Code

hjklo0220 and others added 9 commits April 14, 2026 03:21
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- versions.tf: aws provider ~> 6.0, terraform >= 1.11.0
- backend.tf: S3 remote state (nurihaus-terraform-state/devopsim)
- variables.tf: region, project, environment, VPC, EKS variables
- main.tf: module wiring (vpc, ecr, eks)
- outputs.tf: vpc_id, subnet_ids, cluster_name, kubeconfig command

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- VPC 10.0.0.0/16, 2 AZ (us-east-2a/b)
- Public subnets: 10.0.0.0/24, 10.0.1.0/24
- Private subnets: 10.0.10.0/24, 10.0.11.0/24
- Internet Gateway, NAT Gateway (1개, 비용 절감)
- Public/Private Route Table
- VPC Endpoints: S3(Gateway), ECR API/DKR, STS, CloudWatch Logs
- kubernetes.io/role/elb, internal-elb 태그 (ALB Controller용)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- EKS Cluster (Kubernetes 1.35, public+private endpoint)
- Managed Node Group: t3.medium, desired 2 / min 1 / max 3
- IAM Roles: cluster, node group
- OIDC Provider for IRSA
- EBS CSI Driver addon + IRSA (StatefulSet PVC 지원)
- ALB Controller IRSA (Helm 설치는 week5)
- External Secrets IRSA (Helm 설치는 week5)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ECR repository: devopsim/api
- scan_on_push: true (CVE 스캔)
- Lifecycle policy: 최근 10개 이미지만 유지

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- main.tf: Cluster, Node Group, IAM Roles
- irsa.tf: OIDC Provider, EBS CSI/ALB Controller/External Secrets IRSA
- addons.tf: EBS CSI Driver addon
- Remove week-specific comments

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Interface Endpoints cost ~$14/month each (AZ x $0.01/h).
For a learning project with low traffic, NAT Gateway data
processing is cheaper. S3 Gateway Endpoint is free and
reduces NAT costs for ECR image layer pulls.

Also add docs/terraform.md with full infrastructure notes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- db statefulset: add PGDATA subdir to avoid lost+found conflict on EBS
- api values-production.yaml: ECR image, ALB ingress, resources
- ALB: internet-facing, target-type ip

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hjklo0220 hjklo0220 merged commit e455f7f into main Apr 18, 2026
@hjklo0220 hjklo0220 deleted the feat/terraform branch April 18, 2026 06:56
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant