Difference between revisions of "Terraform resource: google sql database instance"

From wikieduonline
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
   name            = "main-instance"
 
   name            = "main-instance"
 
   database_version = "POSTGRES_15"
 
   database_version = "POSTGRES_15"
   region          = "us-central1"
+
   region          = "[[us-central1]]"
 
+
 
   settings {
 
   settings {
 
     # Second-generation instance tiers are based on the machine
 
     # Second-generation instance tiers are based on the machine
Line 16: Line 16:
 
  }
 
  }
  
 +
 +
== 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 ==
 
== Related ==
 
* <code>[[gcloud sql instances create]]</code>
 
* <code>[[gcloud sql instances create]]</code>
* [[google_sql_user]]
+
* <code>[[google_sql_user]]</code>
 +
* <code>[[aws_db_instance]]</code>
  
 
== See also ==
 
== See also ==
 +
* {{google sql database instance}}
 
* {{tf gcp}}
 
* {{tf gcp}}
  
 
[[Category:Terraform]]
 
[[Category:Terraform]]

Latest revision as of 12:16, 7 November 2024

google_sql_database_instance https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/sql_database_instance

Official example[edit]

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[edit]

# 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[edit]

See also[edit]

Advertising: