google_sql_source_representation_instance

A source representation instance is a Cloud SQL instance that represents the source database server to the Cloud SQL replica. It is visible in the Cloud Console and appears the same as a regular Cloud SQL instance, but it contains no data, requires no configuration or maintenance, and does not affect billing. You cannot update the source representation instance.

Open in Cloud Shell

Example Usage - Sql Source Representation Instance Basic

resource "google_sql_source_representation_instance" "instance" {
  name               = "my-instance"
  region             = "us-central1"
  database_version   = "MYSQL_8_0"
  host               = "10.20.30.40"
  port               = 3306
  username           = "some-user"
  password           = "password-for-the-user"
  dump_file_path     = "gs://replica-bucket/source-database.sql.gz"
}
Open in Cloud Shell

Example Usage - Sql Source Representation Instance Postgres

resource "google_sql_source_representation_instance" "instance" {
  name               = "my-instance"
  region             = "us-central1"
  database_version   = "POSTGRES_9_6"
  host               = "10.20.30.40"
  port               = 3306
  username           = "some-user"
  password           = "password-for-the-user"
  dump_file_path     = "gs://replica-bucket/source-database.sql.gz"
}

Argument Reference

The following arguments are supported:


Attributes Reference

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

Timeouts

This resource provides the following Timeouts configuration options:

Import

SourceRepresentationInstance can be imported using any of these accepted formats:

In Terraform v1.5.0 and later, use an import block to import SourceRepresentationInstance using one of the formats above. For example:

import {
  id = "projects/{{project}}/instances/{{name}}"
  to = google_sql_source_representation_instance.default
}

When using the terraform import command, SourceRepresentationInstance can be imported using one of the formats above. For example:

$ terraform import google_sql_source_representation_instance.default projects/{{project}}/instances/{{name}}
$ terraform import google_sql_source_representation_instance.default {{project}}/{{name}}
$ terraform import google_sql_source_representation_instance.default {{name}}

User Project Overrides

This resource supports User Project Overrides.