provider/aws: Fix issue changing EIP Association #6521
Merged
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.
Fix issue when moving an EIP from one Instance to another.
Currently, we provide the
PrivateIpAddress
in theAssociateAddress
call, but we're sending the private IP of the current instance, not the instance we're targeting. Sinceprivate_ip
is computed, on association we get the PrivateIp of the first Instance here, which incorrectly get's thrown in with the request.Fixes #6436 and failing test
TestAccAWSEIP_instance
Update
Chatted with @phinze about the possible/likely conflict with #6070 and we've got a plan for going forward. I will re-work this PR and update soon
More Update:
I've implemented what @phinze and I discussed:
private_ip
as a user specified value: this value is once again computed and reflects the current private ipassociate_with_private_ip
: this is a private IP you designate to associate the EIP with.Private IP is a computed attribute, meaning it will pick up it's value from the Instance or Network Interface that the EIP is associated with. The
associate_with_private_ip
allows the users to specify what value the EIP should take. Without distinguishing between the two cases, we're unable to move the EIP from Instance to Instance (see #6436 andTestAccAWSEIP_instance
test)