-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutputs.tf
More file actions
150 lines (121 loc) · 5.15 KB
/
outputs.tf
File metadata and controls
150 lines (121 loc) · 5.15 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# Hrafnar Application Outputs
output "hrafnar_app_url" {
description = "URL of the hrafnar application"
value = google_cloud_run_service.main_app.status[0].url
}
output "hrafnar_app_service_name" {
description = "Name of the hrafnar Cloud Run service"
value = google_cloud_run_service.main_app.name
}
# DNS Outputs (if Cloudflare DNS is enabled)
output "app_domain" {
description = "Full domain name for application access"
value = var.enable_cloudflare_dns && var.base_domain != "" ? local.app_fqdn : null
}
# Database Outputs (if database is enabled)
output "database_instance_name" {
description = "Name of the Cloud SQL database instance"
value = var.enable_database ? google_sql_database_instance.main[0].name : null
}
output "database_connection_name" {
description = "Connection name for the Cloud SQL database instance"
value = var.enable_database ? google_sql_database_instance.main[0].connection_name : null
}
output "database_private_ip" {
description = "Private IP address of the Cloud SQL database instance"
value = var.enable_database ? google_sql_database_instance.main[0].private_ip_address : null
}
# Network Outputs
output "vpc_id" {
description = "ID of the VPC network"
value = google_compute_network.main.id
}
output "vpc_name" {
description = "Name of the VPC network"
value = google_compute_network.main.name
}
output "private_subnet_id" {
description = "ID of the private subnet"
value = google_compute_subnetwork.private.id
}
output "private_subnet_name" {
description = "Name of the private subnet"
value = google_compute_subnetwork.private.name
}
# Service Account Outputs
output "hrafnar_app_service_account_email" {
description = "Email of the hrafnar application service account"
value = google_service_account.app.email
}
# Secret Manager Outputs
output "ai_api_key_secret_names" {
description = "Names of the Secret Manager secrets for AI API keys"
value = { for k, v in local.ai_api_key_secrets : k => v }
}
output "database_password_secret_name" {
description = "Name of the Secret Manager secret for database password"
value = var.enable_database ? google_secret_manager_secret.db_password[0].secret_id : null
}
output "database_connection_secret_name" {
description = "Name of the Secret Manager secret for database connection string"
value = var.enable_database ? google_secret_manager_secret.db_connection[0].secret_id : null
}
# Resource Naming Outputs
output "resource_prefix" {
description = "Prefix used for naming resources"
value = local.resource_prefix
}
output "common_labels" {
description = "Common labels applied to all resources"
value = local.common_labels
}
# Valkey/Redis Outputs (if enabled)
output "valkey_instance_name" {
description = "Name of the Valkey/Redis instance"
value = var.enable_valkey ? google_redis_instance.valkey[0].name : null
}
output "valkey_host" {
description = "Host IP of the Valkey/Redis instance"
value = var.enable_valkey ? google_redis_instance.valkey[0].host : null
}
output "valkey_port" {
description = "Port of the Valkey/Redis instance"
value = var.enable_valkey ? google_redis_instance.valkey[0].port : null
}
output "valkey_connection_secret_name" {
description = "Name of the Secret Manager secret containing the Valkey connection URL"
value = var.enable_valkey ? google_secret_manager_secret.valkey_connection[0].secret_id : null
}
output "valkey_auth_secret_name" {
description = "Name of the Secret Manager secret containing the Valkey auth string"
value = var.enable_valkey && var.valkey_auth_enabled ? google_secret_manager_secret.valkey_auth[0].secret_id : null
}
output "valkey_tier" {
description = "Service tier of the Valkey/Redis instance"
value = var.enable_valkey ? google_redis_instance.valkey[0].tier : null
}
output "valkey_memory_size_gb" {
description = "Memory size of the Valkey/Redis instance in GB"
value = var.enable_valkey ? google_redis_instance.valkey[0].memory_size_gb : null
}
# Storage Outputs (if enabled)
output "storage_bucket_name" {
description = "Name of the Cloud Storage bucket"
value = var.enable_storage ? google_storage_bucket.hrafner_storage[0].name : null
}
output "storage_bucket_url" {
description = "URL of the Cloud Storage bucket"
value = var.enable_storage ? google_storage_bucket.hrafner_storage[0].url : null
}
output "storage_bucket_self_link" {
description = "Self link of the Cloud Storage bucket"
value = var.enable_storage ? google_storage_bucket.hrafner_storage[0].self_link : null
}
output "storage_hmac_access_id_secret_name" {
description = "Name of the Secret Manager secret containing the storage HMAC access ID"
value = var.enable_storage && var.storage_create_hmac_key ? google_secret_manager_secret.storage_hmac_access_id[0].secret_id : null
}
output "storage_hmac_secret_secret_name" {
description = "Name of the Secret Manager secret containing the storage HMAC secret key"
value = var.enable_storage && var.storage_create_hmac_key ? google_secret_manager_secret.storage_hmac_secret[0].secret_id : null
}