Skip to content

Commit 9deeef0

Browse files
Add database outputs for PostgreSQL passwordless authentication
- Add database_endpoint, database_username, database_password, database_name outputs - Required for PostgreSQL provider configuration in passwordless auth tests - Enables test to access database connection parameters from module outputs
1 parent f36dc79 commit 9deeef0

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

outputs.tf

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,97 @@ output "s3_bucket" {
9090
value = local.object_storage.s3_bucket
9191
description = "S3 bucket name"
9292
}
93+
94+
# Database outputs for PostgreSQL passwordless authentication
95+
output "database_endpoint" {
96+
value = local.database.endpoint
97+
description = "The connection endpoint of the PostgreSQL database."
98+
sensitive = true
99+
}
100+
101+
output "database_username" {
102+
value = local.database.username
103+
description = "The master username for the PostgreSQL database."
104+
sensitive = true
105+
}
106+
107+
output "database_password" {
108+
value = local.database.password
109+
description = "The master password for the PostgreSQL database."
110+
sensitive = true
111+
}
112+
113+
output "database_name" {
114+
value = local.database.name
115+
description = "The name of the PostgreSQL database."
116+
sensitive = true
117+
}
118+
119+
# IAM and Database outputs for debugging passwordless authentication
120+
output "iam_role_name" {
121+
value = module.service_accounts.iam_role.name
122+
description = "The name of the IAM role attached to TFE EC2 instances."
123+
}
124+
125+
output "iam_instance_profile_name" {
126+
value = module.service_accounts.iam_instance_profile.name
127+
description = "The name of the IAM instance profile attached to TFE EC2 instances."
128+
}
129+
130+
output "database_endpoint" {
131+
value = local.database.endpoint
132+
description = "The connection endpoint of the PostgreSQL database."
133+
sensitive = true
134+
}
135+
136+
output "database_dbi_resource_id" {
137+
value = local.enable_database_module ? module.database[0].dbi_resource_id : (
138+
var.enable_aurora ? module.aurora_database[0].dbi_resource_id : ""
139+
)
140+
description = "The DBI resource ID of the PostgreSQL database (required for IAM authentication policy)."
141+
}
142+
143+
output "redis_endpoint" {
144+
value = local.redis.hostname
145+
description = "The connection endpoint of the Redis instance."
146+
sensitive = true
147+
}
148+
149+
output "redis_iam_username" {
150+
value = local.redis.username
151+
description = "The IAM username for Redis authentication (if IAM auth is enabled)."
152+
}
153+
154+
output "postgres_iam_policy_arn" {
155+
value = module.service_accounts.postgres_iam_policy_arn
156+
description = "The ARN of the PostgreSQL IAM authentication policy, if created."
157+
}
158+
159+
output "redis_iam_policy_arn" {
160+
value = module.service_accounts.redis_iam_policy_arn
161+
description = "The ARN of the Redis IAM authentication policy, if created."
162+
}
163+
164+
output "tfe_autoscaling_group_name" {
165+
value = module.vm.tfe_autoscaling_group.name
166+
description = "The name of the autoscaling group for TFE instances."
167+
}
168+
169+
output "database_username" {
170+
value = local.database.username
171+
description = "The master username for the PostgreSQL database."
172+
sensitive = true
173+
}
174+
175+
output "database_password" {
176+
value = local.database.password
177+
description = "The master password for the PostgreSQL database."
178+
sensitive = true
179+
}
180+
181+
output "database_name" {
182+
value = local.database.name
183+
description = "The name of the PostgreSQL database."
184+
sensitive = true
185+
}
186+

0 commit comments

Comments
 (0)