fix: add triggers to manage Cloud SQL proxy lifecycle#21
Merged
filippolmt merged 1 commit intomainfrom Nov 11, 2025
Merged
Conversation
b88c362 to
229ae86
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds explicit triggers blocks to the execute_cloud_sql_proxy and kill_cloud_sql_proxy null resources to ensure they respond to changes in permissions_refresh_id, improving the lifecycle management of Cloud SQL proxy operations when permissions need to be reapplied.
- Added
triggersblock withrefresh_id = var.permissions_refresh_idto both proxy resources - Updated CHANGELOG.md to document version 0.5.1 with these lifecycle improvements
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| main.tf | Added triggers blocks to execute_cloud_sql_proxy and kill_cloud_sql_proxy resources to track permissions_refresh_id changes |
| CHANGELOG.md | Added version 0.5.1 entry documenting the lifecycle management improvements |
Comments suppressed due to low confidence (2)
main.tf:14
- The
triggersblock andreplace_triggered_bycreate redundant tracking of the same condition. Thenull_resource.force_permissions_refreshalready hastriggers = { refresh_id = var.permissions_refresh_id }(line 74-76), soreplace_triggered_bywill trigger replacement whenpermissions_refresh_idchanges. Adding an identicaltriggersblock here creates double-tracking of the same variable. Consider removing thetriggersblock fromexecute_cloud_sql_proxyand relying solely on thereplace_triggered_bymechanism for cleaner lifecycle management.
triggers = {
refresh_id = var.permissions_refresh_id
}
lifecycle {
replace_triggered_by = [
null_resource.force_permissions_refresh.id
]
}
main.tf:134
- The
triggersblock andreplace_triggered_bycreate redundant tracking of the same condition. Thenull_resource.force_permissions_refreshalready hastriggers = { refresh_id = var.permissions_refresh_id }(line 74-76), soreplace_triggered_bywill trigger replacement whenpermissions_refresh_idchanges. Adding an identicaltriggersblock here creates double-tracking of the same variable. Consider removing thetriggersblock fromkill_cloud_sql_proxyand relying solely on thereplace_triggered_bymechanism for cleaner lifecycle management.
triggers = {
refresh_id = var.permissions_refresh_id
}
lifecycle {
replace_triggered_by = [
null_resource.force_permissions_refresh.id
]
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.