All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Fix MySQL 8.0/8.4 provisioning failure caused by
Access Denied(error 1045) onSHOW GRANTSandREVOKE cloudsqlsuperuser. On Cloud SQL MySQL 8.4,activate_all_roles_on_loginisOFFand the admin's default role may not be initialized until after the first interactive login. The script now prependsSET ROLE ALL;to every MySQL statement to explicitly activate theROLE_ADMINprivilege in each connection. Additionally, aSHOW GRANTSpre-check verifies whether thecloudsqlsuperuserrole is assigned before attempting the revoke, andSET DEFAULT ROLE NONEis only executed when the role was actually revoked.
- Ensure the
execute_cloud_sql_proxyandkill_cloud_sql_proxynull resources pick uppermissions_refresh_idchanges so Terraform always restarts/stops the proxy when permissions are reapplied. - Enforce the start → grant → stop execution order by wiring the proxy/grant null resources through explicit dependencies.
- Introduced the
permissions_refresh_idinput plus thenull_resource.force_permissions_refresh/null_resource.grant_permissionshelpers so you can rerun the proxy/grant scripts without recreating users.
- Reworked the resource lifecycles so proxy start/kill and permission scripts are re-executed whenever
permissions_refresh_idchanges. - Hardened the Cloud SQL proxy helper scripts: better logging, explicit dependency checks (mysql/nc/proxy), use of the v2 proxy CLI syntax, and safer shutdown handling.
- Enhanced
execute_sql.shso MySQL 8.0/8.4 users have thecloudsqlsuperuserrole removed, default roles cleared, and only database-scoped privileges granted. - Documentation updates: clarify Cloud SQL Auth Proxy v2 requirement, mention MySQL 8.4 support.
- Grant execute permission to execute_cloud_sql_proxy.sh to ensure it can be run as a script.
- Allow minor versions for MySQL.
- Fix accidental mysql credential exposure.
- Changed the output sql_users_creds response.
- Bump to 0.3, since 0.2.2 was a breaking change.
- User password special characters are now
_~@from_%@to allow masking in Gitlab.
- The user host is configurable, and not hardcoded to
%. This allows to restrict the access to the database to a specific host. If not specified, it will use the default value%.
- Minimum required version of Terraform si 1.2.x
- Script execution is done through
shand notbash. - Added new dependency for filesystem:
netcat.
- Init project.