-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackstage-humanitec.tf
114 lines (92 loc) · 3.11 KB
/
backstage-humanitec.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
resource "humanitec_application" "backstage" {
id = "backstage"
name = "backstage"
}
# Configure required values for backstage
resource "humanitec_value" "backstage_github_org_id" {
app_id = humanitec_application.backstage.id
key = "GITHUB_ORG_ID"
description = ""
value = var.github_org_id
is_secret = false
}
resource "humanitec_value" "backstage_github_app_id" {
app_id = humanitec_application.backstage.id
key = "GITHUB_APP_ID"
description = ""
value = local.github_app_id
is_secret = false
}
resource "humanitec_value" "backstage_github_app_client_id" {
app_id = humanitec_application.backstage.id
key = "GITHUB_APP_CLIENT_ID"
description = ""
value = local.github_app_client_id
is_secret = true
}
resource "humanitec_value" "backstage_github_app_client_secret" {
app_id = humanitec_application.backstage.id
key = "GITHUB_APP_CLIENT_SECRET"
description = ""
value = local.github_app_client_secret
is_secret = true
}
resource "humanitec_value" "backstage_github_app_private_key" {
app_id = humanitec_application.backstage.id
key = "GITHUB_APP_PRIVATE_KEY"
description = ""
value = indent(2, local.github_app_private_key)
is_secret = true
}
resource "humanitec_value" "backstage_github_app_webhook_secret" {
app_id = humanitec_application.backstage.id
key = "GITHUB_APP_WEBHOOK_SECRET"
description = ""
value = local.github_webhook_secret
is_secret = true
}
resource "humanitec_value" "backstage_humanitec_org" {
app_id = humanitec_application.backstage.id
key = "HUMANITEC_ORG_ID"
description = ""
value = var.humanitec_org_id
is_secret = false
}
resource "humanitec_value" "backstage_humanitec_token" {
app_id = humanitec_application.backstage.id
key = "HUMANITEC_TOKEN"
description = ""
value = var.humanitec_ci_service_user_token
is_secret = true
}
resource "humanitec_value" "backstage_cloud_provider" {
app_id = humanitec_application.backstage.id
key = "CLOUD_PROVIDER"
description = ""
value = "gcp"
is_secret = false
}
# Configure required resources for backstage
locals {
res_def_prefix = "backstage-"
}
# in-cluster postgres
module "backstage_postgres" {
source = "git::https://github.com/humanitec-architecture/resource-packs-in-cluster.git//humanitec-resource-defs/postgres/basic"
prefix = local.res_def_prefix
}
resource "humanitec_resource_definition_criteria" "backstage_postgres" {
resource_definition_id = module.backstage_postgres.id
app_id = humanitec_application.backstage.id
force_delete = true
}
# Configure required resources for scaffolded apps
# in-cluster mysql
module "backstage_mysql" {
source = "git::https://github.com/humanitec-architecture/resource-packs-in-cluster.git//humanitec-resource-defs/mysql/basic"
prefix = local.res_def_prefix
}
resource "humanitec_resource_definition_criteria" "backstage_mysql" {
resource_definition_id = module.backstage_mysql.id
env_type = var.environment
}