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
저자 소개
유사한 검색 결과
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
오리지널 쇼
엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리
제품
- Red Hat Enterprise Linux
- Red Hat OpenShift Enterprise
- Red Hat Ansible Automation Platform
- 클라우드 서비스
- 모든 제품 보기
툴
체험, 구매 & 영업
커뮤니케이션
Red Hat 소개
Red Hat은 Linux, 클라우드, 컨테이너, 쿠버네티스 등을 포함한 글로벌 엔터프라이즈 오픈소스 솔루션 공급업체입니다. Red Hat은 코어 데이터센터에서 네트워크 엣지에 이르기까지 다양한 플랫폼과 환경에서 기업의 업무 편의성을 높여 주는 강화된 기능의 솔루션을 제공합니다.