This project creates a basic Heroku infraistructure using Terraform.
Using your Heroku account, it will create the following:
- Pipeline
- 2 apps (Staging and Production)
- Database (Addons for Heroku Postgres)
- Integration of the addons
To run this project you need to have Terraform installed (Version used is v0.12.24)
$ brew install terraform
- Install the pre-requisites above
$ git clone [email protected]:net-engine/heroku-terraform.git
- Clone the project$ cd heroku-terraform
- Go into the project folder- The file
variables.tf
have all the variables used in this project. Theterraform.tfvars.sample
file works like your.env
, so copy theterraform.tfvars.sample
to a new fileterraform.tfvars
and replace them with the configuration you'd like. You can have multiple.tfvars
files. $ terraform init
- Once you have your config set up, you need to initialize terraform, this command will download and install the plugins required by Terraform.
$ terraform plan
- dry run the scripts against the provider and check if your scripts are okay.$ terraform apply
- Once you're happy with your changes, run this command. It will run the configuration against the provider and provision the resources$ terraform apply --var-file=other_config.tfvars
- To apply your changes using different configuration.$ terraform destroy
- if you want to delete your infra.
If you'd like to use this project as base, please branch off master and use the project name for the new branch:
$ git checkout -b project-name