Skip to main content
Provision and manage Cloud SQL database instances with databases and users on Google Cloud Platform.
Cloud SQL resources form a hierarchy: Instance → Database → User.

gcp/cloudsql/database_instance

Creates a managed Cloud SQL instance (PostgreSQL, MySQL, or SQL Server).

Config

Outputs

Example

Dependencies

The database and user resources depend on an instance. The instance reference is immutable — to move a database or user to another instance, delete and recreate it.

Notes

  • Instance creation takes several minutes. The resource polls until the instance reaches RUNNABLE state.
  • Fields marked (immutable) cannot be changed after creation — you must delete and recreate the resource.
  • Password changes on users are applied in place without recreation.
  • All Cloud SQL resources are idempotent — creating an existing resource returns its current state.