Skip to content

Commit

Permalink
Bump minimum botocore version for 4.0.0
Browse files Browse the repository at this point in the history
1.20.0 was released 2021-02-02.

Note: 1.21.0 was released 2021-07-15, hopefully we'll release 4.0.0 before July.
  • Loading branch information
tremble committed Feb 26, 2022
1 parent 35c27b8 commit af012e8
Show file tree
Hide file tree
Showing 15 changed files with 34 additions and 36 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ As the AWS SDK for Python (Boto3 and Botocore) has [ceased supporting Python 2.7

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 3.0.0 of this collection supports `boto3 >= 1.16.0` and `botocore >= 1.19.0`
Version 4.0.0 of this collection supports `boto3 >= 1.17.0` and `botocore >= 1.20.0`

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

Expand Down
7 changes: 7 additions & 0 deletions changelogs/fragments/release-4--botocore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
major_changes:
- amazon.aws collection - The amazon.aws collection has dropped support for
``botocore<1.20.0`` and ``boto3<1.17.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/574).
4 changes: 2 additions & 2 deletions plugins/doc_fragments/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class ModuleDocFragment(object):
type: dict
requirements:
- python >= 3.6
- boto3 >= 1.16.0
- botocore >= 1.19.0
- boto3 >= 1.17.0
- botocore >= 1.20.0
notes:
- If parameters are not set within the module, the following
environment variables can be used in decreasing order of precedence
Expand Down
2 changes: 1 addition & 1 deletion plugins/lookup/aws_account_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
requirements:
- python >= 3.6
- boto3
- botocore >= 1.19.0
- botocore >= 1.20.0
extends_documentation_fragment:
- amazon.aws.aws_credentials
- amazon.aws.aws_region
Expand Down
2 changes: 1 addition & 1 deletion plugins/lookup/aws_secret.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
requirements:
- python >= 3.6
- boto3
- botocore >= 1.19.0
- botocore >= 1.20.0
extends_documentation_fragment:
- amazon.aws.aws_credentials
- amazon.aws.aws_region
Expand Down
2 changes: 1 addition & 1 deletion plugins/lookup/aws_ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
requirements:
- python >= 3.6
- boto3
- botocore >= 1.19.0
- botocore >= 1.20.0
short_description: Get the value for a SSM parameter or all parameters under a path.
description:
- Get the value for an Amazon Simple Systems Manager parameter or a hierarchy of parameters.
Expand Down
8 changes: 4 additions & 4 deletions plugins/module_utils/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ def __init__(self, **kwargs):
self._module.fail_json(
msg=missing_required_lib('botocore or boto3'))
current_versions = self._gather_versions()
if not self.botocore_at_least('1.19.0'):
self.warn('botocore < 1.19.0 is not supported or tested.'
if not self.botocore_at_least('1.20.0'):
self.warn('botocore < 1.20.0 is not supported or tested.'
' Some features may not work.')
if not self.boto3_at_least("1.16.0"):
self.warn('boto3 < 1.16.0 is not supported or tested.'
if not self.boto3_at_least("1.17.0"):
self.warn('boto3 < 1.17.0 is not supported or tested.'
' Some features may not work.')

self.check_mode = self._module.check_mode
Expand Down
3 changes: 1 addition & 2 deletions plugins/modules/ec2_ami.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,7 @@ def create_image(module, connection):
if instance_id:
params['InstanceId'] = instance_id
params['NoReboot'] = no_reboot
if tags and module.botocore_at_least('1.19.30'):
params['TagSpecifications'] = boto3_tag_specifications(tags, types=['image', 'snapshot'])
params['TagSpecifications'] = boto3_tag_specifications(tags, types=['image', 'snapshot'])
image_id = connection.create_image(aws_retry=True, **params).get('ImageId')
else:
if architecture:
Expand Down
2 changes: 0 additions & 2 deletions plugins/modules/ec2_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@
- A list of block device mappings, by default this will always use the AMI root device so the volumes option is primarily for adding more storage.
- A mapping contains the (optional) keys device_name, virtual_name, ebs.volume_type, ebs.volume_size, ebs.kms_key_id,
ebs.iops, and ebs.delete_on_termination.
- Set ebs.throughput value requires botocore>=1.19.27.
- For more information about each parameter, see U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html).
type: list
elements: dict
Expand Down Expand Up @@ -987,7 +986,6 @@ def build_volume_spec(params):
if not volume['ebs'].get('iops'):
volume['ebs']['iops'] = 3000
if 'throughput' in volume['ebs']:
module.require_botocore_at_least('1.19.27', reason='to set throughtput value')
volume['ebs']['throughput'] = int(volume['ebs']['throughput'])
else:
volume['ebs']['throughput'] = 125
Expand Down
10 changes: 2 additions & 8 deletions plugins/modules/ec2_vol.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
- Volume throughput in MB/s.
- This parameter is only valid for gp3 volumes.
- Valid range is from 125 to 1000.
- Requires at least botocore version 1.19.27.
type: int
version_added: 1.4.0
multi_attach:
Expand Down Expand Up @@ -450,8 +449,7 @@ def update_volume(module, ec2_conn, volume):
volume['volume_type'] = response.get('VolumeModification').get('TargetVolumeType')
volume['iops'] = response.get('VolumeModification').get('TargetIops')
volume['multi_attach_enabled'] = response.get('VolumeModification').get('TargetMultiAttachEnabled')
if module.botocore_at_least("1.19.27"):
volume['throughput'] = response.get('VolumeModification').get('TargetThroughput')
volume['throughput'] = response.get('VolumeModification').get('TargetThroughput')

return volume, changed

Expand Down Expand Up @@ -679,8 +677,7 @@ def get_volume_info(module, volume, tags=None):
'tags': tags
}

if module.botocore_at_least("1.19.27"):
volume_info['throughput'] = volume.get('throughput')
volume_info['throughput'] = volume.get('throughput')

return volume_info

Expand Down Expand Up @@ -759,9 +756,6 @@ def main():
module.deprecate(
'Using the "list" state has been deprecated. Please use the ec2_vol_info module instead', date='2022-06-01', collection_name='amazon.aws')

if module.params.get('throughput'):
module.require_botocore_at_least('1.19.27', reason='to set the throughput for a volume')

# Ensure we have the zone or can get the zone
if instance is None and zone is None and state == 'present':
module.fail_json(msg="You must specify either instance or zone")
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.19.0
boto3>=1.16.0
botocore>=1.20.0
boto3>=1.17.0
6 changes: 3 additions & 3 deletions tests/integration/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
boto3==1.16.0
botocore==1.19.0
boto3==1.17.0
botocore==1.20.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.18.160
awscli==1.19.0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
default_botocore_version: '1.19.0'
default_boto3_version: '1.16.0'
default_botocore_version: '1.20.0'
default_boto3_version: '1.17.0'
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
boto3==1.16.0
botocore==1.19.0
boto3==1.17.0
botocore==1.20.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.18.160
awscli==1.19.0
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class TestMinimalVersions(object):
# Prepare some data for use in our testing
# ========================================================
def setup_method(self):
self.MINIMAL_BOTO3 = '1.16.0'
self.MINIMAL_BOTOCORE = '1.19.0'
self.OLD_BOTO3 = '1.15.999'
self.OLD_BOTOCORE = '1.18.999'
self.MINIMAL_BOTO3 = '1.17.0'
self.MINIMAL_BOTOCORE = '1.20.0'
self.OLD_BOTO3 = '1.16.999'
self.OLD_BOTOCORE = '1.19.999'

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

0 comments on commit af012e8

Please sign in to comment.