Introduction
amazon.aws is the core Ansible collection for managing AWS resources, providing modules such as ec2_instance, cloudformation, autoscaling_group, and the aws_ec2 inventory plugin, along with shared module_utils used by many other AWS-related collections. Version 12.0.0 has been published on Ansible Galaxy, moving up from 11.5.0, and it is a major release that introduces breaking changes to minimum requirements and removes several long-deprecated parameters.
Whats New
Breaking Changes and Requirements
The headline change in this release is a bump in minimum supported versions:
- Minimum ansible-core requirement raised to >= 2.18.0, which in turn requires Python >= 3.11.
- Minimum boto3 and botocore versions raised to 1.38.0.
- Deprecated parameters
placement_groupandtenancyremoved from theec2_instancemodule. - Deprecated parameter
templateremoved from thecloudformationmodule.
Anyone still running older ansible-core, Python, or boto3/botocore versions will need to upgrade their control node environment before pulling in amazon.aws 12.0.0, or pin to the 11.x series.
Module Refactoring and Bugfixes
This release also includes bugfixes for route53_zone and a round of internal refactoring across autoscaling, RDS, and ELB modules aimed at reducing cognitive complexity and standardizing error handling via decorator patterns (RDSErrorHandler, LookupErrorHandler).
Minor Changes
| Area | Change | Reference |
|---|---|---|
| CI | Test matrices updated against ansible-core 2.21, in addition to 2.18, 2.19, 2.20 | PR #3142 |
| Collection deps | Added aiobotocore 2.23.0 as a dependency for event source plugins | PR #2952 |
autoscaling_group | Refactored to reduce complexity, improve error handling, replace manual wait loops with waiter-based implementations | PR #2938 |
autoscaling_group | Standardized return values with autoscaling_group_info via shared transformation logic in module_utils | PR #2938 |
autoscaling_group_info | Same refactor and waiter-based implementation as autoscaling_group | PR #2938 |
autoscaling_group_info | Standardized return values with autoscaling_group | PR #2938 |
aws_account_attribute | Added on_denied parameter (error default, skip, warn) to control behavior when access to account attributes is denied | PR #2914 |
aws_ec2 inventory plugin | Added availability_zone_id to the placement block in host variables | Issue #1550 |
aws_ec2 inventory plugin | Reduced cognitive complexity in hostname processing methods (SonarCloud code-smells) | PR #2936 |
ec2_tag | Added resource_tags as an alias for tags, matching ec2_instance convention | PR #3085 |
elb_application_lb | Refactored to reduce cognitive complexity and improve maintainability | PR #2946 |
elb_application_lb | Added http_xff_header_processing_mode to control how the load balancer appends, preserves, or removes the X-Forwarded-For header | Issue #3098 |
| Lookup plugins | Centralized LookupErrorHandler decorator pattern to reduce code duplication | PR #2914 |
| Lookup plugins | Updated deprecated text converter imports from ansible.module_utils._text to ansible.module_utils.common.text.converters | PR #2914 |
module_utils/_rds/api | Added shared utility functions for DB parameter group operations, decorated with @RDSErrorHandler | PR #3065 |
module_utils/_rds/common | Added DBParameterGroupNotFoundFault to the not-found error codes handled by RDSErrorHandler | PR #3065 |
module_utils/rds | Added describe_db_clusters centralized wrapper with @RDSErrorHandler and @AWSRetry decorators | PR #3065 |
How to Test
Before installing 12.0.0, verify that the control node meets the new minimum requirements: ansible-core >= 2.18.0, Python >= 3.11, and boto3/botocore >= 1.38.0.
# Check current ansible-core and Python versions
ansible --version
python3 --version
# Check current boto3/botocore versions
pip show boto3 botocore
# Install or upgrade amazon.aws to 12.0.0
ansible-galaxy collection install amazon.aws:12.0.0 --force
# Verify the installed version
ansible-galaxy collection list amazon.aws
# If needed, upgrade boto3/botocore to satisfy the new minimum
pip install --upgrade 'boto3>=1.38.0' 'botocore>=1.38.0'
# Run a quick sanity check against a playbook using ec2_instance_info
ansible-playbook -i inventory check_ec2.yml --check
Conclusion
Teams relying on ec2_instance with the now-removed placement_group or tenancy parameters, or on cloudformation with the template parameter, must update their playbooks before moving to 12.0.0. Everyone else should confirm ansible-core, Python, boto3, and botocore versions meet the new minimums, then test the upgrade in a non-production environment given the scope of the autoscaling, RDS, and ELB refactoring work included in this release.