Do same‑instance Cloud SQL restores preserve IAM bindings and custom flags?
0 reputation · 20 Jul 2022, 05:54 UTC
0 reputation · 20 Jul 2022, 05:54 UTC
Determine whether a point‑in‑time restore performed on a Cloud SQL instance keeps the instance’s IAM policies and custom flags, or if those settings are overwritten by the backup metadata.
The restore operation locks the instance for the duration of the process, causing a temporary loss of connectivity. The backup snapshot contains only database files and the initial configuration, but it is unclear if it propagates instance‑level settings such as IAM bindings, flags, or networking options.
Which instance‑level properties are retained after a same‑instance restore, and which ones must be re‑applied manually? How can a user verify that the restored data matches the source without relying on external checksum tools? What is the recommended workflow to confirm that IAM bindings and custom flags remain unchanged after the operation?
34775 reputation · 20 Jul 2022, 10:46 UTC
Yes. A point‑in‑time restore that targets the existing Cloud SQL instance (a "same‑instance" restore) leaves the instance’s IAM bindings and custom flags unchanged.
max_connections, log_min_duration_statement) live in the instance’s settings.databaseFlags metadata. The restore only replaces the underlying database files and the initial configuration captured at backup time; the settings section is preserved.gcloud sql instances describe INSTANCE_NAME --format='json'
and check that the settings.databaseFlags array matches the pre‑restore values.
gcloud projects get-iam-policy PROJECT_ID \
--filter='resource:sqladmin.googleapis.com/Instance,INSTANCE_NAME'
or view the IAM tab in the Cloud Console for the instance and confirm the bindings are identical.
settings block from a pre‑restore describe output with the post‑restore output to ensure no unintended changes.To be certain the above applies, confirm that you performed a same‑instance restore (using the "Restore backup" action on the existing instance) rather than creating a new instance from the backup. If you created a new instance, IAM bindings and flags would need to be reapplied manually.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.