Skip to content

Commit bfad356

Browse files
xgopilot[bot]xgopilotzhangzqs
authored
feat: add MySQL instance password outputs (#14)
- Add mysql_instance_password output to standalone module - Add mysql_primary_instance_password output to replication module - Add mysql_replica_instance_passwords output to replication module - Mark all password outputs as sensitive Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: xgopilot <[email protected]> Co-authored-by: zhangzqs <[email protected]>
1 parent 5fb5550 commit bfad356

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

mysql/replication/outputs.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,18 @@ output "mysql_replication_password" {
2121
description = "MySQL replication password (randomly generated)"
2222
sensitive = true
2323
}
24+
25+
output "mysql_primary_instance_password" {
26+
value = random_password.mysql_instance_password[0].result
27+
description = "Password for the MySQL primary instance (randomly generated)"
28+
sensitive = true
29+
}
30+
31+
output "mysql_replica_instance_passwords" {
32+
value = [
33+
for i in range(var.mysql_replica_count) :
34+
random_password.mysql_instance_password[i + 1].result
35+
]
36+
description = "List of passwords for MySQL replica instances (randomly generated)"
37+
sensitive = true
38+
}

mysql/standalone/outputs.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,9 @@ output "mysql_primary_endpoint" {
22
value = format("%s:3306", qiniu_compute_instance.mysql_primary_node.private_ip_addresses[0].ipv4)
33
description = "MySQL primary address string in the format: <primary_ip>:<port>"
44
}
5+
6+
output "mysql_instance_password" {
7+
value = random_password.mysql_instance_password.result
8+
description = "Password for the MySQL instance (randomly generated)"
9+
sensitive = true
10+
}

0 commit comments

Comments
 (0)