Terraform: Migrate CloudFormation To Terraform

Created on 25 Feb 2016  ยท  5Comments  ยท  Source: hashicorp/terraform

Is there currently a way (other than manually) to migrate cloud formation stacks to terraform profiles?

Currently I have 4 CloudFormation stacks that up and running using the same template (different parameters), but I would like to migrate the setup to TerraForm, with each stack being an environment. Is there an established guide to do this or automated utility.

Is there a way to allow TerraForm to take control of the existing stack without having to delete resources and then delete the CloudFormation "Stack" without deleting the associated resources?

core enhancement

Most helpful comment

@paulchen8709 I used the terraforming gem to get a starting point. You can use it to create your base template and get a state file referencing the existing resources.

All 5 comments

Looks like I found the answer to second part of my issue: It looks like if you update your stack with a deletion policy of retain on all objects. You can delete the stack without the associated resources. Then you could technically create the TerraForm file that manages the associated running resources.

However a tool that does this all automatically I think would be fantastic. Especially since you could consider CloudFormation and TerraForm competing.

Hi @bassrock! Currently there is no way to do this in Terraform itself, though there is a long running issue tracking this request at #581. You could take a look at the Terraforming gem which would give you a starting point, however. We'll continue to track this at #581 so I'll go ahead and close this issue for now. Thanks for giving Terraform a look!

Hi @bassrock ! I 'm in the same situation, and have 3 cloudformation template of the Jaspersoft need to be convert to Terraform version, do U have any solution/best practice on hand. Need your help indeed.

@paulchen8709 I used the terraforming gem to get a starting point. You can use it to create your base template and get a state file referencing the existing resources.

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings