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 (人工知能)
お客様が AI ワークロードをどこでも自由に実行することを可能にするプラットフォームについてのアップデート
オープン・ハイブリッドクラウド
ハイブリッドクラウドで柔軟に未来を築く方法をご確認ください。
セキュリティ
環境やテクノロジー全体に及ぶリスクを軽減する方法に関する最新情報
エッジコンピューティング
エッジでの運用を単純化するプラットフォームのアップデート
インフラストラクチャ
世界有数のエンタープライズ向け Linux プラットフォームの最新情報
アプリケーション
アプリケーションの最も困難な課題に対する Red Hat ソリューションの詳細
オリジナル番組
エンタープライズ向けテクノロジーのメーカーやリーダーによるストーリー
製品
ツール
試用、購入、販売
コミュニケーション
Red Hat について
エンタープライズ・オープンソース・ソリューションのプロバイダーとして世界をリードする Red Hat は、Linux、クラウド、コンテナ、Kubernetes などのテクノロジーを提供しています。Red Hat は強化されたソリューションを提供し、コアデータセンターからネットワークエッジまで、企業が複数のプラットフォームおよび環境間で容易に運用できるようにしています。
言語を選択してください
Red Hat legal and privacy links
- Red Hat について
- 採用情報
- イベント
- 各国のオフィス
- Red Hat へのお問い合わせ
- Red Hat ブログ
- ダイバーシティ、エクイティ、およびインクルージョン
- Cool Stuff Store
- Red Hat Summit