forked from ryvn-mango/aws-rds-postgres
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoutputs.tf
More file actions
59 lines (51 loc) · 1.47 KB
/
outputs.tf
File metadata and controls
59 lines (51 loc) · 1.47 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
output "db_instance_id" {
description = "The RDS instance ID"
value = aws_db_instance.this.id
}
output "db_instance_address" {
description = "The address of the RDS instance"
value = aws_db_instance.this.address
}
output "db_instance_endpoint" {
description = "The connection endpoint"
value = aws_db_instance.this.endpoint
}
output "db_instance_port" {
description = "The database port"
value = aws_db_instance.this.port
}
output "db_subnet_group_id" {
description = "The db subnet group name"
value = aws_db_subnet_group.this.id
}
output "db_security_group_id" {
description = "The security group ID"
value = aws_security_group.this.id
}
output "db_master_password" {
description = "The master password (sensitive)"
value = var.password
sensitive = true
}
output "db_connection_uri" {
description = "PostgreSQL connection URI including credentials (sensitive)"
value = format(
"postgresql://%s:%s@%s:%d/%s",
urlencode(var.username),
urlencode(var.password),
aws_db_instance.this.address,
aws_db_instance.this.port,
urlencode(var.database_name),
)
sensitive = true
}
output "db_connection_uri_with_env_password" {
description = "PostgreSQL connection URI using $(DB_PASSWORD) placeholder"
value = format(
"postgresql://%s:$(DB_PASSWORD)@%s:%d/%s",
urlencode(var.username),
aws_db_instance.this.address,
aws_db_instance.this.port,
urlencode(var.database_name),
)
}