dtan4 / terraforming

Export existing AWS resources to Terraform style (tf, tfstate) / No longer actively maintained
http://terraforming.dtan4.net/
MIT License
4.29k stars 657 forks source link

Introduce Plugin-based architecture #152

Closed dtan4 closed 5 years ago

dtan4 commented 8 years ago

WHY

Terraform itself supports a lot of providers, e.g. AWS, DigitalOcean, GCE, DNSimple ... Terraforming should also support them in the future.

I created terraforming-dnsimple to export DNSimple records & zones into tf & tfstate. This is a independent CLI tool, and maybe incompatible with (AWS-supported) Terraforming now. We want to use other provider with the same command terraforming, however, I don't want to include dependencies of other providers in this repository.

WHAT

Implement plugin-loader in Terraform. Plugin-loader loads gems named terraforming-{provider} automatically.

This is a sample code to find the latest terraforming-{provider} gems from installed gems.

specs = Gem::Specification.find_all.select { |spec| spec.name =~ /\Aterraforming-.+\z/ }.group_by { |spec| spec.name }.values.map do |gems|
  gems.sort_by { |spec| spec.version }.last
end

And also, remove CLI from current terraforming-dnsimple. It will have only the library.

REF

jfelixetcetera commented 8 years ago

Great idea; terraforming should be so much more than AWS. I've created a CloudFlare DNS plugin (which is just a fork of your DNSimple one). I will gladly convert this to a proper plugin when this support lands...

dtan4 commented 5 years ago

This is very stale. I'll reopen this once I come up with the new idea.