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.
Parameters
-
database_version
required - string
The MySQL version running on your source database server. Possible values: ["MYSQL_5_5", "MYSQL_5_6", "MYSQL_5_7", "MYSQL_8_0"]
-
host
required - string
The externally accessible IPv4 address for the source database server.
The name of the source representation instance. Use any valid Cloud SQL instance name.
-
port
optional - number
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.
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.