피드로 돌아가기
Terraform Lock-In Is Real: Here's How to Get Out
Dev.toDev.to
Infrastructure

Terraform Lock-in 4요소를 파악하고 단계별 마이그레이션으로 Exit Path 확보함

Terraform Lock-In Is Real: Here's How to Get Out

Muskan2026년 4월 2일6advanced

Context

2023년 8월 HashiCorp가 Terraform 라이선스를 MPL 2.0에서 BSL 1.1로 변경함. 이 변경으로 infrastructure 분야가 단일 vendor 도구에 얼마나 의존해 왔는지가 드러남. OpenTofu가 2024년 1월 GA로 등장하며 Fork 기반 Exit Ramp를 확보함.

Technical Solution

  • Lock-in 4요소 분석: HCL skill, 3,000개 이상 Providers, State file schema coupling, Module registry coupling을 각각 별도로 평가함
  • OpenTofu 선택 기준: BSL 라이선스 문제이거나 HCL 유지가 필요한 경우. Binary swap 수준의 migration effort임
  • Pulumi 선택 기준: HCL 자체가 제약인 경우. TypeScript, Python, Go, C#으로 infrastructure 코드 작성 가능함
  • 추상화 계층 분리: Internal module이 domain-meaningful input을 provider call로 변환함. Application team은 provider-specific resource를 직접 호출하지 않음

Impact

30+ 엔지니어 팀에서 80~200개 모듈 기준 6~12개월 migration effort가 소요됨. Incremental migration이 big-bang rewrite 대비 2배 빠른 완료율을 보임.

Key Takeaway

Migration cost를 분산시키지 말고 abstraction layer 하나에 집중해야 함. Provider나 tool이 변경되어도 application team은 변경하지 않아도 됨.


Terraform migration을 계획할 때 첫 번째로 production database cluster처럼 critical한 resource의 state file을 식별하고, S3 bucket for dev environment처럼 낮은 위험도의 module부터 시작해야 함. Greenfield new infrastructure는 target tool로 작성하고, CI/CD pipeline은 plan/apply workflow부터 변경해야 함.

원문 읽기