Skip to content

googleSqlSourceRepresentationInstance

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.

\~> Warning: All arguments including onPremisesConfigurationPassword will be stored in the raw state as plain-text. Read more about sensitive data in state.

Example Usage - Sql Source Representation Instance Basic

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.sqlSourceRepresentationInstance.SqlSourceRepresentationInstance(
  this,
  "instance",
  {
    database_version: "MYSQL_8_0",
    dump_file_path: "gs://replica-bucket/source-database.sql.gz",
    host: "10.20.30.40",
    name: "my-instance",
    password: "password-for-the-user",
    port: 3306,
    region: "us-central1",
    username: "some-user",
  }
);

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the source representation instance. Use any valid Cloud SQL instance name.

  • databaseVersion - (Required) The MySQL version running on your source database server. Possible values are mysql55, mysql56, mysql57, and mysql80.

  • host - (Required) The externally accessible IPv4 address for the source database server.


  • region - (Optional) The Region in which the created instance should reside. If it is not provided, the provider region is used.

  • port - (Optional) The externally accessible port for the source database server. Defaults to 3306.

  • username - (Optional) The replication user account on the external server.

  • password - (Optional) The password for the replication user account. Note: This property is sensitive and will not be displayed in the plan.

  • dumpFilePath - (Optional) A file in the bucket that contains the data from the external server.

  • caCertificate - (Optional) The CA certificate on the external server. Include only if SSL/TLS is used on the external server.

  • clientCertificate - (Optional) The client certificate on the external server. Required only for server-client authentication. Include only if SSL/TLS is used on the external server.

  • clientKey - (Optional) The private key file for the client certificate on the external server. Required only for server-client authentication. Include only if SSL/TLS is used on the external server.

  • project - (Optional) The ID of 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:

  • id - an identifier for the resource with format projects/{{project}}/instances/{{name}}

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 20 minutes.
  • delete - Default is 20 minutes.

Import

SourceRepresentationInstance can be imported using any of these accepted formats:

$ 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.