Inconsistency in parameters parsing for the ec2_group module when with ICMP rules #628
Closed
1 task done
Labels
feature
This issue/PR relates to a feature request
module
module
plugins
plugin (any type)
waiting_on_contributor
Needs help. Feel free to engage to get things unblocked
Summary
Current
amazon.aws.ec2_group
module supports a variety of IP protocols. When writing rules for ICMPfrom_port
andto_port
parameters have different meaning than when using TCP or UDP rules.This behavior aligns with current Boto3 implementation for which payload does not distinguish between a port range and ICMP code and type:
I suggest to create supplementary parameters to decouple usage of the module from the payload that the method expects.
This would involve creating a set of two new parameters
icmp_code
andicmp_type
that would be mutually exclusive withfrom_port
andto_port
parameters.The usage of
from_port
andto_port
would fail ifproto
readsicmp
and vice versa, Ansible would complain if theicmp_port
andicmp_type
are used without aicmp
oricmpv6
.Regarding the new
ports
key instead, there may be two solutions:This change would align the semantics of the module with Ansible's philosophy, that is, using mutually exclusive parameters (for instance
instance_name
andinstance_id
) instead of basing the behavior on the module based on the value of a parameter.The change would not change the payload being sent, only create a "superset" for consistency.
Issue Type
Feature Idea
Component Name
ec2_group
Additional Information
Code of Conduct
The text was updated successfully, but these errors were encountered: