forked from taskcluster/taskcluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhooks-service.tf
98 lines (89 loc) · 3.4 KB
/
hooks-service.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
module "hooks_rabbitmq_user" {
source = "modules/rabbitmq-user"
prefix = "${var.prefix}"
project_name = "taskcluster-hooks"
rabbitmq_vhost = "${var.rabbitmq_vhost}"
}
resource "random_string" "hooks_access_token" {
length = 65
override_special = "_-"
}
resource "random_string" "hooks_table_signing_key" {
length = 40
}
resource "random_string" "hooks_table_crypto_key" {
length = 32
}
module "hooks_secrets" {
source = "modules/service-secrets"
project_name = "taskcluster-hooks"
disabled_services = "${var.disabled_services}"
secrets = {
TASKCLUSTER_CLIENT_ID = "static/taskcluster/hooks"
TASKCLUSTER_ACCESS_TOKEN = "${random_string.hooks_access_token.result}"
FORCE_SSL = "false"
TRUST_PROXY = "true"
NODE_ENV = "production"
MONITORING_ENABLE = "true"
PUBLISH_METADATA = "false"
AZURE_ACCOUNT = "${azurerm_storage_account.base.name}"
PULSE_USERNAME = "${module.hooks_rabbitmq_user.username}"
PULSE_PASSWORD = "${module.hooks_rabbitmq_user.password}"
PULSE_HOSTNAME = "${var.rabbitmq_hostname}"
PULSE_VHOST = "${var.rabbitmq_vhost}"
HOOK_TABLE_NAME = "Hooks"
QUEUE_TABLE_NAME = "Queue"
LASTFIRE_TABLE_NAME = "LastFire2"
TABLE_CRYPTO_KEY = "${base64encode(random_string.hooks_table_crypto_key.result)}"
TABLE_SIGNING_KEY = "${random_string.hooks_table_signing_key.result}"
}
}
module "hooks_web_service" {
source = "modules/deployment"
project_name = "taskcluster-hooks"
service_name = "hooks"
proc_name = "web"
readiness_path = "/api/hooks/v1/ping"
secret_name = "${module.hooks_secrets.secret_name}"
secrets_hash = "${module.hooks_secrets.secrets_hash}"
root_url = "${var.root_url}"
secret_keys = "${module.hooks_secrets.env_var_keys}"
docker_image = "${local.taskcluster_image_monoimage}"
}
module "hooks_scheduler" {
source = "modules/deployment"
project_name = "taskcluster-hooks"
service_name = "hooks"
proc_name = "scheduler"
background_job = true
secret_name = "${module.hooks_secrets.secret_name}"
secrets_hash = "${module.hooks_secrets.secrets_hash}"
root_url = "${var.root_url}"
secret_keys = "${module.hooks_secrets.env_var_keys}"
docker_image = "${local.taskcluster_image_monoimage}"
}
module "hooks_listeners" {
source = "modules/deployment"
project_name = "taskcluster-hooks"
service_name = "hooks"
proc_name = "listeners"
background_job = true
secret_name = "${module.hooks_secrets.secret_name}"
secrets_hash = "${module.hooks_secrets.secrets_hash}"
root_url = "${var.root_url}"
secret_keys = "${module.hooks_secrets.env_var_keys}"
docker_image = "${local.taskcluster_image_monoimage}"
}
module "hooks_expire_artifacts" {
source = "modules/scheduled-job"
project_name = "taskcluster-hooks"
service_name = "hooks"
job_name = "expires"
schedule = "10 0 * * *"
deadline_seconds = 86400
secret_name = "${module.hooks_secrets.secret_name}"
secrets_hash = "${module.hooks_secrets.secrets_hash}"
root_url = "${var.root_url}"
secret_keys = "${module.hooks_secrets.env_var_keys}"
docker_image = "${local.taskcluster_image_monoimage}"
}