Skip to content
Discussion options

You must be logged in to vote

03.26) 현재까지의 논의 내용 + 제시 의견 정리

협업 워크플로우 정리

단계 트리거 명령어 목적
Plan PR 생성 시 terraform plan -out=tfplan 변경사항 미리보기, 리뷰어가 승인 전 확인
Apply PR 머지 후 (수동 승인) terraform apply tfplan 실제 인프라 적용

구체적인 타이밍

1. terraform plan

  • 시점: Pull Request 생성 시 (GitHub Actions 자동 실행)
  • 목적: 코드를 머지하기 전에 어떤 변경이 일어날지 팀원들이 리뷰
  • Plan 결과는 PR 코멘트로 자동 첨부되어 팀원들이 확인

2. terraform apply

  • 시점: PR 이 승인되고 main 브랜치에 머지된 후
  • 방식:
    • 자동 실행 방식: 머지되면 바로 apply 실행 (개발 환경 등)

주요 원칙

PR 생성 → Plan 자동 실행 → 팀 리뷰 → PR 승인/머지 → Apply 실행
  • S3 백엔드는 상태 파일을 공유하고, S3 네이티브 상태 파일 락 기능으로 동시 실행을 방지합니다.
    • 해당 방식은 Terraform 1.10 이상부터 가능하기에 모든 개발자는 해당 버전으로 설치해야 합니다!
  • PR 에서 검토한 변경과 실제 적용 대상이 일치해야 하므로, 저장된 plan artifact 를 apply 하거나 merge 후 최신 기준으로 다시 plan/apply 를 수행…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@Hexeong
Comment options

Hexeong Mar 18, 2026
Maintainer Author

Comment options

Hexeong
Mar 26, 2026
Maintainer Author

You must be logged in to vote
2 replies
@whqtker
Comment options

@Hexeong
Comment options

Hexeong Apr 9, 2026
Maintainer Author

Answer selected by Hexeong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants