2022-04-04 08:01:24 -07:00
|
|
|
/**
|
|
|
|
* Copyright 2022 Google LLC
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2022-11-19 03:38:37 -08:00
|
|
|
output "bucket" {
|
|
|
|
description = "Cloud storage bucket to import/export data from Cloud SQL."
|
|
|
|
value = module.gcs.name
|
|
|
|
}
|
|
|
|
|
2022-04-04 08:01:24 -07:00
|
|
|
output "connection_names" {
|
|
|
|
description = "Connection name of each instance."
|
|
|
|
value = module.db.connection_names
|
|
|
|
}
|
|
|
|
|
2022-11-19 03:38:37 -08:00
|
|
|
output "demo_commands" {
|
|
|
|
description = "Demo commands."
|
|
|
|
value = {
|
|
|
|
"01_ssh" = "gcloud compute ssh ${module.test-vm.instance.name} --project ${module.project.name} --zone ${var.regions.primary}-b"
|
|
|
|
"02_cloud_sql_proxy" = "cloud_sql_proxy -enable_iam_login -instances=${module.db.connection_name}=tcp:5432 &"
|
|
|
|
"03_psql" = "psql 'host=127.0.0.1 port=5432 sslmode=disable dbname=${var.postgres_database} user=postgres password=PASSWORD'"
|
|
|
|
}
|
2022-04-14 01:06:04 -07:00
|
|
|
}
|
|
|
|
|
2022-04-04 08:01:24 -07:00
|
|
|
output "ips" {
|
|
|
|
description = "IP address of each instance."
|
|
|
|
value = module.db.ips
|
|
|
|
}
|
|
|
|
|
|
|
|
output "project_id" {
|
|
|
|
description = "ID of the project containing all the instances."
|
|
|
|
value = module.project.project_id
|
|
|
|
}
|
2022-04-13 04:08:57 -07:00
|
|
|
|
2023-08-20 00:44:20 -07:00
|
|
|
output "service_account" {
|
|
|
|
description = "SQL client service Accounts."
|
|
|
|
value = module.service-account-sql.email
|
2022-04-14 01:06:04 -07:00
|
|
|
}
|