This project is a small shell wrapper script to handle multi-env and multi-region terraform deployments in the AWS cloud.
- An S3 bucket for each environment must be in place.
The environment, AWS region and terraform subcommand must be defined in the order below..
./tf_wrapper.sh [env] [region] [plan|apply|destroy|show|taint|untaint]
The 'plan' option will show what changes will be made and validates syntax...
$ ./tf_wrapper.sh dev us-east-1 plan
The 'apply' option will apply the setting shown during the plan
$ ./tf_wrapper.sh dev us-east-1 apply
The 'destroy' option will tear down the resources managed by this terraform project.
$ ./tf_wrapper.sh dev us-east-1 destroy
$ ./tf_wrapper.sh test us-west-1 plan
$ ./tf_wrapper.sh test us-west-1 apply
The 'show' option reads and outputs a terraform state file in a human-readable form.
$ ./tf_wrapper.sh test us-west-1 show
The 'taint' and 'untaint' options manually marks or unmarks a resource to be destroyed and recreated on the next plan/apply. The resource name can be found from the 'show' subcommand option.
$ ./tf_wrapper.sh test us-west-1 taint <aws_resource>
$ ./tf_wrapper.sh test us-west-1 untaint <aws_resource>
- The configuration was developed and tested with Terraform v0.6.16.