Terraformer

Is a fork of the original package that allows you to export resources to Terraform style (tf, tfstate)

Supported version

Ruby 2.1 or higher

Installation

$ gem install terraform-exporter

Prerequisites

AWS credentials.

export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXXXX
export AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export AWS_REGION=xx-yyyy-0

You can also pass them as options --aws_access_key_id --aws_secret_access_key --aws_region

Datadog credentials

export DATADOG_API_KEY=XXXXXXXXXXXXXXXXXXXX
export DATADOG_APP_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

You can also pass them as options --datadog_api_key --datadog_app_key

Usage

$ terraformer
Commands:
  terraformer cwa              # CloudWatch Alarms
  terraformer dm               # Datadog Metrics
  terraformer help [COMMAND]   # Describe available commands or one specific command

Options:
  [--merge=MERGE]                                 # tfstate file to merge
  [--name=NAME]                                   # name of the tf file
  [--aws_access_key_id=AWS_ACCESS_KEY_ID]         # Aws access key
  [--aws_secret_access_key=AWS_SECRET_ACCESS_KEY] # Aws access key
  [--aws_region=AWS_REGION]                       # Aws region
  [--datadog_api_key=DATADOG_API_KEY]             # Datadog api key
  [--datadog_app_key=DATADOG_APP_KEY]             # Datadog app key

Contributing

  1. Fork it ( https://github.com/intercom/terraformer/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request