diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-26 04:05:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-26 04:05:56 +0000 |
commit | 67c6a4d1dccb62159b9d9b2dea4e2f487446e276 (patch) | |
tree | 9ccbb35137f480bbbdb899accbda52a8135d3416 /ansible_collections/community/aws | |
parent | Adding upstream version 9.4.0+dfsg. (diff) | |
download | ansible-67c6a4d1dccb62159b9d9b2dea4e2f487446e276.tar.xz ansible-67c6a4d1dccb62159b9d9b2dea4e2f487446e276.zip |
Adding upstream version 9.5.1+dfsg.upstream/9.5.1+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
18 files changed, 495 insertions, 43 deletions
diff --git a/ansible_collections/community/aws/CHANGELOG.rst b/ansible_collections/community/aws/CHANGELOG.rst index 651b7c763..b47d79fe4 100644 --- a/ansible_collections/community/aws/CHANGELOG.rst +++ b/ansible_collections/community/aws/CHANGELOG.rst @@ -4,6 +4,29 @@ community.aws Release Notes .. contents:: Topics +v7.2.0 +====== + +Release Summary +--------------- + +This release includes a new module ``dynamodb_table_info``, new features for the ``glue_job`` and ``msk_cluster`` modules, and a bugfix for the ``aws_ssm`` connection plugin. + +Minor Changes +------------- + +- glue_job - add support for 2 new instance types which are G.4X and G.8X (https://github.com/ansible-collections/community.aws/pull/2048). +- msk_cluster - Support for additional ``m5`` and ``m7g`` types of MSK clusters (https://github.com/ansible-collections/community.aws/pull/1947). + +Bugfixes +-------- + +- ssm(connection) - fix bucket region logic when region is ``us-east-1`` (https://github.com/ansible-collections/community.aws/pull/1908). + +New Modules +----------- + +- dynamodb_table_info - Returns information about a Dynamo DB table v7.1.0 ====== @@ -23,7 +46,7 @@ Minor Changes Bugfixes -------- -- aws_ssm - disable `enable-bracketed-paste` to fix issue with amazon linux 2023 and other OSes (https://github.com/ansible-collections/community.aws/issues/1756) +- aws_ssm - disable ``enable-bracketed-paste`` to fix issue with amazon linux 2023 and other OSes (https://github.com/ansible-collections/community.aws/issues/1756) v7.0.0 ====== @@ -134,7 +157,6 @@ This release brings some new plugins and features. Several bugfixes, breaking ch The community.aws collection has dropped support for ``botocore<1.25.0`` and ``boto3<1.22.0``. Support for Python 3.6 has also been dropped. - Minor Changes ------------- @@ -207,7 +229,6 @@ Release Summary This release contains a number of bugfixes for various modules, as well as new features for the ``ec2_launch_template`` and ``msk_cluster`` modules. This is the last planned minor release prior to the release of version 6.0.0. - Minor Changes ------------- @@ -303,7 +324,6 @@ modules. As well as improvements to the ``ecs_cluster``, ``ec2_ecr``, ``ecs_service``, ``iam_role`` and ``ssm_parameter`` plugins. - Minor Changes ------------- @@ -369,7 +389,6 @@ Support for ``ansible-core<2.11`` has also been dropped. This release also brings some new features, bugfixes, breaking changes and deprecated features. - Minor Changes ------------- @@ -531,7 +550,6 @@ Release Summary This release contains a minor bugfix for the ``sns_topic`` module as well as corrections to the documentation for various modules. This is the last planned release of the 4.x series. - Bugfixes -------- @@ -889,7 +907,6 @@ Release Summary Following the release of community.aws 5.0.0, 3.6.0 is a bugfix release and the final planned release for the 3.x series. - Minor Changes ------------- diff --git a/ansible_collections/community/aws/FILES.json b/ansible_collections/community/aws/FILES.json index 6bc607963..58ea3a1a7 100644 --- a/ansible_collections/community/aws/FILES.json +++ b/ansible_collections/community/aws/FILES.json @@ -179,7 +179,7 @@ "name": "changelogs/changelog.yaml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "71507aa348f024b04b28a249ccb60a22d09d95eaf0e2f503add687640fc648e9", + "chksum_sha256": "a4a404a462b4858f815f4cdd2b1651a4301a2cc2f868ac9f1ca14bfcec74d313", "format": 1 }, { @@ -214,7 +214,7 @@ "name": "docs/docsite/rst/CHANGELOG.rst", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5c20e11dfc1704180b5d197a68107a5a6092c324a99739646c42bb0e1a0dc8a4", + "chksum_sha256": "56d5b1f84c1fe53d65c7450a967427dd1e64a5ae6f5029e786b617686a98eb69", "format": 1 }, { @@ -242,7 +242,7 @@ "name": "meta/runtime.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "6195942600514b3a6fd22586eaba89cccdc9bc09265aff576f7a2de8346c4a6c", + "chksum_sha256": "73da55c9ac6fc4170daa33c7085e944bb0c61bfa045bd8f0794f66c27bacfb36", "format": 1 }, { @@ -270,7 +270,7 @@ "name": "plugins/connection/aws_ssm.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "72738ace4fc3fabddcee868e0ad6f01ae82976b1aed13319bdbe5ddef1c8e6c6", + "chksum_sha256": "dc7e2bc595289e435c5ed3b4dd3de07d8bed518d67cdfe52ab465aee341bfc6c", "format": 1 }, { @@ -305,7 +305,7 @@ "name": "plugins/module_utils/common.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9ae9caf904353f2952d5257bea7cb0b4a4e96668dcc9871c82809cd0b4f38f4f", + "chksum_sha256": "0f464ad15f459dc646c9596544ec189cf67ff07225c4a22fdba46b0daae73cdc", "format": 1 }, { @@ -687,6 +687,13 @@ "format": 1 }, { + "name": "plugins/modules/dynamodb_table_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "d77ba73e2bf62068b6ffeb53e04b797b4c79cc1fa8f4cf613df7ab5be0536b6d", + "format": 1 + }, + { "name": "plugins/modules/dynamodb_ttl.py", "ftype": "file", "chksum_type": "sha256", @@ -1068,7 +1075,7 @@ "name": "plugins/modules/glue_job.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b9d5d95b21a49c62e1f86bd8f5e30ab45a9ec0bc81dc680a5f3233e712833108", + "chksum_sha256": "5bc96be59165bee14b0e1186072eace1039229420bae41ea50d4cfa9caed560d", "format": 1 }, { @@ -1166,7 +1173,7 @@ "name": "plugins/modules/msk_cluster.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c4211d04238671d5f57b0214e55d12e541c9619b6275c120868019fd3eaf56b4", + "chksum_sha256": "b78414661d661838a4e31182c127c40867669efca69d283a4202ec70da7676b7", "format": 1 }, { @@ -3609,14 +3616,14 @@ "name": "tests/integration/targets/dynamodb_table/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "564f5d43b5e448142ce041267325d9149d1743af5027a7875064248ba656ce22", + "chksum_sha256": "94cd8b7ef587ffd1abc1b33950c1dbfa69f559040c3c02b55932cfb1b9601598", "format": 1 }, { "name": "tests/integration/targets/dynamodb_table/tasks/test_pay_per_request.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "45cf53627344eb31b7bb79bddca9d6e53d9a04a84136c5c2118e4ffd5b3e3694", + "chksum_sha256": "fb8ba194bb9558e1ac5b4f204546b6c3e39c722a74cb8f0627657a7dea463b45", "format": 1 }, { @@ -5408,7 +5415,7 @@ "name": "tests/integration/targets/elb_target/tasks/lambda_target.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3e8f8a7ad8f8d4395ec5529c296ec4297050541026ee8fcbbaa46cb0c0a78640", + "chksum_sha256": "a17e3f3cbd23a65e7aec0ffb1da5e15ea7241d33d5a0ea2323ec9eccd15c349c", "format": 1 }, { @@ -7256,7 +7263,7 @@ "name": "tests/integration/targets/s3_bucket_notification/tasks/test_lambda_notifications.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d401f6906f366e920d10516f37ad5b53b4748e7063b0272ee84e84e09c0477fd", + "chksum_sha256": "f6a147ffee70552754175c3f75247106b13911eee09f39fe7649f642af25100d", "format": 1 }, { @@ -7620,7 +7627,7 @@ "name": "tests/integration/targets/secretsmanager_secret/tasks/rotation.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "01d2a81ec50be52c30ed22608cc917025834e709a3e43ded577e7676c34e5e57", + "chksum_sha256": "e4b8e9c86cd550dc3c11a0e6d8838bbf37c7da0bee0f8b46c57666dd9fa94b9c", "format": 1 }, { @@ -8425,7 +8432,7 @@ "name": "tests/integration/targets/sns_topic/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "00bff28386d44b4c5681c9ab8852075291b3999c2bd8490798605ad84d8d4154", + "chksum_sha256": "c9f6e39100c348ee75fb0de739f853d58c86b7b1050dc3e94ca3a391dbf83d1a", "format": 1 }, { @@ -9139,7 +9146,7 @@ "name": "tests/sanity/ignore-2.17.txt", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "c9271c547f92773ba4ed8df6eb56394c85deefb66078ae7336b285aee9d252d9", + "chksum_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "format": 1 }, { @@ -13311,7 +13318,7 @@ "name": "CHANGELOG.rst", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5c20e11dfc1704180b5d197a68107a5a6092c324a99739646c42bb0e1a0dc8a4", + "chksum_sha256": "56d5b1f84c1fe53d65c7450a967427dd1e64a5ae6f5029e786b617686a98eb69", "format": 1 }, { diff --git a/ansible_collections/community/aws/MANIFEST.json b/ansible_collections/community/aws/MANIFEST.json index 224e6ba06..514454326 100644 --- a/ansible_collections/community/aws/MANIFEST.json +++ b/ansible_collections/community/aws/MANIFEST.json @@ -2,7 +2,7 @@ "collection_info": { "namespace": "community", "name": "aws", - "version": "7.1.0", + "version": "7.2.0", "authors": [ "Ansible (https://github.com/ansible)" ], @@ -28,7 +28,7 @@ "name": "FILES.json", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "efadd5485c903284fc4f80439e50ff696569304185ef6c966c442c2b5603c5c8", + "chksum_sha256": "160883c33483553569816c9173e6073c59ded3c77bc8fdab656e7c72b1794d3a", "format": 1 }, "format": 1 diff --git a/ansible_collections/community/aws/changelogs/changelog.yaml b/ansible_collections/community/aws/changelogs/changelog.yaml index ea65a58be..e299d000e 100644 --- a/ansible_collections/community/aws/changelogs/changelog.yaml +++ b/ansible_collections/community/aws/changelogs/changelog.yaml @@ -3713,7 +3713,7 @@ releases: 7.1.0: changes: bugfixes: - - aws_ssm - disable `enable-bracketed-paste` to fix issue with amazon linux + - aws_ssm - disable ``enable-bracketed-paste`` to fix issue with amazon linux 2023 and other OSes (https://github.com/ansible-collections/community.aws/issues/1756) minor_changes: - aws_ssm - Updated the documentation to explicitly state that an S3 bucket @@ -3734,3 +3734,24 @@ releases: - release.yml - ssm-fedora34.yml release_date: '2024-01-10' + 7.2.0: + changes: + bugfixes: + - ssm(connection) - fix bucket region logic when region is ``us-east-1`` (https://github.com/ansible-collections/community.aws/pull/1908). + minor_changes: + - glue_job - add support for 2 new instance types which are G.4X and G.8X (https://github.com/ansible-collections/community.aws/pull/2048). + - msk_cluster - Support for additional ``m5`` and ``m7g`` types of MSK clusters + (https://github.com/ansible-collections/community.aws/pull/1947). + release_summary: This release includes a new module ``dynamodb_table_info``, + new features for the ``glue_job`` and ``msk_cluster`` modules, and a bugfix + for the ``aws_ssm`` connection plugin. + fragments: + - 1908-fix_find_out_bucket_region_logic.yml + - 1947-add_support_msk_addtinal_type.yml + - 20240402-lambda-test-runtime.yml + - 2048-add-new-instance-types-in-gluejob.yaml + modules: + - description: Returns information about a Dynamo DB table + name: dynamodb_table_info + namespace: '' + release_date: '2024-04-05' diff --git a/ansible_collections/community/aws/docs/docsite/rst/CHANGELOG.rst b/ansible_collections/community/aws/docs/docsite/rst/CHANGELOG.rst index 651b7c763..b47d79fe4 100644 --- a/ansible_collections/community/aws/docs/docsite/rst/CHANGELOG.rst +++ b/ansible_collections/community/aws/docs/docsite/rst/CHANGELOG.rst @@ -4,6 +4,29 @@ community.aws Release Notes .. contents:: Topics +v7.2.0 +====== + +Release Summary +--------------- + +This release includes a new module ``dynamodb_table_info``, new features for the ``glue_job`` and ``msk_cluster`` modules, and a bugfix for the ``aws_ssm`` connection plugin. + +Minor Changes +------------- + +- glue_job - add support for 2 new instance types which are G.4X and G.8X (https://github.com/ansible-collections/community.aws/pull/2048). +- msk_cluster - Support for additional ``m5`` and ``m7g`` types of MSK clusters (https://github.com/ansible-collections/community.aws/pull/1947). + +Bugfixes +-------- + +- ssm(connection) - fix bucket region logic when region is ``us-east-1`` (https://github.com/ansible-collections/community.aws/pull/1908). + +New Modules +----------- + +- dynamodb_table_info - Returns information about a Dynamo DB table v7.1.0 ====== @@ -23,7 +46,7 @@ Minor Changes Bugfixes -------- -- aws_ssm - disable `enable-bracketed-paste` to fix issue with amazon linux 2023 and other OSes (https://github.com/ansible-collections/community.aws/issues/1756) +- aws_ssm - disable ``enable-bracketed-paste`` to fix issue with amazon linux 2023 and other OSes (https://github.com/ansible-collections/community.aws/issues/1756) v7.0.0 ====== @@ -134,7 +157,6 @@ This release brings some new plugins and features. Several bugfixes, breaking ch The community.aws collection has dropped support for ``botocore<1.25.0`` and ``boto3<1.22.0``. Support for Python 3.6 has also been dropped. - Minor Changes ------------- @@ -207,7 +229,6 @@ Release Summary This release contains a number of bugfixes for various modules, as well as new features for the ``ec2_launch_template`` and ``msk_cluster`` modules. This is the last planned minor release prior to the release of version 6.0.0. - Minor Changes ------------- @@ -303,7 +324,6 @@ modules. As well as improvements to the ``ecs_cluster``, ``ec2_ecr``, ``ecs_service``, ``iam_role`` and ``ssm_parameter`` plugins. - Minor Changes ------------- @@ -369,7 +389,6 @@ Support for ``ansible-core<2.11`` has also been dropped. This release also brings some new features, bugfixes, breaking changes and deprecated features. - Minor Changes ------------- @@ -531,7 +550,6 @@ Release Summary This release contains a minor bugfix for the ``sns_topic`` module as well as corrections to the documentation for various modules. This is the last planned release of the 4.x series. - Bugfixes -------- @@ -889,7 +907,6 @@ Release Summary Following the release of community.aws 5.0.0, 3.6.0 is a bugfix release and the final planned release for the 3.x series. - Minor Changes ------------- diff --git a/ansible_collections/community/aws/meta/runtime.yml b/ansible_collections/community/aws/meta/runtime.yml index 5d05436df..4c6bc7291 100644 --- a/ansible_collections/community/aws/meta/runtime.yml +++ b/ansible_collections/community/aws/meta/runtime.yml @@ -89,6 +89,7 @@ action_groups: - dms_endpoint - dms_replication_subnet_group - dynamodb_table + - dynamodb_table_info - dynamodb_ttl - ec2_ami_copy - ec2_asg diff --git a/ansible_collections/community/aws/plugins/connection/aws_ssm.py b/ansible_collections/community/aws/plugins/connection/aws_ssm.py index 5186179f4..5c2d6d577 100644 --- a/ansible_collections/community/aws/plugins/connection/aws_ssm.py +++ b/ansible_collections/community/aws/plugins/connection/aws_ssm.py @@ -430,7 +430,10 @@ class Connection(ConnectionBase): bucket_location = tmp_s3_client.get_bucket_location( Bucket=(self.get_option("bucket_name")), ) - bucket_region = bucket_location["LocationConstraint"] + if bucket_location["LocationConstraint"]: + bucket_region = bucket_location["LocationConstraint"] + else: + bucket_region = "us-east-1" if self.get_option("bucket_endpoint_url"): return self.get_option("bucket_endpoint_url"), bucket_region diff --git a/ansible_collections/community/aws/plugins/module_utils/common.py b/ansible_collections/community/aws/plugins/module_utils/common.py index 0c4374729..321349a1d 100644 --- a/ansible_collections/community/aws/plugins/module_utils/common.py +++ b/ansible_collections/community/aws/plugins/module_utils/common.py @@ -5,4 +5,4 @@ COMMUNITY_AWS_COLLECTION_NAME = "community.aws" -COMMUNITY_AWS_COLLECTION_VERSION = "7.1.0" +COMMUNITY_AWS_COLLECTION_VERSION = "7.2.0" diff --git a/ansible_collections/community/aws/plugins/modules/dynamodb_table_info.py b/ansible_collections/community/aws/plugins/modules/dynamodb_table_info.py new file mode 100644 index 000000000..66349e2d7 --- /dev/null +++ b/ansible_collections/community/aws/plugins/modules/dynamodb_table_info.py @@ -0,0 +1,292 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright: Ansible Project +# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: dynamodb_table_info +version_added: 7.2.0 +short_description: Returns information about a Dynamo DB table +description: + - Returns information about the Dynamo DB table, including the current status of the table, + when it was created, the primary key schema, and any indexes on the table. +author: + - Aubin Bikouo (@abikouo) +options: + name: + description: + - The name of the table to describe. + required: true + type: str +extends_documentation_fragment: + - amazon.aws.common.modules + - amazon.aws.region.modules + - amazon.aws.boto3 +""" + +EXAMPLES = r""" +- name: Return information about the DynamoDB table named 'my-table' + community.aws.dynamodb_table_info: + name: my-table +""" + +RETURN = r""" +table: + description: The returned table params from the describe API call. + returned: success + type: complex + contains: + table_name: + description: The name of the table. + returned: always + type: str + table_status: + description: The current state of the table. + returned: always + type: str + sample: 'ACTIVE' + creation_date_time: + description: The date and time when the table was created, in UNIX epoch time format. + returned: always + type: str + table_size_bytes: + description: The total size of the specified table, in bytes. + returned: always + type: int + item_count: + description: The number of items in the specified table. + returned: always + type: int + table_arn: + description: The Amazon Resource Name (ARN) that uniquely identifies the table. + returned: always + type: str + table_id: + description: Unique identifier for the table for which the backup was created. + returned: always + type: str + attribute_definitions: + description: A list of attributes for describing the key schema for the table and indexes. + returned: always + type: complex + contains: + attribute_name: + description: A name for the attribute. + type: str + returned: always + attribute_type: + description: The data type for the attribute, S (String), N (Number) and B (Binary). + type: str + returned: always + key_schema: + description: A list of key schemas that specify the attributes that make up the primary key of a table, or the key attributes of an index. + returned: always + type: complex + contains: + attribute_name: + description: The name of a key attribute. + type: str + returned: always + key_type: + description: The role that this key attribute will assume, 'HASH' for partition key, 'RANGE' for sort key + type: str + returned: always + billing_mode: + description: Controls how you are charged for read and write throughput and how you manage capacity. + returned: always + type: str + local_secondary_indexes: + description: Represents one or more local secondary indexes on the table. + returned: if any, on the table + type: list + elements: dict + global_secondary_indexes: + description: The global secondary indexes of table. + returned: if any, on the table + type: list + elements: dict + stream_specification: + description: The current DynamoDB Streams configuration for the table. + returned: if any, on the table + type: complex + contains: + stream_enabled: + description: Indicates whether DynamoDB Streams is enabled (true) or disabled (false) on the table. + type: bool + returned: always + sample: true + stream_view_type: + description: When an item in the table is modified, stream_view_type determines what information is written to the stream for this table. + type: str + returned: always + sample: KEYS_ONLY + latest_stream_label: + description: A timestamp, in ISO 8601 format, for this stream. + type: str + returned: if any on the table + latest_stream_arn: + description: The Amazon Resource Name (ARN) that uniquely identifies the latest stream for this table. + returned: if any on the table + type: str + global_table_version: + description: Represents the version of global tables in use, if the table is replicated across AWS Regions. + type: str + returned: if the table is replicated + replicas: + description: Represents replicas of the table. + type: list + elements: dict + returned: if any on the table + source_backup_arn: + description: The Amazon Resource Name (ARN) of the backup from which the table was restored. + type: str + returned: if any, on the table + source_table_arn: + description: The ARN of the source table of the backup that is being restored. + type: str + returned: if any, on the table + restore_date_time: + description: Point in time or source backup time. + type: str + returned: if any, on table + restore_in_progress: + description: Indicates if a restore is in progress or not. + type: bool + returned: if any, on table + sse_description: + description: The description of the server-side encryption status on the specified table. + type: dict + returned: if any, on table + sample: {} + archival_summary: + description: Contains information about the table archive. + type: complex + returned: if any, on table + contains: + archival_date_time: + description: The date and time when table archival was initiated by DynamoDB, in UNIX epoch time format. + type: str + returned: always + archival_reason: + description: The reason DynamoDB archived the table. + type: str + returned: always + sample: INACCESSIBLE_ENCRYPTION_CREDENTIALS + archival_backup_arn: + description: The Amazon Resource Name (ARN) of the backup the table was archived to, when applicable in the archival reason. + type: str + returned: always + table_class: + description: The table class of the specified table. + type: str + returned: if any on the table + sample: STANDARD_INFREQUENT_ACCESS + deletion_protection_enabled: + description: Indicates whether deletion protection is enabled (true) or disabled (false) on the table. + type: bool + returned: always + sample: true + provisioned_throughput: + description: The provisioned throughput settings for the table. + type: dict + returned: always + sample: '{"number_of_decreases_today": 0, "read_capacity_units": 1, "write_capacity_units": 1}' + tags: + description: A dict of tags associated with the DynamoDB table. + returned: always + type: dict +""" + +try: + import botocore +except ImportError: + pass # Handled by AnsibleAWSModule + +from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict + +from ansible_collections.amazon.aws.plugins.module_utils.botocore import is_boto3_error_code +from ansible_collections.amazon.aws.plugins.module_utils.retries import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict + +from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule + + +# ResourceNotFoundException is expected here if the table doesn't exist +@AWSRetry.jittered_backoff(catch_extra_error_codes=["LimitExceededException", "ResourceInUseException"]) +def _describe_table(client, **params): + return client.describe_table(**params) + + +def describe_dynamodb_table(module): + table_name = module.params.get("name") + retry_decorator = AWSRetry.jittered_backoff( + catch_extra_error_codes=["LimitExceededException", "ResourceInUseException", "ResourceNotFoundException"], + ) + client = module.client("dynamodb", retry_decorator=retry_decorator) + try: + table = _describe_table(client, TableName=table_name) + except is_boto3_error_code("ResourceNotFoundException"): + module.exit_json(table={}) + except ( + botocore.exceptions.ClientError, + botocore.exceptions.BotoCoreError, + ) as e: # pylint: disable=duplicate-except + module.fail_json_aws(e, msg="Failed to describe table") + + table = table["Table"] + try: + tags = client.list_tags_of_resource(aws_retry=True, ResourceArn=table["TableArn"])["Tags"] + except is_boto3_error_code("AccessDeniedException"): + module.warn("Permission denied when listing tags") + tags = [] + except ( + botocore.exceptions.ClientError, + botocore.exceptions.BotoCoreError, + ) as e: # pylint: disable=duplicate-except + module.fail_json_aws(e, msg="Failed to list table tags") + + table = camel_dict_to_snake_dict(table) + table["tags"] = boto3_tag_list_to_ansible_dict(tags) + + if "table_class_summary" in table: + table["table_class"] = table["table_class_summary"]["table_class"] + del table["table_class_summary"] + + # billing_mode_summary doesn't always seem to be set but is always set for PAY_PER_REQUEST + # and when updating the billing_mode + if "billing_mode_summary" in table: + table["billing_mode"] = table["billing_mode_summary"]["billing_mode"] + del table["billing_mode_summary"] + else: + table["billing_mode"] = "PROVISIONED" + + # Restore summary + if "restore_summary" in table: + table["source_backup_arn"] = table["restore_summary"].get("source_backup_arn", "") + table["source_table_arn"] = table["restore_summary"].get("source_table_arn", "") + table["restore_date_time"] = table["restore_summary"].get("restore_date_time", "") + table["restore_in_progress"] = table["restore_summary"].get("restore_in_progress") + del table["restore_summary"] + + module.exit_json(table=table) + + +def main(): + argument_spec = dict( + name=dict( + required=True, + ), + ) + + module = AnsibleAWSModule( + argument_spec=argument_spec, + supports_check_mode=True, + ) + + describe_dynamodb_table(module) + + +if __name__ == "__main__": + main() diff --git a/ansible_collections/community/aws/plugins/modules/glue_job.py b/ansible_collections/community/aws/plugins/modules/glue_job.py index 256779975..10ad102e3 100644 --- a/ansible_collections/community/aws/plugins/modules/glue_job.py +++ b/ansible_collections/community/aws/plugins/modules/glue_job.py @@ -95,7 +95,8 @@ options: worker_type: description: - The type of predefined worker that is allocated when a job runs. - choices: [ 'Standard', 'G.1X', 'G.2X' ] + - Support for instance types C(G.4X( and C(G.8X) was added in community.aws release 7.2.0. + choices: [ 'Standard', 'G.1X', 'G.2X', 'G.4X', 'G.8X' ] type: str version_added: 1.5.0 notes: @@ -465,7 +466,7 @@ def main(): state=dict(required=True, choices=["present", "absent"], type="str"), tags=dict(type="dict", aliases=["resource_tags"]), timeout=dict(type="int"), - worker_type=dict(choices=["Standard", "G.1X", "G.2X"], type="str"), + worker_type=dict(choices=["Standard", "G.1X", "G.2X", "G.4X", "G.8X"], type="str"), ) module = AnsibleAWSModule( diff --git a/ansible_collections/community/aws/plugins/modules/msk_cluster.py b/ansible_collections/community/aws/plugins/modules/msk_cluster.py index aa0383294..9ecf053f8 100644 --- a/ansible_collections/community/aws/plugins/modules/msk_cluster.py +++ b/ansible_collections/community/aws/plugins/modules/msk_cluster.py @@ -54,6 +54,17 @@ options: - kafka.m5.xlarge - kafka.m5.2xlarge - kafka.m5.4xlarge + - kafka.m5.8xlarge + - kafka.m5.12xlarge + - kafka.m5.16xlarge + - kafka.m5.24xlarge + - kafka.m7g.large + - kafka.m7g.xlarge + - kafka.m7g.2xlarge + - kafka.m7g.4xlarge + - kafka.m7g.8xlarge + - kafka.m7g.12xlarge + - kafka.m7g.16xlarge default: kafka.t3.small type: str ebs_volume_size: @@ -662,6 +673,17 @@ def main(): "kafka.m5.xlarge", "kafka.m5.2xlarge", "kafka.m5.4xlarge", + "kafka.m5.8xlarge", + "kafka.m5.12xlarge", + "kafka.m5.16xlarge", + "kafka.m5.24xlarge", + "kafka.m7g.large", + "kafka.m7g.xlarge", + "kafka.m7g.2xlarge", + "kafka.m7g.4xlarge", + "kafka.m7g.8xlarge", + "kafka.m7g.12xlarge", + "kafka.m7g.16xlarge", ], default="kafka.t3.small", ), diff --git a/ansible_collections/community/aws/tests/integration/targets/dynamodb_table/tasks/main.yml b/ansible_collections/community/aws/tests/integration/targets/dynamodb_table/tasks/main.yml index 268e61bae..5b3592f30 100644 --- a/ansible_collections/community/aws/tests/integration/targets/dynamodb_table/tasks/main.yml +++ b/ansible_collections/community/aws/tests/integration/targets/dynamodb_table/tasks/main.yml @@ -30,6 +30,16 @@ that: - create_table is successful - create_table is changed + + - name: Ensure the table was not created + dynamodb_table_info: + name: "{{ table_name }}" + register: table_info + + - name: Assert the table was not created + assert: + that: + - not table_info.table - name: Create table dynamodb_table: @@ -65,6 +75,17 @@ - create_table.table_name == table_name - create_table.write_capacity == 1 + - name: Ensure the table was created + dynamodb_table_info: + name: "{{ table_name }}" + register: table_info + + - name: Assert the table was created + assert: + that: + - table_info.table + - 'table_info.table.attribute_definitions == [{"attribute_name": table_index, "attribute_type": table_index_type[0]}]' + - name: Create table - idempotent - check_mode dynamodb_table: state: present diff --git a/ansible_collections/community/aws/tests/integration/targets/dynamodb_table/tasks/test_pay_per_request.yml b/ansible_collections/community/aws/tests/integration/targets/dynamodb_table/tasks/test_pay_per_request.yml index b469a1b51..301d22c06 100644 --- a/ansible_collections/community/aws/tests/integration/targets/dynamodb_table/tasks/test_pay_per_request.yml +++ b/ansible_collections/community/aws/tests/integration/targets/dynamodb_table/tasks/test_pay_per_request.yml @@ -15,6 +15,16 @@ - create_table is successful - create_table is changed +- name: Ensure the table was not created + dynamodb_table_info: + name: "{{ table_name_on_demand }}" + register: _table + +- name: Assert the table does not exist + assert: + that: + - not _table.table + - name: Create table - pay-per-request dynamodb_table: state: present @@ -32,6 +42,17 @@ - create_table is changed - create_table.billing_mode == "PAY_PER_REQUEST" +- name: Ensure the table was created + dynamodb_table_info: + name: "{{ table_name_on_demand }}" + register: _table + +- name: Assert the table has been created with the expected billing mode + assert: + that: + - _table.table + - _table.table.billing_mode == 'PAY_PER_REQUEST' + - name: Create table - pay-per-request - check failure dynamodb_table: state: present @@ -71,6 +92,16 @@ - create_complex_table is successful - create_complex_table is changed +- name: Ensure the table was not created + dynamodb_table_info: + name: "{{ table_name_on_demand_complex }}" + register: _complex_table + +- name: Assert the table does not exist + assert: + that: + - not _complex_table.table + - name: Create complex table - check failure on index dynamodb_table: state: present @@ -120,6 +151,17 @@ - create_complex_table.table_name == table_name_on_demand_complex - create_complex_table.tags == tags_default +- name: Ensure the table was created + dynamodb_table_info: + name: "{{ table_name_on_demand_complex }}" + register: _complex_table + +- name: Assert the table has been created + assert: + that: + - _complex_table.table + - _complex_table.table.billing_mode == 'PAY_PER_REQUEST' + - name: Update complex table billing_mode dynamodb_table: state: present @@ -140,3 +182,13 @@ - convert_complex_table is changed - '"billing_mode" in convert_complex_table' - convert_complex_table.billing_mode == "PROVISIONED" + +- name: Read table info + dynamodb_table_info: + name: "{{ table_name_on_demand_complex }}" + register: _complex_table + +- name: Assert the table has been updated + assert: + that: + - _complex_table.table.billing_mode == 'PROVISIONED' diff --git a/ansible_collections/community/aws/tests/integration/targets/elb_target/tasks/lambda_target.yml b/ansible_collections/community/aws/tests/integration/targets/elb_target/tasks/lambda_target.yml index abc4cc5d0..c4271cdd6 100644 --- a/ansible_collections/community/aws/tests/integration/targets/elb_target/tasks/lambda_target.yml +++ b/ansible_collections/community/aws/tests/integration/targets/elb_target/tasks/lambda_target.yml @@ -23,7 +23,7 @@ name: "{{ lambda_name }}" state: present zip_file: /tmp/lambda.zip - runtime: python3.7 + runtime: python3.12 role: "{{ ROLE_ARN.arn }}" handler: ansible_lambda_target.lambda_handler timeout: 30 diff --git a/ansible_collections/community/aws/tests/integration/targets/s3_bucket_notification/tasks/test_lambda_notifications.yml b/ansible_collections/community/aws/tests/integration/targets/s3_bucket_notification/tasks/test_lambda_notifications.yml index 23ed32e32..b4cc8a6e0 100644 --- a/ansible_collections/community/aws/tests/integration/targets/s3_bucket_notification/tasks/test_lambda_notifications.yml +++ b/ansible_collections/community/aws/tests/integration/targets/s3_bucket_notification/tasks/test_lambda_notifications.yml @@ -41,7 +41,7 @@ name: '{{ lambda_name }}' state: present role: "{{ lambda_role_name }}" - runtime: python3.7 + runtime: python3.12 zip_file: '{{function_res.dest}}' handler: lambda_function.lambda_handler memory_size: '128' diff --git a/ansible_collections/community/aws/tests/integration/targets/secretsmanager_secret/tasks/rotation.yml b/ansible_collections/community/aws/tests/integration/targets/secretsmanager_secret/tasks/rotation.yml index 697c5ecc2..77151227d 100644 --- a/ansible_collections/community/aws/tests/integration/targets/secretsmanager_secret/tasks/rotation.yml +++ b/ansible_collections/community/aws/tests/integration/targets/secretsmanager_secret/tasks/rotation.yml @@ -55,7 +55,7 @@ name: "{{ lambda_name }}" state: present zip_file: "{{ tmp.path }}/hello_world.zip" - runtime: 'python3.9' + runtime: 'python3.12' role: "{{ iam_role_output.arn }}" handler: 'hello_world.lambda_handler' register: lambda_output @@ -169,7 +169,7 @@ name: "{{ lambda_name }}" state: absent zip_file: "{{ tmp.path }}/hello_world.zip" - runtime: 'python3.9' + runtime: 'python3.12' role: "{{ secret_manager_role }}" handler: 'hello_world.lambda_handler' ignore_errors: yes diff --git a/ansible_collections/community/aws/tests/integration/targets/sns_topic/tasks/main.yml b/ansible_collections/community/aws/tests/integration/targets/sns_topic/tasks/main.yml index 00f3f71d9..25f636832 100644 --- a/ansible_collections/community/aws/tests/integration/targets/sns_topic/tasks/main.yml +++ b/ansible_collections/community/aws/tests/integration/targets/sns_topic/tasks/main.yml @@ -309,7 +309,7 @@ name: '{{ sns_topic_lambda_name }}' state: present zip_file: '{{ tempdir.path }}/{{ sns_topic_lambda_function }}.zip' - runtime: python3.9 + runtime: python3.12 role: '{{ sns_topic_lambda_role }}' handler: '{{ sns_topic_lambda_function }}.handler' register: lambda_result diff --git a/ansible_collections/community/aws/tests/sanity/ignore-2.17.txt b/ansible_collections/community/aws/tests/sanity/ignore-2.17.txt index 67d3693df..e69de29bb 100644 --- a/ansible_collections/community/aws/tests/sanity/ignore-2.17.txt +++ b/ansible_collections/community/aws/tests/sanity/ignore-2.17.txt @@ -1,2 +0,0 @@ -plugins/connection/aws_ssm.py yamllint:unparsable-with-libyaml # bug in ansible-test - https://github.com/ansible/ansible/issues/82353 -plugins/inventory/aws_mq.py yamllint:unparsable-with-libyaml # bug in ansible-test - https://github.com/ansible/ansible/issues/82353 |