cloud_sql library

Cloud SQL — managed relational databases (MySQL / PostgreSQL / SQL Server).

For private-IP deployments, see also service_networking.dart (GoogleServiceNetworkingConnection) and compute.dart (GoogleComputeGlobalAddress).

Classes

AuthorizedNetwork
One entry in ip_configuration.authorized_networks. The value field is a CIDR ('203.0.113.0/24' or '203.0.113.42/32').
BackupConfiguration
settings.backup_configuration. Enabling backups is a prerequisite for HA (availability_type: REGIONAL) and point-in-time recovery on Postgres.
BackupRetentionSettings
backup_configuration.backup_retention_settings.
DatabaseFlag
One settings.database_flags entry — engine-level flag. Both keys are simple strings on the wire (numeric flag values are stringified — '1000', not 1000).
GoogleSqlDatabase
Factory wrapper for google_sql_database (provider hashicorp/google ~> 7.0).
GoogleSqlDatabaseInstance
Factory wrapper for google_sql_database_instance (provider hashicorp/google ~> 7.0).
GoogleSqlUser
Factory wrapper for google_sql_user (provider hashicorp/google ~> 7.0).
IpConfiguration
settings.ip_configuration — controls how clients reach the instance. Two main shapes:
LocationPreference
settings.location_preference. Optional — the API picks a zone when omitted. followGaeApplication is rarely set; leave null unless co-locating with an App Engine app.
MaintenanceWindow
settings.maintenance_window. Pin a weekly window when GCP can take the instance down for upgrades.
PscConfig
ip_configuration.psc_config — Private Service Connect. Mutually exclusive with VPC peering on the same instance.
ReplicaConfiguration
replica_configuration block. Only set on read-replica instances (i.e. when GoogleSqlDatabaseInstance.masterInstanceName is also set). The replica's GoogleSqlDatabaseInstance.databaseVersion must match the primary.
Settings
settings block. Required in practice for any non-trivial instance — at minimum supply tier. The remaining knobs default to GCP's per-tier sensible values; override only the ones you need.

Enums

DatabaseVersion
Engine + major version for a Cloud SQL instance. Mapped from the database_version schema string (see the schema attribute description for the canonical supported set). Picking a major family is forcing — Terraform recreates the instance on change.
SqlActivationPolicy
settings.activation_policy. always (default) keeps the instance running 24/7; never keeps it stopped (the underlying storage is preserved). onDemand is legacy — kept for backwards compatibility.
SqlAvailabilityType
settings.availability_type. regional is HA (across 2 zones in the region, automatic failover); zonal is single-zone (cheaper). HA also requires backup_configuration to be enabled (and binary logs on MySQL / point-in-time recovery on Postgres).
SqlDiskType
settings.disk_type. Tier-dependent — hyperdiskBalanced is only available on Enterprise Plus.
SqlEdition
settings.edition. enterprisePlus unlocks data cache, advanced disaster recovery, and the read-pool instance type.
SqlUserType
Authentication mechanism for a google_sql_user.