-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] Correctly setreplica_server_id
on azurerm_postgresql_flexible_server_virtual_endpoint
forazurerm_postgresql_flexible_server
s that exist in separate resource groups
#27509
Merged
stephybun
merged 22 commits into
hashicorp:main
from
bruceharrison1984:fix-flexible-endpoint
Oct 24, 2024
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
41dd191
look up replica ID via API
bruceharrison1984 062ba9c
remove custom poller
bruceharrison1984 46efac4
add test case
bruceharrison1984 94e28c5
improve tests
bruceharrison1984 45a1fa3
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 7cf743e
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 5e047bd
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 f9c1d75
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 251b50a
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 2cb98cc
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 387338c
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 7b5d15a
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 2006332
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 e17cc59
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 cfcac61
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 be50e69
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 a6106be
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 360432c
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 e095372
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 3484e8a
Update internal/services/postgres/postgresql_flexible_server_virtual_…
bruceharrison1984 a427e1e
parse server ID before setting state
bruceharrison1984 b1bda4d
minor simplifications on variable assignments and for loop
stephybun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
71 changes: 0 additions & 71 deletions
71
...ces/postgres/custompollers/postgresql_flexible_server_virtual_endpoint_resource_poller.go
This file was deleted.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the server names we're looking for here guaranteed to be unique per subscription, or could we have a condition where there are multiple servers of the same name in different resource groups that could lead to an unexpected outcome here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The names may not be unique per subscription, however they must be unique per source server. Since we check that the replica name matches, as well as filter those results based on the source server ID we should be protected from selecting an incorrect replica. Even if the names matched, replicas must have unique names per source servers.
TLDR; For a given source server, all replicas associated with the source server must have unique names. By filtering on both conditions, we can confidently pick the correct one even if duplicate named replicas exist within the subscription.
https://github.com/hashicorp/terraform-provider-azurerm/pull/27509/files/94e28c5de14955a188f90192c06828946f9a6fcc#diff-6fceca959b7c5669ebd391456b3a69c7ff858802d5dc5e70a91c6237cd173ff0R258
I was worried about this as well, but I believe it is setup in a safe manner.