-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathmain.tf
52 lines (41 loc) · 954 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
terraform {
required_version = ">= 0.14"
required_providers {
heroku = {
source = "heroku/heroku"
version = "~> 3.2"
}
}
}
provider "heroku" {}
resource "heroku_app" "default" {
name = var.heroku_app
region = "eu"
stack = "container"
config_vars = {
VAULT_AUTO_UNSEAL = var.vault_auto_unseal
VAULT_INIT_SECRET_KEY = var.vault_init_secret_key
}
}
resource "heroku_addon" "database" {
app = heroku_app.default.id
plan = "heroku-postgresql:hobby-dev"
}
resource "heroku_domain" "default" {
count = var.heroku_domain != null ? 1 : 0
app = heroku_app.default.id
hostname = var.heroku_domain
}
resource "heroku_build" "default" {
app = heroku_app.default.id
source = {
path = "heroku-vault.tar.gz"
}
}
resource "heroku_formation" "default" {
app = heroku_app.default.id
type = "web"
quantity = 1
size = "Free"
depends_on = [heroku_build.default]
}