Skip to content

Commit fcf4e84

Browse files
trembleboutetnico
authored andcommitted
[7.0.0] Bump botocore requirements (ansible-collections#1968)
[7.0.0] Bump botocore requirements SUMMARY In line with ansible-collections/amazon.aws#1763 bump our botocore requirements for 7.0.0 ISSUE TYPE Feature Pull Request COMPONENT NAME README.md changelogs/fragments/botocore.yml changelogs/fragments/python37.yml plugins/modules/dynamodb_table.py plugins/modules/ec2_launch_template.py plugins/modules/networkfirewall_policy.py plugins/modules/networkfirewall_rule_group.py plugins/modules/networkfirewall_rule_group_info.py plugins/modules/opensearch.py plugins/modules/opensearch_info.py plugins/modules/s3_lifecycle.py plugins/modules/wafv2_web_acl.py requirements.txt tests/config.yml tests/integration/constraints.txt tests/unit/constraints.txt ADDITIONAL INFORMATION Deliberately links to the amazon.aws PR to avoid duplicating the reasons. Reviewed-by: Alina Buzachis
1 parent fab564a commit fcf4e84

17 files changed

+51
-71
lines changed

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,33 @@ Use community.aws 4.x.y if you are using Ansible 2.9 or Ansible Core 2.10.
1414

1515
This collection depends on the AWS SDK for Python (Boto3 and Botocore). Due to the
1616
[AWS SDK Python Support Policy](https://aws.amazon.com/blogs/developer/python-support-policy-updates-for-aws-sdks-and-tools/)
17-
this collection requires Python 3.6 or greater.
18-
19-
Amazon have also announced the end of support for
20-
[Python less than 3.7](https://aws.amazon.com/blogs/developer/python-support-policy-updates-for-aws-sdks-and-tools/).
21-
As such support for Python less than 3.7 by this collection has been deprecated and will be removed in release 7.0.0.
22-
Additionally, support for Python less than 3.8 is expected to be removed in a release after 2024-12-01 based on currently
23-
available schedules.
17+
this collection requires Python 3.7 or greater.
18+
19+
Amazon have also announced the planned end of support for
20+
[Python less than 3.8](https://aws.amazon.com/blogs/developer/python-support-policy-updates-for-aws-sdks-and-tools/).
21+
As such support for Python less than 3.8 will be removed in a release after 2024-12-01.
22+
23+
<!---
24+
### End of Support by Python Versions:
25+
26+
| Python Version | AWS SDK | Collection |
27+
| -------------- | -------- | ---------- |
28+
| 2.7 | July 2021 | Release 2.0.0 (September 2021) |
29+
| 3.4 | February 2021 | Release 1.0.0 (June 2020) |
30+
| 3.5 | February 2021 | Release 2.0.0 (September 2021) |
31+
| 3.6 | May 2022 | Release 7.0.0 (November 2023) |
32+
| 3.7 | December 2023 | *After December 2024* |
33+
| 3.8 | April 2025 | *After April 2026* |
34+
| 3.9 | April 2026 | *After April 2027* |
35+
| 3.10 | April 2027 | *After April 2028* |
36+
| 3.11 | April 2028 | *After April 2029* |
37+
--->
2438

2539
## AWS SDK version compatibility
2640

2741
Starting with the 2.0.0 releases of amazon.aws and community.aws, it is generally the collection's policy to support the versions of `botocore` and `boto3` that were released 12 months prior to the most recent major collection release, following semantic versioning (for example, 2.0.0, 3.0.0).
2842

29-
Version 6.0.0 of this collection supports `boto3 >= 1.22.0` and `botocore >= 1.25.0`
43+
Version 7.0.0 of this collection supports `boto3 >= 1.26.0` and `botocore >= 1.29.0`
3044

3145
All support for the original AWS SDK `boto` was removed in release 4.0.0.
3246

changelogs/fragments/botocore.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
breaking_changes:
2+
- The community.aws collection has dropped support for ``botocore<1.29.0`` and
3+
``boto3<1.26.0``. Most modules will continue to work with older versions of the AWS SDK, however
4+
compatability with older versions of the SDK is not guaranteed and will not be tested. When using
5+
older versions of the SDK a warning will be emitted by Ansible
6+
(https://github.com/ansible-collections/amazon.aws/pull/1763).

changelogs/fragments/python37.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
breaking_changes:
2+
- community.aws collection - due to the AWS SDKs announcing the end of support
3+
for Python less than 3.7 (https://aws.amazon.com/blogs/developer/python-support-policy-updates-for-aws-sdks-and-tools/)
4+
support for Python less than 3.7 by this collection wss been deprecated in release 6.0.0 and removed in release 7.0.0.
5+
(https://github.com/ansible-collections/amazon.aws/pull/1763).
6+
7+
# We've already announced the deprecation for <3.8 (with 6.0.0), dropping support for <3.9 on ours side will happen
8+
# after April 2026. This is about 2 years + 5 months away assuming a November 7.0.0 release, we could announce
9+
# the deprecation now, but assuming we release 8.0.0 in about 6 months a just short of 2 year
10+
# deprecation feels fine given it's predictable.

plugins/module_utils/networkfirewall.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,9 @@ def _filter_immutable_metadata_attributes(self, metadata):
513513
Removes information from the metadata which can't be updated.
514514
Returns a *copy* of the metadata dictionary.
515515
"""
516-
return deepcopy(metadata)
516+
meta = deepcopy(metadata)
517+
meta.pop("LastModifiedTime", None)
518+
return meta
517519

518520
def _flush_create(self):
519521
changed = super(BaseNetworkFirewallManager, self)._flush_create()

plugins/modules/dynamodb_table.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@
123123
table_class:
124124
description:
125125
- The class of the table.
126-
- Requires at least botocore version 1.23.18.
127126
choices: ['STANDARD', 'STANDARD_INFREQUENT_ACCESS']
128127
type: str
129128
version_added: 3.1.0
@@ -1056,9 +1055,6 @@ def main():
10561055
)
10571056
client = module.client("dynamodb", retry_decorator=retry_decorator)
10581057

1059-
if module.params.get("table_class"):
1060-
module.require_botocore_at_least("1.23.18", reason="to set table_class")
1061-
10621058
current_table = get_dynamodb_table()
10631059
changed = False
10641060
table = None

plugins/modules/ec2_launch_template.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,13 @@
368368
type: str
369369
description: >
370370
- Wether the instance metadata endpoint is available via IPv6 (C(enabled)) or not (C(disabled)).
371-
- Requires botocore >= 1.21.29
372371
choices: [enabled, disabled]
373372
default: 'disabled'
374373
instance_metadata_tags:
375374
version_added: 3.1.0
376375
type: str
377376
description:
378377
- Wether the instance tags are availble (C(enabled)) via metadata endpoint or not (C(disabled)).
379-
- Requires botocore >= 1.23.30
380378
choices: [enabled, disabled]
381379
default: 'disabled'
382380
extends_documentation_fragment:
@@ -582,23 +580,6 @@ def create_or_update(module, template_options):
582580
lt_data = params_to_launch_data(module, dict((k, v) for k, v in module.params.items() if k in template_options))
583581
lt_data = scrub_none_parameters(lt_data, descend_into_lists=True)
584582

585-
if lt_data.get("MetadataOptions"):
586-
if not module.botocore_at_least("1.23.30"):
587-
# fail only if enabled is requested
588-
if lt_data["MetadataOptions"].get("InstanceMetadataTags") == "enabled":
589-
module.require_botocore_at_least("1.23.30", reason="to set instance_metadata_tags")
590-
# pop if it's not requested to keep backwards compatibility.
591-
# otherwise the modules failes because parameters are set due default values
592-
lt_data["MetadataOptions"].pop("InstanceMetadataTags")
593-
594-
if not module.botocore_at_least("1.21.29"):
595-
# fail only if enabled is requested
596-
if lt_data["MetadataOptions"].get("HttpProtocolIpv6") == "enabled":
597-
module.require_botocore_at_least("1.21.29", reason="to set http_protocol_ipv6")
598-
# pop if it's not requested to keep backwards compatibility.
599-
# otherwise the modules failes because parameters are set due default values
600-
lt_data["MetadataOptions"].pop("HttpProtocolIpv6")
601-
602583
if not (template or template_versions):
603584
# create a full new one
604585
try:

plugins/modules/networkfirewall_policy.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
C(aws:alert_strict) and C(aws:alert_established).
7777
- Only valid for policies where I(strict_rule_order=true).
7878
- When creating a new policy defaults to C(aws:drop_strict).
79-
- I(stateful_default_actions) requires botocore>=1.21.52.
8079
required: false
8180
type: list
8281
elements: str
@@ -86,7 +85,6 @@
8685
- When I(strict_rule_order='strict') rules and rule groups are evaluated in
8786
the order that they're defined.
8887
- Cannot be updated after creation.
89-
- I(stateful_rule_order) requires botocore>=1.21.52.
9088
required: false
9189
type: str
9290
choices: ['default', 'strict']
@@ -398,10 +396,6 @@ def main():
398396
manager.set_wait_timeout(module.params.get("wait_timeout", None))
399397

400398
rule_order = module.params.get("stateful_rule_order")
401-
if rule_order and rule_order != "default":
402-
module.require_botocore_at_least("1.21.52", reason="to set the rule order")
403-
if module.params.get("stateful_default_actions"):
404-
module.require_botocore_at_least("1.21.52", reason="to set the default actions for stateful flows")
405399

406400
if state == "absent":
407401
manager.delete()

plugins/modules/networkfirewall_rule_group.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
- Mutually exclusive with I(rule_type=stateless).
5959
- For more information on how rules are evaluated read the AWS documentation
6060
U(https://docs.aws.amazon.com/network-firewall/latest/developerguide/suricata-rule-evaluation-order.html).
61-
- I(rule_order) requires botocore>=1.23.23.
6261
type: str
6362
required: false
6463
choices: ['default', 'strict']
@@ -772,8 +771,6 @@ def main():
772771
],
773772
)
774773

775-
module.require_botocore_at_least("1.19.20")
776-
777774
state = module.params.get("state")
778775
name = module.params.get("name")
779776
arn = module.params.get("arn")
@@ -789,9 +786,6 @@ def main():
789786
if module.params.get("domain_list"):
790787
module.fail_json("domain_list can only be used for stateful rule groups")
791788

792-
if module.params.get("rule_order"):
793-
module.require_botocore_at_least("1.23.23", reason="to set the rule order")
794-
795789
manager = NetworkFirewallRuleManager(module, arn=arn, name=name, rule_type=rule_type)
796790
manager.set_wait(module.params.get("wait", None))
797791
manager.set_wait_timeout(module.params.get("wait_timeout", None))

plugins/modules/networkfirewall_rule_group_info.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
- When I(scope='account') returns a description of all rule groups in the account.
3737
- When I(scope='managed') returns a list of available managed rule group arns.
3838
- By default searches only at the account scope.
39-
- I(scope='managed') requires botocore>=1.23.23.
4039
required: false
4140
choices: ['managed', 'account']
4241
type: str
@@ -412,16 +411,11 @@ def main():
412411
],
413412
)
414413

415-
module.require_botocore_at_least("1.19.20")
416-
417414
arn = module.params.get("arn")
418415
name = module.params.get("name")
419416
rule_type = module.params.get("rule_type")
420417
scope = module.params.get("scope")
421418

422-
if module.params.get("scope") == "managed":
423-
module.require_botocore_at_least("1.23.23", reason="to list managed rules")
424-
425419
manager = NetworkFirewallRuleManager(module, name=name, rule_type=rule_type)
426420

427421
results = dict(changed=False)

plugins/modules/opensearch.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,8 +1310,6 @@ def main():
13101310
supports_check_mode=True,
13111311
)
13121312

1313-
module.require_botocore_at_least("1.21.38")
1314-
13151313
try:
13161314
client = module.client("opensearch", retry_decorator=AWSRetry.jittered_backoff())
13171315
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:

0 commit comments

Comments
 (0)