Skip to content
All projects
Infrastructure as Code

CloudFormation to Terraform

Rebuilding a live EKS environment as 50+ Terraform-managed resources with zero disruption.

Result
Zero
disruption during migration
Where
CleverTap
2024
Stack
5 tools
Terraform · EKS · IPv6 · OIDC · GitHub Actions

Context

The EKS development environment was defined in CloudFormation, while the rest of the platform's tooling and modules had standardised on Terraform.

The problem

Two IaC tools on one platform means two mental models, two review paths, and modules that cannot be shared. Migrating is straightforward on paper and risky in practice: the environment is in use, and a mistake during import is indistinguishable from an outage.

  1. step: Changepull request
  2. control: OIDCshort-lived role
  3. step: terraform planposted on the PR
  4. control: Reviewhuman approval
  5. result: applyEKS, private IPv6
Every change is a reviewed plan, authenticated without static keys.

Approach

  1. 01

    Rebuild as explicit Terraform resources

    The cluster was re-expressed as 50+ Terraform-managed resources rather than wrapped or partially imported, so the state matches what the code says.

  2. 02

    Move networking to private IPv6 subnets

    The migration was the moment to change the network topology, since the addressing was being redefined anyway.

  3. 03

    Authenticate CI with OIDC, not keys

    Pipelines assume a role through OIDC rather than holding long-lived AWS credentials, so there is nothing static to leak or rotate.

  4. 04

    Route every change through plan-on-PR

    Terraform plans run on pull requests, so the effect of a change is reviewable before it is applied. This is what made the migration safe to do incrementally.