humanmade / cf-to-tf

CLI tool for generating Terraform configuration and state for existing CloudFormation resources
Other
416 stars 70 forks source link

Cloudformation template support? #4

Closed dlobue closed 5 years ago

dlobue commented 5 years ago

Hey, great tool! Works perfectly for a cloudformation stack that has already been deployed! Any plans on adding support for converting cloudformation templates to tf format?

AWS has some very nice CF templates for production-ready clusters for quite a few apps: https://aws.amazon.com/quickstart/

The one for nomad, for example, sets up VPC, a bastion, consul, etc: https://aws.amazon.com/quickstart/architecture/nomad/

Currently learning terraform (and the rest of the hashicorp stack), I'd like to avoid having to add CF to that list.

Thanks!

nathanielks commented 5 years ago

Hi @dlobue!

My sincerest apologies for the delay in this response! My email was misbehaving all summer, so I missed a lot of notifications.

To your question! No, there aren't any plans on adding this functionality. I had considered that, but it wasn't something I had the bandwidth or interest in maintaining. It would require a lot of mapping CloudFormation resource names and parameters to Terraform, and with there being so many resources, it was just too much work I didn't feel like doing 😅 .

That said, a lot of parameters do map nearly 1:1, so you could feasibly look at a CloudFormation stack and copy most of it to Terraform and converting the parameters to lowercase snake_case. Easier said than done, of course 😛

nathanielks commented 5 years ago

For those interested, there is https://github.com/dtan4/terraforming, which can create associated terraform resources and state!