Use terraform to create and deploy all 5 edm
applications:
Additionally two data services are created as well:
- a
hobby-dev
PostgreSQL database - a
basic-0
multi-tenant Apache Kafka on Heroku cluster (not free!)
You can read about this architecture in the Heroku Dev Center article: Event Driven Microservices with Apache Kafka.
- Heroku Account
- Terraform
- PostgreSQL
- Heroku Kafka CLI Plugin
If you haven't already, create a Heroku account and install the Heroku CLI.
Once you have the Heroku CLI installed, install the Heroku Kafka CLI plugin:
heroku plugins:install heroku-kafka
Additionally you'll need to make sure that you have Terraform set up on your machine.
Follow instructions here to set up PostgreSQL locally
Now you're ready to run the Terraform config that sets up this system.
Authorization tokens used with Terraform must have global scope to perform the various create, read, update, & delete actions on the Heroku API. If you want to isolate Terraform's capabilities from your existing account, then it should be authorized using a separate Heroku account.
First, check your current login to confirm that you're using the account intended for Terraform. If you want to switch identities, logout & then login as intended using the Heroku CLI:
heroku whoami
heroku logout
heroku login
Second, generate an authorization token using the Heroku CLI. The description is a human-readable name to indicate the purpose or identity of each authorization:
heroku authorizations:create --description terraform-my-app
Once you have acquired your Heroku authorization token set it and your heroku email as enviornment variables:
export \
TF_VAR_heroku_email='your-heroku-email' \
TF_VAR_heroku_api_key='you-heroku-auth-token'
git clone git@github.com:trevorscott/edm-terraform.git
cd edm-terraform
terraform init
Choose a deployment name. Keep it short as your resources will be prefixed by the chosen name.
terraform apply \
-var name=<your-deployment-name>