This repository has been archived by the owner on Oct 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathterraform.tf
82 lines (69 loc) · 1.87 KB
/
terraform.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
variable "app" {}
variable "client" {}
variable "organization" {}
variable "slack_webhook" {}
variable "papertrailUrl" {}
variable "salt" { type = "map" }
variable "databaseUrl" { type = "map" }
variable "auth0" { type = "map" }
provider "heroku" {}
provider "aws" {
region = "us-east-1"
}
provider "cloudflare" {}
module "dev_bucket" {
source = "./bucket"
app = "${var.app}-dev-${var.salt["dev"]}"
client = "${var.client}"
organization = "${var.organization}"
env = "development"
}
module "dev_site" {
source = "./web"
app = "${var.app}-web-dev-${var.salt["dev"]}"
client = "${var.client}"
env = "development"
organization = "${var.organization}"
slack_webhook = "${var.slack_webhook}"
}
module "dev_api" {
source = "./api"
app = "${var.app}-api-dev-${var.salt["dev"]}"
client = "${var.client}"
env = "development"
organization = "${var.organization}"
slack_webhook = "${var.slack_webhook}"
papertrail_url = "${var.papertrailUrl}"
database_url = "${var.databaseUrl["dev"]}"
auth0 = "${var.auth0}"
aws {
bucket = "${module.dev_bucket.bucket}"
access_key_id = "${module.dev_bucket.access_key_id}"
secret_access_key = "${module.dev_bucket.secret_access_key}"
region = "${module.dev_bucket.region}"
}
}
module "sta_site" {
source = "./web"
app = "${var.app}-web-sta-${var.salt["sta"]}"
client = "${var.client}"
env = "staging"
organization = "${var.organization}"
slack_webhook = "${var.slack_webhook}"
}
resource "heroku_pipeline" "web" {
name = "inventory-web"
}
resource "heroku_pipeline" "api" {
name = "inventory-api"
}
resource "heroku_pipeline_coupling" "dev-site" {
app = "${module.dev_site.appId}"
pipeline = "${heroku_pipeline.web.id}"
stage = "development"
}
resource "heroku_pipeline_coupling" "dev-api" {
app = "${module.dev_api.appId}"
pipeline = "${heroku_pipeline.api.id}"
stage = "development"
}