Coder Social home page Coder Social logo

edm-terraform's Introduction

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 [email protected]: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>

edm-terraform's People

Contributors

trevorscott avatar jonmountjoy avatar mars avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.