oss-archive / edm-terraform

Use Terraform to deploy the EDM demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

edm-terraform

Use terraform to create and deploy all 5 edm applications:

  1. edm-relay
  2. edm-stream
  3. edm-stats
  4. edm-ui
  5. edm-dashboard

Additionally two data services are created as well:

  1. a hobby-dev PostgreSQL database
  2. 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.

Event Driven Microservices with Apache Kafka on Heroku Demo Architecture

Requirements

  1. Heroku Account
  2. Terraform
  3. PostgreSQL
  4. 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.

Config

Heroku Authorization

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'

Usage

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>

About

Use Terraform to deploy the EDM demo

License:MIT License


Languages

Language:HCL 73.7%Language:Shell 26.3%