forked from driftlessaf/terraform-infra-reconcilers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.tf
More file actions
110 lines (86 loc) · 2.91 KB
/
main.tf
File metadata and controls
110 lines (86 loc) · 2.91 KB
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
/*
Copyright 2026 Chainguard, Inc.
SPDX-License-Identifier: Apache-2.0
*/
terraform {
required_providers {
ko = { source = "ko-build/ko" }
cosign = { source = "chainguard-dev/cosign" }
}
}
// Stand up the workqueue infrastructure (single shard)
module "workqueue" {
count = var.shards == 1 ? 1 : 0
source = "../workqueue"
project_id = var.project_id
name = "${var.name}-wq"
regions = var.regions
primary-region = var.primary-region
concurrent-work = var.concurrent-work
batch-size = var.batch-size
max-retry = var.max-retry
enable_dead_letter_alerting = var.enable_dead_letter_alerting
reconciler-service = {
name = "${var.name}-rec"
}
team = var.team
product = var.product
deletion_protection = var.deletion_protection
notification_channels = var.notification_channels
labels = var.labels
multi_regional_location = var.multi_regional_location
cpu_idle = var.workqueue_cpu_idle
depends_on = [module.reconciler]
}
// Preserve existing workqueue state when adding count
moved {
from = module.workqueue
to = module.workqueue[0]
}
// Stand up the sharded workqueue infrastructure (multiple shards)
module "workqueue-sharded" {
count = var.shards > 1 ? 1 : 0
source = "../workqueue/hyperqueue"
project_id = var.project_id
name = "${var.name}-wq"
regions = var.regions
shards = var.shards
concurrent-work = var.concurrent-work
batch-size = var.batch-size
max-retry = var.max-retry
enable_dead_letter_alerting = var.enable_dead_letter_alerting
reconciler-service = {
name = "${var.name}-rec"
}
team = var.team
product = var.product
deletion_protection = var.deletion_protection
notification_channels = var.notification_channels
labels = var.labels
multi_regional_location = var.multi_regional_location
depends_on = [module.reconciler]
}
// Stand up the reconciler service
module "reconciler" {
source = "chainguard-dev/common/infra//modules/regional-go-service"
project_id = var.project_id
name = "${var.name}-rec"
regions = var.regions
ingress = "INGRESS_TRAFFIC_INTERNAL_ONLY"
egress = var.egress
deletion_protection = var.deletion_protection
service_account = var.service_account
containers = var.containers
labels = var.labels
team = var.team
product = var.product
scaling = var.scaling
volumes = var.volumes
regional-volumes = var.regional-volumes
enable_profiler = var.enable_profiler
otel_resources = var.otel_resources
request_timeout_seconds = var.request_timeout_seconds
execution_environment = var.execution_environment
slo = var.slo
notification_channels = var.notification_channels
}