diff --git a/examples/postgresql-psc/README.md b/examples/postgresql-psc/README.md index c61f3c7d..783647ce 100644 --- a/examples/postgresql-psc/README.md +++ b/examples/postgresql-psc/README.md @@ -30,6 +30,7 @@ terraform destroy | Name | Description | |------|-------------| +| dns\_name | n/a | | name | The name for Cloud SQL instance | | project\_id | n/a | diff --git a/examples/postgresql-psc/outputs.tf b/examples/postgresql-psc/outputs.tf index 63f6742e..74971911 100644 --- a/examples/postgresql-psc/outputs.tf +++ b/examples/postgresql-psc/outputs.tf @@ -22,3 +22,7 @@ output "name" { description = "The name for Cloud SQL instance" value = module.pg.instance_name } + +output "dns_name" { + value = module.pg.dns_name +} diff --git a/modules/postgresql/README.md b/modules/postgresql/README.md index bd3cc467..3aa6344b 100644 --- a/modules/postgresql/README.md +++ b/modules/postgresql/README.md @@ -66,6 +66,7 @@ Note: CloudSQL provides [disk autoresize](https://cloud.google.com/sql/docs/mysq | Name | Description | |------|-------------| | additional\_users | List of maps of additional users and passwords | +| dns\_name | DNS name of the instance endpoint | | generated\_user\_password | The auto generated default user password if not input password was provided | | iam\_users | The list of the IAM users with access to the CloudSQL instance | | instance\_connection\_name | The connection name of the master instance to be used in connection strings | diff --git a/modules/postgresql/outputs.tf b/modules/postgresql/outputs.tf index 498ca296..e9d21606 100644 --- a/modules/postgresql/outputs.tf +++ b/modules/postgresql/outputs.tf @@ -136,3 +136,8 @@ output "instances" { description = "A list of all `google_sql_database_instance` resources we've created" sensitive = true } + +output "dns_name" { + value = google_sql_database_instance.default.dns_name + description = "DNS name of the instance endpoint" +}