Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cucxabong/tfit

Export resource from AWS into terraform format (HCL)
https://github.com/cucxabong/tfit

Last synced: 4 days ago
JSON representation

Export resource from AWS into terraform format (HCL)

Awesome Lists containing this project

README

        

Export existing AWS resources to [Terraform](https://terraform.io/) style (HCL)

- [What's this](#whats-this)
- [Supported Resources](#supported-resources)
- [Installation](#installation)
- [Usage](#usage)
- [CLI](#cli)
- [Library](#library)

## What's this
Inspired by [terraforming](https://terraforming.dtan4.net) & for learning purpose, I re-write that tool in Go (in form of library & CLI). Any feedbacks & suggestions are welcomed.

## Supported Resources
* EC2
* Instances
* VPC
* Subnet
* Security Group
* Route & Route Table
* Auto Scaling
* Auto Scaling Group
* Launch Configuration
* Route53
* Hosted Zone
* Resource Record Set
* IAM
* Policy
* Role
* User
* Group
* S3
* Bucket
* ELB
* **Updating ......**

## Installation
```bash
$ go get github.com/d0m0reg00dthing/tfit/cmd/tfit
```
## Usage
### CLI
```bash
$ $GOPATH/bin/tfit
Usage:
tfit [command]

Available Commands:
as AutoScaling Related
ec2 EC2 Related
help Help about any command
iam IAM Related
route53 Route53 Hosted Zones & Resource Record Sets
s3 S3 Related resources

Flags:
--access-key string AWS Access Key ID. Overrides AWS_ACCESS_KEY_ID environment variable
-h, --help help for tfit
--output string The output of HCL (Terraform config) contents (Default to StdOut)
--profile string AWS Profile. Overrides AWS_PROFILE environment variable
--region string AWS Region. Overrides AWS_REGION environment variable
--secret-key string AWS Secret Key. Overrides AWS_SECRET_ACCESS_KEY environment variable

Use "tfit [command] --help" for more information about a command.
```

#### Export S3 Buckets (Output to StdOut)
```bash
$ $GOPATH/bin/tfit--region us-east-1 --profile dev s3 buckets
```

```hcl
resource "aws_s3_bucket" "bar" {
bucket = "bar"

versioning {
mfa_delete = false
}
}

resource "aws_s3_bucket" "foo" {
bucket = "foo"

policy = <