Provisions databases on the Heroku platform.
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.
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}"
}
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 |
Name | Description |
---|---|
database_url | The database URL |
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 |
The following is a list of pain points that the author has encountered before creating this module.
- Time spent waiting for AWS RDS database instances to be created (and destroyed).
- Over-provisioning of AWS RDS capacity (even with
db.t2.micro
instances) for low-traffic applications. - Time spent clicking through the Heroku console creating and deleting databases, and then tracking what applications they are used with.
- Boredom, and the desire to write some code.