Basic Terraform script to show its Heroku power. Spins up an empty stack with a Ruby buildpack.
Similar setup to our S3 Static Website Terraform Scripts.
- Terraform
- Heroku Account and Authorization ENV variables exported or logged into Heroku
terraform init
- This will pull in the Heroku Terraform provider.cp environment.tfvars.example environment.tfvars
and change as needed (see Variable Settings section)- Verify:
terraform plan -var-file=environment.tfvars
- Invoke:
terraform apply -var-file=environment.tfvars
- Destroy:
terraform destroy -var-file=environment.tfvars
app_name = "YOUR_APP_NAME"
secret_key_base = "Rails SECRET_KEY_BASE"
heroku_stack = "heroku-20"