Google Cloud SQL Source Representation Instance

This page shows how to write Terraform for Cloud SQL Source Representation Instance and write them securely.

google_sql_source_representation_instance (Terraform)

The Source Representation Instance in Cloud SQL can be configured in Terraform with the resource name google_sql_source_representation_instance. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Review your Terraform file for Google best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

The MySQL version running on your source database server. Possible values: ["MYSQL_5_5", "MYSQL_5_6", "MYSQL_5_7", "MYSQL_8_0"]

The externally accessible IPv4 address for the source database server.

  • id optional computed - string
  • name required - string

The name of the source representation instance. Use any valid Cloud SQL instance name.

The externally accessible port for the source database server. Defaults to 3306.

The Region in which the created instance should reside. If it is not provided, the provider region is used.

Explanation in Terraform Registry

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.

Tips: Best Practices for The Other Google Cloud SQL Resources

In addition to the google_sql_database_instance, Google Cloud SQL has the other resources that should be configured for security reasons. Please check some examples of those resources and precautions.

risk-label

google_sql_database_instance

Ensure to disable local_infile setting in MySQL

It is better to disable the local_infile setting in MySQL. If this is not disabled, arbitrary files might be readable.

Review your Google Cloud SQL settings

In addition to the above, there are other security points you should be aware of making sure that your .tf files are protected in Shisho Cloud.

Frequently asked questions

What is Google Cloud SQL Source Representation Instance?

Google Cloud SQL Source Representation Instance is a resource for Cloud SQL of Google Cloud Platform. Settings can be wrote in Terraform.