Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,19 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.5.1] - 2025-11-11

[Compare with previous version](https://github.com/sparkfabrik/terraform-google-gcp-mysql-db-and-user-creation-helper/compare/0.5.0...0.5.1)

### Changed

- Ensure the `execute_cloud_sql_proxy` and `kill_cloud_sql_proxy` null resources pick up `permissions_refresh_id` changes 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.

## [0.5.0] - 2025-11-11

[Compare with previous version](https://github.com/sparkfabrik/terraform-google-gcp-mysql-db-and-user-creation-helper/compare/0.4.1...0.5.0)

### Added

- Introduced the `permissions_refresh_id` input plus the `null_resource.force_permissions_refresh`/`null_resource.grant_permissions` helpers so you can rerun the proxy/grant scripts without recreating users.
Expand Down
10 changes: 10 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ resource "null_resource" "execute_cloud_sql_proxy" {
for_each = (((var.cloudsql_proxy_host == "localhost" || var.cloudsql_proxy_host == "127.0.0.1") && var.terraform_start_cloud_sql_proxy) ? {
for u in var.database_and_user_list : u.user => u
} : {})

triggers = {
refresh_id = var.permissions_refresh_id
}

lifecycle {
replace_triggered_by = [
null_resource.force_permissions_refresh.id
Expand Down Expand Up @@ -117,6 +122,11 @@ resource "null_resource" "kill_cloud_sql_proxy" {
for_each = (((var.cloudsql_proxy_host == "localhost" || var.cloudsql_proxy_host == "127.0.0.1") && var.terraform_start_cloud_sql_proxy) ? {
for u in var.database_and_user_list : u.user => u
} : {})

triggers = {
refresh_id = var.permissions_refresh_id
}

lifecycle {
replace_triggered_by = [
null_resource.force_permissions_refresh.id
Expand Down