Fixes #6076 - Adjusts check to allow for instance-id reset on aws_route #6682
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.
fixes #6076
As @atward described, when using the
instance_id
attribute for the association, in the background AWS is also assigning thenetwork_interface_id
. The current way of checking would essentially eliminate any possibility of reallocating the route to a new instance id due to thenumTargets
check always returning 2 in that case and fast failing.allowedTargets
is evaluated so thatinstance_id
comes afternetwork_interface_id
to allow for checkinstance_id
andnetwork_interface_id
is the other let AWS handle thenetwork_interface_id
NOTE: One thing I would have liked to add a test for but had a family emergency come up is tainting the original instance and reapplying. I did not see any direct example of doing this and was considering simply standing up 2 instances in the test and running a re-apply to associate the 2nd instance. If I get a chance before this is merged I will try and do so however I do not have cycles immediately.