-
Notifications
You must be signed in to change notification settings - Fork 280
feat(dashboard api): user/team provisioning handlers #2335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 37 commits
c50d248
68a6265
9d8fe63
1e5f28b
56154df
3a431aa
eb69678
bb9fa39
461d2ec
ce0cbd1
4d622ce
84ecd06
3f56979
386d0c6
3e3fa3c
5e0972b
6b5a5c8
1113654
fb0afd4
bd4dd80
97e305a
c98878f
e314b96
db124a4
0e7f147
eed510b
8226f67
8485d7a
37f842f
c0b1102
87ef8f0
45a7ccb
638429a
6b6cfda
aae228c
07d4c25
bd1ebb1
126d984
d4ba4c2
24a425c
4155a96
18dfac4
4187a1f
407530a
7760e3f
5842767
acb1374
b31e568
c2bccdd
7117c13
66efe05
c21f0fd
a4cb5e0
a78fd00
6ae0aa6
9a89372
cc77e88
d53308c
4544bf7
04e18ea
b695386
41b247e
bf9b998
76f1b2b
2ac1f83
da28e6a
1512ede
d25d531
fe217ea
40a5cd0
c25caba
b549874
581afcc
18f7839
9667b77
37eb463
c5d82f0
e4d5bff
4862139
449df87
4ecc627
29bbf59
dc36b11
48a620c
2eda1d4
17d09f9
bb31094
62cac52
2a2311a
11d0f0f
268400f
bb44d06
63b4a2b
06b3274
097db23
b766bf0
3b5c98f
33e45b9
c982884
5285ea8
973d304
32d9d9c
58e1c65
fdea3be
a486438
8d70872
1e49371
e3f6b09
83f66e7
449b14a
b8c3bca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,54 @@ | ||
| locals { | ||
| base_env = { | ||
| GIN_MODE = "release" | ||
| ENVIRONMENT = var.environment | ||
| NODE_ID = "$${node.unique.id}" | ||
| PORT = "$${NOMAD_PORT_api}" | ||
| POSTGRES_CONNECTION_STRING = var.postgres_connection_string | ||
| AUTH_DB_CONNECTION_STRING = var.auth_db_connection_string | ||
| AUTH_DB_READ_REPLICA_CONNECTION_STRING = var.auth_db_read_replica_connection_string | ||
| CLICKHOUSE_CONNECTION_STRING = var.clickhouse_connection_string | ||
| SUPABASE_JWT_SECRETS = var.supabase_jwt_secrets | ||
| REDIS_URL = var.redis_url | ||
| REDIS_CLUSTER_URL = var.redis_cluster_url | ||
| REDIS_TLS_CA_BASE64 = var.redis_tls_ca_base64 | ||
| OTEL_COLLECTOR_GRPC_ENDPOINT = "localhost:${var.otel_collector_grpc_port}" | ||
| LOGS_COLLECTOR_ADDRESS = "http://localhost:${var.logs_proxy_port.port}" | ||
| } | ||
|
|
||
| extra_env = { | ||
| for key, value in var.extra_env : key => value | ||
| if value != null && trimspace(value) != "" | ||
| } | ||
|
|
||
| conflicting_extra_env_keys = sort(tolist(setintersection( | ||
| toset(keys(local.base_env)), | ||
| toset(keys(local.extra_env)), | ||
| ))) | ||
|
|
||
| env = merge(local.base_env, local.extra_env) | ||
| } | ||
|
|
||
| resource "nomad_job" "dashboard_api" { | ||
| jobspec = templatefile("${path.module}/jobs/dashboard-api.hcl", { | ||
| update_stanza = var.update_stanza | ||
| node_pool = var.node_pool | ||
| image_name = var.image | ||
| environment = var.environment | ||
|
|
||
| count = var.count_instances | ||
|
|
||
| memory_mb = 512 | ||
| cpu_count = 1 | ||
|
|
||
| postgres_connection_string = var.postgres_connection_string | ||
| auth_db_connection_string = var.auth_db_connection_string | ||
| auth_db_read_replica_connection_string = var.auth_db_read_replica_connection_string | ||
| clickhouse_connection_string = var.clickhouse_connection_string | ||
| supabase_jwt_secrets = var.supabase_jwt_secrets | ||
| redis_url = var.redis_url | ||
| redis_cluster_url = var.redis_cluster_url | ||
| redis_tls_ca_base64 = var.redis_tls_ca_base64 | ||
| env = local.env | ||
|
|
||
| subdomain = "dashboard-api" | ||
|
|
||
| otel_collector_grpc_endpoint = "localhost:${var.otel_collector_grpc_port}" | ||
| logs_collector_address = "http://localhost:${var.logs_proxy_port.port}" | ||
| }) | ||
|
|
||
| lifecycle { | ||
| precondition { | ||
| condition = length(local.conflicting_extra_env_keys) == 0 | ||
| error_message = "dashboard-api extra_env contains reserved keys: ${join(", ", local.conflicting_extra_env_keys)}" | ||
| } | ||
| } | ||
ben-fornefeld marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.