Skip to content

Commit

Permalink
[9.0.0] Bump botocore/boto3 requirements (add deprecation reminder ab…
Browse files Browse the repository at this point in the history
…out Python 3.8 support)
  • Loading branch information
tremble committed Jul 9, 2024
1 parent 3c6ba70 commit 4395b40
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 50 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ As such support for Python less than 3.8 will be removed in a release after 2024

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).

Version 7.0.0 of this collection supports `boto3 >= 1.26.0` and `botocore >= 1.29.0`
Version 9.0.0 of this collection supports `boto3 >= 1.28.0` and `botocore >= 1.31.0`

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

Expand Down
14 changes: 14 additions & 0 deletions changelogs/fragments/botocore-python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
breaking_changes:
- The amazon.aws collection has dropped support for ``botocore<1.31.0`` and
``boto3<1.28.0``. Most modules will continue to work with older versions of
the AWS SDK. However, compatability with older versions of the SDK is not guaranteed
and will not be tested. When using older versions of the SDK a warning will
be emitted by Ansible
(https://github.com/ansible-collections/amazon.aws/pull/2161).
deprecated_features:
- amazon.aws collection - due to the AWS SDKs announcing the end of support
for Python less than 3.8 (https://aws.amazon.com/blogs/developer/python-support-policy-updates-for-aws-sdks-and-tools/)
support for Python less than 3.8 by this collection has been deprecated
and will removed in release 10.0.0
(https://github.com/ansible-collections/amazon.aws/pull/2161).
4 changes: 2 additions & 2 deletions plugins/module_utils/botocore.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
from .exceptions import AnsibleBotocoreError
from .retries import AWSRetry

MINIMUM_BOTOCORE_VERSION = "1.29.0"
MINIMUM_BOTO3_VERSION = "1.26.0"
MINIMUM_BOTOCORE_VERSION = "1.31.0"
MINIMUM_BOTO3_VERSION = "1.28.0"


def _get_user_agent_string():
Expand Down
7 changes: 0 additions & 7 deletions plugins/modules/rds_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@
- The storage throughput when the O(storage_type) is V(gp3).
- When the allocated storage is below 400 GB, the storage throughput will always be 125 mb/s.
- When the allocated storage is large than or equal 400 GB, the througput starts at 500 mb/s.
- Requires botocore >= 1.29.0.
type: int
version_added: 5.2.0
tde_credential_arn:
Expand Down Expand Up @@ -584,7 +583,6 @@
ca_certificate_identifier:
description:
- The identifier of the CA certificate for the DB instance.
- Requires minimum botocore version 1.29.44.
returned: always
type: str
sample: rds-ca-2015
Expand Down Expand Up @@ -1712,11 +1710,6 @@ def main():
supports_check_mode=True,
)

if module.params["ca_certificate_identifier"]:
module.require_botocore_at_least(
"1.29.44", reason="to use 'ca_certificate_identifier' while creating/updating rds instance"
)

# Sanitize instance identifiers
module.params["db_instance_identifier"] = module.params["db_instance_identifier"].lower()
if module.params["new_db_instance_identifier"]:
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# - tests/unit/constraints.txt
# - tests/integration/constraints.txt
# - tests/integration/targets/setup_botocore_pip
botocore>=1.29.0
boto3>=1.26.0
botocore>=1.31.0
boto3>=1.28.0
6 changes: 3 additions & 3 deletions tests/integration/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Specifically run tests against the oldest versions that we support
botocore==1.29.0
boto3==1.26.0
botocore==1.31.0
boto3==1.28.0

# AWS CLI has `botocore==` dependencies, provide the one that matches botocore
# to avoid needing to download over a years worth of awscli wheels.
awscli==1.27.0
awscli==1.29.0

# AWS CLI depends on PyYAML <5.5,>=3.10; the latest PyYAML release in that range, 5.4.1, fails to install.
# Use a version in that range that is known to work (https://github.com/yaml/pyyaml/issues/736)
Expand Down
5 changes: 1 addition & 4 deletions tests/integration/targets/rds_instance_modify/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
---
dependencies:
- role: setup_botocore_pip
vars:
botocore_version: 1.29.44
dependencies: []
24 changes: 0 additions & 24 deletions tests/integration/targets/rds_instance_modify/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@
Created_by: Ansible rds_instance tests
register: result
check_mode: true
vars:
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"

- name: Get curent CA certificate identifier
amazon.aws.rds_instance_info:
Expand All @@ -233,8 +231,6 @@
Name: "{{ modified_instance_id }}"
Created_by: Ansible rds_instance tests
register: result
vars:
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"

- name: Get curent CA certificate identifier
amazon.aws.rds_instance_info:
Expand All @@ -260,8 +256,6 @@
Name: "{{ modified_instance_id }}"
Created_by: Ansible rds_instance tests
register: result
vars:
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"

- name: Get curent CA certificate identifier
amazon.aws.rds_instance_info:
Expand All @@ -288,8 +282,6 @@
Created_by: Ansible rds_instance tests
register: result
check_mode: true
vars:
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"

- name: Get curent CA certificate identifier
amazon.aws.rds_instance_info:
Expand All @@ -314,8 +306,6 @@
enable_cloudwatch_logs_exports: ["audit", "error", "general", "slowquery"]
register: result
check_mode: true
vars:
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"

- name: Get current cloudwatch log exports
amazon.aws.rds_instance_info:
Expand All @@ -334,8 +324,6 @@
db_instance_identifier: "{{ modified_instance_id }}"
enable_cloudwatch_logs_exports: ["audit", "error", "general", "slowquery"]
register: result
vars:
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"

- name: Get current cloudwatch log exports
amazon.aws.rds_instance_info:
Expand All @@ -361,8 +349,6 @@
db_instance_identifier: "{{ modified_instance_id }}"
enable_cloudwatch_logs_exports: ["audit", "error", "general", "slowquery"]
register: result
vars:
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"

- name: Get current cloudwatch log exports
amazon.aws.rds_instance_info:
Expand All @@ -383,8 +369,6 @@
enable_cloudwatch_logs_exports: ["audit", "error"]
register: result
check_mode: true
vars:
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"

- name: Get current cloudwatch log exports
amazon.aws.rds_instance_info:
Expand All @@ -403,8 +387,6 @@
db_instance_identifier: "{{ modified_instance_id }}"
enable_cloudwatch_logs_exports: ["audit", "error"]
register: result
vars:
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"

- name: Get current cloudwatch log exports
amazon.aws.rds_instance_info:
Expand All @@ -430,8 +412,6 @@
enable_cloudwatch_logs_exports: []
purge_cloudwatch_logs_exports: false
register: result
vars:
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"

- name: Get current cloudwatch log exports
amazon.aws.rds_instance_info:
Expand All @@ -452,8 +432,6 @@
enable_cloudwatch_logs_exports: []
register: result
check_mode: true
vars:
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"

- name: Get current cloudwatch log exports
amazon.aws.rds_instance_info:
Expand All @@ -472,8 +450,6 @@
db_instance_identifier: "{{ modified_instance_id }}"
enable_cloudwatch_logs_exports: []
register: result
vars:
ansible_python_interpreter: "{{ botocore_virtualenv_interpreter }}"

- name: Get current cloudwatch log exports
amazon.aws.rds_instance_info:
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Specifically run tests against the oldest versions that we support
botocore==1.29.0
boto3==1.26.0
botocore==1.31.0
boto3==1.28.0

# AWS CLI has `botocore==` dependencies, provide the one that matches botocore
# to avoid needing to download over a years worth of awscli wheels.
awscli==1.27.0
awscli==1.29.0
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class TestMinimalVersionTestSuite:
# Prepare some data for use in our testing
# ========================================================
def setup_method(self):
self.MINIMAL_BOTO3 = "1.26.0"
self.MINIMAL_BOTOCORE = "1.29.0"
self.OLD_BOTO3 = "1.25.999"
self.OLD_BOTOCORE = "1.28.999"
self.MINIMAL_BOTO3 = "1.28.0"
self.MINIMAL_BOTOCORE = "1.31.0"
self.OLD_BOTO3 = "1.27.999"
self.OLD_BOTOCORE = "1.30.999"

# ========================================================
# Test we don't warn when using valid versions
Expand Down

0 comments on commit 4395b40

Please sign in to comment.