terraform-provider-google/website/docs/r/sql_database.html.markdown
Christoph Tavan 25c6a00ca4 Improve google documentation (#124)
* Mention PostgreSQL in sql_database_instance docs

As mentioned in hashicorp/terraform#12617 the
google_sql_database_instance resource already supports `POSTGRES_9_6` as
`database_version`, it is just undocumented so far.

* Make naming of google_sql_database consistent

Looks like this is a relict from some copy & paste from
`google_storage_*` while writing the docs for `google_sql_database`.

* Note that Postgres support is still BETA
2017-06-14 16:11:31 -05:00

1.2 KiB

layout page_title sidebar_current description
google Google: google_sql_database docs-google-sql-database Creates a new SQL database in Google Cloud SQL.

google_sql_database

Creates a new Google SQL Database on a Google SQL Database Instance. For more information, see the official documentation, or the JSON API.

Example Usage

Example creating a SQL Database.

resource "google_sql_database_instance" "master" {
  name = "master-instance"

  settings {
    tier = "D0"
  }
}

resource "google_sql_database" "users" {
  name     = "users"
  instance = "${google_sql_database_instance.master.name}"
}

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the database.

  • instance - (Required) The name of containing instance.


  • project - (Optional) The project in which the resource belongs. If it is not provided, the provider project is used.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • self_link - The URI of the created resource.