Inscreva-se no feed

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

  • The `boto3` parameter for `get_aws_connection_info()` will be removed in a release post 2025-05-01. This parameter has been ignored since release 4.0.0
  • The `boto3` parameter for `get_aws_region()` will also be removed in a release post 2025-05-01, as it has been ignored since release 4.0.0

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?  

 

Where to go next


Sobre o autor

Alina Buzachis, PhD, is a Senior Software Engineer at Red Hat Ansible, where she works primarily on cloud technologies. Alina received her PhD in Distributed Systems in 2021, focusing on advanced microservice orchestration techniques in the Cloud-to-Thing continuum. In her spare time, Alina enjoys traveling, hiking, and cooking.
Read full bio
UI_Icon-Red_Hat-Close-A-Black-RGB

Navegue por canal

automation icon

Automação

Últimas novidades em automação de TI para empresas de tecnologia, equipes e ambientes

AI icon

Inteligência artificial

Descubra as atualizações nas plataformas que proporcionam aos clientes executar suas cargas de trabalho de IA em qualquer ambiente

open hybrid cloud icon

Nuvem híbrida aberta

Veja como construímos um futuro mais flexível com a nuvem híbrida

security icon

Segurança

Veja as últimas novidades sobre como reduzimos riscos em ambientes e tecnologias

edge icon

Edge computing

Saiba quais são as atualizações nas plataformas que simplificam as operações na borda

Infrastructure icon

Infraestrutura

Saiba o que há de mais recente na plataforma Linux empresarial líder mundial

application development icon

Aplicações

Conheça nossas soluções desenvolvidas para ajudar você a superar os desafios mais complexos de aplicações

Original series icon

Programas originais

Veja as histórias divertidas de criadores e líderes em tecnologia empresarial