Skip to content

Commit 2ebf76b

Browse files
Add comprehensive IAM and database debugging outputs for passwordless authentication
- Add postgres_iam_policy_arn and redis_iam_policy_arn outputs to service_accounts module - Add iam_role_name, iam_instance_profile_name to main module - Add database_endpoint, database_dbi_resource_id for PostgreSQL debugging - Add redis_endpoint, redis_iam_username for Redis debugging - Add tfe_autoscaling_group_name for instance identification - These outputs enable validation of IAM passwordless authentication setup
1 parent f36dc79 commit 2ebf76b

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

modules/service_accounts/outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,13 @@ output "iam_role" {
1212

1313
description = "The IAM role associated with the instance profile."
1414
}
15+
16+
output "postgres_iam_policy_arn" {
17+
value = try(aws_iam_policy.postgres_iam_policy[0].arn, "")
18+
description = "The ARN of the PostgreSQL IAM authentication policy, if created."
19+
}
20+
21+
output "redis_iam_policy_arn" {
22+
value = try(aws_iam_policy.redis_iam_policy[0].arn, "")
23+
description = "The ARN of the Redis IAM authentication policy, if created."
24+
}

outputs.tf

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,54 @@ output "s3_bucket" {
9090
value = local.object_storage.s3_bucket
9191
description = "S3 bucket name"
9292
}
93+
94+
# IAM and Database outputs for debugging passwordless authentication
95+
output "iam_role_name" {
96+
value = module.service_accounts.iam_role.name
97+
description = "The name of the IAM role attached to TFE EC2 instances."
98+
}
99+
100+
output "iam_instance_profile_name" {
101+
value = module.service_accounts.iam_instance_profile.name
102+
description = "The name of the IAM instance profile attached to TFE EC2 instances."
103+
}
104+
105+
output "database_endpoint" {
106+
value = local.database.endpoint
107+
description = "The connection endpoint of the PostgreSQL database."
108+
sensitive = true
109+
}
110+
111+
output "database_dbi_resource_id" {
112+
value = local.enable_database_module ? module.database[0].dbi_resource_id : (
113+
var.enable_aurora ? module.aurora_database[0].dbi_resource_id : ""
114+
)
115+
description = "The DBI resource ID of the PostgreSQL database (required for IAM authentication policy)."
116+
}
117+
118+
output "redis_endpoint" {
119+
value = local.redis.hostname
120+
description = "The connection endpoint of the Redis instance."
121+
sensitive = true
122+
}
123+
124+
output "redis_iam_username" {
125+
value = local.redis.username
126+
description = "The IAM username for Redis authentication (if IAM auth is enabled)."
127+
}
128+
129+
output "postgres_iam_policy_arn" {
130+
value = module.service_accounts.postgres_iam_policy_arn
131+
description = "The ARN of the PostgreSQL IAM authentication policy, if created."
132+
}
133+
134+
output "redis_iam_policy_arn" {
135+
value = module.service_accounts.redis_iam_policy_arn
136+
description = "The ARN of the Redis IAM authentication policy, if created."
137+
}
138+
139+
output "tfe_autoscaling_group_name" {
140+
value = module.vm.tfe_autoscaling_group.name
141+
description = "The name of the autoscaling group for TFE instances."
142+
}
143+

0 commit comments

Comments
 (0)