Skip to content
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

[PR #1213/e436817c backport][stable-5] ec2_security_group - Deprecate automatic flattening of lists passed to cidr_ip and cidr_ipv6 #1215

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelogs/fragments/20221027-ec2_security_group-nested.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
deprecated_features:
- >
ec2_security_group - support for passing nested lists to ``cidr_ip`` and ``cidr_ipv6`` has been deprecated.
Nested lists can be passed through the ``flatten`` filter instead ``cidr_ip: '{{ my_cidrs | flatten }}'`` (https://github.com/ansible-collections/amazon.aws/pull/1213).
11 changes: 11 additions & 0 deletions plugins/modules/ec2_security_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@
- The IPv4 CIDR range traffic is coming from.
- You can specify only one of I(cidr_ip), I(cidr_ipv6), I(ip_prefix), I(group_id)
and I(group_name).
- Support for passing nested lists of strings to I(cidr_ip) has been deprecated and will
be removed in a release after 2024-12-01.
cidr_ipv6:
type: str
description:
- The IPv6 CIDR range traffic is coming from.
- You can specify only one of I(cidr_ip), I(cidr_ipv6), I(ip_prefix), I(group_id)
and I(group_name).
- Support for passing nested lists of strings to I(cidr_ipv6) has been deprecated and will
be removed in a release after 2024-12-01.
ip_prefix:
type: str
description:
Expand Down Expand Up @@ -142,12 +146,16 @@
- The IPv4 CIDR range traffic is going to.
- You can specify only one of I(cidr_ip), I(cidr_ipv6), I(ip_prefix), I(group_id)
and I(group_name).
- Support for passing nested lists of strings to I(cidr_ip) has been deprecated and will
be removed in a release after 2024-12-01.
cidr_ipv6:
type: str
description:
- The IPv6 CIDR range traffic is going to.
- You can specify only one of I(cidr_ip), I(cidr_ipv6), I(ip_prefix), I(group_id)
and I(group_name).
- Support for passing nested lists of strings to I(cidr_ipv6) has been deprecated and will
be removed in a release after 2024-12-01.
ip_prefix:
type: str
description:
Expand Down Expand Up @@ -1213,6 +1221,9 @@ def flatten_nested_targets(module, rules):
def _flatten(targets):
for target in targets:
if isinstance(target, list):
module.deprecate('Support for nested lists in cidr_ip and cidr_ipv6 has been '
'deprecated. The flatten filter can be used instead.',
date='2024-12-01', collection_name='amazon.aws')
for t in _flatten(target):
yield t
elif isinstance(target, string_types):
Expand Down