In the dynamic cloud computing and automation landscape of AWS infrastructure, the latest release of the amazon.aws Ansible Content Collection introduces a number of enhancements. These enhancements are designed to improve the user experience and accelerate the seamless transition from development to production environments.
This blog post provides a glimpse into the updates and introduces the new features of amazon.aws Ansible Content Collection release 8.0.0. Let's explore the highlights!
New features highlights
This release brings several new features. Let’s take a look!
amazon.aws.lambda_event (collection module)
The `amazon.aws.lambda_event` module now supports setting `maximum_batching_window_in_seconds`. This option allows you to configure the maximum amount of time, in seconds, that Lambda spends gathering records before invoking the function. This can be set to any value from 0 to 300 seconds.
For streams (e.g., Amazon Kinesis, Amazon DynamoDB Streams) and Amazon SQS event sources, if `batch_size` is greater than 10 and `maximum_batching_window_in_seconds` is not set, it defaults to 1 second. Note that this option is not supported by FIFO queues.
Use case scenario: Optimizing Lambda invocation frequency for cost savings
Suppose you have a Lambda function that processes messages from an Amazon SQS queue. The function is invoked frequently, leading to higher costs due to the large number of executions. You want to reduce the number of invocations while ensuring that the function still processes messages in a timely manner.
Use the new option `maximum_batching_window_in_seconds` in the `amazon.aws.lambda_event`module to increase the batching window, allowing more records to be gathered before each invocation. This approach optimizes the invocation frequency and can result in significant cost savings.
- name: Create an SQS event mapping
amazon.aws.lambda_event:
state: "present"
event_source: "sqs"
function_arn: "{{ your_lambda_function_arn }}"
source_params:
source_arn: "{{ your_sqs_arn_standard }}"
enabled: true
batch_size: 100
maximum_batching_window_in_seconds: 10
amazon.aws.rds_instance (collection module)
The `amazon.aws.rds_instance` module now supports setting an empty list to `enable_cloudwatch_logs_exports` in order to remove all existing exports. The `enable_cloudwatch_logs_exports`option enables you to list log types to enable for exporting to CloudWatch Logs. For more information, see Publishing Database Logs to Amazon CloudWatch Logs in the Amazon RDS User Guide.
Use case scenario: Disabling log exports for maintenance
Suppose you need to temporarily disable all log exports from an RDS instance to CloudWatch Logs during a maintenance window to reduce logging overhead and focus on critical system performance.
Use the new option in the `amazon.aws.rds_instance` module to remove all existing log exports by setting `enable_cloudwatch_logs_exports` to an empty list. This action will stop all logs from being exported to CloudWatch Logs, so that the maintenance tasks are not interrupted by unnecessary logging activities. After the maintenance window, you can re-enable the necessary log exports as required.
- name: Remove all existing CloudWatch Logs exports from RDS instance
amazon.aws.rds_instance:
state: present
db_instance_identifier: "{{ your_rds_instance }}"
enable_cloudwatch_logs_exports: []
New Ansible support policy
This collection release introduces several deprecations in the modules and drops support for `ansible-core<2.15`, which reached EOL on May 20, 2024. For more information, visit the Ansible release documentation.
Deprecated features
This collection release also introduces some deprecations into the collection's modules.
Module | Description |
cloudformation | The `template` parameter is deprecated and will be removed after 2026-05-01. Use the `template_body` parameter with the lookup plugin instead. |
iam_policy | The previously deprecated `policies` return key will be removed in release 9.0.0. Use the `policy_names` return key instead. |
iam_role iam_role_info | The `iam_role.assume_role_policy_document_raw` return value has been deprecated and `iam_role.assume_role_policy_document` now returns the same format as `iam_role.assume_role_policy_document_raw`. |
rds_param_group | The module has been renamed from `rds_param_group` to `rds_instance_param_group`. The usage remains unchanged, but the `rds_param_group`alias will be removed in version 10.0.0. |
Breaking changes
This collection release also introduces some breaking changes into the collection's modules.
Module | Description |
iam_role iam_role_info | The `iam_role.assume_role_policy_document` is no longer converted from SnakeCase to camel_case. |
kms_key kms_key_info | The `policies` return value has been renamed to `key_policies`, though the contents remain unchanged. |
lambda_event | The `batch_size` no longer defaults to 100. According to the boto3 API, `batch_size` defaults to 10 for SQS sources and to 100 for stream sources. More details. |
Changes for developers
If you are an active contributor to the amazon.aws collection or are willing to become one, the following changes may be of interest to you:
Module | Description |
aws_ec2 inventory plugin | The `include_extra_api_calls` option, previously deprecated, is set to be removed in release 9.0.0. |
module_utils.botocore |
|
module_utils.ec2 | The `boto3` parameter for `get_ec2_security_group_ids_from_names()` will be removed in a release post 2025-05-01, having been ignored since release 4.0.0 |
module_utils.policy | The previously deprecated `sort_json_policy_dict()` function has been removed from module_utils.policy. Users are encouraged to consider using `compare_policies()` instead. |
Code quality improvement
In an ongoing effort to enhance code quality within the collection, several key initiatives are underway.
Firstly, significant attention is being devoted to refactoring critical modules such as the S3, EC2 and RDS modules. This refactoring aims to improve code readability, maintainability and performance to enable a smoother user experience. In this release, the refactoring of the s3_bucket module has been completed and included.
Moreover, unused code segments are being identified and removed from various modules including `autoscaling_group`, `cloudtrail`, `ec2_instance`, `ec2_vol`, `elb_classic_lb`, `kms_key`, and `s3_object`. This cleanup process streamlines the codebase, reducing complexity and enhancing overall maintainability.
However, it's important to note that refactoring efforts are ongoing for several other modules within the collection. While these modules are not included in the current release, they are scheduled for refactoring in future releases to further enhance code quality and user experience.
Additionally, efforts are being made to keep the RETURN block of plugins up-to-date. Accuracy and comprehensiveness in the output data structure returned by these modules is paramount for user understanding and effective utilization. In this release, we included some documentation updates in the RETURN block for several EC2 modules.
Furthermore, the documentation for plugins is being enhanced by adopting the new Ansible semantic markdown. More details. This enhancement aims to improve the readability and clarity of the documentation, thereby facilitating easier usage for users.
These initiatives encompass all modules within the collection and will be reflected in upcoming releases, so users can benefit from cleaner, more efficient and better-documented code throughout the collection.
Looking to get started with Ansible for Amazon Web Services?
- Check out the Amazon Web Services Guide
- Try out the hands-on Interactive Labs
- Read the e-book: Using automation to get the most from your public cloud
Where to go next
- Check out Red Hat Summit 2024!
- For further reading and information, visit the other blogs related to Ansible Automation Platform.
- Check out the YouTube playlist for everything about Ansible Collections to know more.
- Are you new to Ansible automation and want to learn? Check out our getting started guide on developers.redhat.com
À propos de l'auteur
Contenu similaire
Parcourir par canal
Automatisation
Les dernières nouveautés en matière d'automatisation informatique pour les technologies, les équipes et les environnements
Intelligence artificielle
Actualité sur les plateformes qui permettent aux clients d'exécuter des charges de travail d'IA sur tout type d'environnement
Cloud hybride ouvert
Découvrez comment créer un avenir flexible grâce au cloud hybride
Sécurité
Les dernières actualités sur la façon dont nous réduisons les risques dans tous les environnements et technologies
Edge computing
Actualité sur les plateformes qui simplifient les opérations en périphérie
Infrastructure
Les dernières nouveautés sur la plateforme Linux d'entreprise leader au monde
Applications
À l’intérieur de nos solutions aux défis d’application les plus difficiles
Programmes originaux
Histoires passionnantes de créateurs et de leaders de technologies d'entreprise
Produits
- Red Hat Enterprise Linux
- Red Hat OpenShift
- Red Hat Ansible Automation Platform
- Services cloud
- Voir tous les produits
Outils
- Formation et certification
- Mon compte
- Assistance client
- Ressources développeurs
- Rechercher un partenaire
- Red Hat Ecosystem Catalog
- Calculateur de valeur Red Hat
- Documentation
Essayer, acheter et vendre
Communication
- Contacter le service commercial
- Contactez notre service clientèle
- Contacter le service de formation
- Réseaux sociaux
À propos de Red Hat
Premier éditeur mondial de solutions Open Source pour les entreprises, nous fournissons des technologies Linux, cloud, de conteneurs et Kubernetes. Nous proposons des solutions stables qui aident les entreprises à jongler avec les divers environnements et plateformes, du cœur du datacenter à la périphérie du réseau.
Sélectionner une langue
Red Hat legal and privacy links
- À propos de Red Hat
- Carrières
- Événements
- Bureaux
- Contacter Red Hat
- Lire le blog Red Hat
- Diversité, équité et inclusion
- Cool Stuff Store
- Red Hat Summit