Prasanna P
Prasanna P

Reputation: 114

terraform upgrade by creating a state file from scratch for an existing code and infrastructure

I have a terraform repo and infrastructure and its state in s3. But its 0.11 version of terraform and all the modules used in the code were never upgraded. Now it has become a useless piece of code and a bottleneck. Here is my plan:

  1. Create a new terraform repo with new folder structure with latest modules.
  2. Create the code with latest terraform version
  3. Create a statefile for the existing infrastructure from old statefile. with UIDs and etc.
  4. Terraform plan and apply but there should be no resource recreation or changes.

Now i have two terraform repos for the same infrastructure and i retire the old one.

Is it possible?

Upvotes: 0

Views: 203

Answers (0)

Related Questions