Generate a postgresql certificate.
This commit is contained in:
@@ -43,6 +43,11 @@ output "instance" {
|
||||
value = google_sql_database_instance.instance
|
||||
}
|
||||
|
||||
output "certificate" {
|
||||
description = "TLS certificate for connecting to the database."
|
||||
value = google_sql_ssl_cert.client_cert
|
||||
}
|
||||
|
||||
# Needed for CloudSQL Auth Proxy
|
||||
resource "google_project_service" "sqladmin" {
|
||||
project = var.project
|
||||
@@ -85,3 +90,8 @@ resource "google_sql_user" "postgres" {
|
||||
instance = google_sql_database_instance.instance.name
|
||||
password = var.postgres_password
|
||||
}
|
||||
|
||||
resource "google_sql_ssl_cert" "client_cert" {
|
||||
common_name = "client-name"
|
||||
instance = google_sql_database_instance.instance.name
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user