mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 12:31:52 +03:00
35 lines
970 B
Terraform
35 lines
970 B
Terraform
|
# The AlloyDB cluster, with a single instance.
|
||
|
|
||
|
# The initial user password must be provided.
|
||
|
variable "password" {
|
||
|
type = string
|
||
|
sensitive = true
|
||
|
}
|
||
|
|
||
|
resource "google_alloydb_cluster" "default" {
|
||
|
provider = google-beta
|
||
|
cluster_id = "${var.name}-testing-alloydb"
|
||
|
network = "projects/${data.google_project.project.number}/global/networks/${google_compute_network.default.name}"
|
||
|
location = local.region
|
||
|
|
||
|
initial_user {
|
||
|
user = var.name
|
||
|
password = var.password
|
||
|
}
|
||
|
}
|
||
|
|
||
|
resource "google_alloydb_instance" "primary" {
|
||
|
provider = google-beta
|
||
|
cluster = google_alloydb_cluster.default.name
|
||
|
instance_id = "${var.name}-testing-alloydb-instance"
|
||
|
instance_type = "PRIMARY"
|
||
|
depends_on = [
|
||
|
google_service_networking_connection.default
|
||
|
]
|
||
|
}
|
||
|
|
||
|
output "url" {
|
||
|
value = "postgresql://${var.name}:${var.password}@${google_compute_instance.bastion.network_interface.0.access_config.0.nat_ip}/postgres"
|
||
|
sensitive = true
|
||
|
}
|