-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutputs.tf
78 lines (69 loc) · 2.04 KB
/
outputs.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
output "gke_cluster" {
description = "GKE cluster details"
value = {
name = module.gke.cluster_name
endpoint = module.gke.cluster_endpoint
location = module.gke.cluster_location
}
sensitive = true
}
output "database" {
description = "Cloud SQL instance details"
value = {
name = module.database.instance_name
connection_url = module.database.connection_url
private_ip = module.database.private_ip
}
sensitive = true
}
output "storage" {
description = "GCS bucket details"
value = {
name = module.storage.bucket_name
url = module.storage.bucket_url
self_link = module.storage.bucket_self_link
}
}
output "service_accounts" {
description = "Service account details"
value = {
gke_sa = module.gke.service_account_email
materialize_sa = module.gke.workload_identity_sa_email
}
}
locals {
metadata_backend_url = format(
"postgres://%s:%s@%s:5432/%s?sslmode=disable",
var.database_config.username,
var.database_config.password,
module.database.private_ip,
var.database_config.db_name
)
encoded_endpoint = urlencode("https://storage.googleapis.com")
encoded_secret = urlencode(module.storage.hmac_secret)
persist_backend_url = format(
"s3://%s:%s@%s/materialize?endpoint=%s®ion=%s",
module.storage.hmac_access_id,
local.encoded_secret,
module.storage.bucket_name,
local.encoded_endpoint,
var.region
)
}
output "connection_strings" {
description = "Formatted connection strings for Materialize"
value = {
metadata_backend_url = local.metadata_backend_url
persist_backend_url = local.persist_backend_url
}
sensitive = true
}
output "operator" {
description = "Materialize operator details"
value = var.install_materialize_operator ? {
namespace = module.operator[0].operator_namespace
release_name = module.operator[0].operator_release_name
release_status = module.operator[0].operator_release_status
instances = module.operator[0].materialize_instances
} : null
}