youyo / tfstore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tfstore

Create standard backend (S3+Dyanamodb) for terraform state files. https://www.terraform.io/docs/backends/types/s3.html

Install

  • Homebrew
$ brew tap youyo/tap
$ brew install tfstore

Other platforms are download from github release page.

Usage

  • simple way
$ tfstore
-------------------------------------
Creating stack...

bucket: tfstore-bucket-xxxxxxxxxxx
dynamodb_table: tfstore-DynamodbTable-xxxxxxxxxxx
region: ap-northeast-1
key: terraform.tfstate
encrypt: true

Terraform initialize command is

terraform init -backend-config 'bucket=tfstore-bucket-xxxxxxxxxxx' -backend-config 'dynamodb_table=tfstore-DynamodbTable-xxxxxxxxxxx' -backend-config 'key=terraform.tfstate' -backend-config 'region=ap-northeast-1' -backend-config 'encrypt=true'
-------------------------------------

$ terraform init -backend-config 'bucket=tfstore-bucket-xxxxxxxxxxx' -backend-config 'dynamodb_table=tfstore-DynamodbTable-xxxxxxxxxxx' -backend-config 'key=terraform.tfstate' -backend-config 'region=ap-northeast-1' -backend-config 'encrypt=true'
  • specific StackName
$ tfstore --stack-name custom-stack-name
.
.
.

Author

youyo

About

License:MIT License


Languages

Language:Go 100.0%