aws - elastic-ip - used-by filter #9958
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.
Add a new
used-by
filter to theelastic-ip
(network-addr
) resource to help identify the type of service that the Elastic IP is associated with. It utilizes theget_eni_resource_type
utility function contributed in #8028. It will make one API call to get a list of network interfaces that are associated with EIPs.Initially I was going to add a
used
filter, but we can check the usage simply by checking theAssociationId
attribute using thevalue
filter. Theused-by
filter returns the resource type that the ENI which EIP is associated with, is attached to.Background
The Amazon EC2 and NLBs are the only resources that can be protected by AWS Shield Advanced by attaching EIPs. Other resources such as NAT Gateway, Transit Gateway, VPC Endpoint, or AWS Lambda don't need AWS Shield Advanced. Thus, we need a way to filter them out.
Available Types
Example