Difference between revisions of "Terraform resource: google sql database instance"
Jump to navigation
Jump to search
| Line 2: | Line 2: | ||
* <code>[[database_version]]: [[POSTGRES_15]], [[POSTGRES_16]]</code> | * <code>[[database_version]]: [[POSTGRES_15]], [[POSTGRES_16]]</code> | ||
| + | * <code>[[deletion_protection_enabled]]</code> | ||
| + | |||
== Official example == | == Official example == | ||
Revision as of 08:25, 25 June 2026
google_sql_database_instance https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database_instance
Official example
resource "google_sql_database_instance" "main" {
name = "main-instance"
database_version = "POSTGRES_15"
region = "us-central1"
settings {
# Second-generation instance tiers are based on the machine
# type. See argument reference below.
tier = "db-f1-micro"
}
}
Relevants Outputs
# Output Connection Details
output "connection_name" {
value = google_sql_database_instance.your-postgres-instance.connection_name
}
output "private_ip_address" {
value = google_sql_database_instance.your-postgres-instance.private_ip_address
}
Related
See also
google_sql_database_instance, google_sql_user, deletion_protection_enabled- Terraform GCP: [
google_compute_instance | google_storage_bucket| default_object_access_control | default_object_acl | object_access_control | object_acl | google_container_node_pool | google_compute_address | google_compute_network | google_compute_subnetwork | google_iam_policy | google_project_service | google_service_account | google_compute_router | google_compute_router_nat | google_sql_database_instance], provider "google", backend "gcs",gcloud auth application-default login
Advertising: