Skip to content

infrastructure-as-code/terraform-heroku-cloud-database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloud Database Terraform Module

Provisions databases on the Heroku platform.

Introduction

Have you found yourself clicking through a web console on Heroku, AWS, or another cloud provider when you need a cloud database for development or test purposes, and wishing that you had scripted the process? This module will help you do just that by creating the cloud databases you need on Heroku.

Usage

provider "heroku" {}

module "db" {
  source        = "github.com/infrastructure-as-code/terraform-heroku-database"
  name          = "<your-database-app-name>"
  database_plan = "heroku-postgresql:hobby-dev"
}

output "database_url" {
  value = "${module.db.database_url}"
}

Inputs

Name Description Type Default Required
name Used as the application name in Heroku. string - yes
database_plan The Heroku Add-ons plan name. string - yes
region Heroku region string "us" no
organization Heroku team name, if any. string "" no
personal Is this a personal application on Heroku? boolean true no

Outputs

Name Description
database_url The database URL

Heroku Database Add-ons Plans

Heroku has a range of data store add-ons that can be used for your dev, test and production purposes.

Here is a list of selected Heroku add-ons, their respective free plans, and limitations with the free plans, to get you started.

Add-on Plan Name Limitations
Heroku Postgres heroku-postgresql:hobby-dev 10,000 rows
ClearDB MySQL cleardb:ignite 5mb
JawsDB MySQL jawsdb:kitefin 5mb
JawsDB Maria jawsdb-maria:kitefin 5mb
Heroku Redis heroku-redis:hobby-dev 25mb
Redis Cloud rediscloud:30 30mb
Redis To Go redistogo:nano 5mb
mLab MongoDB mongolab:sandbox 496mb

Motivations

The following is a list of pain points that the author has encountered before creating this module.

  1. Time spent waiting for AWS RDS database instances to be created (and destroyed).
  2. Over-provisioning of AWS RDS capacity (even with db.t2.micro instances) for low-traffic applications.
  3. Time spent clicking through the Heroku console creating and deleting databases, and then tracking what applications they are used with.
  4. Boredom, and the desire to write some code.

Releases

No releases published

Packages

No packages published

Languages