diff --git a/.github/workflows/unit_and_sanity.yml b/.github/workflows/unit_and_sanity.yml index 9787938a..dc68e903 100644 --- a/.github/workflows/unit_and_sanity.yml +++ b/.github/workflows/unit_and_sanity.yml @@ -81,7 +81,7 @@ jobs: { "ansible-version": "milestone", "python-version": "3.9" - } + }, { "ansible-version": "devel", "python-version": "3.7" diff --git a/README.md b/README.md index a766b7de..51b213ea 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This work is being made available for research purposes on the Cloud Control API ## Ansible version compatibility -This collection has been tested against following Ansible versions: **>=2.12.0**. +This collection has been tested against following Ansible versions: **>=2.13.0**. Plugins and modules within a collection may be tested with only specific Ansible versions. A collection may contain metadata that identifies these versions. diff --git a/changelogs/fragments/20230809-collection_regeneration.yml b/changelogs/fragments/20230809-collection_regeneration.yml new file mode 100644 index 00000000..8f96c1c8 --- /dev/null +++ b/changelogs/fragments/20230809-collection_regeneration.yml @@ -0,0 +1,19 @@ +bugfixes: + - "plugins/module_utils/utils.py - Fix how dictionaries are merged." + +minor_changes: + - "amazon.cloud - Add the original option name as an alias to avoid issues when snake cased option names are not correctly reversed to CamelCase." + - "Update README.md and meta/runtime.yml to reflect our ansible core testing versions." + +breaking_changes: + - backup_framework - This module was removed in version 0.5.0 of this collection because the ``framework_arn`` option, which is the main identifier of the resource, is a read-only property, so it cannot be set by the user and breaks the use of the module. + - backup_report_plan - This module was removed in version 0.5.0 of this collection because the ``report_plan_arn`` option, which is the main identifier of the resource, is a read-only property, so it cannot be set by the user and breaks the use of the module. + - cloudtrail_event_data_store - This module was removed in version 0.5.0 of this collection because the ``event_data_store_arn`` option, which is the main identifier of the resource, is a read-only property, so it cannot be set by the user and breaks the use of the module. + - ec2_placement_group - This module was removed in version 0.5.0 of this collection because the ``group_name`` option, which is the main identifier of the resource, is a read-only property, so it cannot be set by the user and breaks the use of the module. + - kms_replica_key - This module was removed in version 0.5.0 of this collection because the ``key_id`` option, which is the main identifier of the resource, is a read-only property, so it cannot be set by the user and breaks the use of the module. + - lambda_code_signing_config - This module was removed in version 0.5.0 of this collection because the ``code_signing_config_arn`` option, which is the main identifier of the resource, is a read-only property, so it cannot be set by the user and breaks the use of the module. + - lambda_event_source_mapping - This module was removed in version 0.5.0 of this collection because the ``id`` option, which is the main identifier of the resource, is a read-only property, so it cannot be set by the user and breaks the use of the module. + - logs_query_definition - This module was removed in version 0.5.0 of this collection because the ``query_definition_id`` option, which is the main identifier of the resource, is a read-only property, so it cannot be set by the user and breaks the use of the module. + - ssm_resource_data_sync - This module was removed in version 0.5.0 of this collection because the ``sync_name`` option, which is the main identifier of the resource, is a read-only property, so it cannot be set by the user and breaks the use of the module. + - wafv2_ip_set - This module was removed in version 0.5.0 of this collection because the ``id`` option, which is one of the main identifiers of the resource, is a read-only property, so it cannot be set by the user and breaks the use of the module. + - wafv2_regex_pattern_set - This module was removed in version 0.5.0 of this collection because the ``id`` option, which is one of the main identifiers of the resource, is a read-only property, so it cannot be set by the user and breaks the use of the module. diff --git a/config/modules.yaml b/config/modules.yaml index 10e246bc..4da4f34f 100644 --- a/config/modules.yaml +++ b/config/modules.yaml @@ -5,18 +5,6 @@ description: - Creates and manages logical containers where backups are stored. resource: AWS::Backup::BackupVault -- backup_framework: - documentation: - short_description: Create and manage frameworks with one or more controls - description: - - Creates and manages frameworks with one or more controls. - resource: AWS::Backup::Framework -- backup_report_plan: - documentation: - short_description: Create and manage report plans - description: - - Creates and manages report plans. - resource: AWS::Backup::ReportPlan - eks_cluster: documentation: short_description: Create and manages Amazon EKS control planes @@ -29,19 +17,6 @@ description: - Creates and manages new roles for your AWS account. resource: AWS::IAM::Role -- lambda_code_signing_config: - documentation: - short_description: Code signing for AWS Lambda - description: - - Creates and manage code signing for AWS Lambda. - resource: AWS::Lambda::CodeSigningConfig -- lambda_event_source_mapping: - documentation: - short_description: Create a mapping between an event source and an AWS Lambda - function - description: - - Create a mapping between an event source and an AWS Lambda function. - resource: AWS::Lambda::EventSourceMapping - lambda_function: documentation: short_description: Create and manage Lambda functions @@ -54,12 +29,6 @@ description: - Create and manage log groups. resource: AWS::Logs::LogGroup -- logs_query_definition: - documentation: - short_description: Create and manage query definitions - description: - - Creates and manage query definitions for CloudWatch Logs Insights. - resource: AWS::Logs::QueryDefinition - logs_resource_policy: documentation: short_description: Create and manage resource policies @@ -165,14 +134,6 @@ description: - Specifies a display name for a KMS key. resource: AWS::KMS::Alias -- kms_replica_key: - documentation: - short_description: Creates and manages a multi-Region replica key that is based - on a multi-Region primary key - description: - - Creates andn manages a multi-Region replica key that is based on a multi-Region - primary key. - resource: AWS::KMS::ReplicaKey - rds_db_proxy_endpoint: documentation: short_description: Creates and manages a DB proxy endpoint @@ -224,12 +185,6 @@ - Creates and manages a trail that specifies the settings for delivery of log data to an Amazon S3 bucket. resource: AWS::CloudTrail::Trail -- cloudtrail_event_data_store: - documentation: - short_description: Creates and manages a new event data store - description: - - Creates and manages a new event data store. - resource: AWS::CloudTrail::EventDataStore - cloudwatch_composite_alarm: documentation: short_description: Creates and manages a composite alarm @@ -296,25 +251,6 @@ - This document defines the actions that Systems Manager performs on your AWS resources. resource: AWS::SSM::Document -- ssm_resource_data_sync: - documentation: - short_description: Creates and manages a resource data sync - description: - - Creates and manages a resource data sync for AWS Systems Manager. - - A resource data sync helps you view data from multiple sources in a single - location. - resource: AWS::SSM::ResourceDataSync -- wafv2_ip_set: - documentation: - short_description: Creates and manages and IP set - description: - - Creates and manages and IP set to identify web requests that originate from - specific IP addresses or ranges of IP addresses. - - For example, if you're receiving a lot of requests from a ranges of IP addresses, - you can configure AWS WAF to block them using an IP set that lists those IP - addresses. - - For more information see U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-ipset.html). - resource: AWS::WAFv2::IPSet - wafv2_logging_configuration: documentation: short_description: Creates and manages an association between logging destinations @@ -324,14 +260,6 @@ ACL resource, for logging from AWS WAF. - For more information see U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-loggingconfiguration.html). resource: AWS::WAFv2::LoggingConfiguration -- wafv2_regex_pattern_set: - documentation: - short_description: Creates and manages an AWS WAFv2 Regex Pattern Set - description: - - Creates and manages an AWS WAFv2 Regex Pattern Set. - - Use an AWS WAFv2 Regex Pattern Set to have AWS WAF inspect a web request component - for a specific set of regular expression patterns. - resource: AWS::WAFv2::RegexPatternSet - wafv2_web_acl_association: documentation: short_description: Creates and manages a web ACL association @@ -402,15 +330,6 @@ - The maximum number of metric filters that can be associated with a log group is 100. resource: AWS::Logs::MetricFilter -- ec2_placement_group: - documentation: - short_description: Creates and manages a placement group - description: - - Specifies a placement group in which to launch instances. - - The strategy of the placement group determines how the instances are organized - within the group. - - For more information see U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-placementgroup.html). - resource: AWS::EC2::PlacementGroup - autoscaling_launch_configuration: documentation: short_description: Creates and manages a web ACL association. @@ -443,6 +362,7 @@ - Whenever your application needs to scale out, the Auto Scaling group can draw on the warm pool to meet its new desired capacity. resource: AWS::AutoScaling::WarmPool +# 0.4.0 - memorydb_acl: documentation: short_description: Creates and manages a MemoryDB ACL diff --git a/meta/runtime.yml b/meta/runtime.yml index 1e1a5f2a..d6c510bb 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -1,16 +1,11 @@ -requires_ansible: '>=2.12.0' +requires_ansible: '>=2.13.0' action_groups: aws: - backup_backup_vault - - backup_framework - - backup_report_plan - eks_cluster - iam_role - - lambda_code_signing_config - - lambda_event_source_mapping - lambda_function - logs_log_group - - logs_query_definition - logs_resource_policy - rds_db_proxy - redshift_cluster @@ -26,7 +21,6 @@ action_groups: - eks_addon - iam_server_certificate - kms_alias - - kms_replica_key - rds_db_proxy_endpoint - redshift_endpoint_access - redshift_endpoint_authorization @@ -34,7 +28,6 @@ action_groups: - route53_dnssec - route53_key_signing_key - cloudtrail_trail - - cloudtrail_event_data_store - cloudwatch_composite_alarm - cloudwatch_metric_stream - rds_db_instance @@ -43,10 +36,7 @@ action_groups: - rds_global_cluster - rds_option_group - ssm_document - - ssm_resource_data_sync - - wafv2_ip_set - wafv2_logging_configuration - - wafv2_regex_pattern_set - wafv2_web_acl_association - ecr_repository - ecs_capacity_provider @@ -55,18 +45,17 @@ action_groups: - ecs_primary_task_set - iam_instance_profile - logs_metric_filter - - ec2_placement_group - autoscaling_launch_configuration - autoscaling_lifecycle_hook - autoscaling_warm_pool - - rdsdb_proxy - - s3_object_lambda_access_point - - s3_object_lambda_access_point_policy - memorydb_acl - memorydb_cluster - memorydb_parameter_group - memorydb_subnet_group - memorydb_user + - rdsdb_proxy + - s3_object_lambda_access_point + - s3_object_lambda_access_point_policy plugin_routing: modules: rdsdb_proxy: diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index 4777195a..df09069a 100644 --- a/plugins/module_utils/core.py +++ b/plugins/module_utils/core.py @@ -47,6 +47,8 @@ from ansible_collections.amazon.cloud.plugins.module_utils.common import ( AMAZON_CLOUD_COLLECTION_VERSION, ) + +# pylint: disable=unused-import from .utils import ( normalize_response, scrub_keys, @@ -54,13 +56,22 @@ to_async, diff_dicts, snake_to_camel, + camel_to_snake, json_patch, get_patch, + ensure_json_dumps, + helper_sort_dict, ) from .utils import ansible_dict_to_boto3_tag_list # pylint: disable=unused-import from .utils import snake_dict_to_camel_dict # pylint: disable=unused-import +from .utils import map_key_to_alias # pylint: disable=unused-import from ansible_collections.amazon.cloud.plugins.module_utils.waiters import get_waiter +# pylint: disable=unused-import +from ansible_collections.amazon.aws.plugins.module_utils.transformation import ( + scrub_none_parameters, +) + BOTO3_IMP_ERR = None try: import botocore @@ -147,9 +158,10 @@ async def list_resources( if identifiers: additional_properties: Dict = {} for id in identifiers: - additional_properties[ - snake_to_camel(id, capitalize_first=True) - ] = self.module.params.get(id) + _id = id.split("/")[-1] + additional_properties[_id] = self.module.params.get( + camel_to_snake(_id) + ) params["ResourceModel"] = json.dumps(additional_properties) if i == 0 or "NextToken" in response: @@ -219,15 +231,17 @@ def list_resource_requests(self, params: Iterable) -> List: def get_resources_async(self, type_name, identifier): return self.get_resource(type_name, identifier) + @AWSRetry.jittered_backoff( + catch_extra_error_codes=["ThrottlingException"], retries=10 + ) def get_resource( self, type_name: str, primary_identifier: Union[str, List, Dict] ) -> List: # This is the "describe" equivalent for AWS Cloud Control API response: Dict = {} - identifier: Dict = {} if isinstance(primary_identifier, list): - primary_identifier = self.get_identifier(identifier, primary_identifier) + primary_identifier = self.get_identifier(primary_identifier) elif isinstance(primary_identifier, dict): primary_identifier = json.dumps(primary_identifier) try: @@ -255,13 +269,14 @@ def present( ) -> bool: results = {"changed": False, "result": {}} create_only_params = create_only_params or [] + resource = None identifier: Dict = {} - resource = None if self.module.params.get("identifier"): identifier = self.module.params.get("identifier") else: - identifier = self.get_identifier(identifier, primary_identifier) + identifier = self.get_identifier(primary_identifier) + try: resource = self.client.get_resource( TypeName=type_name, Identifier=identifier, aws_retry=True @@ -269,8 +284,9 @@ def present( results = self.update_resource(resource, params, create_only_params) except self.client.exceptions.ResourceNotFoundException: if self.module.params.get("identifier"): + _primary_identifier = [id.split("/")[-1] for id in primary_identifier] self.module.fail_json( - f"""You must specify both {*primary_identifier, } to create a new resource. + f"""You must specify all of the following to create a new resource: {*_primary_identifier, }. The identifier parameter can only be used to manipulate an existing resource.""" ) results["changed"] |= self.create_resource(type_name, params) @@ -286,7 +302,8 @@ def present( def create_resource(self, type_name: str, params: Dict) -> bool: changed: bool = False - params = json.dumps(params) + + params = json.dumps(ensure_json_dumps(params)) if not self.module.check_mode: try: @@ -351,7 +368,7 @@ def absent(self, type_name: str, primary_identifier: List): if self.module.params.get("identifier"): identifier = self.module.params.get("identifier") else: - identifier = self.get_identifier(identifier, primary_identifier) + identifier = self.get_identifier(primary_identifier) try: response = self.client.get_resource( @@ -446,15 +463,11 @@ def update_resource( obj = None # Ignore createOnlyProperties that can be set only during resource creation - params = scrub_keys( - params_to_set, - [ - "ACLName" - if item == "acl_name" - else snake_to_camel(item, capitalize_first=True) - for item in create_only_params - ], - ) + params = scrub_keys(params_to_set, create_only_params) + + # If we work with Policies just ensure the right quotes are used, otherwise, just ignore + params = ensure_json_dumps(params) + in_progress_requests = self.check_in_progress_requests(type_name, identifier) if not self.module.check_mode: @@ -479,7 +492,9 @@ def update_resource( obj, error = json_patch(properties, patch) if error: self.module.fail_json(**error) - match, diffs = diff_dicts(properties, obj) + + # Ensure properties and obj are sorted before calculating the difference + match, diffs = diff_dicts(helper_sort_dict(properties), helper_sort_dict(obj)) if not self.module.check_mode: # To handle idempotency when purge_* params are False (where the patch is always generated with strategy='replace') @@ -520,14 +535,11 @@ def update_resource( return results - def get_identifier(self, identifier: dict, primary_identifier: list): + def get_identifier(self, primary_identifier: list) -> Dict: + identifier: Dict = {} for id in primary_identifier: - if id == "acl_name": - identifier["ACLName"] = self.module.params.get("acl_name") - else: - identifier[ - snake_to_camel(id, capitalize_first=True) - ] = self.module.params.get(id) + _id = id.split("/")[-1] + identifier[_id] = self.module.params.get(camel_to_snake(_id)) return json.dumps(identifier) diff --git a/plugins/module_utils/utils.py b/plugins/module_utils/utils.py index 1f7528f9..4045471e 100644 --- a/plugins/module_utils/utils.py +++ b/plugins/module_utils/utils.py @@ -7,6 +7,7 @@ import json import functools import traceback +from collections import OrderedDict from typing import Iterable, List, Dict, Union JSON_PATCH_IMPORT_ERR = None @@ -106,6 +107,7 @@ def scrub_keys(a_dict: Dict, list_of_keys_to_remove: List[str]) -> Dict: """Filter a_dict by removing unwanted key: values listed in list_of_keys_to_remove""" if not isinstance(a_dict, dict): return a_dict + return {k: v for k, v in a_dict.items() if k not in list_of_keys_to_remove} @@ -205,6 +207,39 @@ def boto3_tag_list_to_ansible_dict( ) +def map_key_to_alias(data: Dict, mapping: Dict) -> Dict: + # Ensures the alias is passed to the API call + mapped_data: Dict = {} + + for key, value in data.items(): + if key in mapping: + mapped_key = mapping[key].get("aliases", [key])[0] + if isinstance(value, dict): + mapped_data[mapped_key] = map_key_to_alias( + value, + mapping[key].get("options", {}) + or mapping[key].get("suboptions", {}), + ) + elif isinstance(value, list): + mapped_data[mapped_key] = [] + for item in value: + if isinstance(item, dict): + mapped_data[mapped_key].append( + map_key_to_alias( + item, + mapping[key].get("options", {}) + or mapping[key].get("suboptions", {}), + ) + ) + else: + mapped_data[mapped_key] = value + else: + mapped_data[mapped_key] = value + else: + mapped_data[key] = value + return mapped_data + + def diff_dicts(existing: Dict, new: Dict) -> Union[bool, Dict]: result: Dict = {} @@ -264,6 +299,205 @@ def op(operation, path, value): return {"op": operation, "path": path, "value": value} +def safe_json(data): + try: + json_object = json.loads(data) + except (ValueError, TypeError, json.JSONDecodeError) as e: + if "Expecting property name enclosed in double quotes" in str(e): + json_string_fixed = data.replace("'", '"') + json_object = safe_json(json_string_fixed) + else: + # Return data as is + return data + return json_object + + +def helper_sort_dict(obj): + """ + Order a nested complex dictionary + """ + + def custom_key(x): + return json.dumps(x) + + if isinstance(obj, dict): + obj = OrderedDict(sorted(obj.items())) + for k, v in obj.items(): + if isinstance(v, dict) or isinstance(v, list): + obj[k] = helper_sort_dict(v) + + if isinstance(obj, list): + for i, v in enumerate(obj): + if isinstance(v, dict) or isinstance(v, list): + obj[i] = helper_sort_dict(v) + obj = sorted(obj, key=custom_key) + + return obj + + +def merge_lists(list1, list2): + merged_list: List = [] + matched_list: List = [] + + for dict1 in list1: + if isinstance(dict1, dict): + dict1 = helper_sort_dict(dict1) + merged_dict = dict1.copy() + else: + merged_dict = dict1 + + for dict2 in list2: + if isinstance(dict1, dict) and isinstance(dict2, dict): + dict2 = helper_sort_dict(dict2) + for key in dict2: + if dict1.get(key) == dict2.get(key): + # Enforce matching between dictionaries + if all( + isinstance(dict1[key], type(dict2[key])) for key in dict1 + ): + if dict1 == dict2: + # They match, nothing further to do, just append dict1 to merged_list + if dict1 not in merged_list: + merged_list.append(dict1) + matched_list.append(dict1) + else: + # They have the same value types, but do not match + merged_dict = recursive_merge(merged_dict, dict2) + matched_list.append(dict1) + matched_list.append(dict2) + if merged_dict not in merged_list: + merged_list.append(merged_dict) + matched_list.append(merged_dict) + else: + # They do not have anything in common, just add both to merge_list and matched_list + if dict1 not in merged_list and dict1 not in matched_list: + merged_list.append(dict1) + matched_list.append(dict1) + if dict2 not in merged_list and dict2 not in matched_list: + # Add dict2 if already not present in merged_list + merged_list.append(dict2) + matched_list.append(dict2) + else: + if dict2 not in merged_list: + merged_list.append(dict2) + + return merged_list + + +def merge_list_of_dicts(list1: List, list2) -> List: + # Handle when list of dicts (different than Tags and different key names) need to be merged + merged_list = list1.copy() + + for dict2 in list2: + matching_indices = [ + i for i, item1 in enumerate(merged_list) if any(k in item1 for k in dict2) + ] + + if matching_indices: + for index in matching_indices: + if isinstance(merged_list, list): + dict1 = merged_list[index] + if isinstance(dict2, dict) and isinstance(dict1, dict): + for key, value in dict2.items(): + value_dict = safe_json(value) + if ( + dict1.get(key, {}) + and isinstance(value_dict, dict) + and isinstance(dict1[key], dict) + ): + dict1[key] = recursive_merge(dict1[key], value_dict) + elif ( + dict1.get(key, []) + and isinstance(value_dict, list) + and isinstance(dict1[key], list) + ): + # Easy merge + if all( + isinstance(item, (str, int, float)) + for item in dict1[key] + ): + dict1[key] = sorted( + list(set(dict1[key]).union(value_dict)) + ) + else: + dict1[key] = merge_lists(dict1[key], value_dict) + else: + dict1[key] = value_dict + else: + # else: there's no matching, so just add dict2 to merged_list + merged_list.append(dict2) + + return merged_list + + +def recursive_merge(dict1: Dict, dict2: Dict) -> Dict: + merged = dict1.copy() + + for key, value in dict2.items(): + if key in merged and isinstance(merged[key], dict) and isinstance(value, dict): + merged[key] = recursive_merge(merged[key], value) + if key in merged and isinstance(merged[key], list) and isinstance(value, list): + # Easy merge + if all(isinstance(item, (str, int, float)) for item in merged[key]): + dict1[key] = sorted(list(set(merged[key]).union(value))) + else: + merged[key] = merge_lists(merged[key], value) + else: + merged[key] = value + + return merged + + +class QuoteSwappingEncoder(json.JSONEncoder): + def encode(self, o): + def swap_quotes(item): + if isinstance(item, str): + return ( + item.replace("'", "__TEMP_SINGLE_QUOTE__") + .replace('"', "'") + .replace("__TEMP_SINGLE_QUOTE__", '"') + ) + return item + + return super().encode(swap_quotes(o)) + + +def ensure_json_dumps(data): + """ + This function hadles the case when the iam_role modules is used with the + policies option which requiress a policy_document as a string. We'll need + to ensure the correct quotes are used for the API call + For example: + 'Policies': [{ + 'PolicyName': 'dr-lambda-policy', + 'PolicyDocument': "{'Version': '2012-10-17', \ + 'Statement': [{'Effect': 'Allow', \ + 'Action': ['logs:CreateLogGroup', 'logs:CreateLogStream', 'logs:PutLogEvents'], \ + 'Resource': 'arn:aws:logs:*:*:*'}, {'Effect': 'Allow', \ + 'Action': 'lambda:InvokeFunction', 'Resource': '*'}]}" + }], + will become: + '"Policies": [{"PolicyName": "dr-lambda-policy", "PolicyDocument": "{\\"Version\\": \\"2012-10-17\\", \ + \\"Statement\\": [{\\"Effect\\": \\"Allow\\", \\"Action\\": [\\"logs:CreateLogGroup\\", \ + \\"logs:CreateLogStream\\", \\"logs:PutLogEvents\\"], \\"Resource\\": \\"arn:aws:logs:*:*:*\\"}, \ + {\\"Effect\\": \\"Allow\\", \\"Action\\": \\"lambda:InvokeFunction\\", \\"Resource\\": \\"*\\"}]}"}]' + """ + + if "Policies" in data and isinstance(data.get("Policies"), list): + for policy_entry in data["Policies"]: + if "PolicyDocument" in policy_entry and isinstance( + policy_entry.get("PolicyDocument"), str + ): + inner_json = json.loads( + policy_entry["PolicyDocument"].replace("'", '"') + ) # Convert single quotes to double quotes + policy_entry["PolicyDocument"] = json.loads( + json.dumps(inner_json, cls=QuoteSwappingEncoder) + ) + + return data + + def make_op(path, old, new, strategy): _new_cpy = copy.deepcopy(new) @@ -273,7 +507,11 @@ def make_op(path, old, new, strategy): elif isinstance(old, list): if strategy == "merge": _old_cpy = copy.deepcopy(old) - _new_cpy = tag_merge(_old_cpy, new) + if path == "Tags": + _new_cpy = tag_merge(_old_cpy, new) + else: + # When list of dictionaries are different and have keys different that Key and values than Value need to be merged here + _new_cpy = merge_list_of_dicts(_old_cpy, new) return op("replace", path, _new_cpy) diff --git a/plugins/modules/autoscaling_launch_configuration.py b/plugins/modules/autoscaling_launch_configuration.py index 4fd7d436..41ac3088 100644 --- a/plugins/modules/autoscaling_launch_configuration.py +++ b/plugins/modules/autoscaling_launch_configuration.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -16,78 +16,110 @@ application resource, to protect the resource. options: associate_public_ip_address: + aliases: + - AssociatePublicIpAddress description: - For Auto Scaling groups that are running in a virtual private cloud (VPC), specifies whether to assign a public IP address to the groups instances. type: bool block_device_mappings: + aliases: + - BlockDeviceMappings description: - I(block_device_mapping) is a property of AWS::AutoScaling::LaunchConfiguration that describes a block device mapping for an Auto Scaling group. elements: dict suboptions: device_name: + aliases: + - DeviceName description: - The device name exposed to the EC2 instance (for example, /dev/sdh or xvdh). type: str ebs: + aliases: + - Ebs description: - Parameters used to automatically set up EBS volumes when an instance is launched.I(block_device) is a subproperty of I(block_device_mapping) that describes an Amazon EBS volume. suboptions: delete_on_termination: + aliases: + - DeleteOnTermination description: - Indicates whether the volume is deleted on instance termination. type: bool encrypted: + aliases: + - Encrypted description: - Specifies whether the volume should be encrypted. type: bool iops: + aliases: + - Iops description: - The number of input/output (I/O) operations per second (IOPS) to provision for the volume. type: int snapshot_id: + aliases: + - SnapshotId description: - The snapshot ID of the volume to use. type: str throughput: + aliases: + - Throughput description: - The throughput (MiBps) to provision for a gp3 volume. type: int volume_size: + aliases: + - VolumeSize description: - The volume size, in GiBs. type: int volume_type: + aliases: + - VolumeType description: - The volume type. type: str type: dict no_device: + aliases: + - NoDevice description: - Setting this value to true suppresses the specified device included in the block device mapping of the AMI. type: bool virtual_name: + aliases: + - VirtualName description: - The name of the virtual device. type: str type: list classic_link_vpc_id: + aliases: + - ClassicLinkVPCId description: - The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. type: str classic_link_vpc_security_groups: + aliases: + - ClassicLinkVPCSecurityGroups description: - The IDs of one or more security groups for the VPC that you specified in the ClassicLinkVPCId property. elements: str type: list ebs_optimized: + aliases: + - EbsOptimized description: - Specifies whether the launch configuration is optimized for EBS I/O (true) or not (false). @@ -102,77 +134,109 @@ be performed on it. type: bool iam_instance_profile: + aliases: + - IamInstanceProfile description: - Provides the name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. - The instance profile contains the IAM role. type: str image_id: + aliases: + - ImageId description: - Provides the unique ID of the Amazon Machine Image (AMI) that was assigned during registration. type: str instance_id: + aliases: + - InstanceId description: - The ID of the Amazon EC2 instance you want to use to create the launch configuration. type: str instance_monitoring: + aliases: + - InstanceMonitoring description: - Controls whether instances in this group are launched with detailed (true) or basic (false) monitoring. type: bool instance_type: + aliases: + - InstanceType description: - Specifies the instance type of the EC2 instance. type: str kernel_id: + aliases: + - KernelId description: - Provides the ID of the kernel associated with the EC2 AMI. type: str key_name: + aliases: + - KeyName description: - Provides the name of the EC2 key pair. type: str launch_configuration_name: + aliases: + - LaunchConfigurationName description: - The name of the launch configuration. - This name must be unique per Region per account. type: str metadata_options: + aliases: + - MetadataOptions description: - The metadata options for the instances.I(metadata_options) is a property of AWS::AutoScaling::LaunchConfiguration that describes metadata options for the instances. suboptions: http_endpoint: + aliases: + - HttpEndpoint description: - This parameter enables or disables the HTTP metadata endpoint on your instances. type: str http_put_response_hop_limit: + aliases: + - HttpPutResponseHopLimit description: - The desired HTTP PUT response hop limit for instance metadata requests. type: int http_tokens: + aliases: + - HttpTokens description: - The state of token usage for your instance metadata requests. type: str type: dict placement_tenancy: + aliases: + - PlacementTenancy description: - The tenancy of the instance, either default or dedicated. type: str ram_disk_id: + aliases: + - RamDiskId description: - The ID of the RAM disk to select. type: str security_groups: + aliases: + - SecurityGroups description: - A list that contains the security groups to assign to the instances in the Auto Scaling group. elements: str type: list spot_price: + aliases: + - SpotPrice description: - The maximum hourly price you are willing to pay for any Spot Instances launched to fulfill the request. @@ -194,6 +258,8 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str user_data: + aliases: + - UserData description: - The Base64-encoded user data to make available to the launched EC2 instances. type: str @@ -243,11 +309,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -259,55 +326,87 @@ def main(): ), ) - argument_spec["associate_public_ip_address"] = {"type": "bool"} + argument_spec["associate_public_ip_address"] = { + "type": "bool", + "aliases": ["AssociatePublicIpAddress"], + } argument_spec["block_device_mappings"] = { "type": "list", "elements": "dict", "options": { - "no_device": {"type": "bool"}, - "virtual_name": {"type": "str"}, + "no_device": {"type": "bool", "aliases": ["NoDevice"]}, + "virtual_name": {"type": "str", "aliases": ["VirtualName"]}, "ebs": { "type": "dict", "options": { - "snapshot_id": {"type": "str"}, - "volume_type": {"type": "str"}, - "encrypted": {"type": "bool"}, - "iops": {"type": "int"}, - "volume_size": {"type": "int"}, - "delete_on_termination": {"type": "bool"}, - "throughput": {"type": "int"}, + "snapshot_id": {"type": "str", "aliases": ["SnapshotId"]}, + "volume_type": {"type": "str", "aliases": ["VolumeType"]}, + "encrypted": {"type": "bool", "aliases": ["Encrypted"]}, + "iops": {"type": "int", "aliases": ["Iops"]}, + "volume_size": {"type": "int", "aliases": ["VolumeSize"]}, + "delete_on_termination": { + "type": "bool", + "aliases": ["DeleteOnTermination"], + }, + "throughput": {"type": "int", "aliases": ["Throughput"]}, }, + "aliases": ["Ebs"], }, - "device_name": {"type": "str"}, + "device_name": {"type": "str", "aliases": ["DeviceName"]}, }, + "aliases": ["BlockDeviceMappings"], + } + argument_spec["classic_link_vpc_id"] = { + "type": "str", + "aliases": ["ClassicLinkVPCId"], } - argument_spec["classic_link_vpc_id"] = {"type": "str"} argument_spec["classic_link_vpc_security_groups"] = { "type": "list", "elements": "str", + "aliases": ["ClassicLinkVPCSecurityGroups"], + } + argument_spec["ebs_optimized"] = {"type": "bool", "aliases": ["EbsOptimized"]} + argument_spec["iam_instance_profile"] = { + "type": "str", + "aliases": ["IamInstanceProfile"], + } + argument_spec["image_id"] = {"type": "str", "aliases": ["ImageId"]} + argument_spec["instance_id"] = {"type": "str", "aliases": ["InstanceId"]} + argument_spec["instance_monitoring"] = { + "type": "bool", + "aliases": ["InstanceMonitoring"], + } + argument_spec["instance_type"] = {"type": "str", "aliases": ["InstanceType"]} + argument_spec["kernel_id"] = {"type": "str", "aliases": ["KernelId"]} + argument_spec["key_name"] = {"type": "str", "aliases": ["KeyName"]} + argument_spec["launch_configuration_name"] = { + "type": "str", + "aliases": ["LaunchConfigurationName"], } - argument_spec["ebs_optimized"] = {"type": "bool"} - argument_spec["iam_instance_profile"] = {"type": "str"} - argument_spec["image_id"] = {"type": "str"} - argument_spec["instance_id"] = {"type": "str"} - argument_spec["instance_monitoring"] = {"type": "bool"} - argument_spec["instance_type"] = {"type": "str"} - argument_spec["kernel_id"] = {"type": "str"} - argument_spec["key_name"] = {"type": "str"} - argument_spec["launch_configuration_name"] = {"type": "str"} argument_spec["metadata_options"] = { "type": "dict", "options": { - "http_put_response_hop_limit": {"type": "int"}, - "http_tokens": {"type": "str"}, - "http_endpoint": {"type": "str"}, + "http_put_response_hop_limit": { + "type": "int", + "aliases": ["HttpPutResponseHopLimit"], + }, + "http_tokens": {"type": "str", "aliases": ["HttpTokens"]}, + "http_endpoint": {"type": "str", "aliases": ["HttpEndpoint"]}, }, + "aliases": ["MetadataOptions"], + } + argument_spec["placement_tenancy"] = { + "type": "str", + "aliases": ["PlacementTenancy"], + } + argument_spec["ram_disk_id"] = {"type": "str", "aliases": ["RamDiskId"]} + argument_spec["security_groups"] = { + "type": "list", + "elements": "str", + "aliases": ["SecurityGroups"], } - argument_spec["placement_tenancy"] = {"type": "str"} - argument_spec["ram_disk_id"] = {"type": "str"} - argument_spec["security_groups"] = {"type": "list", "elements": "str"} - argument_spec["spot_price"] = {"type": "str"} - argument_spec["user_data"] = {"type": "str"} + argument_spec["spot_price"] = {"type": "str", "aliases": ["SpotPrice"]} + argument_spec["user_data"] = {"type": "str", "aliases": ["UserData"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -321,7 +420,7 @@ def main(): [ "state", "present", - ["instance_type", "launch_configuration_name", "image_id"], + ["instance_type", "image_id", "launch_configuration_name"], True, ], ["state", "absent", ["launch_configuration_name"], True], @@ -366,42 +465,43 @@ def main(): params["user_data"] = module.params.get("user_data") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation create_only_params = [ - "associate_public_ip_address", - "block_device_mappings", - "classic_link_vpc_id", - "classic_link_vpc_security_groups", - "ebs_optimized", - "iam_instance_profile", - "image_id", - "instance_id", - "instance_monitoring", - "instance_type", - "kernel_id", - "key_name", - "launch_configuration_name", - "metadata_options", - "placement_tenancy", - "ram_disk_id", - "security_groups", - "spot_price", - "user_data", + "/properties/AssociatePublicIpAddress", + "/properties/BlockDeviceMappings", + "/properties/ClassicLinkVPCId", + "/properties/ClassicLinkVPCSecurityGroups", + "/properties/EbsOptimized", + "/properties/IamInstanceProfile", + "/properties/ImageId", + "/properties/InstanceId", + "/properties/InstanceMonitoring", + "/properties/InstanceType", + "/properties/KernelId", + "/properties/KeyName", + "/properties/LaunchConfigurationName", + "/properties/MetadataOptions", + "/properties/PlacementTenancy", + "/properties/RamDiskId", + "/properties/SecurityGroups", + "/properties/SpotPrice", + "/properties/UserData", ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "delete", "list"] state = module.params.get("state") - identifier = ["launch_configuration_name"] + identifier = ["/properties/LaunchConfigurationName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index 5c80fee8..3d2a111a 100644 --- a/plugins/modules/autoscaling_lifecycle_hook.py +++ b/plugins/modules/autoscaling_lifecycle_hook.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -21,10 +21,14 @@ for the action to complete before the instance transitions to the next state. options: auto_scaling_group_name: + aliases: + - AutoScalingGroupName description: - The name of the Auto Scaling group for the lifecycle hook. type: str default_result: + aliases: + - DefaultResult description: - The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. @@ -40,6 +44,8 @@ be performed on it. type: bool heartbeat_timeout: + aliases: + - HeartbeatTimeout description: - The maximum time, in seconds, that can elapse before the lifecycle hook times out. @@ -56,19 +62,27 @@ - For more details, visit U(https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html). type: str lifecycle_hook_name: + aliases: + - LifecycleHookName description: - The name of the lifecycle hook. type: str lifecycle_transition: + aliases: + - LifecycleTransition description: - The instance state to which you want to attach the lifecycle hook. type: str notification_metadata: + aliases: + - NotificationMetadata description: - Additional information that is included any time Amazon EC2 Auto Scaling sends a message to the notification target. type: str notification_target_arn: + aliases: + - NotificationTargetARN description: - The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling uses to notify you when an instance is in the transition @@ -79,6 +93,8 @@ name, instance ID, lifecycle transition, and notification metadata.' type: str role_arn: + aliases: + - RoleARN description: - The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target, for example, an Amazon SNS topic or @@ -146,11 +162,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -162,14 +179,32 @@ def main(): ), ) - argument_spec["auto_scaling_group_name"] = {"type": "str"} - argument_spec["default_result"] = {"type": "str"} - argument_spec["heartbeat_timeout"] = {"type": "int"} - argument_spec["lifecycle_hook_name"] = {"type": "str"} - argument_spec["lifecycle_transition"] = {"type": "str"} - argument_spec["notification_metadata"] = {"type": "str"} - argument_spec["notification_target_arn"] = {"type": "str"} - argument_spec["role_arn"] = {"type": "str"} + argument_spec["auto_scaling_group_name"] = { + "type": "str", + "aliases": ["AutoScalingGroupName"], + } + argument_spec["default_result"] = {"type": "str", "aliases": ["DefaultResult"]} + argument_spec["heartbeat_timeout"] = { + "type": "int", + "aliases": ["HeartbeatTimeout"], + } + argument_spec["lifecycle_hook_name"] = { + "type": "str", + "aliases": ["LifecycleHookName"], + } + argument_spec["lifecycle_transition"] = { + "type": "str", + "aliases": ["LifecycleTransition"], + } + argument_spec["notification_metadata"] = { + "type": "str", + "aliases": ["NotificationMetadata"], + } + argument_spec["notification_target_arn"] = { + "type": "str", + "aliases": ["NotificationTargetARN"], + } + argument_spec["role_arn"] = {"type": "str", "aliases": ["RoleARN"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -187,9 +222,9 @@ def main(): "present", [ "lifecycle_transition", - "lifecycle_hook_name", - "auto_scaling_group_name", "identifier", + "auto_scaling_group_name", + "lifecycle_hook_name", ], True, ], @@ -233,22 +268,26 @@ def main(): params["role_arn"] = module.params.get("role_arn") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["auto_scaling_group_name", "lifecycle_hook_name"] + create_only_params = [ + "/properties/AutoScalingGroupName", + "/properties/LifecycleHookName", + ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["auto_scaling_group_name", "lifecycle_hook_name"] + identifier = ["/properties/AutoScalingGroupName", "/properties/LifecycleHookName"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None @@ -256,7 +295,9 @@ def main(): if not module.params.get("auto_scaling_group_name") or not module.params.get( "lifecycle_hook_name" ): - module.fail_json(f"You must specify both {*identifier, } identifiers.") + module.fail_json( + "You must specify all the ('auto_scaling_group_name', 'lifecycle_hook_name') identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/autoscaling_warm_pool.py b/plugins/modules/autoscaling_warm_pool.py index 97179a8b..86fa142d 100644 --- a/plugins/modules/autoscaling_warm_pool.py +++ b/plugins/modules/autoscaling_warm_pool.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -18,6 +18,8 @@ the warm pool to meet its new desired capacity. options: auto_scaling_group_name: + aliases: + - AutoScalingGroupName description: - Not Provived. type: str @@ -31,23 +33,33 @@ be performed on it. type: bool instance_reuse_policy: + aliases: + - InstanceReusePolicy description: - Not Provived. suboptions: reuse_on_scale_in: + aliases: + - ReuseOnScaleIn description: - Not Provived. type: bool type: dict max_group_prepared_capacity: + aliases: + - MaxGroupPreparedCapacity description: - Not Provived. type: int min_size: + aliases: + - MinSize description: - Not Provived. type: int pool_state: + aliases: + - PoolState description: - Not Provived. type: str @@ -113,11 +125,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -129,13 +142,22 @@ def main(): ), ) - argument_spec["auto_scaling_group_name"] = {"type": "str"} - argument_spec["max_group_prepared_capacity"] = {"type": "int"} - argument_spec["min_size"] = {"type": "int"} - argument_spec["pool_state"] = {"type": "str"} + argument_spec["auto_scaling_group_name"] = { + "type": "str", + "aliases": ["AutoScalingGroupName"], + } + argument_spec["max_group_prepared_capacity"] = { + "type": "int", + "aliases": ["MaxGroupPreparedCapacity"], + } + argument_spec["min_size"] = {"type": "int", "aliases": ["MinSize"]} + argument_spec["pool_state"] = {"type": "str", "aliases": ["PoolState"]} argument_spec["instance_reuse_policy"] = { "type": "dict", - "options": {"reuse_on_scale_in": {"type": "bool"}}, + "options": { + "reuse_on_scale_in": {"type": "bool", "aliases": ["ReuseOnScaleIn"]} + }, + "aliases": ["InstanceReusePolicy"], } argument_spec["state"] = { "type": "str", @@ -174,22 +196,23 @@ def main(): params["pool_state"] = module.params.get("pool_state") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["auto_scaling_group_name"] + create_only_params = ["/properties/AutoScalingGroupName"] # Necessary to handle when module does not support all the states handlers = ["create", "delete", "read", "update"] state = module.params.get("state") - identifier = ["auto_scaling_group_name"] + identifier = ["/properties/AutoScalingGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/backup_backup_vault.py b/plugins/modules/backup_backup_vault.py index 8bfaa786..94d0aa3d 100644 --- a/plugins/modules/backup_backup_vault.py +++ b/plugins/modules/backup_backup_vault.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -14,18 +14,26 @@ - Creates and manages logical containers where backups are stored. options: access_policy: + aliases: + - AccessPolicy description: - Not Provived. type: dict backup_vault_name: + aliases: + - BackupVaultName description: - Not Provived. type: str backup_vault_tags: + aliases: + - BackupVaultTags description: - Not Provived. type: dict encryption_key_arn: + aliases: + - EncryptionKeyArn description: - Not Provived. type: str @@ -39,32 +47,46 @@ be performed on it. type: bool lock_configuration: + aliases: + - LockConfiguration description: - Not Provived. suboptions: changeable_for_days: + aliases: + - ChangeableForDays description: - Not Provived. type: int max_retention_days: + aliases: + - MaxRetentionDays description: - Not Provived. type: int min_retention_days: + aliases: + - MinRetentionDays description: - Not Provived. type: int type: dict notifications: + aliases: + - Notifications description: - Not Provived. suboptions: backup_vault_events: + aliases: + - BackupVaultEvents description: - Not Provived. elements: str type: list sns_topic_arn: + aliases: + - SNSTopicArn description: - Not Provived. type: str @@ -92,6 +114,7 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -143,11 +166,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -159,24 +183,36 @@ def main(): ), ) - argument_spec["access_policy"] = {"type": "dict"} - argument_spec["backup_vault_name"] = {"type": "str"} - argument_spec["backup_vault_tags"] = {"type": "dict"} - argument_spec["encryption_key_arn"] = {"type": "str"} + argument_spec["access_policy"] = {"type": "dict", "aliases": ["AccessPolicy"]} + argument_spec["backup_vault_name"] = {"type": "str", "aliases": ["BackupVaultName"]} + argument_spec["backup_vault_tags"] = { + "type": "dict", + "aliases": ["BackupVaultTags"], + } + argument_spec["encryption_key_arn"] = { + "type": "str", + "aliases": ["EncryptionKeyArn"], + } argument_spec["notifications"] = { "type": "dict", "options": { - "backup_vault_events": {"type": "list", "elements": "str"}, - "sns_topic_arn": {"type": "str"}, + "backup_vault_events": { + "type": "list", + "elements": "str", + "aliases": ["BackupVaultEvents"], + }, + "sns_topic_arn": {"type": "str", "aliases": ["SNSTopicArn"]}, }, + "aliases": ["Notifications"], } argument_spec["lock_configuration"] = { "type": "dict", "options": { - "min_retention_days": {"type": "int"}, - "max_retention_days": {"type": "int"}, - "changeable_for_days": {"type": "int"}, + "min_retention_days": {"type": "int", "aliases": ["MinRetentionDays"]}, + "max_retention_days": {"type": "int", "aliases": ["MaxRetentionDays"]}, + "changeable_for_days": {"type": "int", "aliases": ["ChangeableForDays"]}, }, + "aliases": ["LockConfiguration"], } argument_spec["state"] = { "type": "str", @@ -186,7 +222,7 @@ def main(): argument_spec["wait"] = {"type": "bool", "default": False} argument_spec["wait_timeout"] = {"type": "int", "default": 320} argument_spec["force"] = {"type": "bool", "default": False} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ @@ -217,22 +253,23 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["backup_vault_name", "encryption_key_arn"] + create_only_params = ["/properties/BackupVaultName", "/properties/EncryptionKeyArn"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["backup_vault_name"] + identifier = ["/properties/BackupVaultName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/backup_framework.py b/plugins/modules/backup_framework.py deleted file mode 100644 index b883051d..00000000 --- a/plugins/modules/backup_framework.py +++ /dev/null @@ -1,342 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# Copyright: (c) 2022, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# template: header.j2 -# template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette - - -DOCUMENTATION = r""" -module: backup_framework -short_description: Create and manage frameworks with one or more controls -description: -- Creates and manages frameworks with one or more controls. -options: - force: - default: false - description: - - Cancel IN_PROGRESS and PENDING resource requestes. - - Because you can only perform a single operation on a given resource at a - time, there might be cases where you need to cancel the current resource - operation to make the resource available so that another operation may - be performed on it. - type: bool - framework_arn: - description: - - An Amazon Resource Name (ARN) that uniquely identifies Framework as a resource. - type: str - framework_controls: - description: - - Contains detailed information about all of the controls of a framework. - - Each framework must contain at least one control. - elements: dict - suboptions: - control_input_parameters: - description: - - A list of I(parameter_name) and I(parameter_value) pairs. - elements: dict - suboptions: - parameter_name: - description: - - Not Provived. - type: str - parameter_value: - description: - - Not Provived. - type: str - type: list - control_name: - description: - - The name of a control. - - This name is between 1 and 256 characters. - type: str - control_scope: - description: - - The scope of a control. - - The control scope defines what the control will evaluate. - - 'Three examples of control scopes are: a specific backup plan, all - backup plans with a specific tag, or all backup plans.' - suboptions: - compliance_resource_ids: - description: - - The ID of the only AWS resource that you want your control - scope to contain. - elements: str - type: list - compliance_resource_types: - description: - - Describes whether the control scope includes one or more - types of resources, such as EFS or RDS. - elements: str - type: list - tags: - description: - - A key-value pair to associate with a resource. - elements: dict - suboptions: - key: - description: - - The key name of the tag. - - You can specify a value that is 1 to 128 Unicode - characters in length and cannot be prefixed with - aws:. - - 'You can use any of the following characters: the - set of Unicode letters, digits, whitespace, _, - ., /, =, +, and -.' - type: str - value: - description: - - The value for the tag. - - You can specify a value that is 0 to 256 Unicode - characters in length and cannot be prefixed with - aws:. - - 'You can use any of the following characters: the - set of Unicode letters, digits, whitespace, _, - ., /, =, +, and -.' - type: str - type: list - type: dict - type: list - framework_description: - description: - - An optional description of the framework with a maximum 1,024 characters. - type: str - framework_name: - description: - - The unique name of a framework. - - This name is between 1 and 256 characters, starting with a letter, and consisting - of letters (a-z, A-Z), numbers (0-9), and underscores (_). - type: str - framework_tags: - description: - - A key-value pair to associate with a resource. - elements: dict - suboptions: - key: - description: - - The key name of the tag. - - You can specify a value that is 1 to 128 Unicode characters in length - and cannot be prefixed with aws:. - - 'You can use any of the following characters: the set of Unicode - letters, digits, whitespace, _, ., /, =, +, and -.' - type: str - value: - description: - - The value for the tag. - - You can specify a value that is 0 to 256 Unicode characters in length - and cannot be prefixed with aws:. - - 'You can use any of the following characters: the set of Unicode - letters, digits, whitespace, _, ., /, =, +, and -.' - type: str - type: list - purge_tags: - default: true - description: - - Remove tags not listed in I(tags). - type: bool - state: - choices: - - present - - absent - - list - - describe - - get - default: present - description: - - Goal state for resource. - - I(state=present) creates the resource if it doesn't exist, or updates to - the provided state if the resource already exists. - - I(state=absent) ensures an existing instance is deleted. - - I(state=list) get all the existing resources. - - I(state=describe) or I(state=get) retrieves information on an existing resource. - type: str - tags: - aliases: - - resource_tags - description: - - A dict of tags to apply to the resource. - - To remove all tags set I(tags={}) and I(purge_tags=true). - type: dict - wait: - default: false - description: - - Wait for operation to complete before returning. - type: bool - wait_timeout: - default: 320 - description: - - How many seconds to wait for an operation to complete before timing out. - type: int -author: Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 -extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.cloud.boto3 -""" - -EXAMPLES = r""" -""" - -RETURN = r""" -result: - description: - - When I(state=list), it is a list containing dictionaries of resource information. - - Otherwise, it is a dictionary of resource information. - - When I(state=absent), it is an empty dictionary. - returned: always - type: complex - contains: - identifier: - description: The unique identifier of the resource. - type: str - properties: - description: The resource properties. - type: dict -""" - - -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - CloudControlResource, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, -) - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["framework_name"] = {"type": "str"} - argument_spec["framework_description"] = {"type": "str"} - argument_spec["framework_arn"] = {"type": "str"} - argument_spec["framework_controls"] = { - "type": "list", - "elements": "dict", - "options": { - "control_name": {"type": "str"}, - "control_input_parameters": { - "type": "list", - "elements": "dict", - "options": { - "parameter_name": {"type": "str"}, - "parameter_value": {"type": "str"}, - }, - }, - "control_scope": { - "type": "dict", - "options": { - "compliance_resource_ids": {"type": "list", "elements": "str"}, - "compliance_resource_types": {"type": "list", "elements": "str"}, - "tags": { - "type": "list", - "elements": "dict", - "options": {"key": {"type": "str"}, "value": {"type": "str"}}, - }, - }, - }, - }, - } - argument_spec["framework_tags"] = { - "type": "list", - "elements": "dict", - "options": {"key": {"type": "str"}, "value": {"type": "str"}}, - } - argument_spec["state"] = { - "type": "str", - "choices": ["present", "absent", "list", "describe", "get"], - "default": "present", - } - argument_spec["wait"] = {"type": "bool", "default": False} - argument_spec["wait_timeout"] = {"type": "int", "default": 320} - argument_spec["force"] = {"type": "bool", "default": False} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["purge_tags"] = {"type": "bool", "default": True} - - required_if = [ - ["state", "present", ["framework_arn", "framework_controls"], True], - ["state", "absent", ["framework_arn"], True], - ["state", "get", ["framework_arn"], True], - ] - mutually_exclusive = [] - - module = AnsibleAmazonCloudModule( - argument_spec=argument_spec, - required_if=required_if, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - cloud = CloudControlResource(module) - - type_name = "AWS::Backup::Framework" - - params = {} - - params["framework_arn"] = module.params.get("framework_arn") - params["framework_controls"] = module.params.get("framework_controls") - params["framework_description"] = module.params.get("framework_description") - params["framework_name"] = module.params.get("framework_name") - params["framework_tags"] = module.params.get("framework_tags") - params["tags"] = module.params.get("tags") - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} - - # Only if resource is taggable - if module.params.get("tags") is not None: - _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - - # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["framework_name"] - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["framework_arn"] - - results = {"changed": False, "result": {}} - - if state == "list": - if "list" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be listed." - ) - results["result"] = cloud.list_resources(type_name, identifier) - - if state in ("describe", "get"): - if "read" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be read." - ) - results["result"] = cloud.get_resource(type_name, identifier) - - if state == "present": - results = cloud.present( - type_name, identifier, params_to_set, create_only_params - ) - - if state == "absent": - results["changed"] |= cloud.absent(type_name, identifier) - - module.exit_json(**results) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/backup_report_plan.py b/plugins/modules/backup_report_plan.py deleted file mode 100644 index a2cc9ed4..00000000 --- a/plugins/modules/backup_report_plan.py +++ /dev/null @@ -1,323 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# Copyright: (c) 2022, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette - - -DOCUMENTATION = r""" -module: backup_report_plan -short_description: Create and manage report plans -description: -- Creates and manages report plans. -options: - force: - default: false - description: - - Cancel IN_PROGRESS and PENDING resource requestes. - - Because you can only perform a single operation on a given resource at a - time, there might be cases where you need to cancel the current resource - operation to make the resource available so that another operation may - be performed on it. - type: bool - purge_tags: - default: true - description: - - Remove tags not listed in I(tags). - type: bool - report_delivery_channel: - description: - - A structure that contains information about where and how to deliver your - reports, specifically your Amazon S3 bucket name, S3 key prefix, and the - formats of your reports. - suboptions: - formats: - description: - - 'A list of the format of your reports: CSV, JSON, or both.' - - If not specified, the default format is CSV. - elements: str - type: list - s3_bucket_name: - description: - - The unique name of the S3 bucket that receives your reports. - type: str - s3_key_prefix: - description: - - 'The prefix for where AWS Backup Audit Manager delivers your reports - to Amazon S3. The prefix is this part of the following path: s3://your-bucket-name/prefix/Backup/us-west-2/year/month/day/report-name.' - - If not specified, there is no prefix. - type: str - type: dict - report_plan_arn: - description: - - An Amazon Resource Name (ARN) that uniquely identifies a resource. - - The format of the ARN depends on the resource type. - type: str - report_plan_description: - description: - - An optional description of the report plan with a maximum of 1,024 characters. - type: str - report_plan_name: - description: - - The unique name of the report plan. - - The name must be between 1 and 256 characters, starting with a letter, and - consisting of letters (a-z, A-Z), numbers (0-9), and underscores (_). - type: str - report_plan_tags: - description: - - A key-value pair to associate with a resource. - elements: dict - suboptions: - key: - description: - - The key name of the tag. - - You can specify a value that is 1 to 128 Unicode characters in length - and cannot be prefixed with aws:. - - 'You can use any of the following characters: the set of Unicode - letters, digits, whitespace, _, ., /, =, +, and -.' - type: str - value: - description: - - The value for the tag. - - You can specify a value that is 0 to 256 Unicode characters in length - and cannot be prefixed with aws:. - - 'You can use any of the following characters: the set of Unicode - letters, digits, whitespace, _, ., /, =, +, and -.' - type: str - type: list - report_setting: - description: - - Identifies the report template for the report. - - Reports are built using a report template. - suboptions: - accounts: - description: - - The list of AWS accounts that a report covers. - elements: str - type: list - framework_arns: - description: - - The Amazon Resource Names (ARNs) of the frameworks a report covers. - elements: str - type: list - organization_units: - description: - - The list of AWS organization units that a report covers. - elements: str - type: list - regions: - description: - - The list of AWS regions that a report covers. - elements: str - type: list - report_template: - description: - - Identifies the report template for the report. - - Reports are built using a report template. - - 'The report templates are: C(BACKUP_JOB_REPORT) | C(COPY_JOB_REPORT) - | C(RESTORE_JOB_REPORT).' - type: str - type: dict - state: - choices: - - present - - absent - - list - - describe - - get - default: present - description: - - Goal state for resource. - - I(state=present) creates the resource if it doesn't exist, or updates to - the provided state if the resource already exists. - - I(state=absent) ensures an existing instance is deleted. - - I(state=list) get all the existing resources. - - I(state=describe) or I(state=get) retrieves information on an existing resource. - type: str - tags: - aliases: - - resource_tags - description: - - A dict of tags to apply to the resource. - - To remove all tags set I(tags={}) and I(purge_tags=true). - type: dict - wait: - default: false - description: - - Wait for operation to complete before returning. - type: bool - wait_timeout: - default: 320 - description: - - How many seconds to wait for an operation to complete before timing out. - type: int -author: Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 -extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.cloud.boto3 -""" - -EXAMPLES = r""" -""" - -RETURN = r""" -result: - description: - - When I(state=list), it is a list containing dictionaries of resource information. - - Otherwise, it is a dictionary of resource information. - - When I(state=absent), it is an empty dictionary. - returned: always - type: complex - contains: - identifier: - description: The unique identifier of the resource. - type: str - properties: - description: The resource properties. - type: dict -""" - - -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - CloudControlResource, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, -) - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["report_plan_name"] = {"type": "str"} - argument_spec["report_plan_arn"] = {"type": "str"} - argument_spec["report_plan_description"] = {"type": "str"} - argument_spec["report_plan_tags"] = { - "type": "list", - "elements": "dict", - "options": {"key": {"type": "str"}, "value": {"type": "str"}}, - } - argument_spec["report_delivery_channel"] = { - "type": "dict", - "options": { - "formats": {"type": "list", "elements": "str"}, - "s3_bucket_name": {"type": "str"}, - "s3_key_prefix": {"type": "str"}, - }, - } - argument_spec["report_setting"] = { - "type": "dict", - "options": { - "report_template": {"type": "str"}, - "framework_arns": {"type": "list", "elements": "str"}, - "accounts": {"type": "list", "elements": "str"}, - "organization_units": {"type": "list", "elements": "str"}, - "regions": {"type": "list", "elements": "str"}, - }, - } - argument_spec["state"] = { - "type": "str", - "choices": ["present", "absent", "list", "describe", "get"], - "default": "present", - } - argument_spec["wait"] = {"type": "bool", "default": False} - argument_spec["wait_timeout"] = {"type": "int", "default": 320} - argument_spec["force"] = {"type": "bool", "default": False} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["purge_tags"] = {"type": "bool", "default": True} - - required_if = [ - [ - "state", - "present", - ["report_plan_arn", "report_delivery_channel", "report_setting"], - True, - ], - ["state", "absent", ["report_plan_arn"], True], - ["state", "get", ["report_plan_arn"], True], - ] - mutually_exclusive = [] - - module = AnsibleAmazonCloudModule( - argument_spec=argument_spec, - required_if=required_if, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - cloud = CloudControlResource(module) - - type_name = "AWS::Backup::ReportPlan" - - params = {} - - params["report_delivery_channel"] = module.params.get("report_delivery_channel") - params["report_plan_arn"] = module.params.get("report_plan_arn") - params["report_plan_description"] = module.params.get("report_plan_description") - params["report_plan_name"] = module.params.get("report_plan_name") - params["report_plan_tags"] = module.params.get("report_plan_tags") - params["report_setting"] = module.params.get("report_setting") - params["tags"] = module.params.get("tags") - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} - - # Only if resource is taggable - if module.params.get("tags") is not None: - _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - - # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["report_plan_name"] - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["report_plan_arn"] - - results = {"changed": False, "result": {}} - - if state == "list": - if "list" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be listed." - ) - results["result"] = cloud.list_resources(type_name, identifier) - - if state in ("describe", "get"): - if "read" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be read." - ) - results["result"] = cloud.get_resource(type_name, identifier) - - if state == "present": - results = cloud.present( - type_name, identifier, params_to_set, create_only_params - ) - - if state == "absent": - results["changed"] |= cloud.absent(type_name, identifier) - - module.exit_json(**results) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/cloudtrail_event_data_store.py b/plugins/modules/cloudtrail_event_data_store.py deleted file mode 100644 index 7b027520..00000000 --- a/plugins/modules/cloudtrail_event_data_store.py +++ /dev/null @@ -1,331 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# Copyright: (c) 2022, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette - - -DOCUMENTATION = r""" -module: cloudtrail_event_data_store -short_description: Creates and manages a new event data store -description: -- Creates and manages a new event data store. -options: - advanced_event_selectors: - description: - - Advanced event selectors let you create fine-grained selectors for the following - AWS CloudTrail event record ?elds. - - They help you control costs by logging only those events that are important - to you. - elements: dict - suboptions: - field_selectors: - description: - - A single selector statement in an advanced event selector. - elements: dict - suboptions: - ends_with: - description: - - An operator that includes events that match the last few - characters of the event record field specified as the - value of Field. - elements: str - type: list - equals: - description: - - An operator that includes events that match the exact value - of the event record field specified as the value of Field. - - This is the only valid operator that you can use with the - readOnly, eventCategory, and resources.type fields. - elements: str - type: list - field: - description: - - A field in an event record on which to filter events to - be logged. - - Supported fields include readOnly, eventCategory, eventSource - (for management events), eventName, resources.type, and - resources.ARN. - type: str - not_ends_with: - description: - - An operator that excludes events that match the last few - characters of the event record field specified as the - value of Field. - elements: str - type: list - not_equals: - description: - - An operator that excludes events that match the exact value - of the event record field specified as the value of Field. - elements: str - type: list - not_starts_with: - description: - - An operator that excludes events that match the first few - characters of the event record field specified as the - value of Field. - elements: str - type: list - starts_with: - description: - - An operator that includes events that match the first few - characters of the event record field specified as the - value of Field. - elements: str - type: list - type: list - name: - description: - - An optional, descriptive name for an advanced event selector, such - as Log data events for only two S3 buckets. - type: str - type: list - event_data_store_arn: - description: - - The ARN of the event data store. - type: str - force: - default: false - description: - - Cancel IN_PROGRESS and PENDING resource requestes. - - Because you can only perform a single operation on a given resource at a - time, there might be cases where you need to cancel the current resource - operation to make the resource available so that another operation may - be performed on it. - type: bool - kms_key_id: - description: - - Specifies the KMS key ID to use to encrypt the events delivered by CloudTrail. - - The value can be an alias name prefixed by alias/, a fully specified ARN - to an alias, a fully specified ARN to a key, or a globally unique identifier. - type: str - multi_region_enabled: - description: - - Indicates whether the event data store includes events from all regions, - or only from the region in which it was created. - type: bool - name: - description: - - The name of the event data store. - type: str - organization_enabled: - description: - - Indicates that an event data store is collecting logged events for an organization. - type: bool - purge_tags: - default: true - description: - - Remove tags not listed in I(tags). - type: bool - retention_period: - description: - - The retention period, in days. - type: int - state: - choices: - - present - - absent - - list - - describe - - get - default: present - description: - - Goal state for resource. - - I(state=present) creates the resource if it doesn't exist, or updates to - the provided state if the resource already exists. - - I(state=absent) ensures an existing instance is deleted. - - I(state=list) get all the existing resources. - - I(state=describe) or I(state=get) retrieves information on an existing resource. - type: str - tags: - aliases: - - resource_tags - description: - - A dict of tags to apply to the resource. - - To remove all tags set I(tags={}) and I(purge_tags=true). - type: dict - termination_protection_enabled: - description: - - Indicates whether the event data store is protected from termination. - type: bool - wait: - default: false - description: - - Wait for operation to complete before returning. - type: bool - wait_timeout: - default: 320 - description: - - How many seconds to wait for an operation to complete before timing out. - type: int -author: Ansible Cloud Team (@ansible-collections) -version_added: 0.2.0 -extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.cloud.boto3 -""" - -EXAMPLES = r""" -""" - -RETURN = r""" -result: - description: - - When I(state=list), it is a list containing dictionaries of resource information. - - Otherwise, it is a dictionary of resource information. - - When I(state=absent), it is an empty dictionary. - returned: always - type: complex - contains: - identifier: - description: The unique identifier of the resource. - type: str - properties: - description: The resource properties. - type: dict -""" - - -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - CloudControlResource, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, -) - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["advanced_event_selectors"] = { - "type": "list", - "elements": "dict", - "options": { - "name": {"type": "str"}, - "field_selectors": { - "type": "list", - "elements": "dict", - "options": { - "field": {"type": "str"}, - "equals": {"type": "list", "elements": "str"}, - "starts_with": {"type": "list", "elements": "str"}, - "ends_with": {"type": "list", "elements": "str"}, - "not_equals": {"type": "list", "elements": "str"}, - "not_starts_with": {"type": "list", "elements": "str"}, - "not_ends_with": {"type": "list", "elements": "str"}, - }, - }, - }, - } - argument_spec["event_data_store_arn"] = {"type": "str"} - argument_spec["multi_region_enabled"] = {"type": "bool"} - argument_spec["name"] = {"type": "str"} - argument_spec["organization_enabled"] = {"type": "bool"} - argument_spec["retention_period"] = {"type": "int"} - argument_spec["termination_protection_enabled"] = {"type": "bool"} - argument_spec["kms_key_id"] = {"type": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["state"] = { - "type": "str", - "choices": ["present", "absent", "list", "describe", "get"], - "default": "present", - } - argument_spec["wait"] = {"type": "bool", "default": False} - argument_spec["wait_timeout"] = {"type": "int", "default": 320} - argument_spec["force"] = {"type": "bool", "default": False} - argument_spec["purge_tags"] = {"type": "bool", "default": True} - - required_if = [ - ["state", "present", ["event_data_store_arn"], True], - ["state", "absent", ["event_data_store_arn"], True], - ["state", "get", ["event_data_store_arn"], True], - ] - mutually_exclusive = [] - - module = AnsibleAmazonCloudModule( - argument_spec=argument_spec, - required_if=required_if, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - cloud = CloudControlResource(module) - - type_name = "AWS::CloudTrail::EventDataStore" - - params = {} - - params["advanced_event_selectors"] = module.params.get("advanced_event_selectors") - params["event_data_store_arn"] = module.params.get("event_data_store_arn") - params["kms_key_id"] = module.params.get("kms_key_id") - params["multi_region_enabled"] = module.params.get("multi_region_enabled") - params["name"] = module.params.get("name") - params["organization_enabled"] = module.params.get("organization_enabled") - params["retention_period"] = module.params.get("retention_period") - params["tags"] = module.params.get("tags") - params["termination_protection_enabled"] = module.params.get( - "termination_protection_enabled" - ) - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} - - # Only if resource is taggable - if module.params.get("tags") is not None: - _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - - # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = {} - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["event_data_store_arn"] - - results = {"changed": False, "result": {}} - - if state == "list": - if "list" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be listed." - ) - results["result"] = cloud.list_resources(type_name, identifier) - - if state in ("describe", "get"): - if "read" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be read." - ) - results["result"] = cloud.get_resource(type_name, identifier) - - if state == "present": - results = cloud.present( - type_name, identifier, params_to_set, create_only_params - ) - - if state == "absent": - results["changed"] |= cloud.absent(type_name, identifier) - - module.exit_json(**results) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/cloudtrail_trail.py b/plugins/modules/cloudtrail_trail.py index 9c4218e2..079987a7 100644 --- a/plugins/modules/cloudtrail_trail.py +++ b/plugins/modules/cloudtrail_trail.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -15,7 +15,99 @@ - Creates and manages a trail that specifies the settings for delivery of log data to an Amazon S3 bucket. options: + advanced_event_selectors: + aliases: + - AdvancedEventSelectors + description: + - Advanced event selectors let you create fine-grained selectors for the following + AWS CloudTrail event record ?elds. + - They help you control costs by logging only those events that are important + to you. + elements: dict + suboptions: + field_selectors: + aliases: + - FieldSelectors + description: + - A single selector statement in an advanced event selector. + elements: dict + suboptions: + ends_with: + aliases: + - EndsWith + description: + - An operator that includes events that match the last few + characters of the event record field specified as the + value of Field. + elements: str + type: list + equals: + aliases: + - Equals + description: + - An operator that includes events that match the exact value + of the event record field specified as the value of Field. + - This is the only valid operator that you can use with the + readOnly, eventCategory, and resources.type fields. + elements: str + type: list + field: + aliases: + - Field + description: + - A field in an event record on which to filter events to + be logged. + - Supported fields include readOnly, eventCategory, eventSource + (for management events), eventName, resources.type, and + resources.ARN. + type: str + not_ends_with: + aliases: + - NotEndsWith + description: + - An operator that excludes events that match the last few + characters of the event record field specified as the + value of Field. + elements: str + type: list + not_equals: + aliases: + - NotEquals + description: + - An operator that excludes events that match the exact value + of the event record field specified as the value of Field. + elements: str + type: list + not_starts_with: + aliases: + - NotStartsWith + description: + - An operator that excludes events that match the first few + characters of the event record field specified as the + value of Field. + elements: str + type: list + starts_with: + aliases: + - StartsWith + description: + - An operator that includes events that match the first few + characters of the event record field specified as the + value of Field. + elements: str + type: list + type: list + name: + aliases: + - Name + description: + - An optional, descriptive name for an advanced event selector, such + as Log data events for only two S3 buckets. + type: str + type: list cloud_watch_logs_log_group_arn: + aliases: + - CloudWatchLogsLogGroupArn description: - Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs will @@ -23,21 +115,29 @@ - Not required unless you specify CloudWatchLogsRoleArn. type: str cloud_watch_logs_role_arn: + aliases: + - CloudWatchLogsRoleArn description: - Specifies the role for the CloudWatch Logs endpoint to assume to write to a users log group. type: str enable_log_file_validation: + aliases: + - EnableLogFileValidation description: - Specifies whether log file validation is enabled. - The default is false. type: bool event_selectors: + aliases: + - EventSelectors description: - The type of email sending events to publish to the event destination. elements: dict suboptions: data_resources: + aliases: + - DataResources description: - CloudTrail supports data event logging for Amazon S3 objects and AWS Lambda functions. @@ -49,12 +149,16 @@ elements: dict suboptions: type: + aliases: + - Type description: - The resource type in which you want to log data events. - You can specify AWS::S3::Object or AWS::Lambda::Function resources. type: str values: + aliases: + - Values description: - An array of Amazon Resource Name (ARN) strings or partial ARN strings for the specified objects. @@ -62,6 +166,8 @@ type: list type: list exclude_management_event_sources: + aliases: + - ExcludeManagementEventSources description: - An optional list of service event sources from which you do not want management events to be logged on your trail. @@ -73,11 +179,15 @@ elements: str type: list include_management_events: + aliases: + - IncludeManagementEvents description: - Specify if you want your event selector to include management events for your trail. type: bool read_write_type: + aliases: + - ReadWriteType choices: - All - ReadOnly @@ -99,25 +209,35 @@ be performed on it. type: bool include_global_service_events: + aliases: + - IncludeGlobalServiceEvents description: - Specifies whether the trail is publishing events from global services such as IAM to the log files. type: bool insight_selectors: + aliases: + - InsightSelectors description: - A string that contains insight types that are logged on a trail. elements: dict suboptions: insight_type: + aliases: + - InsightType description: - The type of insight to log on a trail. type: str type: list is_logging: + aliases: + - IsLogging description: - Whether the CloudTrail is currently logging AWS API calls. type: bool is_multi_region_trail: + aliases: + - IsMultiRegionTrail description: - Specifies whether the trail applies only to the current region or to all regions. @@ -131,6 +251,8 @@ - As a best practice, consider using trails that log events in all regions. type: bool is_organization_trail: + aliases: + - IsOrganizationTrail description: - Specifies whether the trail is created for all accounts in an organization in AWS Organizations, or only for the current AWS account. @@ -139,6 +261,8 @@ Organizations. type: bool kms_key_id: + aliases: + - KMSKeyId description: - Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. - The value can be an alias name prefixed by alias/, a fully specified ARN @@ -150,12 +274,16 @@ - Remove tags not listed in I(tags). type: bool s3_bucket_name: + aliases: + - S3BucketName description: - Specifies the name of the Amazon S3 bucket designated for publishing log files. - See Amazon S3 Bucket Naming Requirements. type: str s3_key_prefix: + aliases: + - S3KeyPrefix description: - Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. @@ -163,6 +291,8 @@ - The maximum length is 200 characters. type: str sns_topic_name: + aliases: + - SnsTopicName description: - Specifies the name of the Amazon SNS topic defined for notification of log file delivery. @@ -186,12 +316,15 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). type: dict trail_name: + aliases: + - TrailName description: - Not Provived. type: str @@ -241,11 +374,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -257,9 +391,64 @@ def main(): ), ) - argument_spec["cloud_watch_logs_log_group_arn"] = {"type": "str"} - argument_spec["cloud_watch_logs_role_arn"] = {"type": "str"} - argument_spec["enable_log_file_validation"] = {"type": "bool"} + argument_spec["cloud_watch_logs_log_group_arn"] = { + "type": "str", + "aliases": ["CloudWatchLogsLogGroupArn"], + } + argument_spec["cloud_watch_logs_role_arn"] = { + "type": "str", + "aliases": ["CloudWatchLogsRoleArn"], + } + argument_spec["enable_log_file_validation"] = { + "type": "bool", + "aliases": ["EnableLogFileValidation"], + } + argument_spec["advanced_event_selectors"] = { + "type": "list", + "elements": "dict", + "options": { + "name": {"type": "str", "aliases": ["Name"]}, + "field_selectors": { + "type": "list", + "elements": "dict", + "options": { + "field": {"type": "str", "aliases": ["Field"]}, + "equals": { + "type": "list", + "elements": "str", + "aliases": ["Equals"], + }, + "starts_with": { + "type": "list", + "elements": "str", + "aliases": ["StartsWith"], + }, + "ends_with": { + "type": "list", + "elements": "str", + "aliases": ["EndsWith"], + }, + "not_equals": { + "type": "list", + "elements": "str", + "aliases": ["NotEquals"], + }, + "not_starts_with": { + "type": "list", + "elements": "str", + "aliases": ["NotStartsWith"], + }, + "not_ends_with": { + "type": "list", + "elements": "str", + "aliases": ["NotEndsWith"], + }, + }, + "aliases": ["FieldSelectors"], + }, + }, + "aliases": ["AdvancedEventSelectors"], + } argument_spec["event_selectors"] = { "type": "list", "elements": "dict", @@ -268,32 +457,56 @@ def main(): "type": "list", "elements": "dict", "options": { - "type": {"type": "str"}, - "values": {"type": "list", "elements": "str"}, + "type": {"type": "str", "aliases": ["Type"]}, + "values": { + "type": "list", + "elements": "str", + "aliases": ["Values"], + }, }, + "aliases": ["DataResources"], + }, + "include_management_events": { + "type": "bool", + "aliases": ["IncludeManagementEvents"], }, - "include_management_events": {"type": "bool"}, "read_write_type": { "type": "str", "choices": ["All", "ReadOnly", "WriteOnly"], + "aliases": ["ReadWriteType"], + }, + "exclude_management_event_sources": { + "type": "list", + "elements": "str", + "aliases": ["ExcludeManagementEventSources"], }, - "exclude_management_event_sources": {"type": "list", "elements": "str"}, }, + "aliases": ["EventSelectors"], + } + argument_spec["include_global_service_events"] = { + "type": "bool", + "aliases": ["IncludeGlobalServiceEvents"], + } + argument_spec["is_logging"] = {"type": "bool", "aliases": ["IsLogging"]} + argument_spec["is_multi_region_trail"] = { + "type": "bool", + "aliases": ["IsMultiRegionTrail"], + } + argument_spec["is_organization_trail"] = { + "type": "bool", + "aliases": ["IsOrganizationTrail"], } - argument_spec["include_global_service_events"] = {"type": "bool"} - argument_spec["is_logging"] = {"type": "bool"} - argument_spec["is_multi_region_trail"] = {"type": "bool"} - argument_spec["is_organization_trail"] = {"type": "bool"} - argument_spec["kms_key_id"] = {"type": "str"} - argument_spec["s3_bucket_name"] = {"type": "str"} - argument_spec["s3_key_prefix"] = {"type": "str"} - argument_spec["sns_topic_name"] = {"type": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["trail_name"] = {"type": "str"} + argument_spec["kms_key_id"] = {"type": "str", "aliases": ["KMSKeyId"]} + argument_spec["s3_bucket_name"] = {"type": "str", "aliases": ["S3BucketName"]} + argument_spec["s3_key_prefix"] = {"type": "str", "aliases": ["S3KeyPrefix"]} + argument_spec["sns_topic_name"] = {"type": "str", "aliases": ["SnsTopicName"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} + argument_spec["trail_name"] = {"type": "str", "aliases": ["TrailName"]} argument_spec["insight_selectors"] = { "type": "list", "elements": "dict", - "options": {"insight_type": {"type": "str"}}, + "options": {"insight_type": {"type": "str", "aliases": ["InsightType"]}}, + "aliases": ["InsightSelectors"], } argument_spec["state"] = { "type": "str", @@ -306,7 +519,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["s3_bucket_name", "is_logging", "trail_name"], True], + ["state", "present", ["is_logging", "s3_bucket_name", "trail_name"], True], ["state", "absent", ["trail_name"], True], ["state", "get", ["trail_name"], True], ] @@ -324,6 +537,7 @@ def main(): params = {} + params["advanced_event_selectors"] = module.params.get("advanced_event_selectors") params["cloud_watch_logs_log_group_arn"] = module.params.get( "cloud_watch_logs_log_group_arn" ) @@ -347,22 +561,23 @@ def main(): params["trail_name"] = module.params.get("trail_name") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["trail_name"] + create_only_params = ["/properties/TrailName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["trail_name"] + identifier = ["/properties/TrailName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/cloudwatch_composite_alarm.py b/plugins/modules/cloudwatch_composite_alarm.py index 0818dd6c..06633172 100644 --- a/plugins/modules/cloudwatch_composite_alarm.py +++ b/plugins/modules/cloudwatch_composite_alarm.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -18,41 +18,57 @@ met. options: actions_enabled: + aliases: + - ActionsEnabled description: - Indicates whether actions should be executed during any changes to the alarm state. - The default is C(True). type: bool actions_suppressor: + aliases: + - ActionsSuppressor description: - Actions will be suppressed if the suppressor alarm is in the ALARM state. - ActionsSuppressor can be an AlarmName or an Amazon Resource Name (ARN) from an existing alarm. type: str actions_suppressor_extension_period: + aliases: + - ActionsSuppressorExtensionPeriod description: - Actions will be suppressed if WaitPeriod is active. - The length of time that actions are suppressed is in seconds. type: int actions_suppressor_wait_period: + aliases: + - ActionsSuppressorWaitPeriod description: - Actions will be suppressed if ExtensionPeriod is active. - The length of time that actions are suppressed is in seconds. type: int alarm_actions: + aliases: + - AlarmActions description: - Amazon Resource Name (ARN) of the action. elements: str type: list alarm_description: + aliases: + - AlarmDescription description: - The description of the alarm. type: str alarm_name: + aliases: + - AlarmName description: - The name of the Composite Alarm. type: str alarm_rule: + aliases: + - AlarmRule description: - Expression which aggregates the state of other Alarms (Metric or Composite Alarms). @@ -67,11 +83,15 @@ be performed on it. type: bool insufficient_data_actions: + aliases: + - InsufficientDataActions description: - Amazon Resource Name (ARN) of the action. elements: str type: list ok_actions: + aliases: + - OKActions description: - Amazon Resource Name (ARN) of the action. elements: str @@ -138,11 +158,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -154,16 +175,40 @@ def main(): ), ) - argument_spec["alarm_name"] = {"type": "str"} - argument_spec["alarm_rule"] = {"type": "str"} - argument_spec["alarm_description"] = {"type": "str"} - argument_spec["actions_enabled"] = {"type": "bool"} - argument_spec["ok_actions"] = {"type": "list", "elements": "str"} - argument_spec["alarm_actions"] = {"type": "list", "elements": "str"} - argument_spec["insufficient_data_actions"] = {"type": "list", "elements": "str"} - argument_spec["actions_suppressor"] = {"type": "str"} - argument_spec["actions_suppressor_wait_period"] = {"type": "int"} - argument_spec["actions_suppressor_extension_period"] = {"type": "int"} + argument_spec["alarm_name"] = {"type": "str", "aliases": ["AlarmName"]} + argument_spec["alarm_rule"] = {"type": "str", "aliases": ["AlarmRule"]} + argument_spec["alarm_description"] = { + "type": "str", + "aliases": ["AlarmDescription"], + } + argument_spec["actions_enabled"] = {"type": "bool", "aliases": ["ActionsEnabled"]} + argument_spec["ok_actions"] = { + "type": "list", + "elements": "str", + "aliases": ["OKActions"], + } + argument_spec["alarm_actions"] = { + "type": "list", + "elements": "str", + "aliases": ["AlarmActions"], + } + argument_spec["insufficient_data_actions"] = { + "type": "list", + "elements": "str", + "aliases": ["InsufficientDataActions"], + } + argument_spec["actions_suppressor"] = { + "type": "str", + "aliases": ["ActionsSuppressor"], + } + argument_spec["actions_suppressor_wait_period"] = { + "type": "int", + "aliases": ["ActionsSuppressorWaitPeriod"], + } + argument_spec["actions_suppressor_extension_period"] = { + "type": "int", + "aliases": ["ActionsSuppressorExtensionPeriod"], + } argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -208,22 +253,23 @@ def main(): params["ok_actions"] = module.params.get("ok_actions") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["alarm_name"] + create_only_params = ["/properties/AlarmName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["alarm_name"] + identifier = ["/properties/AlarmName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index 2784c6ec..646534f3 100644 --- a/plugins/modules/cloudwatch_metric_stream.py +++ b/plugins/modules/cloudwatch_metric_stream.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -17,16 +17,31 @@ - For more information, see U(https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Metric-Streams.html). options: exclude_filters: + aliases: + - ExcludeFilters description: - This structure defines the metrics that will be streamed. elements: dict suboptions: + metric_names: + aliases: + - MetricNames + description: + - Only metrics with I(metric_names) matching these values will be + streamed. + - Must be set together with Namespace. + elements: str + type: list namespace: + aliases: + - Namespace description: - Only metrics with Namespace matching this value will be streamed. type: str type: list firehose_arn: + aliases: + - FirehoseArn description: - The ARN of the Kinesis Firehose where to stream the data. type: str @@ -40,16 +55,31 @@ be performed on it. type: bool include_filters: + aliases: + - IncludeFilters description: - This structure defines the metrics that will be streamed. elements: dict suboptions: + metric_names: + aliases: + - MetricNames + description: + - Only metrics with I(metric_names) matching these values will be + streamed. + - Must be set together with Namespace. + elements: str + type: list namespace: + aliases: + - Namespace description: - Only metrics with Namespace matching this value will be streamed. type: str type: list include_linked_accounts_metrics: + aliases: + - IncludeLinkedAccountsMetrics description: - If you are creating a metric stream in a monitoring account, specify true to include metrics from source accounts that are linked to this monitoring @@ -57,10 +87,14 @@ - The default is false. type: bool name: + aliases: + - Name description: - Name of the metric stream. type: str output_format: + aliases: + - OutputFormat description: - The output format of the data streamed to the Kinesis Firehose. type: str @@ -70,6 +104,8 @@ - Remove tags not listed in I(tags). type: bool role_arn: + aliases: + - RoleArn description: - The ARN of the role that provides access to the Kinesis Firehose. type: str @@ -90,6 +126,8 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str statistics_configurations: + aliases: + - StatisticsConfigurations description: - This structure specifies a list of additional statistics to stream, and the metrics to stream those additional statistics for. @@ -98,11 +136,15 @@ elements: dict suboptions: additional_statistics: + aliases: + - AdditionalStatistics description: - The additional statistics to stream for the metrics listed in I(include_metrics). elements: str type: list include_metrics: + aliases: + - IncludeMetrics description: - A structure that specifies the metric name and namespace for one metric that is going to have additional statistics included in @@ -110,10 +152,14 @@ elements: dict suboptions: metric_name: + aliases: + - MetricName description: - The name of the metric. type: str namespace: + aliases: + - Namespace description: - The namespace of the metric. type: str @@ -121,6 +167,7 @@ type: list tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -172,11 +219,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -191,34 +239,59 @@ def main(): argument_spec["exclude_filters"] = { "type": "list", "elements": "dict", - "options": {"namespace": {"type": "str"}}, + "options": { + "namespace": {"type": "str", "aliases": ["Namespace"]}, + "metric_names": { + "type": "list", + "elements": "str", + "aliases": ["MetricNames"], + }, + }, + "aliases": ["ExcludeFilters"], } - argument_spec["firehose_arn"] = {"type": "str"} + argument_spec["firehose_arn"] = {"type": "str", "aliases": ["FirehoseArn"]} argument_spec["include_filters"] = { "type": "list", "elements": "dict", - "options": {"namespace": {"type": "str"}}, + "options": { + "namespace": {"type": "str", "aliases": ["Namespace"]}, + "metric_names": { + "type": "list", + "elements": "str", + "aliases": ["MetricNames"], + }, + }, + "aliases": ["IncludeFilters"], } - argument_spec["name"] = {"type": "str"} - argument_spec["role_arn"] = {"type": "str"} - argument_spec["output_format"] = {"type": "str"} + argument_spec["name"] = {"type": "str", "aliases": ["Name"]} + argument_spec["role_arn"] = {"type": "str", "aliases": ["RoleArn"]} + argument_spec["output_format"] = {"type": "str", "aliases": ["OutputFormat"]} argument_spec["statistics_configurations"] = { "type": "list", "elements": "dict", "options": { - "additional_statistics": {"type": "list", "elements": "str"}, + "additional_statistics": { + "type": "list", + "elements": "str", + "aliases": ["AdditionalStatistics"], + }, "include_metrics": { "type": "list", "elements": "dict", "options": { - "metric_name": {"type": "str"}, - "namespace": {"type": "str"}, + "metric_name": {"type": "str", "aliases": ["MetricName"]}, + "namespace": {"type": "str", "aliases": ["Namespace"]}, }, + "aliases": ["IncludeMetrics"], }, }, + "aliases": ["StatisticsConfigurations"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} + argument_spec["include_linked_accounts_metrics"] = { + "type": "bool", + "aliases": ["IncludeLinkedAccountsMetrics"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["include_linked_accounts_metrics"] = {"type": "bool"} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -233,7 +306,7 @@ def main(): [ "state", "present", - ["output_format", "role_arn", "name", "firehose_arn"], + ["role_arn", "name", "output_format", "firehose_arn"], True, ], ["state", "absent", ["name"], True], @@ -266,22 +339,23 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["name"] + create_only_params = ["/properties/Name"] # Necessary to handle when module does not support all the states handlers = ["create", "update", "delete", "list", "read"] state = module.params.get("state") - identifier = ["name"] + identifier = ["/properties/Name"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/dynamodb_global_table.py b/plugins/modules/dynamodb_global_table.py index bf9ef019..afe5297f 100644 --- a/plugins/modules/dynamodb_global_table.py +++ b/plugins/modules/dynamodb_global_table.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -15,20 +15,28 @@ - This resource cannot be used to create or manage a Version 2017.11.29 global table. options: attribute_definitions: + aliases: + - AttributeDefinitions description: - Not Provived. elements: dict suboptions: attribute_name: + aliases: + - AttributeName description: - Not Provived. type: str attribute_type: + aliases: + - AttributeType description: - Not Provived. type: str type: list billing_mode: + aliases: + - BillingMode description: - Not Provived. type: str @@ -42,79 +50,115 @@ be performed on it. type: bool global_secondary_indexes: + aliases: + - GlobalSecondaryIndexes description: - Not Provived. elements: dict suboptions: index_name: + aliases: + - IndexName description: - Not Provived. type: str key_schema: + aliases: + - KeySchema description: - Not Provived. elements: dict suboptions: attribute_name: + aliases: + - AttributeName description: - Not Provived. type: str key_type: + aliases: + - KeyType description: - Not Provived. type: str type: list projection: + aliases: + - Projection description: - Not Provived. suboptions: non_key_attributes: + aliases: + - NonKeyAttributes description: - Not Provived. elements: str type: list projection_type: + aliases: + - ProjectionType description: - Not Provived. type: str type: dict write_provisioned_throughput_settings: + aliases: + - WriteProvisionedThroughputSettings description: - Not Provived. suboptions: write_capacity_auto_scaling_settings: + aliases: + - WriteCapacityAutoScalingSettings description: - Not Provived. suboptions: max_capacity: + aliases: + - MaxCapacity description: - Not Provived. type: int min_capacity: + aliases: + - MinCapacity description: - Not Provived. type: int seed_capacity: + aliases: + - SeedCapacity description: - Not Provived. type: int target_tracking_scaling_policy_configuration: + aliases: + - TargetTrackingScalingPolicyConfiguration description: - Not Provived. suboptions: disable_scale_in: + aliases: + - DisableScaleIn description: - Not Provived. type: bool scale_in_cooldown: + aliases: + - ScaleInCooldown description: - Not Provived. type: int scale_out_cooldown: + aliases: + - ScaleOutCooldown description: - Not Provived. type: int target_value: + aliases: + - TargetValue description: - Not Provived. type: int @@ -123,234 +167,357 @@ type: dict type: list key_schema: + aliases: + - KeySchema description: - Not Provived. elements: dict suboptions: attribute_name: + aliases: + - AttributeName description: - Not Provived. type: str key_type: + aliases: + - KeyType description: - Not Provived. type: str type: list local_secondary_indexes: + aliases: + - LocalSecondaryIndexes description: - Not Provived. elements: dict suboptions: index_name: + aliases: + - IndexName description: - Not Provived. type: str key_schema: + aliases: + - KeySchema description: - Not Provived. elements: dict suboptions: attribute_name: + aliases: + - AttributeName description: - Not Provived. type: str key_type: + aliases: + - KeyType description: - Not Provived. type: str type: list projection: + aliases: + - Projection description: - Not Provived. suboptions: non_key_attributes: + aliases: + - NonKeyAttributes description: - Not Provived. elements: str type: list projection_type: + aliases: + - ProjectionType description: - Not Provived. type: str type: dict type: list replicas: + aliases: + - Replicas description: - Not Provived. elements: dict suboptions: contributor_insights_specification: + aliases: + - ContributorInsightsSpecification description: - Not Provived. suboptions: enabled: + aliases: + - Enabled description: - Not Provived. type: bool type: dict + deletion_protection_enabled: + aliases: + - DeletionProtectionEnabled + description: + - Not Provived. + type: bool global_secondary_indexes: + aliases: + - GlobalSecondaryIndexes description: - Not Provived. elements: dict suboptions: contributor_insights_specification: + aliases: + - ContributorInsightsSpecification description: - Not Provived. suboptions: enabled: + aliases: + - Enabled description: - Not Provived. type: bool type: dict index_name: + aliases: + - IndexName description: - Not Provived. type: str read_provisioned_throughput_settings: + aliases: + - ReadProvisionedThroughputSettings description: - Not Provived. suboptions: read_capacity_auto_scaling_settings: + aliases: + - ReadCapacityAutoScalingSettings description: - Not Provived. suboptions: max_capacity: + aliases: + - MaxCapacity description: - Not Provived. type: int min_capacity: + aliases: + - MinCapacity description: - Not Provived. type: int seed_capacity: + aliases: + - SeedCapacity description: - Not Provived. type: int target_tracking_scaling_policy_configuration: + aliases: + - TargetTrackingScalingPolicyConfiguration description: - Not Provived. suboptions: disable_scale_in: + aliases: + - DisableScaleIn description: - Not Provived. type: bool scale_in_cooldown: + aliases: + - ScaleInCooldown description: - Not Provived. type: int scale_out_cooldown: + aliases: + - ScaleOutCooldown description: - Not Provived. type: int target_value: + aliases: + - TargetValue description: - Not Provived. type: int type: dict type: dict read_capacity_units: + aliases: + - ReadCapacityUnits description: - Not Provived. type: int type: dict type: list + kinesis_stream_specification: + aliases: + - KinesisStreamSpecification + description: + - Not Provived. + suboptions: + stream_arn: + aliases: + - StreamArn + description: + - Not Provived. + type: str + type: dict point_in_time_recovery_specification: + aliases: + - PointInTimeRecoverySpecification description: - Not Provived. suboptions: point_in_time_recovery_enabled: + aliases: + - PointInTimeRecoveryEnabled description: - Not Provived. type: bool type: dict read_provisioned_throughput_settings: + aliases: + - ReadProvisionedThroughputSettings description: - Not Provived. suboptions: read_capacity_auto_scaling_settings: + aliases: + - ReadCapacityAutoScalingSettings description: - Not Provived. suboptions: max_capacity: + aliases: + - MaxCapacity description: - Not Provived. type: int min_capacity: + aliases: + - MinCapacity description: - Not Provived. type: int seed_capacity: + aliases: + - SeedCapacity description: - Not Provived. type: int target_tracking_scaling_policy_configuration: + aliases: + - TargetTrackingScalingPolicyConfiguration description: - Not Provived. suboptions: disable_scale_in: + aliases: + - DisableScaleIn description: - Not Provived. type: bool scale_in_cooldown: + aliases: + - ScaleInCooldown description: - Not Provived. type: int scale_out_cooldown: + aliases: + - ScaleOutCooldown description: - Not Provived. type: int target_value: + aliases: + - TargetValue description: - Not Provived. type: int type: dict type: dict read_capacity_units: + aliases: + - ReadCapacityUnits description: - Not Provived. type: int type: dict region: + aliases: + - Region description: - Not Provived. type: str sse_specification: + aliases: + - SSESpecification description: - Not Provived. suboptions: kms_master_key_id: + aliases: + - KMSMasterKeyId description: - Not Provived. type: str type: dict table_class: + aliases: + - TableClass description: - Not Provived. type: str tags: + aliases: + - Tags description: - Not Provived. elements: dict suboptions: key: + aliases: + - Key description: - Not Provived. type: str value: + aliases: + - Value description: - Not Provived. type: str type: list type: list sse_specification: + aliases: + - SSESpecification description: - Not Provived. suboptions: sse_enabled: + aliases: + - SSEEnabled description: - Not Provived. type: bool sse_type: + aliases: + - SSEType description: - Not Provived. type: str @@ -372,27 +539,39 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str stream_specification: + aliases: + - StreamSpecification description: - Not Provived. suboptions: stream_view_type: + aliases: + - StreamViewType description: - Not Provived. type: str type: dict table_name: + aliases: + - TableName description: - Not Provived. type: str time_to_live_specification: + aliases: + - TimeToLiveSpecification description: - Not Provived. suboptions: attribute_name: + aliases: + - AttributeName description: - Not Provived. type: str enabled: + aliases: + - Enabled description: - Not Provived. type: bool @@ -408,42 +587,62 @@ - How many seconds to wait for an operation to complete before timing out. type: int write_provisioned_throughput_settings: + aliases: + - WriteProvisionedThroughputSettings description: - Not Provived. suboptions: write_capacity_auto_scaling_settings: + aliases: + - WriteCapacityAutoScalingSettings description: - Not Provived. suboptions: max_capacity: + aliases: + - MaxCapacity description: - Not Provived. type: int min_capacity: + aliases: + - MinCapacity description: - Not Provived. type: int seed_capacity: + aliases: + - SeedCapacity description: - Not Provived. type: int target_tracking_scaling_policy_configuration: + aliases: + - TargetTrackingScalingPolicyConfiguration description: - Not Provived. suboptions: disable_scale_in: + aliases: + - DisableScaleIn description: - Not Provived. type: bool scale_in_cooldown: + aliases: + - ScaleInCooldown description: - Not Provived. type: int scale_out_cooldown: + aliases: + - ScaleOutCooldown description: - Not Provived. type: int target_value: + aliases: + - TargetValue description: - Not Provived. type: int @@ -486,11 +685,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -506,30 +706,37 @@ def main(): "type": "list", "elements": "dict", "options": { - "attribute_name": {"type": "str"}, - "attribute_type": {"type": "str"}, + "attribute_name": {"type": "str", "aliases": ["AttributeName"]}, + "attribute_type": {"type": "str", "aliases": ["AttributeType"]}, }, + "aliases": ["AttributeDefinitions"], } - argument_spec["billing_mode"] = {"type": "str"} + argument_spec["billing_mode"] = {"type": "str", "aliases": ["BillingMode"]} argument_spec["global_secondary_indexes"] = { "type": "list", "elements": "dict", "options": { - "index_name": {"type": "str"}, + "index_name": {"type": "str", "aliases": ["IndexName"]}, "key_schema": { "type": "list", "elements": "dict", "options": { - "attribute_name": {"type": "str"}, - "key_type": {"type": "str"}, + "attribute_name": {"type": "str", "aliases": ["AttributeName"]}, + "key_type": {"type": "str", "aliases": ["KeyType"]}, }, + "aliases": ["KeySchema"], }, "projection": { "type": "dict", "options": { - "non_key_attributes": {"type": "list", "elements": "str"}, - "projection_type": {"type": "str"}, + "non_key_attributes": { + "type": "list", + "elements": "str", + "aliases": ["NonKeyAttributes"], + }, + "projection_type": {"type": "str", "aliases": ["ProjectionType"]}, }, + "aliases": ["Projection"], }, "write_provisioned_throughput_settings": { "type": "dict", @@ -537,50 +744,80 @@ def main(): "write_capacity_auto_scaling_settings": { "type": "dict", "options": { - "min_capacity": {"type": "int"}, - "max_capacity": {"type": "int"}, - "seed_capacity": {"type": "int"}, + "min_capacity": {"type": "int", "aliases": ["MinCapacity"]}, + "max_capacity": {"type": "int", "aliases": ["MaxCapacity"]}, + "seed_capacity": { + "type": "int", + "aliases": ["SeedCapacity"], + }, "target_tracking_scaling_policy_configuration": { "type": "dict", "options": { - "disable_scale_in": {"type": "bool"}, - "scale_in_cooldown": {"type": "int"}, - "scale_out_cooldown": {"type": "int"}, - "target_value": {"type": "int"}, + "disable_scale_in": { + "type": "bool", + "aliases": ["DisableScaleIn"], + }, + "scale_in_cooldown": { + "type": "int", + "aliases": ["ScaleInCooldown"], + }, + "scale_out_cooldown": { + "type": "int", + "aliases": ["ScaleOutCooldown"], + }, + "target_value": { + "type": "int", + "aliases": ["TargetValue"], + }, }, + "aliases": ["TargetTrackingScalingPolicyConfiguration"], }, }, + "aliases": ["WriteCapacityAutoScalingSettings"], } }, + "aliases": ["WriteProvisionedThroughputSettings"], }, }, + "aliases": ["GlobalSecondaryIndexes"], } argument_spec["key_schema"] = { "type": "list", "elements": "dict", - "options": {"attribute_name": {"type": "str"}, "key_type": {"type": "str"}}, + "options": { + "attribute_name": {"type": "str", "aliases": ["AttributeName"]}, + "key_type": {"type": "str", "aliases": ["KeyType"]}, + }, + "aliases": ["KeySchema"], } argument_spec["local_secondary_indexes"] = { "type": "list", "elements": "dict", "options": { - "index_name": {"type": "str"}, + "index_name": {"type": "str", "aliases": ["IndexName"]}, "key_schema": { "type": "list", "elements": "dict", "options": { - "attribute_name": {"type": "str"}, - "key_type": {"type": "str"}, + "attribute_name": {"type": "str", "aliases": ["AttributeName"]}, + "key_type": {"type": "str", "aliases": ["KeyType"]}, }, + "aliases": ["KeySchema"], }, "projection": { "type": "dict", "options": { - "non_key_attributes": {"type": "list", "elements": "str"}, - "projection_type": {"type": "str"}, + "non_key_attributes": { + "type": "list", + "elements": "str", + "aliases": ["NonKeyAttributes"], + }, + "projection_type": {"type": "str", "aliases": ["ProjectionType"]}, }, + "aliases": ["Projection"], }, }, + "aliases": ["LocalSecondaryIndexes"], } argument_spec["write_provisioned_throughput_settings"] = { "type": "dict", @@ -588,116 +825,215 @@ def main(): "write_capacity_auto_scaling_settings": { "type": "dict", "options": { - "min_capacity": {"type": "int"}, - "max_capacity": {"type": "int"}, - "seed_capacity": {"type": "int"}, + "min_capacity": {"type": "int", "aliases": ["MinCapacity"]}, + "max_capacity": {"type": "int", "aliases": ["MaxCapacity"]}, + "seed_capacity": {"type": "int", "aliases": ["SeedCapacity"]}, "target_tracking_scaling_policy_configuration": { "type": "dict", "options": { - "disable_scale_in": {"type": "bool"}, - "scale_in_cooldown": {"type": "int"}, - "scale_out_cooldown": {"type": "int"}, - "target_value": {"type": "int"}, + "disable_scale_in": { + "type": "bool", + "aliases": ["DisableScaleIn"], + }, + "scale_in_cooldown": { + "type": "int", + "aliases": ["ScaleInCooldown"], + }, + "scale_out_cooldown": { + "type": "int", + "aliases": ["ScaleOutCooldown"], + }, + "target_value": {"type": "int", "aliases": ["TargetValue"]}, }, + "aliases": ["TargetTrackingScalingPolicyConfiguration"], }, }, + "aliases": ["WriteCapacityAutoScalingSettings"], } }, + "aliases": ["WriteProvisionedThroughputSettings"], } argument_spec["replicas"] = { "type": "list", "elements": "dict", "options": { - "region": {"type": "str"}, + "region": {"type": "str", "aliases": ["Region"]}, "global_secondary_indexes": { "type": "list", "elements": "dict", "options": { - "index_name": {"type": "str"}, + "index_name": {"type": "str", "aliases": ["IndexName"]}, "contributor_insights_specification": { "type": "dict", - "options": {"enabled": {"type": "bool"}}, + "options": { + "enabled": {"type": "bool", "aliases": ["Enabled"]} + }, + "aliases": ["ContributorInsightsSpecification"], }, "read_provisioned_throughput_settings": { "type": "dict", "options": { - "read_capacity_units": {"type": "int"}, + "read_capacity_units": { + "type": "int", + "aliases": ["ReadCapacityUnits"], + }, "read_capacity_auto_scaling_settings": { "type": "dict", "options": { - "min_capacity": {"type": "int"}, - "max_capacity": {"type": "int"}, - "seed_capacity": {"type": "int"}, + "min_capacity": { + "type": "int", + "aliases": ["MinCapacity"], + }, + "max_capacity": { + "type": "int", + "aliases": ["MaxCapacity"], + }, + "seed_capacity": { + "type": "int", + "aliases": ["SeedCapacity"], + }, "target_tracking_scaling_policy_configuration": { "type": "dict", "options": { - "disable_scale_in": {"type": "bool"}, - "scale_in_cooldown": {"type": "int"}, - "scale_out_cooldown": {"type": "int"}, - "target_value": {"type": "int"}, + "disable_scale_in": { + "type": "bool", + "aliases": ["DisableScaleIn"], + }, + "scale_in_cooldown": { + "type": "int", + "aliases": ["ScaleInCooldown"], + }, + "scale_out_cooldown": { + "type": "int", + "aliases": ["ScaleOutCooldown"], + }, + "target_value": { + "type": "int", + "aliases": ["TargetValue"], + }, }, + "aliases": [ + "TargetTrackingScalingPolicyConfiguration" + ], }, }, + "aliases": ["ReadCapacityAutoScalingSettings"], }, }, + "aliases": ["ReadProvisionedThroughputSettings"], }, }, + "aliases": ["GlobalSecondaryIndexes"], }, "contributor_insights_specification": { "type": "dict", - "options": {"enabled": {"type": "bool"}}, + "options": {"enabled": {"type": "bool", "aliases": ["Enabled"]}}, + "aliases": ["ContributorInsightsSpecification"], }, "point_in_time_recovery_specification": { "type": "dict", - "options": {"point_in_time_recovery_enabled": {"type": "bool"}}, + "options": { + "point_in_time_recovery_enabled": { + "type": "bool", + "aliases": ["PointInTimeRecoveryEnabled"], + } + }, + "aliases": ["PointInTimeRecoverySpecification"], + }, + "table_class": {"type": "str", "aliases": ["TableClass"]}, + "deletion_protection_enabled": { + "type": "bool", + "aliases": ["DeletionProtectionEnabled"], }, - "table_class": {"type": "str"}, "sse_specification": { "type": "dict", - "options": {"kms_master_key_id": {"type": "str"}}, + "options": { + "kms_master_key_id": {"type": "str", "aliases": ["KMSMasterKeyId"]} + }, + "aliases": ["SSESpecification"], }, "tags": { "type": "list", "elements": "dict", - "options": {"key": {"type": "str"}, "value": {"type": "str"}}, + "options": { + "key": {"type": "str", "aliases": ["Key"]}, + "value": {"type": "str", "aliases": ["Value"]}, + }, + "aliases": ["Tags"], }, "read_provisioned_throughput_settings": { "type": "dict", "options": { - "read_capacity_units": {"type": "int"}, + "read_capacity_units": { + "type": "int", + "aliases": ["ReadCapacityUnits"], + }, "read_capacity_auto_scaling_settings": { "type": "dict", "options": { - "min_capacity": {"type": "int"}, - "max_capacity": {"type": "int"}, - "seed_capacity": {"type": "int"}, + "min_capacity": {"type": "int", "aliases": ["MinCapacity"]}, + "max_capacity": {"type": "int", "aliases": ["MaxCapacity"]}, + "seed_capacity": { + "type": "int", + "aliases": ["SeedCapacity"], + }, "target_tracking_scaling_policy_configuration": { "type": "dict", "options": { - "disable_scale_in": {"type": "bool"}, - "scale_in_cooldown": {"type": "int"}, - "scale_out_cooldown": {"type": "int"}, - "target_value": {"type": "int"}, + "disable_scale_in": { + "type": "bool", + "aliases": ["DisableScaleIn"], + }, + "scale_in_cooldown": { + "type": "int", + "aliases": ["ScaleInCooldown"], + }, + "scale_out_cooldown": { + "type": "int", + "aliases": ["ScaleOutCooldown"], + }, + "target_value": { + "type": "int", + "aliases": ["TargetValue"], + }, }, + "aliases": ["TargetTrackingScalingPolicyConfiguration"], }, }, + "aliases": ["ReadCapacityAutoScalingSettings"], }, }, + "aliases": ["ReadProvisionedThroughputSettings"], + }, + "kinesis_stream_specification": { + "type": "dict", + "options": {"stream_arn": {"type": "str", "aliases": ["StreamArn"]}}, + "aliases": ["KinesisStreamSpecification"], }, }, + "aliases": ["Replicas"], } argument_spec["sse_specification"] = { "type": "dict", - "options": {"sse_enabled": {"type": "bool"}, "sse_type": {"type": "str"}}, + "options": { + "sse_enabled": {"type": "bool", "aliases": ["SSEEnabled"]}, + "sse_type": {"type": "str", "aliases": ["SSEType"]}, + }, + "aliases": ["SSESpecification"], } argument_spec["stream_specification"] = { "type": "dict", - "options": {"stream_view_type": {"type": "str"}}, + "options": {"stream_view_type": {"type": "str", "aliases": ["StreamViewType"]}}, + "aliases": ["StreamSpecification"], } - argument_spec["table_name"] = {"type": "str"} + argument_spec["table_name"] = {"type": "str", "aliases": ["TableName"]} argument_spec["time_to_live_specification"] = { "type": "dict", - "options": {"attribute_name": {"type": "str"}, "enabled": {"type": "bool"}}, + "options": { + "attribute_name": {"type": "str", "aliases": ["AttributeName"]}, + "enabled": {"type": "bool", "aliases": ["Enabled"]}, + }, + "aliases": ["TimeToLiveSpecification"], } argument_spec["state"] = { "type": "str", @@ -712,7 +1048,7 @@ def main(): [ "state", "present", - ["key_schema", "attribute_definitions", "replicas", "table_name"], + ["attribute_definitions", "replicas", "table_name", "key_schema"], True, ], ["state", "absent", ["table_name"], True], @@ -749,22 +1085,27 @@ def main(): ) # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["local_secondary_indexes", "table_name", "key_schema"] + create_only_params = [ + "/properties/LocalSecondaryIndexes", + "/properties/TableName", + "/properties/KeySchema", + ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["table_name"] + identifier = ["/properties/TableName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ec2_placement_group.py b/plugins/modules/ec2_placement_group.py deleted file mode 100644 index 3e7f8e3d..00000000 --- a/plugins/modules/ec2_placement_group.py +++ /dev/null @@ -1,222 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# Copyright: (c) 2022, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette - - -DOCUMENTATION = r""" -module: ec2_placement_group -short_description: Creates and manages a placement group -description: -- Specifies a placement group in which to launch instances. -- The strategy of the placement group determines how the instances are organized within - the group. -- For more information see U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-placementgroup.html). -options: - force: - default: false - description: - - Cancel IN_PROGRESS and PENDING resource requestes. - - Because you can only perform a single operation on a given resource at a - time, there might be cases where you need to cancel the current resource - operation to make the resource available so that another operation may - be performed on it. - type: bool - group_name: - description: - - The Group Name of Placement Group. - type: str - partition_count: - description: - - The number of partitions. - - Valid only when **Strategy** is set to partition. - type: int - purge_tags: - default: true - description: - - Remove tags not listed in I(tags). - type: bool - spread_level: - description: - - The Spread Level of Placement Group is an enum where it accepts either host - or rack when strategy is spread. - type: str - state: - choices: - - present - - absent - - list - - describe - - get - default: present - description: - - Goal state for resource. - - I(state=present) creates the resource if it doesn't exist, or updates to - the provided state if the resource already exists. - - I(state=absent) ensures an existing instance is deleted. - - I(state=list) get all the existing resources. - - I(state=describe) or I(state=get) retrieves information on an existing resource. - type: str - strategy: - description: - - The placement strategy. - type: str - tags: - aliases: - - resource_tags - description: - - A dict of tags to apply to the resource. - - To remove all tags set I(tags={}) and I(purge_tags=true). - type: dict - wait: - default: false - description: - - Wait for operation to complete before returning. - type: bool - wait_timeout: - default: 320 - description: - - How many seconds to wait for an operation to complete before timing out. - type: int -author: Ansible Cloud Team (@ansible-collections) -version_added: 0.3.0 -extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.cloud.boto3 -""" - -EXAMPLES = r""" -""" - -RETURN = r""" -result: - description: - - When I(state=list), it is a list containing dictionaries of resource information. - - Otherwise, it is a dictionary of resource information. - - When I(state=absent), it is an empty dictionary. - returned: always - type: complex - contains: - identifier: - description: The unique identifier of the resource. - type: str - properties: - description: The resource properties. - type: dict -""" - - -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - CloudControlResource, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, -) - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["strategy"] = {"type": "str"} - argument_spec["group_name"] = {"type": "str"} - argument_spec["spread_level"] = {"type": "str"} - argument_spec["partition_count"] = {"type": "int"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["state"] = { - "type": "str", - "choices": ["present", "absent", "list", "describe", "get"], - "default": "present", - } - argument_spec["wait"] = {"type": "bool", "default": False} - argument_spec["wait_timeout"] = {"type": "int", "default": 320} - argument_spec["force"] = {"type": "bool", "default": False} - argument_spec["purge_tags"] = {"type": "bool", "default": True} - - required_if = [ - ["state", "present", ["group_name"], True], - ["state", "absent", ["group_name"], True], - ["state", "get", ["group_name"], True], - ] - mutually_exclusive = [] - - module = AnsibleAmazonCloudModule( - argument_spec=argument_spec, - required_if=required_if, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - cloud = CloudControlResource(module) - - type_name = "AWS::EC2::PlacementGroup" - - params = {} - - params["group_name"] = module.params.get("group_name") - params["partition_count"] = module.params.get("partition_count") - params["spread_level"] = module.params.get("spread_level") - params["strategy"] = module.params.get("strategy") - params["tags"] = module.params.get("tags") - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} - - # Only if resource is taggable - if module.params.get("tags") is not None: - _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - - # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["strategy", "spread_level", "partition_count"] - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "delete", "list"] - - state = module.params.get("state") - identifier = ["group_name"] - - results = {"changed": False, "result": {}} - - if state == "list": - if "list" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be listed." - ) - results["result"] = cloud.list_resources(type_name, identifier) - - if state in ("describe", "get"): - if "read" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be read." - ) - results["result"] = cloud.get_resource(type_name, identifier) - - if state == "present": - results = cloud.present( - type_name, identifier, params_to_set, create_only_params - ) - - if state == "absent": - results["changed"] |= cloud.absent(type_name, identifier) - - module.exit_json(**results) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/ecr_repository.py b/plugins/modules/ecr_repository.py index 3e02df57..06645247 100644 --- a/plugins/modules/ecr_repository.py +++ b/plugins/modules/ecr_repository.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -17,6 +17,8 @@ - For more information see U(https://docs.aws.amazon.com/AmazonECR/latest/userguide/Repositories.html). options: encryption_configuration: + aliases: + - EncryptionConfiguration description: - The encryption configuration for the repository. - This determines how the contents of your repository are encrypted at rest. @@ -28,6 +30,8 @@ - For more information, see U(https://docs.aws.amazon.com/AmazonECR/latest/userguide/encryption-at-rest.html). suboptions: encryption_type: + aliases: + - EncryptionType choices: - AES256 - KMS @@ -35,6 +39,8 @@ - The encryption type to use. type: str kms_key: + aliases: + - KmsKey description: - If you use the C(KMS) encryption type, specify the CMK to use for encryption. @@ -54,18 +60,24 @@ be performed on it. type: bool image_scanning_configuration: + aliases: + - ImageScanningConfiguration description: - The image scanning configuration for the repository. - This setting determines whether images are scanned for known vulnerabilities after being pushed to the repository. suboptions: scan_on_push: + aliases: + - ScanOnPush description: - The setting that determines whether images are scanned after being pushed to a repository. type: bool type: dict image_tag_mutability: + aliases: + - ImageTagMutability choices: - IMMUTABLE - MUTABLE @@ -73,15 +85,21 @@ - The image tag mutability setting for the repository. type: str lifecycle_policy: + aliases: + - LifecyclePolicy description: - The I(lifecycle_policy) property type specifies a lifecycle policy. - For information about lifecycle policy syntax, see U(https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html). suboptions: lifecycle_policy_text: + aliases: + - LifecyclePolicyText description: - The JSON repository policy text to apply to the repository. type: str registry_id: + aliases: + - RegistryId description: - The AWS account ID associated with the registry that contains the repository. @@ -94,6 +112,8 @@ - Remove tags not listed in I(tags). type: bool repository_name: + aliases: + - RepositoryName description: - The name to use for the repository. - The repository name may be specified on its own (such as nginx-web-app) @@ -104,6 +124,8 @@ - For more information, see U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html.). type: str repository_policy_text: + aliases: + - RepositoryPolicyText description: - The JSON repository policy text to apply to the repository. - For more information, see U(https://docs.aws.amazon.com/AmazonECR/latest/userguide/RepositoryPolicyExamples.html) @@ -127,6 +149,7 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -178,11 +201,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -197,27 +221,41 @@ def main(): argument_spec["lifecycle_policy"] = { "type": "dict", "options": { - "lifecycle_policy_text": {"type": "str"}, - "registry_id": {"type": "str"}, + "lifecycle_policy_text": { + "type": "str", + "aliases": ["LifecyclePolicyText"], + }, + "registry_id": {"type": "str", "aliases": ["RegistryId"]}, }, + "aliases": ["LifecyclePolicy"], + } + argument_spec["repository_name"] = {"type": "str", "aliases": ["RepositoryName"]} + argument_spec["repository_policy_text"] = { + "type": "dict", + "aliases": ["RepositoryPolicyText"], } - argument_spec["repository_name"] = {"type": "str"} - argument_spec["repository_policy_text"] = {"type": "dict"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["image_tag_mutability"] = { "type": "str", "choices": ["IMMUTABLE", "MUTABLE"], + "aliases": ["ImageTagMutability"], } argument_spec["image_scanning_configuration"] = { "type": "dict", - "options": {"scan_on_push": {"type": "bool"}}, + "options": {"scan_on_push": {"type": "bool", "aliases": ["ScanOnPush"]}}, + "aliases": ["ImageScanningConfiguration"], } argument_spec["encryption_configuration"] = { "type": "dict", "options": { - "encryption_type": {"type": "str", "choices": ["AES256", "KMS"]}, - "kms_key": {"type": "str"}, + "encryption_type": { + "type": "str", + "choices": ["AES256", "KMS"], + "aliases": ["EncryptionType"], + }, + "kms_key": {"type": "str", "aliases": ["KmsKey"]}, }, + "aliases": ["EncryptionConfiguration"], } argument_spec["state"] = { "type": "str", @@ -259,27 +297,28 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation create_only_params = [ - "repository_name", - "encryption_configuration", - "encryption_type", - "kms_key", + "/properties/RepositoryName", + "/properties/EncryptionConfiguration", + "/properties/EncryptionConfiguration/EncryptionType", + "/properties/EncryptionConfiguration/KmsKey", ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["repository_name"] + identifier = ["/properties/RepositoryName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ecs_capacity_provider.py b/plugins/modules/ecs_capacity_provider.py index 47c53071..70b19858 100644 --- a/plugins/modules/ecs_capacity_provider.py +++ b/plugins/modules/ecs_capacity_provider.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -16,31 +16,45 @@ provider strategies to facilitate cluster auto scaling. options: auto_scaling_group_provider: + aliases: + - AutoScalingGroupProvider description: - Not Provived. suboptions: auto_scaling_group_arn: + aliases: + - AutoScalingGroupArn description: - Not Provived. type: str managed_scaling: + aliases: + - ManagedScaling description: - The managed scaling settings for the Auto Scaling group capacity provider. suboptions: instance_warmup_period: + aliases: + - InstanceWarmupPeriod description: - Not Provived. type: int maximum_scaling_step_size: + aliases: + - MaximumScalingStepSize description: - Not Provived. type: int minimum_scaling_step_size: + aliases: + - MinimumScalingStepSize description: - Not Provived. type: int status: + aliases: + - Status choices: - DISABLED - ENABLED @@ -48,11 +62,15 @@ - Not Provived. type: str target_capacity: + aliases: + - TargetCapacity description: - Not Provived. type: int type: dict managed_termination_protection: + aliases: + - ManagedTerminationProtection choices: - DISABLED - ENABLED @@ -70,6 +88,8 @@ be performed on it. type: bool name: + aliases: + - Name description: - Not Provived. type: str @@ -96,6 +116,7 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -147,11 +168,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -166,25 +188,44 @@ def main(): argument_spec["auto_scaling_group_provider"] = { "type": "dict", "options": { - "auto_scaling_group_arn": {"type": "str"}, + "auto_scaling_group_arn": { + "type": "str", + "aliases": ["AutoScalingGroupArn"], + }, "managed_scaling": { "type": "dict", "options": { - "minimum_scaling_step_size": {"type": "int"}, - "maximum_scaling_step_size": {"type": "int"}, - "status": {"type": "str", "choices": ["DISABLED", "ENABLED"]}, - "target_capacity": {"type": "int"}, - "instance_warmup_period": {"type": "int"}, + "minimum_scaling_step_size": { + "type": "int", + "aliases": ["MinimumScalingStepSize"], + }, + "maximum_scaling_step_size": { + "type": "int", + "aliases": ["MaximumScalingStepSize"], + }, + "status": { + "type": "str", + "choices": ["DISABLED", "ENABLED"], + "aliases": ["Status"], + }, + "target_capacity": {"type": "int", "aliases": ["TargetCapacity"]}, + "instance_warmup_period": { + "type": "int", + "aliases": ["InstanceWarmupPeriod"], + }, }, + "aliases": ["ManagedScaling"], }, "managed_termination_protection": { "type": "str", "choices": ["DISABLED", "ENABLED"], + "aliases": ["ManagedTerminationProtection"], }, }, + "aliases": ["AutoScalingGroupProvider"], } - argument_spec["name"] = {"type": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["name"] = {"type": "str", "aliases": ["Name"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -196,7 +237,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["auto_scaling_group_provider", "name"], True], + ["state", "present", ["name", "auto_scaling_group_provider"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] @@ -221,22 +262,26 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["auto_scaling_group_arn", "name"] + create_only_params = [ + "/properties/AutoScalingGroupProvider/AutoScalingGroupArn", + "/properties/Name", + ] # Necessary to handle when module does not support all the states handlers = ["create", "delete", "read", "update", "list"] state = module.params.get("state") - identifier = ["name"] + identifier = ["/properties/Name"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ecs_cluster.py b/plugins/modules/ecs_cluster.py index f1551de1..0cb5a097 100644 --- a/plugins/modules/ecs_cluster.py +++ b/plugins/modules/ecs_cluster.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -15,17 +15,23 @@ - Creates and manages an Amazon Elastic Container Service (Amazon ECS) cluster. options: capacity_providers: + aliases: + - CapacityProviders description: - Not Provived. elements: str type: list cluster_name: + aliases: + - ClusterName description: - A user-generated string that you use to identify your cluster. - If you dont specify a name, AWS CloudFormation generates a unique physical ID for the name. type: str cluster_settings: + aliases: + - ClusterSettings description: - The setting to use when creating a cluster. - This parameter is used to enable CloudWatch Container Insights for a cluster. @@ -34,58 +40,84 @@ elements: dict suboptions: name: + aliases: + - Name description: - Not Provived. type: str value: + aliases: + - Value description: - Not Provived. type: str type: list configuration: + aliases: + - Configuration description: - The configurations to be set at cluster level. suboptions: execute_command_configuration: + aliases: + - ExecuteCommandConfiguration description: - The configuration for ExecuteCommand. suboptions: kms_key_id: + aliases: + - KmsKeyId description: - Not Provived. type: str log_configuration: + aliases: + - LogConfiguration description: - The session logging configuration for ExecuteCommand. suboptions: cloud_watch_encryption_enabled: + aliases: + - CloudWatchEncryptionEnabled description: - Not Provived. type: bool cloud_watch_log_group_name: + aliases: + - CloudWatchLogGroupName description: - Not Provived. type: str s3_bucket_name: + aliases: + - S3BucketName description: - Not Provived. type: str s3_encryption_enabled: + aliases: + - S3EncryptionEnabled description: - Not Provived. type: bool s3_key_prefix: + aliases: + - S3KeyPrefix description: - Not Provived. type: str type: dict logging: + aliases: + - Logging description: - Not Provived. type: str type: dict type: dict default_capacity_provider_strategy: + aliases: + - DefaultCapacityProviderStrategy description: - A capacity provider strategy consists of one or more capacity providers along with the base and weight to assign to them. @@ -97,14 +129,20 @@ elements: dict suboptions: base: + aliases: + - Base description: - Not Provived. type: int capacity_provider: + aliases: + - CapacityProvider description: - Not Provived. type: str weight: + aliases: + - Weight description: - Not Provived. type: int @@ -124,11 +162,15 @@ - Remove tags not listed in I(tags). type: bool service_connect_defaults: + aliases: + - ServiceConnectDefaults description: - Service Connect Configuration default for all services or tasks within this cluster. suboptions: namespace: + aliases: + - Namespace description: - Service Connect Namespace Name or ARN default for all services or tasks within this cluster. @@ -152,6 +194,7 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -203,11 +246,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -219,12 +263,16 @@ def main(): ), ) - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["cluster_name"] = {"type": "str"} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} + argument_spec["cluster_name"] = {"type": "str", "aliases": ["ClusterName"]} argument_spec["cluster_settings"] = { "type": "list", "elements": "dict", - "options": {"name": {"type": "str"}, "value": {"type": "str"}}, + "options": { + "name": {"type": "str", "aliases": ["Name"]}, + "value": {"type": "str", "aliases": ["Value"]}, + }, + "aliases": ["ClusterSettings"], } argument_spec["configuration"] = { "type": "dict", @@ -232,35 +280,59 @@ def main(): "execute_command_configuration": { "type": "dict", "options": { - "kms_key_id": {"type": "str"}, - "logging": {"type": "str"}, + "kms_key_id": {"type": "str", "aliases": ["KmsKeyId"]}, + "logging": {"type": "str", "aliases": ["Logging"]}, "log_configuration": { "type": "dict", "options": { - "cloud_watch_log_group_name": {"type": "str"}, - "cloud_watch_encryption_enabled": {"type": "bool"}, - "s3_bucket_name": {"type": "str"}, - "s3_encryption_enabled": {"type": "bool"}, - "s3_key_prefix": {"type": "str"}, + "cloud_watch_log_group_name": { + "type": "str", + "aliases": ["CloudWatchLogGroupName"], + }, + "cloud_watch_encryption_enabled": { + "type": "bool", + "aliases": ["CloudWatchEncryptionEnabled"], + }, + "s3_bucket_name": { + "type": "str", + "aliases": ["S3BucketName"], + }, + "s3_encryption_enabled": { + "type": "bool", + "aliases": ["S3EncryptionEnabled"], + }, + "s3_key_prefix": { + "type": "str", + "aliases": ["S3KeyPrefix"], + }, }, + "aliases": ["LogConfiguration"], }, }, + "aliases": ["ExecuteCommandConfiguration"], } }, + "aliases": ["Configuration"], + } + argument_spec["capacity_providers"] = { + "type": "list", + "elements": "str", + "aliases": ["CapacityProviders"], } - argument_spec["capacity_providers"] = {"type": "list", "elements": "str"} argument_spec["default_capacity_provider_strategy"] = { "type": "list", "elements": "dict", "options": { - "capacity_provider": {"type": "str"}, - "weight": {"type": "int"}, - "base": {"type": "int"}, + "capacity_provider": {"type": "str", "aliases": ["CapacityProvider"]}, + "weight": {"type": "int", "aliases": ["Weight"]}, + "base": {"type": "int", "aliases": ["Base"]}, }, + "aliases": ["DefaultCapacityProviderStrategy"], } argument_spec["service_connect_defaults"] = { "type": "dict", - "options": {"namespace": {"type": "str"}}, + "options": {"namespace": {"type": "str", "aliases": ["Namespace"]}}, + "aliases": ["ServiceConnectDefaults"], } argument_spec["state"] = { "type": "str", @@ -302,22 +374,23 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["cluster_name"] + create_only_params = ["/properties/ClusterName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["cluster_name"] + identifier = ["/properties/ClusterName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ecs_cluster_capacity_provider_associations.py b/plugins/modules/ecs_cluster_capacity_provider_associations.py index 28993c80..49da41f2 100644 --- a/plugins/modules/ecs_cluster_capacity_provider_associations.py +++ b/plugins/modules/ecs_cluster_capacity_provider_associations.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -16,36 +16,42 @@ capacity providers and a default capacity provider strategy with a cluster. options: capacity_providers: - choices: - - FARGATE - - FARGATE_SPOT + aliases: + - CapacityProviders description: - If using ec2 auto-scaling, the name of the associated capacity provider. - - Otherwise C(FARGATE), C(FARGATE_SPOT). + - Otherwise FARGATE, C(FARGATE_SPOT). elements: str type: list cluster: + aliases: + - Cluster description: - The name of the cluster. type: str default_capacity_provider_strategy: + aliases: + - DefaultCapacityProviderStrategy description: - List of capacity providers to associate with the cluster. elements: dict suboptions: base: + aliases: + - Base description: - Not Provived. type: int capacity_provider: - choices: - - FARGATE - - FARGATE_SPOT + aliases: + - CapacityProvider description: - If using ec2 auto-scaling, the name of the associated capacity provider. - - Otherwise C(FARGATE), C(FARGATE_SPOT). + - Otherwise FARGATE, C(FARGATE_SPOT). type: str weight: + aliases: + - Weight description: - Not Provived. type: int @@ -121,11 +127,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -140,20 +147,18 @@ def main(): argument_spec["capacity_providers"] = { "type": "list", "elements": "str", - "choices": ["FARGATE", "FARGATE_SPOT"], + "aliases": ["CapacityProviders"], } - argument_spec["cluster"] = {"type": "str"} + argument_spec["cluster"] = {"type": "str", "aliases": ["Cluster"]} argument_spec["default_capacity_provider_strategy"] = { "type": "list", "elements": "dict", "options": { - "base": {"type": "int"}, - "weight": {"type": "int"}, - "capacity_provider": { - "type": "str", - "choices": ["FARGATE", "FARGATE_SPOT"], - }, + "base": {"type": "int", "aliases": ["Base"]}, + "weight": {"type": "int", "aliases": ["Weight"]}, + "capacity_provider": {"type": "str", "aliases": ["CapacityProvider"]}, }, + "aliases": ["DefaultCapacityProviderStrategy"], } argument_spec["state"] = { "type": "str", @@ -168,7 +173,7 @@ def main(): [ "state", "present", - ["cluster", "capacity_providers", "default_capacity_provider_strategy"], + ["default_capacity_provider_strategy", "cluster", "capacity_providers"], True, ], ["state", "absent", ["cluster"], True], @@ -195,22 +200,23 @@ def main(): ) # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["cluster"] + create_only_params = ["/properties/Cluster"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["cluster"] + identifier = ["/properties/Cluster"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ecs_primary_task_set.py b/plugins/modules/ecs_primary_task_set.py index c458f1c5..8c7498c0 100644 --- a/plugins/modules/ecs_primary_task_set.py +++ b/plugins/modules/ecs_primary_task_set.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -17,6 +17,8 @@ - This is used when a service uses the EXTERNAL deployment controller type. options: cluster: + aliases: + - Cluster description: - The short name or full Amazon Resource Name (ARN) of the cluster that hosts the service to create the task set in. @@ -38,6 +40,8 @@ - For more details, visit U(https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html). type: str service: + aliases: + - Service description: - The short name or full Amazon Resource Name (ARN) of the service to create the task set in. @@ -59,6 +63,8 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str task_set_id: + aliases: + - TaskSetId description: - The ID or full Amazon Resource Name (ARN) of the task set. type: str @@ -108,11 +114,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -124,9 +131,9 @@ def main(): ), ) - argument_spec["cluster"] = {"type": "str"} - argument_spec["task_set_id"] = {"type": "str"} - argument_spec["service"] = {"type": "str"} + argument_spec["cluster"] = {"type": "str", "aliases": ["Cluster"]} + argument_spec["task_set_id"] = {"type": "str", "aliases": ["TaskSetId"]} + argument_spec["service"] = {"type": "str", "aliases": ["Service"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -139,7 +146,7 @@ def main(): required_if = [ ["state", "list", ["cluster"], True], - ["state", "present", ["service", "cluster", "task_set_id", "identifier"], True], + ["state", "present", ["identifier", "task_set_id", "cluster", "service"], True], ["state", "absent", ["cluster", "service", "identifier"], True], ["state", "get", ["cluster", "service", "identifier"], True], ] @@ -163,28 +170,31 @@ def main(): params["task_set_id"] = module.params.get("task_set_id") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["cluster", "service"] + create_only_params = ["/properties/Cluster", "/properties/Service"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete"] state = module.params.get("state") - identifier = ["cluster", "service"] + identifier = ["/properties/Cluster", "/properties/Service"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): if not module.params.get("cluster") or not module.params.get("service"): - module.fail_json(f"You must specify both {*identifier, } identifiers.") + module.fail_json( + "You must specify all the ('cluster', 'service') identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/eks_addon.py b/plugins/modules/eks_addon.py index 5bd04ab0..26624075 100644 --- a/plugins/modules/eks_addon.py +++ b/plugins/modules/eks_addon.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -18,18 +18,26 @@ - For more information see U(https://docs.aws.amazon.com/eks/latest/userguide/eks-add-ons.html). options: addon_name: + aliases: + - AddonName description: - Name of Addon. type: str addon_version: + aliases: + - AddonVersion description: - Version of Addon. type: str cluster_name: + aliases: + - ClusterName description: - Name of Cluster. type: str configuration_values: + aliases: + - ConfigurationValues description: - The configuration values to use with the add-on. type: str @@ -50,6 +58,8 @@ - For more details, visit U(https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html). type: str preserve_on_delete: + aliases: + - PreserveOnDelete description: - PreserveOnDelete parameter value. type: bool @@ -59,6 +69,8 @@ - Remove tags not listed in I(tags). type: bool resolve_conflicts: + aliases: + - ResolveConflicts choices: - NONE - OVERWRITE @@ -67,6 +79,8 @@ - Resolve parameter value conflicts. type: str service_account_role_arn: + aliases: + - ServiceAccountRoleArn description: - IAM role to bind to the add-ons service account. type: str @@ -88,6 +102,7 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -139,11 +154,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -155,17 +171,27 @@ def main(): ), ) - argument_spec["cluster_name"] = {"type": "str"} - argument_spec["addon_name"] = {"type": "str"} - argument_spec["addon_version"] = {"type": "str"} - argument_spec["preserve_on_delete"] = {"type": "bool"} + argument_spec["cluster_name"] = {"type": "str", "aliases": ["ClusterName"]} + argument_spec["addon_name"] = {"type": "str", "aliases": ["AddonName"]} + argument_spec["addon_version"] = {"type": "str", "aliases": ["AddonVersion"]} + argument_spec["preserve_on_delete"] = { + "type": "bool", + "aliases": ["PreserveOnDelete"], + } argument_spec["resolve_conflicts"] = { "type": "str", "choices": ["NONE", "OVERWRITE", "PRESERVE"], + "aliases": ["ResolveConflicts"], + } + argument_spec["service_account_role_arn"] = { + "type": "str", + "aliases": ["ServiceAccountRoleArn"], } - argument_spec["service_account_role_arn"] = {"type": "str"} - argument_spec["configuration_values"] = {"type": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["configuration_values"] = { + "type": "str", + "aliases": ["ConfigurationValues"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -179,7 +205,7 @@ def main(): required_if = [ ["state", "list", ["cluster_name"], True], - ["state", "present", ["cluster_name", "identifier", "addon_name"], True], + ["state", "present", ["addon_name", "cluster_name", "identifier"], True], ["state", "absent", ["cluster_name", "addon_name", "identifier"], True], ["state", "get", ["cluster_name", "addon_name", "identifier"], True], ] @@ -208,28 +234,31 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["cluster_name", "addon_name"] + create_only_params = ["/properties/ClusterName", "/properties/AddonName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "delete", "list", "update"] state = module.params.get("state") - identifier = ["cluster_name", "addon_name"] + identifier = ["/properties/ClusterName", "/properties/AddonName"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): if not module.params.get("cluster_name") or not module.params.get("addon_name"): - module.fail_json(f"You must specify both {*identifier, } identifiers.") + module.fail_json( + "You must specify all the ('cluster_name', 'addon_name') identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/eks_cluster.py b/plugins/modules/eks_cluster.py index a28562ae..009caa55 100644 --- a/plugins/modules/eks_cluster.py +++ b/plugins/modules/eks_cluster.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -14,15 +14,21 @@ - Create and manage Amazon EKS control planes. options: encryption_config: + aliases: + - EncryptionConfig description: - The encryption configuration for the cluster. elements: dict suboptions: provider: + aliases: + - Provider description: - The encryption provider for the cluster. suboptions: key_arn: + aliases: + - KeyArn description: - Amazon Resource Name (ARN) or alias of the KMS key. - The KMS key must be symmetric, created in the same region @@ -31,6 +37,8 @@ type: str type: dict resources: + aliases: + - Resources description: - Specifies the resources to be encrypted. - The only supported value is secrets. @@ -46,46 +54,31 @@ operation to make the resource available so that another operation may be performed on it. type: bool - kubernetes_network_config: - description: - - The Kubernetes network configuration for the cluster. - suboptions: - ip_family: - choices: - - ipv4 - - ipv6 - description: - - Ipv4 or Ipv6. - - You can only specify ipv6 for 1.21 and later clusters that use version - 1.10.1 or later of the Amazon VPC CNI add-on. - type: str - service_ipv4_cidr: - description: - - The CIDR block to assign Kubernetes service IP addresses from. - - If you dont specify a block, Kubernetes assigns addresses from either - the 10.100.0.0/16 or 172.20.0.0/16 CIDR blocks. - - We recommend that you specify a block that does not overlap with - resources in other networks that are peered or connected to your - VPC. - type: str - type: dict logging: + aliases: + - Logging description: - Enable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs based on log types. - By default, cluster control plane logs arent exported to CloudWatch Logs. suboptions: cluster_logging: + aliases: + - ClusterLogging description: - The cluster control plane logging configuration for your cluster. - The cluster control plane logging configuration for your cluster. suboptions: enabled_types: + aliases: + - EnabledTypes description: - Enabled Logging Type. elements: dict suboptions: type: + aliases: + - Type choices: - api - audit @@ -99,32 +92,44 @@ type: dict type: dict name: + aliases: + - Name description: - The unique name to give to your cluster. type: str outpost_config: + aliases: + - OutpostConfig description: - An object representing the Outpost configuration to use for AWS EKS outpost cluster. suboptions: control_plane_instance_type: + aliases: + - ControlPlaneInstanceType description: - Specify the Instance type of the machines that should be used to create your cluster. type: str control_plane_placement: + aliases: + - ControlPlanePlacement description: - Specify the placement group of the control plane machines for your cluster.Specify the placement group of the control plane machines for your cluster. suboptions: group_name: + aliases: + - GroupName description: - Specify the placement group name of the control place machines for your cluster. type: str type: dict outpost_arns: + aliases: + - OutpostArns description: - Specify one or more Arn(s) of Outpost(s) on which you would like to create your cluster. @@ -137,10 +142,14 @@ - Remove tags not listed in I(tags). type: bool resources_vpc_config: + aliases: + - ResourcesVpcConfig description: - An object representing the VPC configuration to use for an Amazon EKS cluster. suboptions: endpoint_private_access: + aliases: + - EndpointPrivateAccess description: - Set this value to true to enable private access for your clusters Kubernetes API server endpoint. @@ -154,6 +163,8 @@ Fargate pods. type: bool endpoint_public_access: + aliases: + - EndpointPublicAccess description: - Set this value to false to disable public access to your clusters Kubernetes API server endpoint. @@ -163,6 +174,8 @@ for your Kubernetes API server. type: bool public_access_cidrs: + aliases: + - PublicAccessCidrs description: - The CIDR blocks that are allowed access to your clusters public Kubernetes API server endpoint. @@ -175,6 +188,8 @@ elements: str type: list security_group_ids: + aliases: + - SecurityGroupIds description: - Specify one or more security groups for the cross-account elastic network interfaces that Amazon EKS creates to use to allow communication @@ -184,6 +199,8 @@ elements: str type: list subnet_ids: + aliases: + - SubnetIds description: - Specify subnets for your Amazon EKS nodes. - Amazon EKS creates cross-account elastic network interfaces in these @@ -193,6 +210,8 @@ type: list type: dict role_arn: + aliases: + - RoleArn description: - The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control plane to make calls to AWS API operations on @@ -216,12 +235,15 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). type: dict version: + aliases: + - Version description: - The desired Kubernetes version for your cluster. - If you dont specify a value here, the latest version available in Amazon @@ -303,11 +325,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -323,16 +346,14 @@ def main(): "type": "list", "elements": "dict", "options": { - "provider": {"type": "dict", "options": {"key_arn": {"type": "str"}}}, - "resources": {"type": "list", "elements": "str"}, - }, - } - argument_spec["kubernetes_network_config"] = { - "type": "dict", - "options": { - "service_ipv4_cidr": {"type": "str"}, - "ip_family": {"type": "str", "choices": ["ipv4", "ipv6"]}, + "provider": { + "type": "dict", + "options": {"key_arn": {"type": "str", "aliases": ["KeyArn"]}}, + "aliases": ["Provider"], + }, + "resources": {"type": "list", "elements": "str", "aliases": ["Resources"]}, }, + "aliases": ["EncryptionConfig"], } argument_spec["logging"] = { "type": "dict", @@ -353,38 +374,66 @@ def main(): "controllerManager", "scheduler", ], + "aliases": ["Type"], } }, + "aliases": ["EnabledTypes"], } }, + "aliases": ["ClusterLogging"], } }, + "aliases": ["Logging"], } - argument_spec["name"] = {"type": "str"} + argument_spec["name"] = {"type": "str", "aliases": ["Name"]} argument_spec["resources_vpc_config"] = { "type": "dict", "options": { - "endpoint_private_access": {"type": "bool"}, - "endpoint_public_access": {"type": "bool"}, - "public_access_cidrs": {"type": "list", "elements": "str"}, - "security_group_ids": {"type": "list", "elements": "str"}, - "subnet_ids": {"type": "list", "elements": "str"}, + "endpoint_private_access": { + "type": "bool", + "aliases": ["EndpointPrivateAccess"], + }, + "endpoint_public_access": { + "type": "bool", + "aliases": ["EndpointPublicAccess"], + }, + "public_access_cidrs": { + "type": "list", + "elements": "str", + "aliases": ["PublicAccessCidrs"], + }, + "security_group_ids": { + "type": "list", + "elements": "str", + "aliases": ["SecurityGroupIds"], + }, + "subnet_ids": {"type": "list", "elements": "str", "aliases": ["SubnetIds"]}, }, + "aliases": ["ResourcesVpcConfig"], } argument_spec["outpost_config"] = { "type": "dict", "options": { - "outpost_arns": {"type": "list", "elements": "str"}, - "control_plane_instance_type": {"type": "str"}, + "outpost_arns": { + "type": "list", + "elements": "str", + "aliases": ["OutpostArns"], + }, + "control_plane_instance_type": { + "type": "str", + "aliases": ["ControlPlaneInstanceType"], + }, "control_plane_placement": { "type": "dict", - "options": {"group_name": {"type": "str"}}, + "options": {"group_name": {"type": "str", "aliases": ["GroupName"]}}, + "aliases": ["ControlPlanePlacement"], }, }, + "aliases": ["OutpostConfig"], } - argument_spec["role_arn"] = {"type": "str"} - argument_spec["version"] = {"type": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["role_arn"] = {"type": "str", "aliases": ["RoleArn"]} + argument_spec["version"] = {"type": "str", "aliases": ["Version"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -396,7 +445,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["resources_vpc_config", "role_arn", "name"], True], + ["state", "present", ["role_arn", "name", "resources_vpc_config"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] @@ -415,7 +464,6 @@ def main(): params = {} params["encryption_config"] = module.params.get("encryption_config") - params["kubernetes_network_config"] = module.params.get("kubernetes_network_config") params["logging"] = module.params.get("logging") params["name"] = module.params.get("name") params["outpost_config"] = module.params.get("outpost_config") @@ -425,30 +473,31 @@ def main(): params["version"] = module.params.get("version") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation create_only_params = [ - "outpost_config", - "encryption_config", - "kubernetes_network_config", - "name", - "role_arn", - "subnet_ids", - "security_group_ids", + "/properties/OutpostConfig", + "/properties/EncryptionConfig", + "/properties/KubernetesNetworkConfig", + "/properties/Name", + "/properties/RoleArn", + "/properties/ResourcesVpcConfig/SubnetIds", + "/properties/ResourcesVpcConfig/SecurityGroupIds", ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["name"] + identifier = ["/properties/Name"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/eks_fargate_profile.py b/plugins/modules/eks_fargate_profile.py index d93aca13..6070ed89 100644 --- a/plugins/modules/eks_fargate_profile.py +++ b/plugins/modules/eks_fargate_profile.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -16,10 +16,14 @@ Fargate. options: cluster_name: + aliases: + - ClusterName description: - Name of the Cluster. type: str fargate_profile_name: + aliases: + - FargateProfileName description: - Name of FargateProfile. type: str @@ -40,6 +44,8 @@ - For more details, visit U(https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html). type: str pod_execution_role_arn: + aliases: + - PodExecutionRoleArn description: - The IAM policy arn for pods. type: str @@ -49,25 +55,35 @@ - Remove tags not listed in I(tags). type: bool selectors: + aliases: + - Selectors description: - Not Provived. elements: dict suboptions: labels: + aliases: + - Labels description: - A key-value pair to associate with a pod. elements: dict suboptions: key: + aliases: + - Key description: - The key name of the label. type: str value: + aliases: + - Value description: - The value for the label. type: str type: list namespace: + aliases: + - Namespace description: - Not Provived. type: str @@ -89,12 +105,15 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str subnets: + aliases: + - Subnets description: - Not Provived. elements: str type: list tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -243,11 +262,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -259,23 +279,38 @@ def main(): ), ) - argument_spec["cluster_name"] = {"type": "str"} - argument_spec["fargate_profile_name"] = {"type": "str"} - argument_spec["pod_execution_role_arn"] = {"type": "str"} - argument_spec["subnets"] = {"type": "list", "elements": "str"} + argument_spec["cluster_name"] = {"type": "str", "aliases": ["ClusterName"]} + argument_spec["fargate_profile_name"] = { + "type": "str", + "aliases": ["FargateProfileName"], + } + argument_spec["pod_execution_role_arn"] = { + "type": "str", + "aliases": ["PodExecutionRoleArn"], + } + argument_spec["subnets"] = { + "type": "list", + "elements": "str", + "aliases": ["Subnets"], + } argument_spec["selectors"] = { "type": "list", "elements": "dict", "options": { - "namespace": {"type": "str"}, + "namespace": {"type": "str", "aliases": ["Namespace"]}, "labels": { "type": "list", "elements": "dict", - "options": {"key": {"type": "str"}, "value": {"type": "str"}}, + "options": { + "key": {"type": "str", "aliases": ["Key"]}, + "value": {"type": "str", "aliases": ["Value"]}, + }, + "aliases": ["Labels"], }, }, + "aliases": ["Selectors"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -293,10 +328,10 @@ def main(): "state", "present", [ - "identifier", "selectors", "pod_execution_role_arn", "fargate_profile_name", + "identifier", "cluster_name", ], True, @@ -332,28 +367,29 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation create_only_params = [ - "cluster_name", - "fargate_profile_name", - "pod_execution_role_arn", - "subnets", - "selectors", + "/properties/ClusterName", + "/properties/FargateProfileName", + "/properties/PodExecutionRoleArn", + "/properties/Subnets", + "/properties/Selectors", ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "delete", "list", "update"] state = module.params.get("state") - identifier = ["cluster_name", "fargate_profile_name"] + identifier = ["/properties/ClusterName", "/properties/FargateProfileName"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None @@ -361,7 +397,9 @@ def main(): if not module.params.get("cluster_name") or not module.params.get( "fargate_profile_name" ): - module.fail_json(f"You must specify both {*identifier, } identifiers.") + module.fail_json( + "You must specify all the ('cluster_name', 'fargate_profile_name') identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/iam_instance_profile.py b/plugins/modules/iam_instance_profile.py index 4f095890..09005cb0 100644 --- a/plugins/modules/iam_instance_profile.py +++ b/plugins/modules/iam_instance_profile.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -24,14 +24,20 @@ be performed on it. type: bool instance_profile_name: + aliases: + - InstanceProfileName description: - The name of the instance profile to create. type: str path: + aliases: + - Path description: - The path to the instance profile. type: str roles: + aliases: + - Roles description: - The name of the role to associate with the instance profile. - Only one role can be assigned to an EC2 instance at a time, and all applications @@ -100,11 +106,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -116,9 +123,12 @@ def main(): ), ) - argument_spec["path"] = {"type": "str"} - argument_spec["roles"] = {"type": "list", "elements": "str"} - argument_spec["instance_profile_name"] = {"type": "str"} + argument_spec["path"] = {"type": "str", "aliases": ["Path"]} + argument_spec["roles"] = {"type": "list", "elements": "str", "aliases": ["Roles"]} + argument_spec["instance_profile_name"] = { + "type": "str", + "aliases": ["InstanceProfileName"], + } argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -129,7 +139,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["instance_profile_name", "roles"], True], + ["state", "present", ["roles", "instance_profile_name"], True], ["state", "absent", ["instance_profile_name"], True], ["state", "get", ["instance_profile_name"], True], ] @@ -152,22 +162,23 @@ def main(): params["roles"] = module.params.get("roles") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["instance_profile_name", "path"] + create_only_params = ["/properties/InstanceProfileName", "/properties/Path"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["instance_profile_name"] + identifier = ["/properties/InstanceProfileName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index a50d5c2f..9c0f49b9 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -14,10 +14,14 @@ - Creates and manages new roles for your AWS account. options: assume_role_policy_document: + aliases: + - AssumeRolePolicyDocument description: - The trust policy that is associated with this role. type: dict description: + aliases: + - Description description: - A description of the role that you provide. type: str @@ -31,12 +35,16 @@ be performed on it. type: bool managed_policy_arns: + aliases: + - ManagedPolicyArns description: - A list of Amazon Resource Names (ARNs) of the IAM managed policies that you want to attach to the role. elements: str type: list max_session_duration: + aliases: + - MaxSessionDuration description: - The maximum session duration (in seconds) that you want to set for the specified role. @@ -45,23 +53,33 @@ - This setting can have a value from 1 hour to 12 hours. type: int path: + aliases: + - Path description: - The path to the role. type: str permissions_boundary: + aliases: + - PermissionsBoundary description: - The ARN of the policy used to set the permissions boundary for the role. type: str policies: + aliases: + - Policies description: - The inline policy document that is embedded in the specified IAM role. elements: dict suboptions: policy_document: + aliases: + - PolicyDocument description: - The policy document. type: str policy_name: + aliases: + - PolicyName description: - The friendly name (not ARN) identifying the policy. type: str @@ -72,6 +90,8 @@ - Remove tags not listed in I(tags). type: bool role_name: + aliases: + - RoleName description: - A name for the IAM role, up to 64 characters in length. type: str @@ -93,6 +113,7 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -144,11 +165,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -160,19 +182,36 @@ def main(): ), ) - argument_spec["assume_role_policy_document"] = {"type": "dict"} - argument_spec["description"] = {"type": "str"} - argument_spec["managed_policy_arns"] = {"type": "list", "elements": "str"} - argument_spec["max_session_duration"] = {"type": "int"} - argument_spec["path"] = {"type": "str"} - argument_spec["permissions_boundary"] = {"type": "str"} + argument_spec["assume_role_policy_document"] = { + "type": "dict", + "aliases": ["AssumeRolePolicyDocument"], + } + argument_spec["description"] = {"type": "str", "aliases": ["Description"]} + argument_spec["managed_policy_arns"] = { + "type": "list", + "elements": "str", + "aliases": ["ManagedPolicyArns"], + } + argument_spec["max_session_duration"] = { + "type": "int", + "aliases": ["MaxSessionDuration"], + } + argument_spec["path"] = {"type": "str", "aliases": ["Path"]} + argument_spec["permissions_boundary"] = { + "type": "str", + "aliases": ["PermissionsBoundary"], + } argument_spec["policies"] = { "type": "list", "elements": "dict", - "options": {"policy_document": {"type": "str"}, "policy_name": {"type": "str"}}, + "options": { + "policy_document": {"type": "str", "aliases": ["PolicyDocument"]}, + "policy_name": {"type": "str", "aliases": ["PolicyName"]}, + }, + "aliases": ["Policies"], } - argument_spec["role_name"] = {"type": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["role_name"] = {"type": "str", "aliases": ["RoleName"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -215,22 +254,23 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["path", "role_name"] + create_only_params = ["/properties/Path", "/properties/RoleName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["role_name"] + identifier = ["/properties/RoleName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/iam_server_certificate.py b/plugins/modules/iam_server_certificate.py index b6d2bd2a..88cae07d 100644 --- a/plugins/modules/iam_server_certificate.py +++ b/plugins/modules/iam_server_certificate.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -14,10 +14,14 @@ - Uploads and manages a server certificate entity for the AWS account. options: certificate_body: + aliases: + - CertificateBody description: - Not Provived. type: str certificate_chain: + aliases: + - CertificateChain description: - Not Provived. type: str @@ -31,10 +35,14 @@ be performed on it. type: bool path: + aliases: + - Path description: - Not Provived. type: str private_key: + aliases: + - PrivateKey description: - Not Provived. type: str @@ -44,6 +52,8 @@ - Remove tags not listed in I(tags). type: bool server_certificate_name: + aliases: + - ServerCertificateName description: - Not Provived. type: str @@ -65,6 +75,7 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -152,11 +163,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -168,12 +180,18 @@ def main(): ), ) - argument_spec["certificate_body"] = {"type": "str"} - argument_spec["certificate_chain"] = {"type": "str"} - argument_spec["server_certificate_name"] = {"type": "str"} - argument_spec["path"] = {"type": "str"} - argument_spec["private_key"] = {"type": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["certificate_body"] = {"type": "str", "aliases": ["CertificateBody"]} + argument_spec["certificate_chain"] = { + "type": "str", + "aliases": ["CertificateChain"], + } + argument_spec["server_certificate_name"] = { + "type": "str", + "aliases": ["ServerCertificateName"], + } + argument_spec["path"] = {"type": "str", "aliases": ["Path"]} + argument_spec["private_key"] = {"type": "str", "aliases": ["PrivateKey"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -211,27 +229,28 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation create_only_params = [ - "server_certificate_name", - "private_key", - "certificate_body", - "certificate_chain", + "/properties/ServerCertificateName", + "/properties/PrivateKey", + "/properties/CertificateBody", + "/properties/CertificateChain", ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["server_certificate_name"] + identifier = ["/properties/ServerCertificateName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/kms_alias.py b/plugins/modules/kms_alias.py index 170b9dca..c4983d97 100644 --- a/plugins/modules/kms_alias.py +++ b/plugins/modules/kms_alias.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -14,6 +14,8 @@ - Specifies a display name for a KMS key. options: alias_name: + aliases: + - AliasName description: - Specifies the alias name. - This value must begin with alias/ followed by a name, such as alias/ExampleAlias. @@ -46,6 +48,8 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str target_key_id: + aliases: + - TargetKeyId description: - Identifies the AWS KMS key to which the alias refers. - Specify the key ID or the Amazon Resource Name (ARN) of the AWS KMS key. @@ -99,11 +103,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -115,8 +120,8 @@ def main(): ), ) - argument_spec["alias_name"] = {"type": "str"} - argument_spec["target_key_id"] = {"type": "str"} + argument_spec["alias_name"] = {"type": "str", "aliases": ["AliasName"]} + argument_spec["target_key_id"] = {"type": "str", "aliases": ["TargetKeyId"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -149,22 +154,23 @@ def main(): params["target_key_id"] = module.params.get("target_key_id") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["alias_name"] + create_only_params = ["/properties/AliasName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["alias_name"] + identifier = ["/properties/AliasName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/kms_replica_key.py b/plugins/modules/kms_replica_key.py deleted file mode 100644 index 88ad46a7..00000000 --- a/plugins/modules/kms_replica_key.py +++ /dev/null @@ -1,241 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# Copyright: (c) 2022, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette - - -DOCUMENTATION = r""" -module: kms_replica_key -short_description: Creates and manages a multi-Region replica key that is based on - a multi-Region primary key -description: -- Creates andn manages a multi-Region replica key that is based on a multi-Region - primary key. -options: - description: - description: - - A description of the AWS KMS key. - - Use a description that helps you to distinguish this AWS KMS key from others - in the account, such as its intended use. - type: str - enabled: - description: - - Specifies whether the AWS KMS key is enabled. - - Disabled AWS KMS keys cannot be used in cryptographic operations. - type: bool - force: - default: false - description: - - Cancel IN_PROGRESS and PENDING resource requestes. - - Because you can only perform a single operation on a given resource at a - time, there might be cases where you need to cancel the current resource - operation to make the resource available so that another operation may - be performed on it. - type: bool - key_id: - description: - - Not Provived. - type: str - key_policy: - description: - - The key policy that authorizes use of the AWS KMS key. - - The key policy must observe the following rules. - type: dict - pending_window_in_days: - description: - - Specifies the number of days in the waiting period before AWS KMS deletes - an AWS KMS key that has been removed from a CloudFormation stack. - - Enter a value between 7 and 30 days. - - The default value is 30 days. - type: int - primary_key_arn: - description: - - Identifies the primary AWS KMS key to create a replica of. - - Specify the Amazon Resource Name (ARN) of the AWS KMS key. - - You cannot specify an alias or key ID. For help finding the ARN, see Finding - the Key ID and ARN in the AWS Key Management Service Developer Guide. - type: str - purge_tags: - default: true - description: - - Remove tags not listed in I(tags). - type: bool - state: - choices: - - present - - absent - - list - - describe - - get - default: present - description: - - Goal state for resource. - - I(state=present) creates the resource if it doesn't exist, or updates to - the provided state if the resource already exists. - - I(state=absent) ensures an existing instance is deleted. - - I(state=list) get all the existing resources. - - I(state=describe) or I(state=get) retrieves information on an existing resource. - type: str - tags: - aliases: - - resource_tags - description: - - A dict of tags to apply to the resource. - - To remove all tags set I(tags={}) and I(purge_tags=true). - type: dict - wait: - default: false - description: - - Wait for operation to complete before returning. - type: bool - wait_timeout: - default: 320 - description: - - How many seconds to wait for an operation to complete before timing out. - type: int -author: Ansible Cloud Team (@ansible-collections) -version_added: 0.2.0 -extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.cloud.boto3 -""" - -EXAMPLES = r""" -""" - -RETURN = r""" -result: - description: - - When I(state=list), it is a list containing dictionaries of resource information. - - Otherwise, it is a dictionary of resource information. - - When I(state=absent), it is an empty dictionary. - returned: always - type: complex - contains: - identifier: - description: The unique identifier of the resource. - type: str - properties: - description: The resource properties. - type: dict -""" - - -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - CloudControlResource, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, -) - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["primary_key_arn"] = {"type": "str"} - argument_spec["description"] = {"type": "str"} - argument_spec["enabled"] = {"type": "bool"} - argument_spec["key_policy"] = {"type": "dict"} - argument_spec["pending_window_in_days"] = {"type": "int"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["key_id"] = {"type": "str"} - argument_spec["state"] = { - "type": "str", - "choices": ["present", "absent", "list", "describe", "get"], - "default": "present", - } - argument_spec["wait"] = {"type": "bool", "default": False} - argument_spec["wait_timeout"] = {"type": "int", "default": 320} - argument_spec["force"] = {"type": "bool", "default": False} - argument_spec["purge_tags"] = {"type": "bool", "default": True} - - required_if = [ - ["state", "present", ["primary_key_arn", "key_policy", "key_id"], True], - ["state", "absent", ["key_id"], True], - ["state", "get", ["key_id"], True], - ] - mutually_exclusive = [] - - module = AnsibleAmazonCloudModule( - argument_spec=argument_spec, - required_if=required_if, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - cloud = CloudControlResource(module) - - type_name = "AWS::KMS::ReplicaKey" - - params = {} - - params["description"] = module.params.get("description") - params["enabled"] = module.params.get("enabled") - params["key_id"] = module.params.get("key_id") - params["key_policy"] = module.params.get("key_policy") - params["pending_window_in_days"] = module.params.get("pending_window_in_days") - params["primary_key_arn"] = module.params.get("primary_key_arn") - params["tags"] = module.params.get("tags") - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} - - # Only if resource is taggable - if module.params.get("tags") is not None: - _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - - # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["primary_key_arn"] - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["key_id"] - - results = {"changed": False, "result": {}} - - if state == "list": - if "list" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be listed." - ) - results["result"] = cloud.list_resources(type_name, identifier) - - if state in ("describe", "get"): - if "read" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be read." - ) - results["result"] = cloud.get_resource(type_name, identifier) - - if state == "present": - results = cloud.present( - type_name, identifier, params_to_set, create_only_params - ) - - if state == "absent": - results["changed"] |= cloud.absent(type_name, identifier) - - module.exit_json(**results) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/lambda_code_signing_config.py b/plugins/modules/lambda_code_signing_config.py deleted file mode 100644 index d36ac50f..00000000 --- a/plugins/modules/lambda_code_signing_config.py +++ /dev/null @@ -1,237 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# Copyright: (c) 2022, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette - - -DOCUMENTATION = r""" -module: lambda_code_signing_config -short_description: Code signing for AWS Lambda -description: -- Creates and manage code signing for AWS Lambda. -options: - allowed_publishers: - description: - - When the CodeSigningConfig is later on attached to a function, the function - code will be expected to be signed by profiles from this listWhen the - CodeSigningConfig is later on attached to a function, the function code - will be expected to be signed by profiles from this list. - suboptions: - signing_profile_version_arns: - description: - - List of Signing profile version Arns. - elements: str - type: list - type: dict - code_signing_config_arn: - description: - - A unique Arn for CodeSigningConfig resource. - type: str - code_signing_policies: - description: - - Policies to control how to act if a signature is invalidPolicies to control - how to act if a signature is invalid. - suboptions: - untrusted_artifact_on_deployment: - choices: - - Enforce - - Warn - default: Warn - description: - - Indicates how Lambda operations involve updating the code artifact - will operate. - - Default to Warn if not provided. - type: str - type: dict - description: - description: - - A description of the CodeSigningConfig. - type: str - force: - default: false - description: - - Cancel IN_PROGRESS and PENDING resource requestes. - - Because you can only perform a single operation on a given resource at a - time, there might be cases where you need to cancel the current resource - operation to make the resource available so that another operation may - be performed on it. - type: bool - state: - choices: - - present - - absent - - list - - describe - - get - default: present - description: - - Goal state for resource. - - I(state=present) creates the resource if it doesn't exist, or updates to - the provided state if the resource already exists. - - I(state=absent) ensures an existing instance is deleted. - - I(state=list) get all the existing resources. - - I(state=describe) or I(state=get) retrieves information on an existing resource. - type: str - wait: - default: false - description: - - Wait for operation to complete before returning. - type: bool - wait_timeout: - default: 320 - description: - - How many seconds to wait for an operation to complete before timing out. - type: int -author: Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 -extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.cloud.boto3 -""" - -EXAMPLES = r""" -""" - -RETURN = r""" -result: - description: - - When I(state=list), it is a list containing dictionaries of resource information. - - Otherwise, it is a dictionary of resource information. - - When I(state=absent), it is an empty dictionary. - returned: always - type: complex - contains: - identifier: - description: The unique identifier of the resource. - type: str - properties: - description: The resource properties. - type: dict -""" - - -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - CloudControlResource, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, -) - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["description"] = {"type": "str"} - argument_spec["allowed_publishers"] = { - "type": "dict", - "options": { - "signing_profile_version_arns": {"type": "list", "elements": "str"} - }, - } - argument_spec["code_signing_policies"] = { - "type": "dict", - "options": { - "untrusted_artifact_on_deployment": { - "type": "str", - "default": "Warn", - "choices": ["Enforce", "Warn"], - } - }, - } - argument_spec["code_signing_config_arn"] = {"type": "str"} - argument_spec["state"] = { - "type": "str", - "choices": ["present", "absent", "list", "describe", "get"], - "default": "present", - } - argument_spec["wait"] = {"type": "bool", "default": False} - argument_spec["wait_timeout"] = {"type": "int", "default": 320} - argument_spec["force"] = {"type": "bool", "default": False} - - required_if = [ - ["state", "present", ["code_signing_config_arn", "allowed_publishers"], True], - ["state", "absent", ["code_signing_config_arn"], True], - ["state", "get", ["code_signing_config_arn"], True], - ] - mutually_exclusive = [] - - module = AnsibleAmazonCloudModule( - argument_spec=argument_spec, - required_if=required_if, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - cloud = CloudControlResource(module) - - type_name = "AWS::Lambda::CodeSigningConfig" - - params = {} - - params["allowed_publishers"] = module.params.get("allowed_publishers") - params["code_signing_config_arn"] = module.params.get("code_signing_config_arn") - params["code_signing_policies"] = module.params.get("code_signing_policies") - params["description"] = module.params.get("description") - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} - - # Only if resource is taggable - if module.params.get("tags") is not None: - _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - - # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = {} - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["code_signing_config_arn"] - - results = {"changed": False, "result": {}} - - if state == "list": - if "list" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be listed." - ) - results["result"] = cloud.list_resources(type_name, identifier) - - if state in ("describe", "get"): - if "read" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be read." - ) - results["result"] = cloud.get_resource(type_name, identifier) - - if state == "present": - results = cloud.present( - type_name, identifier, params_to_set, create_only_params - ) - - if state == "absent": - results["changed"] |= cloud.absent(type_name, identifier) - - module.exit_json(**results) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/lambda_event_source_mapping.py b/plugins/modules/lambda_event_source_mapping.py deleted file mode 100644 index 75acc9e4..00000000 --- a/plugins/modules/lambda_event_source_mapping.py +++ /dev/null @@ -1,485 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# Copyright: (c) 2022, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette - - -DOCUMENTATION = r""" -module: lambda_event_source_mapping -short_description: Create a mapping between an event source and an AWS Lambda function -description: -- Create a mapping between an event source and an AWS Lambda function. -options: - amazon_managed_kafka_event_source_config: - description: - - Specific configuration settings for an MSK event source.Specific configuration - settings for an MSK event source. - suboptions: - consumer_group_id: - description: - - The identifier for the Kafka Consumer Group to join.The identifier - for the Kafka Consumer Group to join. - type: str - type: dict - batch_size: - description: - - The maximum number of items to retrieve in a single batch. - type: int - bisect_batch_on_function_error: - description: - - (Streams) If the function returns an error, split the batch in two and retry. - type: bool - destination_config: - description: - - (Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded - records.(Streams) An Amazon SQS queue or Amazon SNS topic destination - for discarded records. - suboptions: - on_failure: - description: - - The destination configuration for failed invocations.A destination - for events that failed processing. - suboptions: - destination: - description: - - The Amazon Resource Name (ARN) of the destination resource. - type: str - type: dict - type: dict - enabled: - description: - - Disables the event source mapping to pause polling and invocation. - type: bool - event_source_arn: - description: - - The Amazon Resource Name (ARN) of the event source. - type: str - filter_criteria: - description: - - The filter criteria to control event filtering.The filter criteria to control - event filtering. - suboptions: - filters: - description: - - The filter object that defines parameters for ESM filtering. - elements: dict - suboptions: - pattern: - description: - - The filter pattern that defines which events should be passed - for invocations. - type: str - type: list - type: dict - force: - default: false - description: - - Cancel IN_PROGRESS and PENDING resource requestes. - - Because you can only perform a single operation on a given resource at a - time, there might be cases where you need to cancel the current resource - operation to make the resource available so that another operation may - be performed on it. - type: bool - function_name: - description: - - The name of the Lambda function. - type: str - function_response_types: - choices: - - ReportBatchItemFailures - description: - - (Streams) A list of response types supported by the function. - elements: str - type: list - id: - description: - - Event Source Mapping Identifier UUID. - type: str - maximum_batching_window_in_seconds: - description: - - (Streams) The maximum amount of time to gather records before invoking the - function, in seconds. - type: int - maximum_record_age_in_seconds: - description: - - (Streams) The maximum age of a record that Lambda sends to a function for - processing. - type: int - maximum_retry_attempts: - description: - - (Streams) The maximum number of times to retry when the function returns - an error. - type: int - parallelization_factor: - description: - - (Streams) The number of batches to process from each shard concurrently. - type: int - queues: - description: - - (ActiveMQ) A list of ActiveMQ queues. - elements: str - type: list - scaling_config: - description: - - The scaling configuration for the event source.The scaling configuration - for the event source. - suboptions: - maximum_concurrency: - description: - - The maximum number of concurrent functions that the event source - can invoke.The maximum number of concurrent functions that an - event source can invoke. - type: int - type: dict - self_managed_event_source: - description: - - Self-managed event source endpoints.The configuration used by AWS Lambda - to access a self-managed event source. - suboptions: - endpoints: - description: - - The endpoints for a self-managed event source.The endpoints used - by AWS Lambda to access a self-managed event source. - suboptions: - kafka_bootstrap_servers: - description: - - The URL of a Kafka server. - elements: str - type: list - type: dict - type: dict - self_managed_kafka_event_source_config: - description: - - Specific configuration settings for a Self-Managed Apache Kafka event source.Specific - configuration settings for a Self-Managed Apache Kafka event source. - suboptions: - consumer_group_id: - description: - - The identifier for the Kafka Consumer Group to join. - type: str - type: dict - source_access_configurations: - description: - - The configuration used by AWS Lambda to access event source. - elements: dict - suboptions: - type: - choices: - - BASIC_AUTH - - CLIENT_CERTIFICATE_TLS_AUTH - - SASL_SCRAM_256_AUTH - - SASL_SCRAM_512_AUTH - - SERVER_ROOT_CA_CERTIFICATE - - VIRTUAL_HOST - - VPC_SECURITY_GROUP - - VPC_SUBNET - description: - - The type of source access configuration. - type: str - uri: - description: - - The URI for the source access configuration resource. - type: str - type: list - starting_position: - description: - - The position in a stream from which to start reading. - - Required for Amazon Kinesis and Amazon DynamoDB Streams sources. - type: str - starting_position_timestamp: - description: - - With StartingPosition set to C(AT_TIMESTAMP), the time from which to start - reading, in Unix time seconds. - type: int - state: - choices: - - present - - absent - - list - - describe - - get - default: present - description: - - Goal state for resource. - - I(state=present) creates the resource if it doesn't exist, or updates to - the provided state if the resource already exists. - - I(state=absent) ensures an existing instance is deleted. - - I(state=list) get all the existing resources. - - I(state=describe) or I(state=get) retrieves information on an existing resource. - type: str - topics: - description: - - (Kafka) A list of Kafka topics. - elements: str - type: list - tumbling_window_in_seconds: - description: - - (Streams) Tumbling window (non-overlapping time window) duration to perform - aggregations. - type: int - wait: - default: false - description: - - Wait for operation to complete before returning. - type: bool - wait_timeout: - default: 320 - description: - - How many seconds to wait for an operation to complete before timing out. - type: int -author: Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 -extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.cloud.boto3 -""" - -EXAMPLES = r""" -""" - -RETURN = r""" -result: - description: - - When I(state=list), it is a list containing dictionaries of resource information. - - Otherwise, it is a dictionary of resource information. - - When I(state=absent), it is an empty dictionary. - returned: always - type: complex - contains: - identifier: - description: The unique identifier of the resource. - type: str - properties: - description: The resource properties. - type: dict -""" - - -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - CloudControlResource, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, -) - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["id"] = {"type": "str"} - argument_spec["batch_size"] = {"type": "int"} - argument_spec["bisect_batch_on_function_error"] = {"type": "bool"} - argument_spec["destination_config"] = { - "type": "dict", - "options": { - "on_failure": {"type": "dict", "options": {"destination": {"type": "str"}}} - }, - } - argument_spec["enabled"] = {"type": "bool"} - argument_spec["event_source_arn"] = {"type": "str"} - argument_spec["filter_criteria"] = { - "type": "dict", - "options": { - "filters": { - "type": "list", - "elements": "dict", - "options": {"pattern": {"type": "str"}}, - } - }, - } - argument_spec["function_name"] = {"type": "str"} - argument_spec["maximum_batching_window_in_seconds"] = {"type": "int"} - argument_spec["maximum_record_age_in_seconds"] = {"type": "int"} - argument_spec["maximum_retry_attempts"] = {"type": "int"} - argument_spec["parallelization_factor"] = {"type": "int"} - argument_spec["starting_position"] = {"type": "str"} - argument_spec["starting_position_timestamp"] = {"type": "int"} - argument_spec["topics"] = {"type": "list", "elements": "str"} - argument_spec["queues"] = {"type": "list", "elements": "str"} - argument_spec["source_access_configurations"] = { - "type": "list", - "elements": "dict", - "options": { - "type": { - "type": "str", - "choices": [ - "BASIC_AUTH", - "CLIENT_CERTIFICATE_TLS_AUTH", - "SASL_SCRAM_256_AUTH", - "SASL_SCRAM_512_AUTH", - "SERVER_ROOT_CA_CERTIFICATE", - "VIRTUAL_HOST", - "VPC_SECURITY_GROUP", - "VPC_SUBNET", - ], - }, - "uri": {"type": "str"}, - }, - } - argument_spec["tumbling_window_in_seconds"] = {"type": "int"} - argument_spec["function_response_types"] = { - "type": "list", - "elements": "str", - "choices": ["ReportBatchItemFailures"], - } - argument_spec["self_managed_event_source"] = { - "type": "dict", - "options": { - "endpoints": { - "type": "dict", - "options": { - "kafka_bootstrap_servers": {"type": "list", "elements": "str"} - }, - } - }, - } - argument_spec["amazon_managed_kafka_event_source_config"] = { - "type": "dict", - "options": {"consumer_group_id": {"type": "str"}}, - } - argument_spec["self_managed_kafka_event_source_config"] = { - "type": "dict", - "options": {"consumer_group_id": {"type": "str"}}, - } - argument_spec["scaling_config"] = { - "type": "dict", - "options": {"maximum_concurrency": {"type": "int"}}, - } - argument_spec["state"] = { - "type": "str", - "choices": ["present", "absent", "list", "describe", "get"], - "default": "present", - } - argument_spec["wait"] = {"type": "bool", "default": False} - argument_spec["wait_timeout"] = {"type": "int", "default": 320} - argument_spec["force"] = {"type": "bool", "default": False} - - required_if = [ - ["state", "present", ["id", "function_name"], True], - ["state", "absent", ["id"], True], - ["state", "get", ["id"], True], - ] - mutually_exclusive = [] - - module = AnsibleAmazonCloudModule( - argument_spec=argument_spec, - required_if=required_if, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - cloud = CloudControlResource(module) - - type_name = "AWS::Lambda::EventSourceMapping" - - params = {} - - params["amazon_managed_kafka_event_source_config"] = module.params.get( - "amazon_managed_kafka_event_source_config" - ) - params["batch_size"] = module.params.get("batch_size") - params["bisect_batch_on_function_error"] = module.params.get( - "bisect_batch_on_function_error" - ) - params["destination_config"] = module.params.get("destination_config") - params["enabled"] = module.params.get("enabled") - params["event_source_arn"] = module.params.get("event_source_arn") - params["filter_criteria"] = module.params.get("filter_criteria") - params["function_name"] = module.params.get("function_name") - params["function_response_types"] = module.params.get("function_response_types") - params["id"] = module.params.get("id") - params["maximum_batching_window_in_seconds"] = module.params.get( - "maximum_batching_window_in_seconds" - ) - params["maximum_record_age_in_seconds"] = module.params.get( - "maximum_record_age_in_seconds" - ) - params["maximum_retry_attempts"] = module.params.get("maximum_retry_attempts") - params["parallelization_factor"] = module.params.get("parallelization_factor") - params["queues"] = module.params.get("queues") - params["scaling_config"] = module.params.get("scaling_config") - params["self_managed_event_source"] = module.params.get("self_managed_event_source") - params["self_managed_kafka_event_source_config"] = module.params.get( - "self_managed_kafka_event_source_config" - ) - params["source_access_configurations"] = module.params.get( - "source_access_configurations" - ) - params["starting_position"] = module.params.get("starting_position") - params["starting_position_timestamp"] = module.params.get( - "starting_position_timestamp" - ) - params["topics"] = module.params.get("topics") - params["tumbling_window_in_seconds"] = module.params.get( - "tumbling_window_in_seconds" - ) - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} - - # Only if resource is taggable - if module.params.get("tags") is not None: - _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - - # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = [ - "event_source_arn", - "starting_position", - "starting_position_timestamp", - "self_managed_event_source", - "amazon_managed_kafka_event_source_config", - "self_managed_kafka_event_source_config", - ] - - # Necessary to handle when module does not support all the states - handlers = ["create", "delete", "list", "read", "update"] - - state = module.params.get("state") - identifier = ["id"] - - results = {"changed": False, "result": {}} - - if state == "list": - if "list" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be listed." - ) - results["result"] = cloud.list_resources(type_name, identifier) - - if state in ("describe", "get"): - if "read" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be read." - ) - results["result"] = cloud.get_resource(type_name, identifier) - - if state == "present": - results = cloud.present( - type_name, identifier, params_to_set, create_only_params - ) - - if state == "absent": - results["changed"] |= cloud.absent(type_name, identifier) - - module.exit_json(**results) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/lambda_function.py b/plugins/modules/lambda_function.py index 247ee4da..bae9dfaa 100644 --- a/plugins/modules/lambda_function.py +++ b/plugins/modules/lambda_function.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -14,6 +14,8 @@ - Creates and manage Lambda functions. options: architectures: + aliases: + - Architectures choices: - arm64 - x86_64 @@ -22,28 +24,40 @@ elements: str type: list code: + aliases: + - Code description: - The code for the function. suboptions: image_uri: + aliases: + - ImageUri description: - I(image_uri). type: str s3_bucket: + aliases: + - S3Bucket description: - An Amazon S3 bucket in the same AWS Region as your function. - The bucket can be in a different AWS account. type: str s3_key: + aliases: + - S3Key description: - The Amazon S3 key of the deployment package. type: str s3_object_version: + aliases: + - S3ObjectVersion description: - For versioned objects, the version of the deployment package object to use. type: str zip_file: + aliases: + - ZipFile description: - The source code of your Lambda function. - If you include your function source inline with this parameter, @@ -52,45 +66,63 @@ type: str type: dict code_signing_config_arn: + aliases: + - CodeSigningConfigArn description: - A unique Arn for CodeSigningConfig resource. type: str dead_letter_config: + aliases: + - DeadLetterConfig description: - A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing.The dead-letter queue for failed asynchronous invocations. suboptions: target_arn: + aliases: + - TargetArn description: - The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic. type: str type: dict description: + aliases: + - Description description: - A description of the function. type: str environment: + aliases: + - Environment description: - Environment variables that are accessible from function code during execution.A functions environment variable settings. suboptions: variables: + aliases: + - Variables description: - Environment variable key-value pairs. type: dict type: dict ephemeral_storage: + aliases: + - EphemeralStorage description: - A functions ephemeral storage settings.A functions ephemeral storage settings. suboptions: size: + aliases: + - Size description: - The amount of ephemeral storage that your function has access to. type: int type: dict file_system_configs: + aliases: + - FileSystemConfigs description: - Connection settings for an Amazon EFS file system. - To connect a function to a file system, a mount target must be available @@ -100,7 +132,16 @@ or updated before the function. elements: dict suboptions: + arn: + aliases: + - Arn + description: + - The Amazon Resource Name (ARN) of the Amazon EFS access point that + provides access to the file system. + type: str local_mount_path: + aliases: + - LocalMountPath description: - The path where the function can access the file system, starting with /mnt/. @@ -116,11 +157,15 @@ be performed on it. type: bool function_name: + aliases: + - FunctionName description: - The name of the Lambda function, up to 64 characters in length. - If you dont specify a name, AWS CloudFormation generates one. type: str handler: + aliases: + - Handler description: - The name of the method within your code that Lambda calls to execute your function. @@ -128,43 +173,59 @@ - It can also include namespaces and other qualifiers, depending on the runtime. type: str image_config: + aliases: + - ImageConfig description: - I(image_config). suboptions: command: + aliases: + - Command description: - Command. elements: str type: list entry_point: + aliases: + - EntryPoint description: - I(entry_point). elements: str type: list working_directory: + aliases: + - WorkingDirectory description: - I(working_directory). type: str type: dict kms_key_arn: + aliases: + - KmsKeyArn description: - The ARN of the AWS Key Management Service (AWS KMS) key thats used to encrypt your functions environment variables. - If its not provided, AWS Lambda uses a default service key. type: str layers: + aliases: + - Layers description: - A list of function layers to add to the functions execution environment. - Specify each layer by its ARN, including the version. elements: str type: list memory_size: + aliases: + - MemorySize description: - The amount of memory that your function has access to. - Increasing the functions memory also increases its CPU allocation. - The default value is 128 MB. The value must be a multiple of 64 MB. type: int package_type: + aliases: + - PackageType choices: - Image - Zip @@ -177,26 +238,38 @@ - Remove tags not listed in I(tags). type: bool reserved_concurrent_executions: + aliases: + - ReservedConcurrentExecutions description: - The number of simultaneous executions to reserve for the function. type: int role: + aliases: + - Role description: - The Amazon Resource Name (ARN) of the functions execution role. type: str runtime: + aliases: + - Runtime description: - The identifier of the functions runtime. type: str runtime_management_config: + aliases: + - RuntimeManagementConfig description: - I(runtime_management_config). suboptions: runtime_version_arn: + aliases: + - RuntimeVersionArn description: - Unique identifier for a runtime version arn. type: str update_runtime_on: + aliases: + - UpdateRuntimeOn choices: - Auto - FunctionUpdate @@ -206,11 +279,22 @@ type: str type: dict snap_start: + aliases: + - SnapStart description: - The I(snap_start) setting of your functionThe functions I(snap_start) setting. - When set to PublishedVersions, Lambda creates a snapshot of the execution environment when you publish a function version. - suboptions: {} + suboptions: + apply_on: + aliases: + - ApplyOn + choices: + - None + - PublishedVersions + description: + - Applying I(snap_start) setting on function resource type. + type: str type: dict state: choices: @@ -230,12 +314,15 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). type: dict timeout: + aliases: + - Timeout description: - The amount of time that Lambda allows a function to run before stopping it. @@ -243,12 +330,16 @@ - The maximum allowed value is 900 seconds. type: int tracing_config: + aliases: + - TracingConfig description: - Set Mode to Active to sample and trace a subset of incoming requests with AWS X-Ray.The functions AWS X-Ray tracing configuration. - To sample and record incoming requests, set Mode to Active. suboptions: mode: + aliases: + - Mode choices: - Active - PassThrough @@ -257,6 +348,8 @@ type: str type: dict vpc_config: + aliases: + - VpcConfig description: - For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC.The VPC security groups and subnets that @@ -267,11 +360,15 @@ - The function can only access resources and the internet through that VPC. suboptions: security_group_ids: + aliases: + - SecurityGroupIds description: - A list of VPC security groups IDs. elements: str type: list subnet_ids: + aliases: + - SubnetIds description: - A list of VPC subnet IDs. elements: str @@ -323,11 +420,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -339,17 +437,29 @@ def main(): ), ) - argument_spec["description"] = {"type": "str"} + argument_spec["description"] = {"type": "str", "aliases": ["Description"]} argument_spec["tracing_config"] = { "type": "dict", - "options": {"mode": {"type": "str", "choices": ["Active", "PassThrough"]}}, + "options": { + "mode": { + "type": "str", + "choices": ["Active", "PassThrough"], + "aliases": ["Mode"], + } + }, + "aliases": ["TracingConfig"], } argument_spec["vpc_config"] = { "type": "dict", "options": { - "security_group_ids": {"type": "list", "elements": "str"}, - "subnet_ids": {"type": "list", "elements": "str"}, + "security_group_ids": { + "type": "list", + "elements": "str", + "aliases": ["SecurityGroupIds"], + }, + "subnet_ids": {"type": "list", "elements": "str", "aliases": ["SubnetIds"]}, }, + "aliases": ["VpcConfig"], } argument_spec["runtime_management_config"] = { "type": "dict", @@ -357,62 +467,98 @@ def main(): "update_runtime_on": { "type": "str", "choices": ["Auto", "FunctionUpdate", "Manual"], + "aliases": ["UpdateRuntimeOn"], }, - "runtime_version_arn": {"type": "str"}, + "runtime_version_arn": {"type": "str", "aliases": ["RuntimeVersionArn"]}, + }, + "aliases": ["RuntimeManagementConfig"], + } + argument_spec["reserved_concurrent_executions"] = { + "type": "int", + "aliases": ["ReservedConcurrentExecutions"], + } + argument_spec["snap_start"] = { + "type": "dict", + "options": { + "apply_on": { + "type": "str", + "choices": ["None", "PublishedVersions"], + "aliases": ["ApplyOn"], + } }, + "aliases": ["SnapStart"], } - argument_spec["reserved_concurrent_executions"] = {"type": "int"} - argument_spec["snap_start"] = {"type": "dict", "options": {}} argument_spec["file_system_configs"] = { "type": "list", "elements": "dict", - "options": {"local_mount_path": {"type": "str"}}, + "options": { + "arn": {"type": "str", "aliases": ["Arn"]}, + "local_mount_path": {"type": "str", "aliases": ["LocalMountPath"]}, + }, + "aliases": ["FileSystemConfigs"], + } + argument_spec["function_name"] = {"type": "str", "aliases": ["FunctionName"]} + argument_spec["runtime"] = {"type": "str", "aliases": ["Runtime"]} + argument_spec["kms_key_arn"] = {"type": "str", "aliases": ["KmsKeyArn"]} + argument_spec["package_type"] = { + "type": "str", + "choices": ["Image", "Zip"], + "aliases": ["PackageType"], } - argument_spec["function_name"] = {"type": "str"} - argument_spec["runtime"] = {"type": "str"} - argument_spec["kms_key_arn"] = {"type": "str"} - argument_spec["package_type"] = {"type": "str", "choices": ["Image", "Zip"]} - argument_spec["code_signing_config_arn"] = {"type": "str"} - argument_spec["layers"] = {"type": "list", "elements": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["code_signing_config_arn"] = { + "type": "str", + "aliases": ["CodeSigningConfigArn"], + } + argument_spec["layers"] = {"type": "list", "elements": "str", "aliases": ["Layers"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["image_config"] = { "type": "dict", "options": { - "working_directory": {"type": "str"}, - "command": {"type": "list", "elements": "str"}, - "entry_point": {"type": "list", "elements": "str"}, + "working_directory": {"type": "str", "aliases": ["WorkingDirectory"]}, + "command": {"type": "list", "elements": "str", "aliases": ["Command"]}, + "entry_point": { + "type": "list", + "elements": "str", + "aliases": ["EntryPoint"], + }, }, + "aliases": ["ImageConfig"], } - argument_spec["memory_size"] = {"type": "int"} + argument_spec["memory_size"] = {"type": "int", "aliases": ["MemorySize"]} argument_spec["dead_letter_config"] = { "type": "dict", - "options": {"target_arn": {"type": "str"}}, + "options": {"target_arn": {"type": "str", "aliases": ["TargetArn"]}}, + "aliases": ["DeadLetterConfig"], } - argument_spec["timeout"] = {"type": "int"} - argument_spec["handler"] = {"type": "str"} + argument_spec["timeout"] = {"type": "int", "aliases": ["Timeout"]} + argument_spec["handler"] = {"type": "str", "aliases": ["Handler"]} argument_spec["code"] = { "type": "dict", "options": { - "s3_object_version": {"type": "str"}, - "s3_bucket": {"type": "str"}, - "zip_file": {"type": "str"}, - "s3_key": {"type": "str"}, - "image_uri": {"type": "str"}, + "s3_object_version": {"type": "str", "aliases": ["S3ObjectVersion"]}, + "s3_bucket": {"type": "str", "aliases": ["S3Bucket"]}, + "zip_file": {"type": "str", "aliases": ["ZipFile"]}, + "s3_key": {"type": "str", "aliases": ["S3Key"]}, + "image_uri": {"type": "str", "aliases": ["ImageUri"]}, }, + "aliases": ["Code"], } - argument_spec["role"] = {"type": "str"} + argument_spec["role"] = {"type": "str", "aliases": ["Role"]} argument_spec["environment"] = { "type": "dict", - "options": {"variables": {"type": "dict"}}, + "options": {"variables": {"type": "dict", "aliases": ["Variables"]}}, + "aliases": ["Environment"], } argument_spec["ephemeral_storage"] = { "type": "dict", - "options": {"size": {"type": "int"}}, + "options": {"size": {"type": "int", "aliases": ["Size"]}}, + "aliases": ["EphemeralStorage"], } argument_spec["architectures"] = { "type": "list", "elements": "str", "choices": ["arm64", "x86_64"], + "aliases": ["Architectures"], } argument_spec["state"] = { "type": "str", @@ -425,7 +571,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["role", "function_name", "code"], True], + ["state", "present", ["code", "function_name", "role"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] @@ -471,22 +617,23 @@ def main(): params["vpc_config"] = module.params.get("vpc_config") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["function_name"] + create_only_params = ["/properties/FunctionName"] # Necessary to handle when module does not support all the states handlers = ["read", "create", "update", "list", "delete"] state = module.params.get("state") - identifier = ["function_name"] + identifier = ["/properties/FunctionName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/logs_log_group.py b/plugins/modules/logs_log_group.py index 5a65299a..f2b07ec0 100644 --- a/plugins/modules/logs_log_group.py +++ b/plugins/modules/logs_log_group.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -14,6 +14,8 @@ - Create and manage log groups. options: data_protection_policy: + aliases: + - DataProtectionPolicy description: - The body of the policy document you want to use for this topic. - You can only add one policy per topic. @@ -30,10 +32,14 @@ be performed on it. type: bool kms_key_id: + aliases: + - KmsKeyId description: - The Amazon Resource Name (ARN) of the CMK to use when encrypting log data. type: str log_group_name: + aliases: + - LogGroupName description: - The name of the log group. - If you dont specify a name, AWS CloudFormation generates a unique ID for @@ -45,6 +51,8 @@ - Remove tags not listed in I(tags). type: bool retention_in_days: + aliases: + - RetentionInDays choices: - 1 - 3 @@ -61,6 +69,7 @@ - 400 - 545 - 731 + - 1096 - 1827 - 2192 - 2557 @@ -70,7 +79,8 @@ description: - The number of days to retain the log events in the specified log group. - 'Possible values are: C(1), C(3), C(5), C(7), C(14), C(30), C(60), C(90), - C(120), C(150), C(180), C(365), C(400), C(545), C(731), C(1827), and C(3653).' + C(120), C(150), C(180), C(365), C(400), C(545), C(731), C(1096), C(1827), + and C(3653).' type: int state: choices: @@ -90,6 +100,7 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -172,11 +183,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -188,9 +200,12 @@ def main(): ), ) - argument_spec["log_group_name"] = {"type": "str"} - argument_spec["kms_key_id"] = {"type": "str"} - argument_spec["data_protection_policy"] = {"type": "dict"} + argument_spec["log_group_name"] = {"type": "str", "aliases": ["LogGroupName"]} + argument_spec["kms_key_id"] = {"type": "str", "aliases": ["KmsKeyId"]} + argument_spec["data_protection_policy"] = { + "type": "dict", + "aliases": ["DataProtectionPolicy"], + } argument_spec["retention_in_days"] = { "type": "int", "choices": [ @@ -209,6 +224,7 @@ def main(): 400, 545, 731, + 1096, 1827, 2192, 2557, @@ -216,8 +232,9 @@ def main(): 3288, 3653, ], + "aliases": ["RetentionInDays"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -254,22 +271,23 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["log_group_name"] + create_only_params = ["/properties/LogGroupName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["log_group_name"] + identifier = ["/properties/LogGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index 8d5bd599..c18e1bae 100644 --- a/plugins/modules/logs_metric_filter.py +++ b/plugins/modules/logs_metric_filter.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -20,10 +20,14 @@ 100. options: filter_name: + aliases: + - FilterName description: - A name for the metric filter. type: str filter_pattern: + aliases: + - FilterPattern description: - Pattern that Logs follows to interpret each entry in a log. type: str @@ -44,50 +48,70 @@ - For more details, visit U(https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html). type: str log_group_name: + aliases: + - LogGroupName description: - Existing log group that you want to associate with this filter. type: str metric_transformations: + aliases: + - MetricTransformations description: - A collection of information that defines how metric data gets emitted. elements: dict suboptions: default_value: + aliases: + - DefaultValue description: - The value to emit when a filter pattern does not match a log event. - This value can be null. type: int dimensions: + aliases: + - Dimensions description: - the key-value pairs that further define a metric. elements: dict suboptions: key: + aliases: + - Key description: - The key of the dimension. - Maximum length of 255. type: str value: + aliases: + - Value description: - The value of the dimension. - Maximum length of 255. type: str type: list metric_name: + aliases: + - MetricName description: - The name of the CloudWatch metric. - Metric name must be in ASCII format. type: str metric_namespace: + aliases: + - MetricNamespace description: - The namespace of the CloudWatch metric. type: str metric_value: + aliases: + - MetricValue description: - The value to publish to the CloudWatch metric when a filter pattern matches a log event. type: str unit: + aliases: + - Unit choices: - Bits - Bits/Second @@ -183,11 +207,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -199,17 +224,17 @@ def main(): ), ) - argument_spec["filter_name"] = {"type": "str"} - argument_spec["filter_pattern"] = {"type": "str"} - argument_spec["log_group_name"] = {"type": "str"} + argument_spec["filter_name"] = {"type": "str", "aliases": ["FilterName"]} + argument_spec["filter_pattern"] = {"type": "str", "aliases": ["FilterPattern"]} + argument_spec["log_group_name"] = {"type": "str", "aliases": ["LogGroupName"]} argument_spec["metric_transformations"] = { "type": "list", "elements": "dict", "options": { - "default_value": {"type": "int"}, - "metric_name": {"type": "str"}, - "metric_namespace": {"type": "str"}, - "metric_value": {"type": "str"}, + "default_value": {"type": "int", "aliases": ["DefaultValue"]}, + "metric_name": {"type": "str", "aliases": ["MetricName"]}, + "metric_namespace": {"type": "str", "aliases": ["MetricNamespace"]}, + "metric_value": {"type": "str", "aliases": ["MetricValue"]}, "unit": { "type": "str", "choices": [ @@ -241,13 +266,19 @@ def main(): "Terabytes", "Terabytes/Second", ], + "aliases": ["Unit"], }, "dimensions": { "type": "list", "elements": "dict", - "options": {"key": {"type": "str"}, "value": {"type": "str"}}, + "options": { + "key": {"type": "str", "aliases": ["Key"]}, + "value": {"type": "str", "aliases": ["Value"]}, + }, + "aliases": ["Dimensions"], }, }, + "aliases": ["MetricTransformations"], } argument_spec["state"] = { "type": "str", @@ -265,11 +296,11 @@ def main(): "state", "present", [ - "identifier", - "log_group_name", + "filter_pattern", "filter_name", "metric_transformations", - "filter_pattern", + "identifier", + "log_group_name", ], True, ], @@ -297,22 +328,23 @@ def main(): params["metric_transformations"] = module.params.get("metric_transformations") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["filter_name", "log_group_name"] + create_only_params = ["/properties/FilterName", "/properties/LogGroupName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["log_group_name", "filter_name"] + identifier = ["/properties/LogGroupName", "/properties/FilterName"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None @@ -320,7 +352,9 @@ def main(): if not module.params.get("log_group_name") or not module.params.get( "filter_name" ): - module.fail_json(f"You must specify both {*identifier, } identifiers.") + module.fail_json( + "You must specify all the ('log_group_name', 'filter_name') identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/logs_query_definition.py b/plugins/modules/logs_query_definition.py deleted file mode 100644 index d0f61800..00000000 --- a/plugins/modules/logs_query_definition.py +++ /dev/null @@ -1,203 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# Copyright: (c) 2022, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette - - -DOCUMENTATION = r""" -module: logs_query_definition -short_description: Create and manage query definitions -description: -- Creates and manage query definitions for CloudWatch Logs Insights. -options: - force: - default: false - description: - - Cancel IN_PROGRESS and PENDING resource requestes. - - Because you can only perform a single operation on a given resource at a - time, there might be cases where you need to cancel the current resource - operation to make the resource available so that another operation may - be performed on it. - type: bool - log_group_names: - description: - - I(log_group) name. - elements: str - type: list - name: - description: - - A name for the saved query definition. - type: str - query_definition_id: - description: - - Unique identifier of a query definition. - type: str - query_string: - description: - - The query string to use for this definition. - type: str - state: - choices: - - present - - absent - - list - - describe - - get - default: present - description: - - Goal state for resource. - - I(state=present) creates the resource if it doesn't exist, or updates to - the provided state if the resource already exists. - - I(state=absent) ensures an existing instance is deleted. - - I(state=list) get all the existing resources. - - I(state=describe) or I(state=get) retrieves information on an existing resource. - type: str - wait: - default: false - description: - - Wait for operation to complete before returning. - type: bool - wait_timeout: - default: 320 - description: - - How many seconds to wait for an operation to complete before timing out. - type: int -author: Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 -extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.cloud.boto3 -""" - -EXAMPLES = r""" -""" - -RETURN = r""" -result: - description: - - When I(state=list), it is a list containing dictionaries of resource information. - - Otherwise, it is a dictionary of resource information. - - When I(state=absent), it is an empty dictionary. - returned: always - type: complex - contains: - identifier: - description: The unique identifier of the resource. - type: str - properties: - description: The resource properties. - type: dict -""" - - -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - CloudControlResource, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, -) - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["name"] = {"type": "str"} - argument_spec["query_string"] = {"type": "str"} - argument_spec["log_group_names"] = {"type": "list", "elements": "str"} - argument_spec["query_definition_id"] = {"type": "str"} - argument_spec["state"] = { - "type": "str", - "choices": ["present", "absent", "list", "describe", "get"], - "default": "present", - } - argument_spec["wait"] = {"type": "bool", "default": False} - argument_spec["wait_timeout"] = {"type": "int", "default": 320} - argument_spec["force"] = {"type": "bool", "default": False} - - required_if = [ - ["state", "present", ["query_definition_id", "query_string", "name"], True], - ["state", "absent", ["query_definition_id"], True], - ["state", "get", ["query_definition_id"], True], - ] - mutually_exclusive = [] - - module = AnsibleAmazonCloudModule( - argument_spec=argument_spec, - required_if=required_if, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - cloud = CloudControlResource(module) - - type_name = "AWS::Logs::QueryDefinition" - - params = {} - - params["log_group_names"] = module.params.get("log_group_names") - params["name"] = module.params.get("name") - params["query_definition_id"] = module.params.get("query_definition_id") - params["query_string"] = module.params.get("query_string") - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} - - # Only if resource is taggable - if module.params.get("tags") is not None: - _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - - # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = {} - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["query_definition_id"] - - results = {"changed": False, "result": {}} - - if state == "list": - if "list" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be listed." - ) - results["result"] = cloud.list_resources(type_name, identifier) - - if state in ("describe", "get"): - if "read" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be read." - ) - results["result"] = cloud.get_resource(type_name, identifier) - - if state == "present": - results = cloud.present( - type_name, identifier, params_to_set, create_only_params - ) - - if state == "absent": - results["changed"] |= cloud.absent(type_name, identifier) - - module.exit_json(**results) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/logs_resource_policy.py b/plugins/modules/logs_resource_policy.py index bb37b67d..2f8cb60d 100644 --- a/plugins/modules/logs_resource_policy.py +++ b/plugins/modules/logs_resource_policy.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -24,10 +24,14 @@ be performed on it. type: bool policy_document: + aliases: + - PolicyDocument description: - The policy document. type: str policy_name: + aliases: + - PolicyName description: - A name for resource policy. type: str @@ -93,11 +97,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -109,8 +114,8 @@ def main(): ), ) - argument_spec["policy_name"] = {"type": "str"} - argument_spec["policy_document"] = {"type": "str"} + argument_spec["policy_name"] = {"type": "str", "aliases": ["PolicyName"]} + argument_spec["policy_document"] = {"type": "str", "aliases": ["PolicyDocument"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -121,7 +126,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["policy_document", "policy_name"], True], + ["state", "present", ["policy_name", "policy_document"], True], ["state", "absent", ["policy_name"], True], ["state", "get", ["policy_name"], True], ] @@ -143,22 +148,23 @@ def main(): params["policy_name"] = module.params.get("policy_name") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["policy_name"] + create_only_params = ["/properties/PolicyName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["policy_name"] + identifier = ["/properties/PolicyName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_acl.py b/plugins/modules/memorydb_acl.py index bfb45013..69630beb 100644 --- a/plugins/modules/memorydb_acl.py +++ b/plugins/modules/memorydb_acl.py @@ -15,6 +15,8 @@ for Redis cluster. For more information, see U(https://docs.aws.amazon.com/memorydb/latest/devguide/clusters.acls.html) options: acl_name: + aliases: + - ACLName description: - The name of the acl. type: str @@ -50,12 +52,15 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). type: dict user_names: + aliases: + - UserNames description: - List of users associated to this acl. elements: str @@ -71,7 +76,7 @@ - How many seconds to wait for an operation to complete before timing out. type: int author: Ansible Cloud Team (@ansible-collections) -version_added: 0.4.0 +version_added: 0.3.0 extends_documentation_fragment: - amazon.aws.aws - amazon.aws.ec2 @@ -79,23 +84,6 @@ """ EXAMPLES = r""" - - name: Create memorydb acl with name test-acl - amazon.cloud.memorydb_acl: - acl_name: "test-acl" - tags: - env: "test" - register: acl_output - - - name: Describe the acl - amazon.cloud.memorydb_acl: - acl_name: "test-acl" - state: describe - register: acl_describe - - - name: Delete memorydb cluster - amazon.cloud.memorydb_cluster: - cluster_name: test-cluster - state: absent """ RETURN = r""" @@ -123,11 +111,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -139,12 +128,13 @@ def main(): ), ) - argument_spec["acl_name"] = {"type": "str"} + argument_spec["acl_name"] = {"type": "str", "aliases": ["ACLName"]} argument_spec["user_names"] = { "type": "list", "elements": "str", + "aliases": ["UserNames"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -179,24 +169,23 @@ def main(): params["user_names"] = module.params.get("user_names") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - if "AclName" in params_to_set: - params_to_set["ACLName"] = params_to_set.pop("AclName") + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["acl_name"] + create_only_params = ["/properties/ACLName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["acl_name"] + identifier = ["/properties/ACLName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index caf5c4fa..07a36a3c 100644 --- a/plugins/modules/memorydb_cluster.py +++ b/plugins/modules/memorydb_cluster.py @@ -14,10 +14,14 @@ - Creates or manages a MemoryDB for Redis cluster. For more information, see U(https://docs.aws.amazon.com/cli/latest/reference/memorydb/create-cluster.html) options: acl_name: + aliases: + - ACLName description: - The name of the Access Control List to associate with the cluster. type: str auto_minor_version_upgrade: + aliases: + - AutoMinorVersionUpgrade description: - A flag that enables automatic minor version upgrade when set to true. - You cannot modify the value of AutoMinorVersionUpgrade after the cluster @@ -25,17 +29,16 @@ - To enable AutoMinorVersionUpgrade on a cluster you must set AutoMinorVersionUpgrade to true when you create a cluster. type: bool - cluster_endpoint: - description: - - The cluster endpoint. - suboptions: {} - type: dict cluster_name: + aliases: + - ClusterName description: - The name of the cluster. - This value must be unique as it also serves as the cluster identifier. type: str data_tiering: + aliases: + - DataTiering choices: - 'false' - 'true' @@ -45,14 +48,20 @@ - This parameter must be set when using r6gd nodes. type: str description: + aliases: + - Description description: - An optional description of the cluster. type: str engine_version: + aliases: + - EngineVersion description: - The Redis engine version used by the cluster. type: str final_snapshot_name: + aliases: + - FinalSnapshotName description: - The user-supplied name of a final cluster snapshot. - This is the unique name that identifies the snapshot. @@ -69,10 +78,14 @@ be performed on it. type: bool kms_key_id: + aliases: + - KmsKeyId description: - The ID of the KMS key used to encrypt the cluster. type: str maintenance_window: + aliases: + - MaintenanceWindow description: - Specifies the weekly time range during which maintenance on the cluster is performed. @@ -80,33 +93,51 @@ UTC). The minimum maintenance window is a 60 minute period. type: str node_type: + aliases: + - NodeType description: - The compute and memory capacity of the nodes in the cluster. type: str num_replicas_per_shard: + aliases: + - NumReplicasPerShard description: - The number of replicas to apply to each shard. - The limit is 5. type: int num_shards: + aliases: + - NumShards description: - The number of shards the cluster will contain. type: int parameter_group_name: + aliases: + - ParameterGroupName description: - The name of the parameter group associated with the cluster. type: str + port: + aliases: + - Port + description: + - The port number on which each member of the cluster accepts connections. + type: int purge_tags: default: true description: - Remove tags not listed in I(tags). type: bool security_group_ids: + aliases: + - SecurityGroupIds description: - One or more Amazon VPC security groups associated with this cluster. elements: str type: list snapshot_arns: + aliases: + - SnapshotArns description: - A list of Amazon Resource Names (ARN) that uniquely identify the RDB snapshot files stored in Amazon S3. The snapshot files are used to populate the @@ -115,12 +146,16 @@ elements: str type: list snapshot_name: + aliases: + - SnapshotName description: - The name of a snapshot from which to restore data into the new cluster. - The snapshot status changes to restoring while the new cluster is being created. type: str snapshot_retention_limit: + aliases: + - SnapshotRetentionLimit description: - The number of days for which MemoryDB retains automatic snapshots before deleting them. @@ -128,16 +163,22 @@ taken today is retained for 5 days before being deleted. type: int snapshot_window: + aliases: + - SnapshotWindow description: - The daily time range (in UTC) during which MemoryDB begins taking a daily snapshot of your cluster. type: str sns_topic_arn: + aliases: + - SnsTopicArn description: - The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic to which notifications are sent. type: str sns_topic_status: + aliases: + - SnsTopicStatus description: - The status of the Amazon SNS notification topic. - Notifications are sent only if the status is enabled. @@ -159,17 +200,22 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str subnet_group_name: + aliases: + - SubnetGroupName description: - The name of the subnet group to be used for the cluster. type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). type: dict tls_enabled: + aliases: + - TLSEnabled description: - A flag that enables in-transit encryption when set to true. - You cannot modify the value of TransitEncryptionEnabled after the cluster @@ -188,7 +234,7 @@ - How many seconds to wait for an operation to complete before timing out. type: int author: Ansible Cloud Team (@ansible-collections) -version_added: 0.4.0 +version_added: 0.3.0 extends_documentation_fragment: - amazon.aws.aws - amazon.aws.ec2 @@ -196,27 +242,6 @@ """ EXAMPLES = r""" - - name: Create memorydb cluster with name test-cluster - amazon.cloud.memorydb_cluster: - cluster_name: test-cluster - node_type: db.t4g.small - acl_name: test-acl - parameter_group_name: test-parameter-group - subnet_group_name: test-subnet-group - wait: True - wait_timeout: 500 - tags: - env: "test" - - - name: Describe the cluster - amazon.cloud.memorydb_cluster: - cluster_name: test-cluster - state: describe - - - name: Delete memorydb cluster - amazon.cloud.memorydb_cluster: - cluster_name: test-cluster - state: absent """ RETURN = r""" @@ -244,11 +269,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -260,30 +286,60 @@ def main(): ), ) - argument_spec["cluster_name"] = {"type": "str"} - argument_spec["description"] = {"type": "str"} - argument_spec["node_type"] = {"type": "str"} - argument_spec["num_shards"] = {"type": "int"} - argument_spec["num_replicas_per_shard"] = {"type": "int"} - argument_spec["subnet_group_name"] = {"type": "str"} - argument_spec["security_group_ids"] = {"type": "list", "elements": "str"} - argument_spec["maintenance_window"] = {"type": "str"} - argument_spec["parameter_group_name"] = {"type": "str"} - argument_spec["snapshot_retention_limit"] = {"type": "int"} - argument_spec["snapshot_window"] = {"type": "str"} - argument_spec["acl_name"] = {"type": "str"} - argument_spec["sns_topic_arn"] = {"type": "str"} - argument_spec["sns_topic_status"] = {"type": "str"} - argument_spec["tls_enabled"] = {"type": "bool"} - argument_spec["data_tiering"] = {"type": "str", "choices": ["false", "true"]} - argument_spec["kms_key_id"] = {"type": "str"} - argument_spec["snapshot_arns"] = {"type": "list", "elements": "str"} - argument_spec["snapshot_name"] = {"type": "str"} - argument_spec["final_snapshot_name"] = {"type": "str"} - argument_spec["engine_version"] = {"type": "str"} - argument_spec["cluster_endpoint"] = {"type": "dict", "options": {}} - argument_spec["auto_minor_version_upgrade"] = {"type": "bool"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["cluster_name"] = {"type": "str", "aliases": ["ClusterName"]} + argument_spec["description"] = {"type": "str", "aliases": ["Description"]} + argument_spec["node_type"] = {"type": "str", "aliases": ["NodeType"]} + argument_spec["num_shards"] = {"type": "int", "aliases": ["NumShards"]} + argument_spec["num_replicas_per_shard"] = { + "type": "int", + "aliases": ["NumReplicasPerShard"], + } + argument_spec["subnet_group_name"] = {"type": "str", "aliases": ["SubnetGroupName"]} + argument_spec["security_group_ids"] = { + "type": "list", + "elements": "str", + "aliases": ["SecurityGroupIds"], + } + argument_spec["maintenance_window"] = { + "type": "str", + "aliases": ["MaintenanceWindow"], + } + argument_spec["parameter_group_name"] = { + "type": "str", + "aliases": ["ParameterGroupName"], + } + argument_spec["port"] = {"type": "int", "aliases": ["Port"]} + argument_spec["snapshot_retention_limit"] = { + "type": "int", + "aliases": ["SnapshotRetentionLimit"], + } + argument_spec["snapshot_window"] = {"type": "str", "aliases": ["SnapshotWindow"]} + argument_spec["acl_name"] = {"type": "str", "aliases": ["ACLName"]} + argument_spec["sns_topic_arn"] = {"type": "str", "aliases": ["SnsTopicArn"]} + argument_spec["sns_topic_status"] = {"type": "str", "aliases": ["SnsTopicStatus"]} + argument_spec["tls_enabled"] = {"type": "bool", "aliases": ["TLSEnabled"]} + argument_spec["data_tiering"] = { + "type": "str", + "choices": ["false", "true"], + "aliases": ["DataTiering"], + } + argument_spec["kms_key_id"] = {"type": "str", "aliases": ["KmsKeyId"]} + argument_spec["snapshot_arns"] = { + "type": "list", + "elements": "str", + "aliases": ["SnapshotArns"], + } + argument_spec["snapshot_name"] = {"type": "str", "aliases": ["SnapshotName"]} + argument_spec["final_snapshot_name"] = { + "type": "str", + "aliases": ["FinalSnapshotName"], + } + argument_spec["engine_version"] = {"type": "str", "aliases": ["EngineVersion"]} + argument_spec["auto_minor_version_upgrade"] = { + "type": "bool", + "aliases": ["AutoMinorVersionUpgrade"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -295,7 +351,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["acl_name", "cluster_name", "node_type"], True], + ["state", "present", ["cluster_name", "acl_name", "node_type"], True], ["state", "absent", ["cluster_name"], True], ["state", "get", ["cluster_name"], True], ] @@ -317,7 +373,6 @@ def main(): params["auto_minor_version_upgrade"] = module.params.get( "auto_minor_version_upgrade" ) - params["cluster_endpoint"] = module.params.get("cluster_endpoint") params["cluster_name"] = module.params.get("cluster_name") params["data_tiering"] = module.params.get("data_tiering") params["description"] = module.params.get("description") @@ -329,6 +384,7 @@ def main(): params["num_replicas_per_shard"] = module.params.get("num_replicas_per_shard") params["num_shards"] = module.params.get("num_shards") params["parameter_group_name"] = module.params.get("parameter_group_name") + params["port"] = module.params.get("port") params["security_group_ids"] = module.params.get("security_group_ids") params["snapshot_arns"] = module.params.get("snapshot_arns") params["snapshot_name"] = module.params.get("snapshot_name") @@ -341,33 +397,32 @@ def main(): params["tls_enabled"] = module.params.get("tls_enabled") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - if "AclName" in params_to_set: - params_to_set["ACLName"] = params_to_set.pop("AclName") + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation create_only_params = [ - "cluster_name", - "tls_enabled", - "data_tiering", - "kms_key_id", - "port", - "subnet_group_name", - "snapshot_arns", - "snapshot_name", + "/properties/ClusterName", + "/properties/TLSEnabled", + "/properties/DataTiering", + "/properties/KmsKeyId", + "/properties/Port", + "/properties/SubnetGroupName", + "/properties/SnapshotArns", + "/properties/SnapshotName", ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["cluster_name"] + identifier = ["/properties/ClusterName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_parameter_group.py b/plugins/modules/memorydb_parameter_group.py index ab51a7d3..c903969b 100644 --- a/plugins/modules/memorydb_parameter_group.py +++ b/plugins/modules/memorydb_parameter_group.py @@ -16,10 +16,14 @@ information, see U(https://docs.aws.amazon.com/MemoryDB/latest/devguide/parametergroups.html) options: description: + aliases: + - Description description: - A description of the parameter group. type: str family: + aliases: + - Family description: - The name of the parameter group family that this parameter group is compatible with. @@ -34,10 +38,14 @@ be performed on it. type: bool parameter_group_name: + aliases: + - ParameterGroupName description: - The name of the parameter group. type: str parameters: + aliases: + - Parameters description: - An map of parameter names and values for the parameter update. - You must supply at least one parameter name and value; subsequent arguments @@ -66,6 +74,7 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -82,7 +91,7 @@ - How many seconds to wait for an operation to complete before timing out. type: int author: Ansible Cloud Team (@ansible-collections) -version_added: 0.4.0 +version_added: 0.3.0 extends_documentation_fragment: - amazon.aws.aws - amazon.aws.ec2 @@ -90,21 +99,6 @@ """ EXAMPLES = r""" - - name: Create memorydb parameter group with name test-parameter-group - amazon.cloud.memorydb_parameter_group: - parameter_group_name: test-parameter-group - family: "memorydb_redis7" - description: "test parameter group" - tags: - env: "test" - - name: Describe the parameter group - amazon.cloud.memorydb_parameter_group: - parameter_group_name: test-parameter-group - state: describe - - name: Delete memorydb parameter group - amazon.cloud.memorydb_parameter_group: - parameter_group_name: test-parameter-group - state: absent """ RETURN = r""" @@ -132,11 +126,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -148,11 +143,14 @@ def main(): ), ) - argument_spec["parameter_group_name"] = {"type": "str"} - argument_spec["family"] = {"type": "str"} - argument_spec["description"] = {"type": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["parameters"] = {"type": "dict"} + argument_spec["parameter_group_name"] = { + "type": "str", + "aliases": ["ParameterGroupName"], + } + argument_spec["family"] = {"type": "str", "aliases": ["Family"]} + argument_spec["description"] = {"type": "str", "aliases": ["Description"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} + argument_spec["parameters"] = {"type": "dict", "aliases": ["Parameters"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -189,24 +187,27 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - if "AclName" in params_to_set: - params_to_set["ACLName"] = params_to_set.pop("AclName") + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["parameter_group_name", "family", "description"] + create_only_params = [ + "/properties/ParameterGroupName", + "/properties/Family", + "/properties/Description", + ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["parameter_group_name"] + identifier = ["/properties/ParameterGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_subnet_group.py b/plugins/modules/memorydb_subnet_group.py index 1a938822..f2e46b9b 100644 --- a/plugins/modules/memorydb_subnet_group.py +++ b/plugins/modules/memorydb_subnet_group.py @@ -18,6 +18,8 @@ to associate with your nodes. For more information, see U(https://docs.aws.amazon.com/MemoryDB/latest/devguide/subnetgroups.html) options: description: + aliases: + - Description description: - An optional description of the subnet group. type: str @@ -52,17 +54,22 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str subnet_group_name: + aliases: + - SubnetGroupName description: - The name of the subnet group. - This value must be unique as it also serves as the subnet group identifier. type: str subnet_ids: + aliases: + - SubnetIds description: - A list of VPC subnet IDs for the subnet group. elements: str type: list tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -79,7 +86,7 @@ - How many seconds to wait for an operation to complete before timing out. type: int author: Ansible Cloud Team (@ansible-collections) -version_added: 0.4.0 +version_added: 0.3.0 extends_documentation_fragment: - amazon.aws.aws - amazon.aws.ec2 @@ -87,25 +94,6 @@ """ EXAMPLES = r""" - - name: Create subnet group with name test-subnet-group - amazon.cloud.memorydb_subnet_group: - subnet_group_name: test-subnet-group - subnet_ids: - - "{{ vpc_subnet_create1.subnet.id }}" - - "{{ vpc_subnet_create2.subnet.id }}" - description: "test subnet group" - tags: - env: "test" - - - name: Describe the parameter group - amazon.cloud.memorydb_subnet_group: - subnet_group_name: test-subnet-group - state: describe - - - name: Delete memorydb subnet group - amazon.cloud.memorydb_subnet_group: - subnet_group_name: test-subnet-group - state: absent """ RETURN = r""" @@ -133,11 +121,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -149,10 +138,14 @@ def main(): ), ) - argument_spec["subnet_group_name"] = {"type": "str"} - argument_spec["description"] = {"type": "str"} - argument_spec["subnet_ids"] = {"type": "list", "elements": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["subnet_group_name"] = {"type": "str", "aliases": ["SubnetGroupName"]} + argument_spec["description"] = {"type": "str", "aliases": ["Description"]} + argument_spec["subnet_ids"] = { + "type": "list", + "elements": "str", + "aliases": ["SubnetIds"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -164,7 +157,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["subnet_group_name", "subnet_ids"], True], + ["state", "present", ["subnet_ids", "subnet_group_name"], True], ["state", "absent", ["subnet_group_name"], True], ["state", "get", ["subnet_group_name"], True], ] @@ -188,24 +181,23 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - if "AclName" in params_to_set: - params_to_set["ACLName"] = params_to_set.pop("AclName") + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["subnet_group_name"] + create_only_params = ["/properties/SubnetGroupName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["subnet_group_name"] + identifier = ["/properties/SubnetGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_user.py b/plugins/modules/memorydb_user.py index 171369ce..9d06535c 100644 --- a/plugins/modules/memorydb_user.py +++ b/plugins/modules/memorydb_user.py @@ -14,20 +14,28 @@ - Creates a MemoryDB user. For more information, see U(https://docs.aws.amazon.com/memorydb/latest/devguide/clusters.acls.html) options: access_string: + aliases: + - AccessString description: - Access permissions string used for this user account. type: str authentication_mode: + aliases: + - AuthenticationMode description: - Not Provived. suboptions: passwords: + aliases: + - Passwords description: - Passwords used for this user account. - You can create up to two passwords for each user. elements: str type: list type: + aliases: + - Type choices: - iam - password @@ -67,12 +75,15 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). type: dict user_name: + aliases: + - UserName description: - The name of the user. type: str @@ -87,7 +98,7 @@ - How many seconds to wait for an operation to complete before timing out. type: int author: Ansible Cloud Team (@ansible-collections) -version_added: 0.4.0 +version_added: 0.3.0 extends_documentation_fragment: - amazon.aws.aws - amazon.aws.ec2 @@ -122,11 +133,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -138,20 +150,21 @@ def main(): ), ) - argument_spec["user_name"] = {"type": "str"} - argument_spec["access_string"] = {"type": "str"} + argument_spec["user_name"] = {"type": "str", "aliases": ["UserName"]} + argument_spec["access_string"] = {"type": "str", "aliases": ["AccessString"]} argument_spec["authentication_mode"] = { "type": "dict", "options": { - "type": {"type": "str", "choices": ["iam", "password"]}, - "passwords": { - "type": "list", - "elements": "str", - "no_log": True, + "type": { + "type": "str", + "choices": ["iam", "password"], + "aliases": ["Type"], }, + "passwords": {"type": "list", "elements": "str", "aliases": ["Passwords"]}, }, + "aliases": ["AuthenticationMode"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -187,24 +200,23 @@ def main(): params["user_name"] = module.params.get("user_name") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - if "AclName" in params_to_set: - params_to_set["ACLName"] = params_to_set.pop("AclName") + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["user_name"] + create_only_params = ["/properties/UserName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["user_name"] + identifier = ["/properties/UserName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_db_cluster_parameter_group.py b/plugins/modules/rds_db_cluster_parameter_group.py index edddee2f..acbef884 100644 --- a/plugins/modules/rds_db_cluster_parameter_group.py +++ b/plugins/modules/rds_db_cluster_parameter_group.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -15,14 +15,20 @@ - Creates and manages an Amazon Aurora DB cluster or Multi-AZ DB cluster. options: db_cluster_parameter_group_name: + aliases: + - DBClusterParameterGroupName description: - Not Provived. type: str description: + aliases: + - Description description: - A friendly description for this DB cluster parameter group. type: str family: + aliases: + - Family description: - The DB cluster parameter group family name. - A DB cluster parameter group can be associated with one and only one DB @@ -40,6 +46,8 @@ be performed on it. type: bool parameters: + aliases: + - Parameters description: - An array of parameters to be modified. - A maximum of 20 parameters can be modified in a single request. @@ -67,6 +75,7 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -118,11 +127,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -134,11 +144,14 @@ def main(): ), ) - argument_spec["description"] = {"type": "str"} - argument_spec["family"] = {"type": "str"} - argument_spec["parameters"] = {"type": "dict"} - argument_spec["db_cluster_parameter_group_name"] = {"type": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["description"] = {"type": "str", "aliases": ["Description"]} + argument_spec["family"] = {"type": "str", "aliases": ["Family"]} + argument_spec["parameters"] = {"type": "dict", "aliases": ["Parameters"]} + argument_spec["db_cluster_parameter_group_name"] = { + "type": "str", + "aliases": ["DBClusterParameterGroupName"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -153,7 +166,7 @@ def main(): [ "state", "present", - ["family", "db_cluster_parameter_group_name", "parameters", "description"], + ["description", "parameters", "db_cluster_parameter_group_name", "family"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], @@ -182,22 +195,27 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["db_cluster_parameter_group_name", "description", "family"] + create_only_params = [ + "/properties/DBClusterParameterGroupName", + "/properties/Description", + "/properties/Family", + ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["db_cluster_parameter_group_name"] + identifier = ["/properties/DBClusterParameterGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_db_instance.py b/plugins/modules/rds_db_instance.py index d321fd53..1366dfe3 100644 --- a/plugins/modules/rds_db_instance.py +++ b/plugins/modules/rds_db_instance.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -16,23 +16,31 @@ Aurora DB cluster. options: allocated_storage: + aliases: + - AllocatedStorage description: - The amount of storage (in gigabytes) to be initially allocated for the database instance. type: str allow_major_version_upgrade: + aliases: + - AllowMajorVersionUpgrade description: - A value that indicates whether major version upgrades are allowed. - Changing this parameter doesnt result in an outage and the change is asynchronously applied as soon as possible. type: bool associated_roles: + aliases: + - AssociatedRoles description: - The AWS Identity and Access Management (IAM) roles associated with the DB instance. elements: dict suboptions: feature_name: + aliases: + - FeatureName description: - The name of the feature associated with the AWS Identity and Access Management (IAM) role. @@ -40,23 +48,31 @@ for the DB instance to access other AWS services on your behalf. type: str role_arn: + aliases: + - RoleArn description: - The Amazon Resource Name (ARN) of the IAM role that is associated with the DB instance. type: str type: list auto_minor_version_upgrade: + aliases: + - AutoMinorVersionUpgrade description: - A value that indicates whether minor engine upgrades are applied automatically to the DB instance during the maintenance window. - By default, minor engine upgrades are applied automatically. type: bool availability_zone: + aliases: + - AvailabilityZone description: - The Availability Zone (AZ) where the database will be created. - For information on AWS Regions and Availability Zones. type: str backup_retention_period: + aliases: + - BackupRetentionPeriod default: 1 description: - The number of days for which automated backups are retained. @@ -64,15 +80,14 @@ - Setting this parameter to 0 disables automated backups. type: int ca_certificate_identifier: + aliases: + - CACertificateIdentifier description: - The identifier of the CA certificate for this DB instance. type: str - certificate_details: - description: - - Returns the details of the DB instances server certificate. - suboptions: {} - type: dict certificate_rotation_restart: + aliases: + - CertificateRotationRestart description: - A value that indicates whether the DB instance is restarted when you rotate your SSL/TLS certificate. @@ -83,17 +98,23 @@ - This setting doesnt apply to RDS Custom. type: bool character_set_name: + aliases: + - CharacterSetName description: - For supported engines, indicates that the DB instance should be associated with the specified character set. type: str copy_tags_to_snapshot: + aliases: + - CopyTagsToSnapshot description: - A value that indicates whether to copy tags from the DB instance to snapshots of the DB instance. - By default, tags are not copied. type: bool custom_iam_instance_profile: + aliases: + - CustomIAMInstanceProfile description: - The instance profile associated with the underlying Amazon EC2 instance of an RDS Custom DB instance. @@ -108,10 +129,14 @@ - This setting is required for RDS Custom. type: str db_cluster_identifier: + aliases: + - DBClusterIdentifier description: - The identifier of the DB cluster that the instance will belong to. type: str db_cluster_snapshot_identifier: + aliases: + - DBClusterSnapshotIdentifier description: - The identifier for the RDS for MySQL Multi-AZ DB cluster snapshot to restore from. @@ -127,12 +152,16 @@ - '* Cant be the identifier of an RDS for PostgreSQL Multi-AZ DB cluster snapshot.' type: str db_instance_class: + aliases: + - DBInstanceClass description: - The compute and memory capacity of the DB instance, for example, db.m4.large. - Not all DB instance classes are available in all AWS Regions, or for all database engines. type: str db_instance_identifier: + aliases: + - DBInstanceIdentifier description: - A name for the DB instance. - If you specify a name, AWS CloudFormation converts it to lowercase. @@ -140,16 +169,22 @@ ID and uses that ID for the DB instance. type: str db_name: + aliases: + - DBName description: - The meaning of this parameter differs according to the database engine you use. type: str db_parameter_group_name: + aliases: + - DBParameterGroupName description: - The name of an existing DB parameter group or a reference to an AWS::RDS::DBParameterGroup resource created in the template. type: str db_security_groups: + aliases: + - DBSecurityGroups description: - A list of the DB security groups to assign to the DB instance. - The list can include both the name of existing DB security groups or references @@ -157,6 +192,8 @@ elements: str type: list db_snapshot_identifier: + aliases: + - DBSnapshotIdentifier description: - The name or Amazon Resource Name (ARN) of the DB snapshot thats used to restore the DB instance. @@ -164,12 +201,16 @@ ARN of the snapshot. type: str db_subnet_group_name: + aliases: + - DBSubnetGroupName description: - A DB subnet group to associate with the DB instance. - If you update this value, the new subnet group must be a subnet group in a new VPC. type: str delete_automated_backups: + aliases: + - DeleteAutomatedBackups description: - A value that indicates whether to remove automated backups immediately after the DB instance is deleted. @@ -178,23 +219,31 @@ is deleted. type: bool deletion_protection: + aliases: + - DeletionProtection description: - A value that indicates whether the DB instance has deletion protection enabled. - The database cant be deleted when deletion protection is enabled. - By default, deletion protection is disabled. type: bool domain: + aliases: + - Domain description: - The Active Directory directory ID to create the DB instance in. - Currently, only MySQL, Microsoft SQL Server, Oracle, and PostgreSQL DB instances can be created in an Active Directory Domain. type: str domain_iam_role_name: + aliases: + - DomainIAMRoleName description: - Specify the name of the IAM role to be used when making API calls to the Directory Service. type: str enable_cloudwatch_logs_exports: + aliases: + - EnableCloudwatchLogsExports description: - The list of log types that need to be enabled for exporting to CloudWatch Logs. @@ -202,26 +251,29 @@ elements: str type: list enable_iam_database_authentication: + aliases: + - EnableIAMDatabaseAuthentication description: - A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts. - By default, mapping is disabled. type: bool enable_performance_insights: + aliases: + - EnablePerformanceInsights description: - A value that indicates whether to enable Performance Insights for the DB instance. type: bool - endpoint: - description: - - Specifies the connection endpoint. - suboptions: {} - type: dict engine: + aliases: + - Engine description: - The name of the database engine that you want to use for this DB instance. type: str engine_version: + aliases: + - EngineVersion description: - The version number of the database engine to use. type: str @@ -235,47 +287,53 @@ be performed on it. type: bool iops: + aliases: + - Iops description: - The number of I/O operations per second (IOPS) that the database provisions. type: int kms_key_id: + aliases: + - KmsKeyId description: - The ARN of the AWS Key Management Service (AWS KMS) master key thats used to encrypt the DB instance. type: str license_model: + aliases: + - LicenseModel description: - License model information for this DB instance. type: str manage_master_user_password: + aliases: + - ManageMasterUserPassword description: - A value that indicates whether to manage the master user password with AWS Secrets Manager. type: bool master_user_password: + aliases: + - MasterUserPassword description: - The password for the master user. type: str - master_user_secret: - description: - - Contains the secret managed by RDS in AWS Secrets Manager for the master - user password. - suboptions: - kms_key_id: - description: - - The AWS KMS key identifier that is used to encrypt the secret. - type: str - type: dict master_username: + aliases: + - MasterUsername description: - The master user name for the DB instance. type: str max_allocated_storage: + aliases: + - MaxAllocatedStorage description: - The upper limit to which Amazon RDS can automatically scale the storage of the DB instance. type: int monitoring_interval: + aliases: + - MonitoringInterval default: 0 description: - The interval, in seconds, between points when Enhanced Monitoring metrics @@ -284,57 +342,85 @@ - The default is 0. type: int monitoring_role_arn: + aliases: + - MonitoringRoleArn description: - The ARN for the IAM role that permits RDS to send enhanced monitoring metrics to Amazon CloudWatch Logs. type: str multi_az: + aliases: + - MultiAZ description: - Specifies whether the database instance is a multiple Availability Zone deployment. type: bool nchar_character_set_name: + aliases: + - NcharCharacterSetName description: - The name of the NCHAR character set for the Oracle DB instance. - This parameter doesnt apply to RDS Custom. type: str network_type: + aliases: + - NetworkType description: - The network type of the DB cluster. type: str option_group_name: + aliases: + - OptionGroupName description: - Indicates that the DB instance should be associated with the specified option group. type: str performance_insights_kms_key_id: + aliases: + - PerformanceInsightsKMSKeyId description: - The AWS KMS key identifier for encryption of Performance Insights data. - The KMS key ID is the Amazon Resource Name (ARN), KMS key identifier, or the KMS key alias for the KMS encryption key. type: str performance_insights_retention_period: + aliases: + - PerformanceInsightsRetentionPeriod description: - The amount of time, in days, to retain Performance Insights data. - Valid values are 7 or 731 (2 years). type: int + port: + aliases: + - Port + description: + - The port number on which the database accepts connections. + type: str preferred_backup_window: + aliases: + - PreferredBackupWindow description: - The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter. type: str preferred_maintenance_window: + aliases: + - PreferredMaintenanceWindow description: - he weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC). type: str processor_features: + aliases: + - ProcessorFeatures description: - The number of CPU cores and the number of threads per core for the DB instance class of the DB instance. elements: dict suboptions: name: + aliases: + - Name choices: - coreCount - threadsPerCore @@ -343,17 +429,23 @@ class of the DB instance. - Valid names are coreCount and threadsPerCore. type: str value: + aliases: + - Value description: - The value of a processor feature name. type: str type: list promotion_tier: + aliases: + - PromotionTier default: 1 description: - A value that specifies the order in which an Aurora Replica is promoted to the primary instance after a failure of the existing primary instance. type: int publicly_accessible: + aliases: + - PubliclyAccessible description: - Indicates whether the DB instance is an internet-facing instance. - If you specify true, AWS CloudFormation creates an instance with a publicly @@ -367,30 +459,50 @@ class of the DB instance. - Remove tags not listed in I(tags). type: bool replica_mode: + aliases: + - ReplicaMode description: - The open mode of an Oracle read replica. - The default is open-read-only. type: str restore_time: + aliases: + - RestoreTime description: - The date and time to restore from. type: str + source_db_cluster_identifier: + aliases: + - SourceDBClusterIdentifier + description: + - The identifier of the Multi-AZ DB cluster that will act as the source for + the read replica. + - Each DB cluster can have up to 15 read replicas. + type: str source_db_instance_automated_backups_arn: + aliases: + - SourceDBInstanceAutomatedBackupsArn description: - The Amazon Resource Name (ARN) of the replicated automated backups from which to restore. type: str source_db_instance_identifier: + aliases: + - SourceDBInstanceIdentifier description: - If you want to create a Read Replica DB instance, specify the ID of the source DB instance. - Each DB instance can have a limited number of Read Replicas. type: str source_dbi_resource_id: + aliases: + - SourceDbiResourceId description: - The resource ID of the source DB instance from which to restore. type: str source_region: + aliases: + - SourceRegion description: - The ID of the region that contains the source DB instance for the Read Replica. type: str @@ -411,52 +523,71 @@ class of the DB instance. - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str storage_encrypted: + aliases: + - StorageEncrypted description: - A value that indicates whether the DB instance is encrypted. - By default, it isnt encrypted. type: bool storage_throughput: + aliases: + - StorageThroughput description: - Specifies the storage throughput for the DB instance. type: int storage_type: + aliases: + - StorageType description: - Specifies the storage type to be associated with the DB instance. type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). type: dict tde_credential_arn: + aliases: + - TdeCredentialArn description: - The ARN from the key store with which to associate the instance for TDE encryption. type: str tde_credential_password: + aliases: + - TdeCredentialPassword description: - The password for the given ARN from the key store in order to access the device. type: str timezone: + aliases: + - Timezone description: - The time zone of the DB instance. - The time zone parameter is currently supported only by Microsoft SQL Server. type: str use_default_processor_features: + aliases: + - UseDefaultProcessorFeatures description: - A value that indicates whether the DB instance class of the DB instance uses its default processor features. type: bool use_latest_restorable_time: + aliases: + - UseLatestRestorableTime description: - A value that indicates whether the DB instance is restored from the latest backup time. - By default, the DB instance isnt restored from the latest backup time. type: bool vpc_security_groups: + aliases: + - VPCSecurityGroups description: - A list of the VPC security group IDs to assign to the DB instance. - The list can include both the physical IDs of existing VPC security groups @@ -509,11 +640,12 @@ class of the DB instance. CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -525,91 +657,237 @@ def main(): ), ) - argument_spec["allocated_storage"] = {"type": "str"} - argument_spec["allow_major_version_upgrade"] = {"type": "bool"} + argument_spec["allocated_storage"] = { + "type": "str", + "aliases": ["AllocatedStorage"], + } + argument_spec["allow_major_version_upgrade"] = { + "type": "bool", + "aliases": ["AllowMajorVersionUpgrade"], + } argument_spec["associated_roles"] = { "type": "list", "elements": "dict", - "options": {"feature_name": {"type": "str"}, "role_arn": {"type": "str"}}, - } - argument_spec["auto_minor_version_upgrade"] = {"type": "bool"} - argument_spec["availability_zone"] = {"type": "str"} - argument_spec["backup_retention_period"] = {"type": "int", "default": 1} - argument_spec["ca_certificate_identifier"] = {"type": "str"} - argument_spec["certificate_details"] = {"type": "dict", "options": {}} - argument_spec["certificate_rotation_restart"] = {"type": "bool"} - argument_spec["character_set_name"] = {"type": "str"} - argument_spec["copy_tags_to_snapshot"] = {"type": "bool"} - argument_spec["custom_iam_instance_profile"] = {"type": "str"} - argument_spec["db_cluster_identifier"] = {"type": "str"} - argument_spec["db_cluster_snapshot_identifier"] = {"type": "str"} - argument_spec["db_instance_class"] = {"type": "str"} - argument_spec["db_instance_identifier"] = {"type": "str"} - argument_spec["db_name"] = {"type": "str"} - argument_spec["db_parameter_group_name"] = {"type": "str"} - argument_spec["db_security_groups"] = {"type": "list", "elements": "str"} - argument_spec["db_snapshot_identifier"] = {"type": "str"} - argument_spec["db_subnet_group_name"] = {"type": "str"} - argument_spec["delete_automated_backups"] = {"type": "bool"} - argument_spec["deletion_protection"] = {"type": "bool"} - argument_spec["domain"] = {"type": "str"} - argument_spec["domain_iam_role_name"] = {"type": "str"} + "options": { + "feature_name": {"type": "str", "aliases": ["FeatureName"]}, + "role_arn": {"type": "str", "aliases": ["RoleArn"]}, + }, + "aliases": ["AssociatedRoles"], + } + argument_spec["auto_minor_version_upgrade"] = { + "type": "bool", + "aliases": ["AutoMinorVersionUpgrade"], + } + argument_spec["availability_zone"] = { + "type": "str", + "aliases": ["AvailabilityZone"], + } + argument_spec["backup_retention_period"] = { + "type": "int", + "default": 1, + "aliases": ["BackupRetentionPeriod"], + } + argument_spec["ca_certificate_identifier"] = { + "type": "str", + "aliases": ["CACertificateIdentifier"], + } + argument_spec["certificate_rotation_restart"] = { + "type": "bool", + "aliases": ["CertificateRotationRestart"], + } + argument_spec["character_set_name"] = { + "type": "str", + "aliases": ["CharacterSetName"], + } + argument_spec["copy_tags_to_snapshot"] = { + "type": "bool", + "aliases": ["CopyTagsToSnapshot"], + } + argument_spec["custom_iam_instance_profile"] = { + "type": "str", + "aliases": ["CustomIAMInstanceProfile"], + } + argument_spec["db_cluster_identifier"] = { + "type": "str", + "aliases": ["DBClusterIdentifier"], + } + argument_spec["db_cluster_snapshot_identifier"] = { + "type": "str", + "aliases": ["DBClusterSnapshotIdentifier"], + } + argument_spec["db_instance_class"] = {"type": "str", "aliases": ["DBInstanceClass"]} + argument_spec["db_instance_identifier"] = { + "type": "str", + "aliases": ["DBInstanceIdentifier"], + } + argument_spec["db_name"] = {"type": "str", "aliases": ["DBName"]} + argument_spec["db_parameter_group_name"] = { + "type": "str", + "aliases": ["DBParameterGroupName"], + } + argument_spec["db_security_groups"] = { + "type": "list", + "elements": "str", + "aliases": ["DBSecurityGroups"], + } + argument_spec["db_snapshot_identifier"] = { + "type": "str", + "aliases": ["DBSnapshotIdentifier"], + } + argument_spec["db_subnet_group_name"] = { + "type": "str", + "aliases": ["DBSubnetGroupName"], + } + argument_spec["delete_automated_backups"] = { + "type": "bool", + "aliases": ["DeleteAutomatedBackups"], + } + argument_spec["deletion_protection"] = { + "type": "bool", + "aliases": ["DeletionProtection"], + } + argument_spec["domain"] = {"type": "str", "aliases": ["Domain"]} + argument_spec["domain_iam_role_name"] = { + "type": "str", + "aliases": ["DomainIAMRoleName"], + } argument_spec["enable_cloudwatch_logs_exports"] = { "type": "list", "elements": "str", + "aliases": ["EnableCloudwatchLogsExports"], + } + argument_spec["enable_iam_database_authentication"] = { + "type": "bool", + "aliases": ["EnableIAMDatabaseAuthentication"], + } + argument_spec["enable_performance_insights"] = { + "type": "bool", + "aliases": ["EnablePerformanceInsights"], + } + argument_spec["engine"] = {"type": "str", "aliases": ["Engine"]} + argument_spec["engine_version"] = {"type": "str", "aliases": ["EngineVersion"]} + argument_spec["manage_master_user_password"] = { + "type": "bool", + "aliases": ["ManageMasterUserPassword"], + } + argument_spec["iops"] = {"type": "int", "aliases": ["Iops"]} + argument_spec["kms_key_id"] = {"type": "str", "aliases": ["KmsKeyId"]} + argument_spec["license_model"] = {"type": "str", "aliases": ["LicenseModel"]} + argument_spec["master_username"] = {"type": "str", "aliases": ["MasterUsername"]} + argument_spec["master_user_password"] = { + "type": "str", + "aliases": ["MasterUserPassword"], + } + argument_spec["max_allocated_storage"] = { + "type": "int", + "aliases": ["MaxAllocatedStorage"], + } + argument_spec["monitoring_interval"] = { + "type": "int", + "default": 0, + "aliases": ["MonitoringInterval"], + } + argument_spec["monitoring_role_arn"] = { + "type": "str", + "aliases": ["MonitoringRoleArn"], + } + argument_spec["multi_az"] = {"type": "bool", "aliases": ["MultiAZ"]} + argument_spec["nchar_character_set_name"] = { + "type": "str", + "aliases": ["NcharCharacterSetName"], + } + argument_spec["network_type"] = {"type": "str", "aliases": ["NetworkType"]} + argument_spec["option_group_name"] = {"type": "str", "aliases": ["OptionGroupName"]} + argument_spec["performance_insights_kms_key_id"] = { + "type": "str", + "aliases": ["PerformanceInsightsKMSKeyId"], + } + argument_spec["performance_insights_retention_period"] = { + "type": "int", + "aliases": ["PerformanceInsightsRetentionPeriod"], + } + argument_spec["port"] = {"type": "str", "aliases": ["Port"]} + argument_spec["preferred_backup_window"] = { + "type": "str", + "aliases": ["PreferredBackupWindow"], + } + argument_spec["preferred_maintenance_window"] = { + "type": "str", + "aliases": ["PreferredMaintenanceWindow"], } - argument_spec["enable_iam_database_authentication"] = {"type": "bool"} - argument_spec["enable_performance_insights"] = {"type": "bool"} - argument_spec["endpoint"] = {"type": "dict", "options": {}} - argument_spec["engine"] = {"type": "str"} - argument_spec["engine_version"] = {"type": "str"} - argument_spec["manage_master_user_password"] = {"type": "bool"} - argument_spec["iops"] = {"type": "int"} - argument_spec["kms_key_id"] = {"type": "str"} - argument_spec["license_model"] = {"type": "str"} - argument_spec["master_username"] = {"type": "str"} - argument_spec["master_user_password"] = {"type": "str"} - argument_spec["master_user_secret"] = { - "type": "dict", - "options": {"kms_key_id": {"type": "str"}}, - } - argument_spec["max_allocated_storage"] = {"type": "int"} - argument_spec["monitoring_interval"] = {"type": "int", "default": 0} - argument_spec["monitoring_role_arn"] = {"type": "str"} - argument_spec["multi_az"] = {"type": "bool"} - argument_spec["nchar_character_set_name"] = {"type": "str"} - argument_spec["network_type"] = {"type": "str"} - argument_spec["option_group_name"] = {"type": "str"} - argument_spec["performance_insights_kms_key_id"] = {"type": "str"} - argument_spec["performance_insights_retention_period"] = {"type": "int"} - argument_spec["preferred_backup_window"] = {"type": "str"} - argument_spec["preferred_maintenance_window"] = {"type": "str"} argument_spec["processor_features"] = { "type": "list", "elements": "dict", "options": { - "name": {"type": "str", "choices": ["coreCount", "threadsPerCore"]}, - "value": {"type": "str"}, + "name": { + "type": "str", + "choices": ["coreCount", "threadsPerCore"], + "aliases": ["Name"], + }, + "value": {"type": "str", "aliases": ["Value"]}, }, + "aliases": ["ProcessorFeatures"], + } + argument_spec["promotion_tier"] = { + "type": "int", + "default": 1, + "aliases": ["PromotionTier"], + } + argument_spec["publicly_accessible"] = { + "type": "bool", + "aliases": ["PubliclyAccessible"], + } + argument_spec["replica_mode"] = {"type": "str", "aliases": ["ReplicaMode"]} + argument_spec["restore_time"] = {"type": "str", "aliases": ["RestoreTime"]} + argument_spec["source_db_cluster_identifier"] = { + "type": "str", + "aliases": ["SourceDBClusterIdentifier"], + } + argument_spec["source_dbi_resource_id"] = { + "type": "str", + "aliases": ["SourceDbiResourceId"], + } + argument_spec["source_db_instance_automated_backups_arn"] = { + "type": "str", + "aliases": ["SourceDBInstanceAutomatedBackupsArn"], + } + argument_spec["source_db_instance_identifier"] = { + "type": "str", + "aliases": ["SourceDBInstanceIdentifier"], + } + argument_spec["source_region"] = {"type": "str", "aliases": ["SourceRegion"]} + argument_spec["storage_encrypted"] = { + "type": "bool", + "aliases": ["StorageEncrypted"], + } + argument_spec["storage_type"] = {"type": "str", "aliases": ["StorageType"]} + argument_spec["storage_throughput"] = { + "type": "int", + "aliases": ["StorageThroughput"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} + argument_spec["tde_credential_arn"] = { + "type": "str", + "aliases": ["TdeCredentialArn"], + } + argument_spec["tde_credential_password"] = { + "type": "str", + "aliases": ["TdeCredentialPassword"], + } + argument_spec["timezone"] = {"type": "str", "aliases": ["Timezone"]} + argument_spec["use_default_processor_features"] = { + "type": "bool", + "aliases": ["UseDefaultProcessorFeatures"], + } + argument_spec["use_latest_restorable_time"] = { + "type": "bool", + "aliases": ["UseLatestRestorableTime"], + } + argument_spec["vpc_security_groups"] = { + "type": "list", + "elements": "str", + "aliases": ["VPCSecurityGroups"], } - argument_spec["promotion_tier"] = {"type": "int", "default": 1} - argument_spec["publicly_accessible"] = {"type": "bool"} - argument_spec["replica_mode"] = {"type": "str"} - argument_spec["restore_time"] = {"type": "str"} - argument_spec["source_dbi_resource_id"] = {"type": "str"} - argument_spec["source_db_instance_automated_backups_arn"] = {"type": "str"} - argument_spec["source_db_instance_identifier"] = {"type": "str"} - argument_spec["source_region"] = {"type": "str"} - argument_spec["storage_encrypted"] = {"type": "bool"} - argument_spec["storage_type"] = {"type": "str"} - argument_spec["storage_throughput"] = {"type": "int"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["tde_credential_arn"] = {"type": "str"} - argument_spec["tde_credential_password"] = {"type": "str"} - argument_spec["timezone"] = {"type": "str"} - argument_spec["use_default_processor_features"] = {"type": "bool"} - argument_spec["use_latest_restorable_time"] = {"type": "bool"} - argument_spec["vpc_security_groups"] = {"type": "list", "elements": "str"} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -650,7 +928,6 @@ def main(): params["availability_zone"] = module.params.get("availability_zone") params["backup_retention_period"] = module.params.get("backup_retention_period") params["ca_certificate_identifier"] = module.params.get("ca_certificate_identifier") - params["certificate_details"] = module.params.get("certificate_details") params["certificate_rotation_restart"] = module.params.get( "certificate_rotation_restart" ) @@ -683,7 +960,6 @@ def main(): params["enable_performance_insights"] = module.params.get( "enable_performance_insights" ) - params["endpoint"] = module.params.get("endpoint") params["engine"] = module.params.get("engine") params["engine_version"] = module.params.get("engine_version") params["iops"] = module.params.get("iops") @@ -693,7 +969,6 @@ def main(): "manage_master_user_password" ) params["master_user_password"] = module.params.get("master_user_password") - params["master_user_secret"] = module.params.get("master_user_secret") params["master_username"] = module.params.get("master_username") params["max_allocated_storage"] = module.params.get("max_allocated_storage") params["monitoring_interval"] = module.params.get("monitoring_interval") @@ -708,6 +983,7 @@ def main(): params["performance_insights_retention_period"] = module.params.get( "performance_insights_retention_period" ) + params["port"] = module.params.get("port") params["preferred_backup_window"] = module.params.get("preferred_backup_window") params["preferred_maintenance_window"] = module.params.get( "preferred_maintenance_window" @@ -717,6 +993,9 @@ def main(): params["publicly_accessible"] = module.params.get("publicly_accessible") params["replica_mode"] = module.params.get("replica_mode") params["restore_time"] = module.params.get("restore_time") + params["source_db_cluster_identifier"] = module.params.get( + "source_db_cluster_identifier" + ) params["source_db_instance_automated_backups_arn"] = module.params.get( "source_db_instance_automated_backups_arn" ) @@ -740,37 +1019,47 @@ def main(): ) params["vpc_security_groups"] = module.params.get("vpc_security_groups") + if module.params.get("engine") not in ( + "aurora", + "aurora-postgresql", + "aurora-mysql", + ): + # It can only be used when engine is one of ("aurora", "aurora-postgresql", "aurora-mysql"). + # Since the CloudFormation template assigns 'default: 1', it is always set to 1. + params.pop("promotion_tier") + # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation create_only_params = [ - "character_set_name", - "custom_iam_instance_profile", - "db_cluster_identifier", - "db_instance_identifier", - "db_name", - "db_subnet_group_name", - "kms_key_id", - "master_username", - "nchar_character_set_name", - "port", - "source_region", - "storage_encrypted", - "timezone", + "/properties/CharacterSetName", + "/properties/CustomIAMInstanceProfile", + "/properties/DBClusterIdentifier", + "/properties/DBInstanceIdentifier", + "/properties/DBName", + "/properties/DBSubnetGroupName", + "/properties/KmsKeyId", + "/properties/MasterUsername", + "/properties/NcharCharacterSetName", + "/properties/Port", + "/properties/SourceRegion", + "/properties/StorageEncrypted", + "/properties/Timezone", ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["db_instance_identifier"] + identifier = ["/properties/DBInstanceIdentifier"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index 44f8e5a7..5b3077aa 100644 --- a/plugins/modules/rds_db_proxy.py +++ b/plugins/modules/rds_db_proxy.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -14,11 +14,15 @@ - Creates and manage DB proxies. options: auth: + aliases: + - Auth description: - The authorization mechanism that the proxy uses. elements: dict suboptions: auth_scheme: + aliases: + - AuthScheme choices: - SECRETS description: @@ -26,6 +30,8 @@ the proxy to the underlying database. type: str client_password_auth_type: + aliases: + - ClientPasswordAuthType choices: - MYSQL_NATIVE_PASSWORD - POSTGRES_MD5 @@ -35,11 +41,15 @@ - The type of authentication the proxy uses for connections from clients. type: str description: + aliases: + - Description description: - A user-specified description about the authentication used by a proxy to log in as a specific database user. type: str iam_auth: + aliases: + - IAMAuth choices: - DISABLED - ENABLED @@ -52,6 +62,8 @@ SQL Server. type: str secret_arn: + aliases: + - SecretArn description: - The Amazon Resource Name (ARN) representing the secret that the proxy uses to authenticate to the RDS DB instance or Aurora DB @@ -60,17 +72,23 @@ type: str type: list db_proxy_name: + aliases: + - DBProxyName description: - The identifier for the proxy. - This name must be unique for all proxies owned by your AWS account in the specified AWS Region. type: str debug_logging: + aliases: + - DebugLogging description: - Whether the proxy includes detailed information about SQL statements in its logs. type: bool engine_family: + aliases: + - EngineFamily choices: - MYSQL - POSTGRESQL @@ -88,6 +106,8 @@ be performed on it. type: bool idle_client_timeout: + aliases: + - IdleClientTimeout description: - The number of seconds that a connection to the proxy can be inactive before the proxy disconnects it. @@ -98,11 +118,15 @@ - Remove tags not listed in I(tags). type: bool require_tls: + aliases: + - RequireTLS description: - A Boolean parameter that specifies whether Transport Layer Security (TLS) encryption is required for connections to the proxy. type: bool role_arn: + aliases: + - RoleArn description: - The Amazon Resource Name (ARN) of the IAM role that the proxy uses to access secrets in AWS Secrets Manager. @@ -125,17 +149,22 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). type: dict vpc_security_group_ids: + aliases: + - VpcSecurityGroupIds description: - VPC security group IDs to associate with the new proxy. elements: str type: list vpc_subnet_ids: + aliases: + - VpcSubnetIds description: - VPC subnet IDs to associate with the new proxy. elements: str @@ -151,7 +180,7 @@ - How many seconds to wait for an operation to complete before timing out. type: int author: Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 0.2.0 extends_documentation_fragment: - amazon.aws.aws - amazon.aws.ec2 @@ -186,11 +215,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -206,10 +236,18 @@ def main(): "type": "list", "elements": "dict", "options": { - "auth_scheme": {"type": "str", "choices": ["SECRETS"]}, - "description": {"type": "str"}, - "iam_auth": {"type": "str", "choices": ["DISABLED", "ENABLED", "REQUIRED"]}, - "secret_arn": {"type": "str"}, + "auth_scheme": { + "type": "str", + "choices": ["SECRETS"], + "aliases": ["AuthScheme"], + }, + "description": {"type": "str", "aliases": ["Description"]}, + "iam_auth": { + "type": "str", + "choices": ["DISABLED", "ENABLED", "REQUIRED"], + "aliases": ["IAMAuth"], + }, + "secret_arn": {"type": "str", "aliases": ["SecretArn"]}, "client_password_auth_type": { "type": "str", "choices": [ @@ -218,21 +256,35 @@ def main(): "POSTGRES_SCRAM_SHA_256", "SQL_SERVER_AUTHENTICATION", ], + "aliases": ["ClientPasswordAuthType"], }, }, + "aliases": ["Auth"], } - argument_spec["db_proxy_name"] = {"type": "str"} - argument_spec["debug_logging"] = {"type": "bool"} + argument_spec["db_proxy_name"] = {"type": "str", "aliases": ["DBProxyName"]} + argument_spec["debug_logging"] = {"type": "bool", "aliases": ["DebugLogging"]} argument_spec["engine_family"] = { "type": "str", "choices": ["MYSQL", "POSTGRESQL", "SQLSERVER"], + "aliases": ["EngineFamily"], + } + argument_spec["idle_client_timeout"] = { + "type": "int", + "aliases": ["IdleClientTimeout"], + } + argument_spec["require_tls"] = {"type": "bool", "aliases": ["RequireTLS"]} + argument_spec["role_arn"] = {"type": "str", "aliases": ["RoleArn"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} + argument_spec["vpc_security_group_ids"] = { + "type": "list", + "elements": "str", + "aliases": ["VpcSecurityGroupIds"], + } + argument_spec["vpc_subnet_ids"] = { + "type": "list", + "elements": "str", + "aliases": ["VpcSubnetIds"], } - argument_spec["idle_client_timeout"] = {"type": "int"} - argument_spec["require_tls"] = {"type": "bool"} - argument_spec["role_arn"] = {"type": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["vpc_security_group_ids"] = {"type": "list", "elements": "str"} - argument_spec["vpc_subnet_ids"] = {"type": "list", "elements": "str"} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -247,7 +299,7 @@ def main(): [ "state", "present", - ["vpc_subnet_ids", "role_arn", "auth", "db_proxy_name", "engine_family"], + ["engine_family", "role_arn", "vpc_subnet_ids", "auth", "db_proxy_name"], True, ], ["state", "absent", ["db_proxy_name"], True], @@ -279,22 +331,27 @@ def main(): params["vpc_subnet_ids"] = module.params.get("vpc_subnet_ids") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["db_proxy_name", "engine_family", "vpc_subnet_ids"] + create_only_params = [ + "/properties/DBProxyName", + "/properties/EngineFamily", + "/properties/VpcSubnetIds", + ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["db_proxy_name"] + identifier = ["/properties/DBProxyName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_db_proxy_endpoint.py b/plugins/modules/rds_db_proxy_endpoint.py index f7cbfbd2..75834853 100644 --- a/plugins/modules/rds_db_proxy_endpoint.py +++ b/plugins/modules/rds_db_proxy_endpoint.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -16,12 +16,16 @@ the proxy's default VPC. options: db_proxy_endpoint_name: + aliases: + - DBProxyEndpointName description: - The identifier for the DB proxy endpoint. - This name must be unique for all DB proxy endpoints owned by your AWS account in the specified AWS Region. type: str db_proxy_name: + aliases: + - DBProxyName description: - The identifier for the proxy. - This name must be unique for all proxies owned by your AWS account in the @@ -59,17 +63,32 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). type: dict + target_role: + aliases: + - TargetRole + choices: + - READ_ONLY + - READ_WRITE + description: + - A value that indicates whether the DB proxy endpoint can be used for read/write + or read-only operations. + type: str vpc_security_group_ids: + aliases: + - VpcSecurityGroupIds description: - VPC security group IDs to associate with the new DB proxy endpoint. elements: str type: list vpc_subnet_ids: + aliases: + - VpcSubnetIds description: - VPC subnet IDs to associate with the new DB proxy endpoint. elements: str @@ -120,11 +139,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -136,11 +156,27 @@ def main(): ), ) - argument_spec["db_proxy_endpoint_name"] = {"type": "str"} - argument_spec["db_proxy_name"] = {"type": "str"} - argument_spec["vpc_security_group_ids"] = {"type": "list", "elements": "str"} - argument_spec["vpc_subnet_ids"] = {"type": "list", "elements": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["db_proxy_endpoint_name"] = { + "type": "str", + "aliases": ["DBProxyEndpointName"], + } + argument_spec["db_proxy_name"] = {"type": "str", "aliases": ["DBProxyName"]} + argument_spec["vpc_security_group_ids"] = { + "type": "list", + "elements": "str", + "aliases": ["VpcSecurityGroupIds"], + } + argument_spec["vpc_subnet_ids"] = { + "type": "list", + "elements": "str", + "aliases": ["VpcSubnetIds"], + } + argument_spec["target_role"] = { + "type": "str", + "choices": ["READ_ONLY", "READ_WRITE"], + "aliases": ["TargetRole"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -178,26 +214,32 @@ def main(): params["db_proxy_endpoint_name"] = module.params.get("db_proxy_endpoint_name") params["db_proxy_name"] = module.params.get("db_proxy_name") params["tags"] = module.params.get("tags") + params["target_role"] = module.params.get("target_role") params["vpc_security_group_ids"] = module.params.get("vpc_security_group_ids") params["vpc_subnet_ids"] = module.params.get("vpc_subnet_ids") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["db_proxy_name", "db_proxy_endpoint_name", "vpc_subnet_ids"] + create_only_params = [ + "/properties/DBProxyName", + "/properties/DBProxyEndpointName", + "/properties/VpcSubnetIds", + ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["db_proxy_endpoint_name"] + identifier = ["/properties/DBProxyEndpointName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_db_subnet_group.py b/plugins/modules/rds_db_subnet_group.py index 2f489a3d..b9e87993 100644 --- a/plugins/modules/rds_db_subnet_group.py +++ b/plugins/modules/rds_db_subnet_group.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -16,10 +16,14 @@ in the same region. options: db_subnet_group_description: + aliases: + - DBSubnetGroupDescription description: - Not Provived. type: str db_subnet_group_name: + aliases: + - DBSubnetGroupName description: - Not Provived. type: str @@ -54,12 +58,15 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str subnet_ids: + aliases: + - SubnetIds description: - Not Provived. elements: str type: list tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -111,11 +118,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -127,10 +135,20 @@ def main(): ), ) - argument_spec["db_subnet_group_description"] = {"type": "str"} - argument_spec["db_subnet_group_name"] = {"type": "str"} - argument_spec["subnet_ids"] = {"type": "list", "elements": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["db_subnet_group_description"] = { + "type": "str", + "aliases": ["DBSubnetGroupDescription"], + } + argument_spec["db_subnet_group_name"] = { + "type": "str", + "aliases": ["DBSubnetGroupName"], + } + argument_spec["subnet_ids"] = { + "type": "list", + "elements": "str", + "aliases": ["SubnetIds"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -145,7 +163,7 @@ def main(): [ "state", "present", - ["db_subnet_group_name", "db_subnet_group_description", "subnet_ids"], + ["subnet_ids", "db_subnet_group_description", "db_subnet_group_name"], True, ], ["state", "absent", ["db_subnet_group_name"], True], @@ -173,22 +191,23 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["db_subnet_group_name"] + create_only_params = ["/properties/DBSubnetGroupName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["db_subnet_group_name"] + identifier = ["/properties/DBSubnetGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_global_cluster.py b/plugins/modules/rds_global_cluster.py index 214c955a..77e03ac7 100644 --- a/plugins/modules/rds_global_cluster.py +++ b/plugins/modules/rds_global_cluster.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -16,11 +16,15 @@ Regions. options: deletion_protection: + aliases: + - DeletionProtection description: - The deletion protection setting for the new global database. - The global database cant be deleted when deletion protection is enabled. type: bool engine: + aliases: + - Engine choices: - aurora - aurora-mysql @@ -34,6 +38,8 @@ - The value is inherited from the cluster. type: str engine_version: + aliases: + - EngineVersion description: - The version number of the database engine to use. - If you specify the SourceDBClusterIdentifier property, dont specify this @@ -50,11 +56,15 @@ be performed on it. type: bool global_cluster_identifier: + aliases: + - GlobalClusterIdentifier description: - The cluster identifier of the new global database cluster. - This parameter is stored as a lowercase string. type: str source_db_cluster_identifier: + aliases: + - SourceDBClusterIdentifier description: - The Amazon Resource Name (ARN) to use as the primary cluster of the global database. @@ -79,6 +89,8 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str storage_encrypted: + aliases: + - StorageEncrypted description: - The storage encryption setting for the new global database cluster. - If you specify the SourceDBClusterIdentifier property, dont specify this @@ -131,11 +143,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -150,12 +163,26 @@ def main(): argument_spec["engine"] = { "type": "str", "choices": ["aurora", "aurora-mysql", "aurora-postgresql"], + "aliases": ["Engine"], + } + argument_spec["engine_version"] = {"type": "str", "aliases": ["EngineVersion"]} + argument_spec["deletion_protection"] = { + "type": "bool", + "aliases": ["DeletionProtection"], + } + argument_spec["global_cluster_identifier"] = { + "type": "str", + "aliases": ["GlobalClusterIdentifier"], + } + argument_spec["source_db_cluster_identifier"] = { + "type": "str", + "options": {}, + "aliases": ["SourceDBClusterIdentifier"], + } + argument_spec["storage_encrypted"] = { + "type": "bool", + "aliases": ["StorageEncrypted"], } - argument_spec["engine_version"] = {"type": "str"} - argument_spec["deletion_protection"] = {"type": "bool"} - argument_spec["global_cluster_identifier"] = {"type": "str"} - argument_spec["source_db_cluster_identifier"] = {"type": "str", "options": {}} - argument_spec["storage_encrypted"] = {"type": "bool"} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -194,28 +221,28 @@ def main(): params["storage_encrypted"] = module.params.get("storage_encrypted") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation create_only_params = [ - "global_cluster_identifier", - "source_db_cluster_identifier", - "storage_encrypted", - "engine", - "engine_version", + "/properties/GlobalClusterIdentifier", + "/properties/SourceDBClusterIdentifier", + "/properties/StorageEncrypted", + "/properties/Engine", ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["global_cluster_identifier"] + identifier = ["/properties/GlobalClusterIdentifier"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_option_group.py b/plugins/modules/rds_option_group.py index ea68814b..3fac819a 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -15,6 +15,8 @@ to a particular DB engine. options: engine_name: + aliases: + - EngineName description: - Indicates the name of the engine that this option group can be applied to. type: str @@ -28,48 +30,68 @@ be performed on it. type: bool major_engine_version: + aliases: + - MajorEngineVersion description: - Indicates the major engine version associated with this option group. type: str option_configurations: + aliases: + - OptionConfigurations description: - The I(option_configuration) property type specifies an individual option, and its settings, within an AWS::RDS::OptionGroup resource. elements: dict suboptions: db_security_group_memberships: + aliases: + - DBSecurityGroupMemberships description: - A list of DBSecurityGroupMembership name strings used for this option. elements: str type: list option_name: + aliases: + - OptionName description: - The configuration of options to include in a group. type: str option_settings: + aliases: + - OptionSettings description: - The I(option_setting) property type specifies the value for an option within an I(option_setting) property. elements: dict suboptions: name: + aliases: + - Name description: - The name of the option that has settings that you can set. type: str value: + aliases: + - Value description: - The current value of the option setting. type: str type: list option_version: + aliases: + - OptionVersion description: - The version for the option. type: str port: + aliases: + - Port description: - The optional port for the option. type: int vpc_security_group_memberships: + aliases: + - VpcSecurityGroupMemberships description: - A list of VpcSecurityGroupMembership name strings used for this option. @@ -77,10 +99,14 @@ type: list type: list option_group_description: + aliases: + - OptionGroupDescription description: - Provides a description of the option group. type: str option_group_name: + aliases: + - OptionGroupName description: - Specifies the name of the option group. type: str @@ -107,6 +133,7 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -158,11 +185,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -174,27 +202,46 @@ def main(): ), ) - argument_spec["option_group_name"] = {"type": "str"} - argument_spec["option_group_description"] = {"type": "str"} - argument_spec["engine_name"] = {"type": "str"} - argument_spec["major_engine_version"] = {"type": "str"} + argument_spec["option_group_name"] = {"type": "str", "aliases": ["OptionGroupName"]} + argument_spec["option_group_description"] = { + "type": "str", + "aliases": ["OptionGroupDescription"], + } + argument_spec["engine_name"] = {"type": "str", "aliases": ["EngineName"]} + argument_spec["major_engine_version"] = { + "type": "str", + "aliases": ["MajorEngineVersion"], + } argument_spec["option_configurations"] = { "type": "list", "elements": "dict", "options": { - "db_security_group_memberships": {"type": "list", "elements": "str"}, - "option_name": {"type": "str"}, + "db_security_group_memberships": { + "type": "list", + "elements": "str", + "aliases": ["DBSecurityGroupMemberships"], + }, + "option_name": {"type": "str", "aliases": ["OptionName"]}, "option_settings": { "type": "list", "elements": "dict", - "options": {"name": {"type": "str"}, "value": {"type": "str"}}, + "options": { + "name": {"type": "str", "aliases": ["Name"]}, + "value": {"type": "str", "aliases": ["Value"]}, + }, + "aliases": ["OptionSettings"], + }, + "option_version": {"type": "str", "aliases": ["OptionVersion"]}, + "port": {"type": "int", "aliases": ["Port"]}, + "vpc_security_group_memberships": { + "type": "list", + "elements": "str", + "aliases": ["VpcSecurityGroupMemberships"], }, - "option_version": {"type": "str"}, - "port": {"type": "int"}, - "vpc_security_group_memberships": {"type": "list", "elements": "str"}, }, + "aliases": ["OptionConfigurations"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -211,9 +258,9 @@ def main(): "present", [ "engine_name", + "option_group_description", "option_group_name", "major_engine_version", - "option_group_description", ], True, ], @@ -242,27 +289,28 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation create_only_params = [ - "engine_name", - "major_engine_version", - "option_group_description", - "option_group_name", + "/properties/EngineName", + "/properties/MajorEngineVersion", + "/properties/OptionGroupDescription", + "/properties/OptionGroupName", ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["option_group_name"] + identifier = ["/properties/OptionGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index 9bb6dc12..989c178e 100644 --- a/plugins/modules/redshift_cluster.py +++ b/plugins/modules/redshift_cluster.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -14,12 +14,16 @@ - Creates and manage clusters. options: allow_version_upgrade: + aliases: + - AllowVersionUpgrade description: - Major version upgrades can be applied during the maintenance window to the Amazon Redshift engine that is running on the cluster. - Default value is True. type: bool aqua_configuration_status: + aliases: + - AquaConfigurationStatus description: - The value represents how the cluster is configured to use AQUA (Advanced Query Accelerator) after the cluster is restored. @@ -30,12 +34,16 @@ - auto - Amazon Redshift determines whether to use AQUA. type: str automated_snapshot_retention_period: + aliases: + - AutomatedSnapshotRetentionPeriod description: - The number of days that automated snapshots are retained. - If the value is 0, automated snapshots are disabled. - Default value is 1. type: int availability_zone: + aliases: + - AvailabilityZone description: - The EC2 Availability Zone (AZ) in which you want Amazon Redshift to provision the cluster. @@ -43,15 +51,21 @@ specified by the endpoint.' type: str availability_zone_relocation: + aliases: + - AvailabilityZoneRelocation description: - The option to enable relocation for an Amazon Redshift cluster between Availability Zones after the cluster modification is complete. type: bool availability_zone_relocation_status: + aliases: + - AvailabilityZoneRelocationStatus description: - The availability zone relocation status of the cluster. type: str classic: + aliases: + - Classic description: - A boolean value indicating whether the resize operation is using the classic resize process. @@ -59,6 +73,8 @@ type is elastic. type: bool cluster_identifier: + aliases: + - ClusterIdentifier description: - A unique identifier for the cluster. - You use this identifier to refer to the cluster for any subsequent cluster @@ -68,55 +84,77 @@ - Cluster name should be unique for all clusters within an AWS account. type: str cluster_parameter_group_name: + aliases: + - ClusterParameterGroupName description: - The name of the parameter group to be associated with this cluster. type: str cluster_security_groups: + aliases: + - ClusterSecurityGroups description: - A list of security groups to be associated with this cluster. elements: str type: list cluster_subnet_group_name: + aliases: + - ClusterSubnetGroupName description: - The name of a cluster subnet group to be associated with this cluster. type: str cluster_type: + aliases: + - ClusterType description: - The type of the cluster. - When cluster type is specified as single-node, the NumberOfNodes parameter is not required and if multi-node, the NumberOfNodes parameter is required. type: str cluster_version: + aliases: + - ClusterVersion description: - The version of the Amazon Redshift engine software that you want to deploy on the cluster.The version selected runs on all the nodes in the cluster. type: str db_name: + aliases: + - DBName description: - The name of the first database to be created when the cluster is created. - To create additional databases after the cluster is created, connect to the cluster with a SQL client and use SQL commands to create a database. type: str defer_maintenance: + aliases: + - DeferMaintenance description: - A boolean indicating whether to enable the deferred maintenance window. type: bool defer_maintenance_duration: + aliases: + - DeferMaintenanceDuration description: - An integer indicating the duration of the maintenance window in days. - If you specify a duration, you cant specify an end time. - The duration must be 45 days or less. type: int defer_maintenance_end_time: + aliases: + - DeferMaintenanceEndTime description: - A timestamp indicating end time for the deferred maintenance window. - If you specify an end time, you cant specify a duration. type: str defer_maintenance_start_time: + aliases: + - DeferMaintenanceStartTime description: - A timestamp indicating the start time for the deferred maintenance window. type: str destination_region: + aliases: + - DestinationRegion description: - The destination AWS Region that you want to copy snapshots to. - 'Constraints: Must be the name of a valid AWS Region.' @@ -124,19 +162,20 @@ ) General Reference. type: str elastic_ip: + aliases: + - ElasticIp description: - The Elastic IP (EIP) address for the cluster. type: str encrypted: + aliases: + - Encrypted description: - If true, the data in the cluster is encrypted at rest. type: bool - endpoint: - description: - - Not Provived. - suboptions: {} - type: dict enhanced_vpc_routing: + aliases: + - EnhancedVpcRouting description: - An option that specifies whether to create the cluster with enhanced VPC routing enabled. @@ -156,16 +195,22 @@ be performed on it. type: bool hsm_client_certificate_identifier: + aliases: + - HsmClientCertificateIdentifier description: - Specifies the name of the HSM client certificate the Amazon Redshift cluster uses to retrieve the data encryption keys stored in an HSM. type: str hsm_configuration_identifier: + aliases: + - HsmConfigurationIdentifier description: - Specifies the name of the HSM configuration that contains the information the Amazon Redshift cluster can use to retrieve and store keys in an HSM. type: str iam_roles: + aliases: + - IamRoles description: - A list of AWS Identity and Access Management (IAM) roles that can be used by the cluster to access other AWS services. @@ -174,24 +219,34 @@ elements: str type: list kms_key_id: + aliases: + - KmsKeyId description: - The AWS Key Management Service (KMS) key ID of the encryption key that you want to use to encrypt data in the cluster. type: str logging_properties: + aliases: + - LoggingProperties description: - Not Provived. suboptions: bucket_name: + aliases: + - BucketName description: - Not Provived. type: str s3_key_prefix: + aliases: + - S3KeyPrefix description: - Not Provived. type: str type: dict maintenance_track_name: + aliases: + - MaintenanceTrackName description: - The name for the maintenance track that you want to assign for the cluster. - This name change is asynchronous. @@ -202,6 +257,8 @@ - At this point, the maintenance track name is applied. type: str manual_snapshot_retention_period: + aliases: + - ManualSnapshotRetentionPeriod description: - The number of days to retain newly copied snapshots in the destination AWS Region after they are copied from the source AWS Region. @@ -209,6 +266,8 @@ - The value must be either -1 or an integer between 1 and 3,653. type: int master_user_password: + aliases: + - MasterUserPassword description: - The password associated with the master user account for the cluster that is being created. @@ -217,33 +276,52 @@ one number.Can be any printable ASCII character. type: str master_username: + aliases: + - MasterUsername description: - The user name associated with the master user account for the cluster that is being created. - The user name cant be PUBLIC and first character must be a letter. type: str node_type: + aliases: + - NodeType description: - 'The node type to be provisioned for the cluster.Valid Values: ds2.xlarge | ds2.8xlarge | dc1.large | dc1.8xlarge | dc2.large | dc2.8xlarge | ra3.4xlarge | ra3.16xlarge.' type: str number_of_nodes: + aliases: + - NumberOfNodes description: - The number of compute nodes in the cluster. - This parameter is required when the ClusterType parameter is specified as multi-node. type: int owner_account: + aliases: + - OwnerAccount description: - Not Provived. type: str + port: + aliases: + - Port + description: + - The port number on which the cluster accepts incoming connections. + - The cluster is accessible only via the JDBC and ODBC connection strings. + type: int preferred_maintenance_window: + aliases: + - PreferredMaintenanceWindow description: - The weekly time range (in UTC) during which automated cluster maintenance can occur. type: str publicly_accessible: + aliases: + - PubliclyAccessible description: - If true, the cluster can be accessed from a public network. type: bool @@ -253,21 +331,29 @@ - Remove tags not listed in I(tags). type: bool resource_action: + aliases: + - ResourceAction description: - The Redshift operation to be performed. - Resource Action supports pause-cluster, resume-cluster APIs. type: str revision_target: + aliases: + - RevisionTarget description: - The identifier of the database revision. - You can retrieve this value from the response to the DescribeClusterDbRevisions request. type: str rotate_encryption_key: + aliases: + - RotateEncryptionKey description: - A boolean indicating if we want to rotate Encryption Keys. type: bool snapshot_cluster_identifier: + aliases: + - SnapshotClusterIdentifier description: - The name of the cluster the source snapshot was created from. - This parameter is required if your IAM user has a policy containing a snapshot @@ -275,16 +361,22 @@ name. type: str snapshot_copy_grant_name: + aliases: + - SnapshotCopyGrantName description: - The name of the snapshot copy grant to use when snapshots of an AWS KMS-encrypted cluster are copied to the destination region. type: str snapshot_copy_manual: + aliases: + - SnapshotCopyManual description: - Indicates whether to apply the snapshot retention period to newly copied manual snapshots instead of automated snapshots. type: bool snapshot_copy_retention_period: + aliases: + - SnapshotCopyRetentionPeriod description: - The number of days to retain automated snapshots in the destination region after they are copied from the source region. @@ -292,6 +384,8 @@ - 'Constraints: Must be at least 1 and no more than 35.' type: int snapshot_identifier: + aliases: + - SnapshotIdentifier description: - The name of the snapshot from which to create the new cluster. - This parameter isnt case sensitive. @@ -314,12 +408,15 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). type: dict vpc_security_group_ids: + aliases: + - VpcSecurityGroupIds description: - A list of Virtual Private Cloud (VPC) security groups to be associated with the cluster. @@ -371,11 +468,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -387,56 +485,156 @@ def main(): ), ) - argument_spec["cluster_identifier"] = {"type": "str"} - argument_spec["master_username"] = {"type": "str"} - argument_spec["master_user_password"] = {"type": "str"} - argument_spec["node_type"] = {"type": "str"} - argument_spec["allow_version_upgrade"] = {"type": "bool"} - argument_spec["automated_snapshot_retention_period"] = {"type": "int"} - argument_spec["availability_zone"] = {"type": "str"} - argument_spec["cluster_parameter_group_name"] = {"type": "str"} - argument_spec["cluster_type"] = {"type": "str"} - argument_spec["cluster_version"] = {"type": "str"} - argument_spec["cluster_subnet_group_name"] = {"type": "str"} - argument_spec["db_name"] = {"type": "str"} - argument_spec["elastic_ip"] = {"type": "str"} - argument_spec["encrypted"] = {"type": "bool"} - argument_spec["hsm_client_certificate_identifier"] = {"type": "str"} - argument_spec["hsm_configuration_identifier"] = {"type": "str"} - argument_spec["kms_key_id"] = {"type": "str"} - argument_spec["number_of_nodes"] = {"type": "int"} - argument_spec["preferred_maintenance_window"] = {"type": "str"} - argument_spec["publicly_accessible"] = {"type": "bool"} - argument_spec["cluster_security_groups"] = {"type": "list", "elements": "str"} - argument_spec["iam_roles"] = {"type": "list", "elements": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["vpc_security_group_ids"] = {"type": "list", "elements": "str"} - argument_spec["snapshot_cluster_identifier"] = {"type": "str"} - argument_spec["snapshot_identifier"] = {"type": "str"} - argument_spec["owner_account"] = {"type": "str"} + argument_spec["cluster_identifier"] = { + "type": "str", + "aliases": ["ClusterIdentifier"], + } + argument_spec["master_username"] = {"type": "str", "aliases": ["MasterUsername"]} + argument_spec["master_user_password"] = { + "type": "str", + "aliases": ["MasterUserPassword"], + } + argument_spec["node_type"] = {"type": "str", "aliases": ["NodeType"]} + argument_spec["allow_version_upgrade"] = { + "type": "bool", + "aliases": ["AllowVersionUpgrade"], + } + argument_spec["automated_snapshot_retention_period"] = { + "type": "int", + "aliases": ["AutomatedSnapshotRetentionPeriod"], + } + argument_spec["availability_zone"] = { + "type": "str", + "aliases": ["AvailabilityZone"], + } + argument_spec["cluster_parameter_group_name"] = { + "type": "str", + "aliases": ["ClusterParameterGroupName"], + } + argument_spec["cluster_type"] = {"type": "str", "aliases": ["ClusterType"]} + argument_spec["cluster_version"] = {"type": "str", "aliases": ["ClusterVersion"]} + argument_spec["cluster_subnet_group_name"] = { + "type": "str", + "aliases": ["ClusterSubnetGroupName"], + } + argument_spec["db_name"] = {"type": "str", "aliases": ["DBName"]} + argument_spec["elastic_ip"] = {"type": "str", "aliases": ["ElasticIp"]} + argument_spec["encrypted"] = {"type": "bool", "aliases": ["Encrypted"]} + argument_spec["hsm_client_certificate_identifier"] = { + "type": "str", + "aliases": ["HsmClientCertificateIdentifier"], + } + argument_spec["hsm_configuration_identifier"] = { + "type": "str", + "aliases": ["HsmConfigurationIdentifier"], + } + argument_spec["kms_key_id"] = {"type": "str", "aliases": ["KmsKeyId"]} + argument_spec["number_of_nodes"] = {"type": "int", "aliases": ["NumberOfNodes"]} + argument_spec["port"] = {"type": "int", "aliases": ["Port"]} + argument_spec["preferred_maintenance_window"] = { + "type": "str", + "aliases": ["PreferredMaintenanceWindow"], + } + argument_spec["publicly_accessible"] = { + "type": "bool", + "aliases": ["PubliclyAccessible"], + } + argument_spec["cluster_security_groups"] = { + "type": "list", + "elements": "str", + "aliases": ["ClusterSecurityGroups"], + } + argument_spec["iam_roles"] = { + "type": "list", + "elements": "str", + "aliases": ["IamRoles"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} + argument_spec["vpc_security_group_ids"] = { + "type": "list", + "elements": "str", + "aliases": ["VpcSecurityGroupIds"], + } + argument_spec["snapshot_cluster_identifier"] = { + "type": "str", + "aliases": ["SnapshotClusterIdentifier"], + } + argument_spec["snapshot_identifier"] = { + "type": "str", + "aliases": ["SnapshotIdentifier"], + } + argument_spec["owner_account"] = {"type": "str", "aliases": ["OwnerAccount"]} argument_spec["logging_properties"] = { "type": "dict", - "options": {"bucket_name": {"type": "str"}, "s3_key_prefix": {"type": "str"}}, - } - argument_spec["endpoint"] = {"type": "dict", "options": {}} - argument_spec["destination_region"] = {"type": "str"} - argument_spec["snapshot_copy_retention_period"] = {"type": "int"} - argument_spec["snapshot_copy_grant_name"] = {"type": "str"} - argument_spec["manual_snapshot_retention_period"] = {"type": "int"} - argument_spec["snapshot_copy_manual"] = {"type": "bool"} - argument_spec["availability_zone_relocation"] = {"type": "bool"} - argument_spec["availability_zone_relocation_status"] = {"type": "str"} - argument_spec["aqua_configuration_status"] = {"type": "str"} - argument_spec["classic"] = {"type": "bool"} - argument_spec["enhanced_vpc_routing"] = {"type": "bool"} - argument_spec["maintenance_track_name"] = {"type": "str"} - argument_spec["defer_maintenance"] = {"type": "bool"} - argument_spec["defer_maintenance_start_time"] = {"type": "str"} - argument_spec["defer_maintenance_end_time"] = {"type": "str"} - argument_spec["defer_maintenance_duration"] = {"type": "int"} - argument_spec["revision_target"] = {"type": "str"} - argument_spec["resource_action"] = {"type": "str"} - argument_spec["rotate_encryption_key"] = {"type": "bool"} + "options": { + "bucket_name": {"type": "str", "aliases": ["BucketName"]}, + "s3_key_prefix": {"type": "str", "aliases": ["S3KeyPrefix"]}, + }, + "aliases": ["LoggingProperties"], + } + argument_spec["destination_region"] = { + "type": "str", + "aliases": ["DestinationRegion"], + } + argument_spec["snapshot_copy_retention_period"] = { + "type": "int", + "aliases": ["SnapshotCopyRetentionPeriod"], + } + argument_spec["snapshot_copy_grant_name"] = { + "type": "str", + "aliases": ["SnapshotCopyGrantName"], + } + argument_spec["manual_snapshot_retention_period"] = { + "type": "int", + "aliases": ["ManualSnapshotRetentionPeriod"], + } + argument_spec["snapshot_copy_manual"] = { + "type": "bool", + "aliases": ["SnapshotCopyManual"], + } + argument_spec["availability_zone_relocation"] = { + "type": "bool", + "aliases": ["AvailabilityZoneRelocation"], + } + argument_spec["availability_zone_relocation_status"] = { + "type": "str", + "aliases": ["AvailabilityZoneRelocationStatus"], + } + argument_spec["aqua_configuration_status"] = { + "type": "str", + "aliases": ["AquaConfigurationStatus"], + } + argument_spec["classic"] = {"type": "bool", "aliases": ["Classic"]} + argument_spec["enhanced_vpc_routing"] = { + "type": "bool", + "aliases": ["EnhancedVpcRouting"], + } + argument_spec["maintenance_track_name"] = { + "type": "str", + "aliases": ["MaintenanceTrackName"], + } + argument_spec["defer_maintenance"] = { + "type": "bool", + "aliases": ["DeferMaintenance"], + } + argument_spec["defer_maintenance_start_time"] = { + "type": "str", + "aliases": ["DeferMaintenanceStartTime"], + } + argument_spec["defer_maintenance_end_time"] = { + "type": "str", + "aliases": ["DeferMaintenanceEndTime"], + } + argument_spec["defer_maintenance_duration"] = { + "type": "int", + "aliases": ["DeferMaintenanceDuration"], + } + argument_spec["revision_target"] = {"type": "str", "aliases": ["RevisionTarget"]} + argument_spec["resource_action"] = {"type": "str", "aliases": ["ResourceAction"]} + argument_spec["rotate_encryption_key"] = { + "type": "bool", + "aliases": ["RotateEncryptionKey"], + } argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -452,11 +650,11 @@ def main(): "state", "present", [ - "cluster_type", - "master_user_password", - "db_name", "cluster_identifier", + "master_user_password", "master_username", + "db_name", + "cluster_type", "node_type", ], True, @@ -513,7 +711,6 @@ def main(): params["destination_region"] = module.params.get("destination_region") params["elastic_ip"] = module.params.get("elastic_ip") params["encrypted"] = module.params.get("encrypted") - params["endpoint"] = module.params.get("endpoint") params["enhanced_vpc_routing"] = module.params.get("enhanced_vpc_routing") params["hsm_client_certificate_identifier"] = module.params.get( "hsm_client_certificate_identifier" @@ -533,6 +730,7 @@ def main(): params["node_type"] = module.params.get("node_type") params["number_of_nodes"] = module.params.get("number_of_nodes") params["owner_account"] = module.params.get("owner_account") + params["port"] = module.params.get("port") params["preferred_maintenance_window"] = module.params.get( "preferred_maintenance_window" ) @@ -553,30 +751,31 @@ def main(): params["vpc_security_group_ids"] = module.params.get("vpc_security_group_ids") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation create_only_params = [ - "cluster_identifier", - "owner_account", - "snapshot_identifier", - "db_name", - "snapshot_cluster_identifier", - "cluster_subnet_group_name", - "master_username", + "/properties/ClusterIdentifier", + "/properties/OwnerAccount", + "/properties/SnapshotIdentifier", + "/properties/DBName", + "/properties/SnapshotClusterIdentifier", + "/properties/ClusterSubnetGroupName", + "/properties/MasterUsername", ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["cluster_identifier"] + identifier = ["/properties/ClusterIdentifier"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index dc1ef25b..ff5b3b9c 100644 --- a/plugins/modules/redshift_endpoint_access.py +++ b/plugins/modules/redshift_endpoint_access.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -14,6 +14,8 @@ - Creates and manages a Redshift-managed VPC endpoint. options: cluster_identifier: + aliases: + - ClusterIdentifier description: - A unique identifier for the cluster. - You use this identifier to refer to the cluster for any subsequent cluster @@ -23,6 +25,8 @@ - Cluster name should be unique for all clusters within an AWS account. type: str endpoint_name: + aliases: + - EndpointName description: - The name of the endpoint. type: str @@ -36,6 +40,8 @@ be performed on it. type: bool resource_owner: + aliases: + - ResourceOwner description: - The AWS account ID of the owner of the cluster. type: str @@ -56,32 +62,18 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str subnet_group_name: + aliases: + - SubnetGroupName description: - The subnet group name where Amazon Redshift chooses to deploy the endpoint. type: str - vpc_endpoint: - description: - - The connection endpoint for connecting to an Amazon Redshift cluster through - the proxy. - suboptions: - network_interfaces: - description: - - Describes a network interface. - elements: dict - suboptions: {} - type: list - type: dict vpc_security_group_ids: + aliases: + - VpcSecurityGroupIds description: - A list of vpc security group ids to apply to the created endpoint access. elements: str type: list - vpc_security_groups: - description: - - Describes the members of a VPC security group. - elements: dict - suboptions: {} - type: list wait: default: false description: @@ -128,11 +120,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -144,21 +137,17 @@ def main(): ), ) - argument_spec["cluster_identifier"] = {"type": "str"} - argument_spec["vpc_security_groups"] = { - "type": "list", - "elements": "dict", - "options": {}, + argument_spec["cluster_identifier"] = { + "type": "str", + "aliases": ["ClusterIdentifier"], } - argument_spec["resource_owner"] = {"type": "str"} - argument_spec["endpoint_name"] = {"type": "str"} - argument_spec["subnet_group_name"] = {"type": "str"} - argument_spec["vpc_security_group_ids"] = {"type": "list", "elements": "str"} - argument_spec["vpc_endpoint"] = { - "type": "dict", - "options": { - "network_interfaces": {"type": "list", "elements": "dict", "options": {}} - }, + argument_spec["resource_owner"] = {"type": "str", "aliases": ["ResourceOwner"]} + argument_spec["endpoint_name"] = {"type": "str", "aliases": ["EndpointName"]} + argument_spec["subnet_group_name"] = {"type": "str", "aliases": ["SubnetGroupName"]} + argument_spec["vpc_security_group_ids"] = { + "type": "list", + "elements": "str", + "aliases": ["VpcSecurityGroupIds"], } argument_spec["state"] = { "type": "str", @@ -174,10 +163,10 @@ def main(): "state", "present", [ - "endpoint_name", - "subnet_group_name", "vpc_security_group_ids", + "subnet_group_name", "cluster_identifier", + "endpoint_name", ], True, ], @@ -202,32 +191,31 @@ def main(): params["endpoint_name"] = module.params.get("endpoint_name") params["resource_owner"] = module.params.get("resource_owner") params["subnet_group_name"] = module.params.get("subnet_group_name") - params["vpc_endpoint"] = module.params.get("vpc_endpoint") params["vpc_security_group_ids"] = module.params.get("vpc_security_group_ids") - params["vpc_security_groups"] = module.params.get("vpc_security_groups") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation create_only_params = [ - "endpoint_name", - "cluster_identifier", - "resource_owner", - "subnet_group_name", + "/properties/EndpointName", + "/properties/ClusterIdentifier", + "/properties/ResourceOwner", + "/properties/SubnetGroupName", ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["endpoint_name"] + identifier = ["/properties/EndpointName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index 7820d7b0..aa3f6fc5 100644 --- a/plugins/modules/redshift_endpoint_authorization.py +++ b/plugins/modules/redshift_endpoint_authorization.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -16,10 +16,14 @@ access to a cluster across AWS accounts. options: account: + aliases: + - Account description: - The target AWS account ID to grant or revoke access for. type: str cluster_identifier: + aliases: + - ClusterIdentifier description: - The cluster identifier. type: str @@ -56,6 +60,8 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str vpc_ids: + aliases: + - VpcIds description: - The virtual private cloud (VPC) identifiers to grant or revoke access to. elements: str @@ -106,11 +112,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -122,9 +129,16 @@ def main(): ), ) - argument_spec["cluster_identifier"] = {"type": "str"} - argument_spec["account"] = {"type": "str"} - argument_spec["vpc_ids"] = {"type": "list", "elements": "str"} + argument_spec["cluster_identifier"] = { + "type": "str", + "aliases": ["ClusterIdentifier"], + } + argument_spec["account"] = {"type": "str", "aliases": ["Account"]} + argument_spec["vpc_ids"] = { + "type": "list", + "elements": "str", + "aliases": ["VpcIds"], + } argument_spec["force"] = {"type": "bool", "default": False} argument_spec["state"] = { "type": "str", @@ -137,7 +151,7 @@ def main(): required_if = [ ["state", "list", ["cluster_identifier"], True], - ["state", "present", ["account", "identifier", "cluster_identifier"], True], + ["state", "present", ["identifier", "cluster_identifier", "account"], True], ["state", "absent", ["cluster_identifier", "account", "identifier"], True], ["state", "get", ["cluster_identifier", "account", "identifier"], True], ] @@ -161,22 +175,23 @@ def main(): params["vpc_ids"] = module.params.get("vpc_ids") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["cluster_identifier", "account"] + create_only_params = ["/properties/ClusterIdentifier", "/properties/Account"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["cluster_identifier", "account"] + identifier = ["/properties/ClusterIdentifier", "/properties/Account"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None @@ -184,7 +199,9 @@ def main(): if not module.params.get("cluster_identifier") or not module.params.get( "account" ): - module.fail_json(f"You must specify both {*identifier, } identifiers.") + module.fail_json( + "You must specify all the ('cluster_identifier', 'account') identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_event_subscription.py b/plugins/modules/redshift_event_subscription.py index 0e149c24..8b7e5985 100644 --- a/plugins/modules/redshift_event_subscription.py +++ b/plugins/modules/redshift_event_subscription.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -14,11 +14,15 @@ - Creates and manage Amazon Redshift event notification subscriptions. options: enabled: + aliases: + - Enabled description: - A boolean value; set to true to activate the subscription, and set to false to create the subscription but not activate it. type: bool event_categories: + aliases: + - EventCategories choices: - configuration - management @@ -45,6 +49,8 @@ - Remove tags not listed in I(tags). type: bool severity: + aliases: + - Severity choices: - ERROR - INFO @@ -53,16 +59,22 @@ notification subscription. type: str sns_topic_arn: + aliases: + - SnsTopicArn description: - The Amazon Resource Name (ARN) of the Amazon SNS topic used to transmit the event notifications. type: str source_ids: + aliases: + - SourceIds description: - A list of one or more identifiers of Amazon Redshift source objects. elements: str type: list source_type: + aliases: + - SourceType choices: - cluster - cluster-parameter-group @@ -89,11 +101,14 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str subscription_name: + aliases: + - SubscriptionName description: - The name of the Amazon Redshift event notification subscription. type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. @@ -145,11 +160,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -161,8 +177,11 @@ def main(): ), ) - argument_spec["subscription_name"] = {"type": "str"} - argument_spec["sns_topic_arn"] = {"type": "str"} + argument_spec["subscription_name"] = { + "type": "str", + "aliases": ["SubscriptionName"], + } + argument_spec["sns_topic_arn"] = {"type": "str", "aliases": ["SnsTopicArn"]} argument_spec["source_type"] = { "type": "str", "choices": [ @@ -172,16 +191,26 @@ def main(): "cluster-snapshot", "scheduled-action", ], + "aliases": ["SourceType"], + } + argument_spec["source_ids"] = { + "type": "list", + "elements": "str", + "aliases": ["SourceIds"], } - argument_spec["source_ids"] = {"type": "list", "elements": "str"} argument_spec["event_categories"] = { "type": "list", "elements": "str", "choices": ["configuration", "management", "monitoring", "pending", "security"], + "aliases": ["EventCategories"], + } + argument_spec["severity"] = { + "type": "str", + "choices": ["ERROR", "INFO"], + "aliases": ["Severity"], } - argument_spec["severity"] = {"type": "str", "choices": ["ERROR", "INFO"]} - argument_spec["enabled"] = {"type": "bool"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["enabled"] = {"type": "bool", "aliases": ["Enabled"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -221,22 +250,23 @@ def main(): params["tags"] = module.params.get("tags") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["subscription_name"] + create_only_params = ["/properties/SubscriptionName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["subscription_name"] + identifier = ["/properties/SubscriptionName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_scheduled_action.py b/plugins/modules/redshift_scheduled_action.py index 9b07b0fa..acd529eb 100644 --- a/plugins/modules/redshift_scheduled_action.py +++ b/plugins/modules/redshift_scheduled_action.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -16,11 +16,15 @@ - For example, you can create a schedule of when to run the ResizeCluster API operation. options: enable: + aliases: + - Enable description: - If true, the schedule is enabled. - If false, the scheduled action does not trigger. type: bool end_time: + aliases: + - EndTime description: - The end time in UTC of the scheduled action. - After this time, the scheduled action does not trigger. @@ -35,23 +39,33 @@ be performed on it. type: bool iam_role: + aliases: + - IamRole description: - The IAM role to assume to run the target action. type: str schedule: + aliases: + - Schedule description: - The schedule in at( ) or cron( ) format. type: str scheduled_action_description: + aliases: + - ScheduledActionDescription description: - The description of the scheduled action. type: str scheduled_action_name: + aliases: + - ScheduledActionName description: - The name of the scheduled action. - The name must be unique within an account. type: str start_time: + aliases: + - StartTime description: - The start time in UTC of the scheduled action. - Before this time, the scheduled action does not trigger. @@ -73,54 +87,76 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str target_action: + aliases: + - TargetAction description: - A JSON format string of the Amazon Redshift API operation with input parameters. suboptions: pause_cluster: + aliases: + - PauseCluster description: - Describes a pause cluster operation. - For example, a scheduled action to run the I(pause_cluster) API operation. suboptions: cluster_identifier: + aliases: + - ClusterIdentifier description: - Not Provived. type: str type: dict resize_cluster: + aliases: + - ResizeCluster description: - Describes a resize cluster operation. - For example, a scheduled action to run the I(resize_cluster) API operation. suboptions: classic: + aliases: + - Classic description: - Not Provived. type: bool cluster_identifier: + aliases: + - ClusterIdentifier description: - Not Provived. type: str cluster_type: + aliases: + - ClusterType description: - Not Provived. type: str node_type: + aliases: + - NodeType description: - Not Provived. type: str number_of_nodes: + aliases: + - NumberOfNodes description: - Not Provived. type: int type: dict resume_cluster: + aliases: + - ResumeCluster description: - Describes a resume cluster operation. - For example, a scheduled action to run the I(resume_cluster) API operation. suboptions: cluster_identifier: + aliases: + - ClusterIdentifier description: - Not Provived. type: str @@ -172,11 +208,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -188,36 +225,59 @@ def main(): ), ) - argument_spec["scheduled_action_name"] = {"type": "str"} + argument_spec["scheduled_action_name"] = { + "type": "str", + "aliases": ["ScheduledActionName"], + } argument_spec["target_action"] = { "type": "dict", "options": { "resize_cluster": { "type": "dict", "options": { - "cluster_identifier": {"type": "str"}, - "cluster_type": {"type": "str"}, - "node_type": {"type": "str"}, - "number_of_nodes": {"type": "int"}, - "classic": {"type": "bool"}, + "cluster_identifier": { + "type": "str", + "aliases": ["ClusterIdentifier"], + }, + "cluster_type": {"type": "str", "aliases": ["ClusterType"]}, + "node_type": {"type": "str", "aliases": ["NodeType"]}, + "number_of_nodes": {"type": "int", "aliases": ["NumberOfNodes"]}, + "classic": {"type": "bool", "aliases": ["Classic"]}, }, + "aliases": ["ResizeCluster"], }, "pause_cluster": { "type": "dict", - "options": {"cluster_identifier": {"type": "str"}}, + "options": { + "cluster_identifier": { + "type": "str", + "aliases": ["ClusterIdentifier"], + } + }, + "aliases": ["PauseCluster"], }, "resume_cluster": { "type": "dict", - "options": {"cluster_identifier": {"type": "str"}}, + "options": { + "cluster_identifier": { + "type": "str", + "aliases": ["ClusterIdentifier"], + } + }, + "aliases": ["ResumeCluster"], }, }, + "aliases": ["TargetAction"], + } + argument_spec["schedule"] = {"type": "str", "aliases": ["Schedule"]} + argument_spec["iam_role"] = {"type": "str", "aliases": ["IamRole"]} + argument_spec["scheduled_action_description"] = { + "type": "str", + "aliases": ["ScheduledActionDescription"], } - argument_spec["schedule"] = {"type": "str"} - argument_spec["iam_role"] = {"type": "str"} - argument_spec["scheduled_action_description"] = {"type": "str"} - argument_spec["start_time"] = {"type": "str"} - argument_spec["end_time"] = {"type": "str"} - argument_spec["enable"] = {"type": "bool"} + argument_spec["start_time"] = {"type": "str", "aliases": ["StartTime"]} + argument_spec["end_time"] = {"type": "str", "aliases": ["EndTime"]} + argument_spec["enable"] = {"type": "bool", "aliases": ["Enable"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -258,22 +318,23 @@ def main(): params["target_action"] = module.params.get("target_action") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["scheduled_action_name"] + create_only_params = ["/properties/ScheduledActionName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["scheduled_action_name"] + identifier = ["/properties/ScheduledActionName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/route53_dnssec.py b/plugins/modules/route53_dnssec.py index 26ebaefa..6d600506 100644 --- a/plugins/modules/route53_dnssec.py +++ b/plugins/modules/route53_dnssec.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -23,6 +23,8 @@ be performed on it. type: bool hosted_zone_id: + aliases: + - HostedZoneId description: - The unique string (ID) used to identify a hosted zone. type: str @@ -88,11 +90,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -104,7 +107,7 @@ def main(): ), ) - argument_spec["hosted_zone_id"] = {"type": "str"} + argument_spec["hosted_zone_id"] = {"type": "str", "aliases": ["HostedZoneId"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -136,22 +139,23 @@ def main(): params["hosted_zone_id"] = module.params.get("hosted_zone_id") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["hosted_zone_id"] + create_only_params = ["/properties/HostedZoneId"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "delete", "list"] state = module.params.get("state") - identifier = ["hosted_zone_id"] + identifier = ["/properties/HostedZoneId"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/route53_key_signing_key.py b/plugins/modules/route53_key_signing_key.py index b777407a..b8282e99 100644 --- a/plugins/modules/route53_key_signing_key.py +++ b/plugins/modules/route53_key_signing_key.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -23,6 +23,8 @@ be performed on it. type: bool hosted_zone_id: + aliases: + - HostedZoneId description: - The unique string (ID) used to identify a hosted zone. type: str @@ -34,12 +36,16 @@ - For more details, visit U(https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html). type: str key_management_service_arn: + aliases: + - KeyManagementServiceArn description: - The Amazon resource name (ARN) for a customer managed key (CMK) in AWS Key Management Service (KMS). The KeyManagementServiceArn must be unique for each key signing key (KSK) in a single hosted zone. type: str name: + aliases: + - Name description: - An alphanumeric string used to identify a key signing key (KSK). Name must be unique for each key signing key in the same hosted zone. @@ -61,6 +67,8 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str status: + aliases: + - Status choices: - ACTIVE - INACTIVE @@ -114,11 +122,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -130,10 +139,17 @@ def main(): ), ) - argument_spec["hosted_zone_id"] = {"type": "str"} - argument_spec["status"] = {"type": "str", "choices": ["ACTIVE", "INACTIVE"]} - argument_spec["name"] = {"type": "str"} - argument_spec["key_management_service_arn"] = {"type": "str"} + argument_spec["hosted_zone_id"] = {"type": "str", "aliases": ["HostedZoneId"]} + argument_spec["status"] = { + "type": "str", + "choices": ["ACTIVE", "INACTIVE"], + "aliases": ["Status"], + } + argument_spec["name"] = {"type": "str", "aliases": ["Name"]} + argument_spec["key_management_service_arn"] = { + "type": "str", + "aliases": ["KeyManagementServiceArn"], + } argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -150,11 +166,11 @@ def main(): "state", "present", [ - "identifier", - "hosted_zone_id", "status", "key_management_service_arn", "name", + "identifier", + "hosted_zone_id", ], True, ], @@ -184,28 +200,35 @@ def main(): params["status"] = module.params.get("status") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["hosted_zone_id", "name", "key_management_service_arn"] + create_only_params = [ + "/properties/HostedZoneId", + "/properties/Name", + "/properties/KeyManagementServiceArn", + ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["hosted_zone_id", "name"] + identifier = ["/properties/HostedZoneId", "/properties/Name"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): if not module.params.get("hosted_zone_id") or not module.params.get("name"): - module.fail_json(f"You must specify both {*identifier, } identifiers.") + module.fail_json( + "You must specify all the ('hosted_zone_id', 'name') identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/s3_access_point.py b/plugins/modules/s3_access_point.py index ab6a7cb3..1bf4328b 100644 --- a/plugins/modules/s3_access_point.py +++ b/plugins/modules/s3_access_point.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -14,10 +14,14 @@ - Create and manage Amazon S3 access points to use to access S3 buckets. options: bucket: + aliases: + - Bucket description: - The name of the bucket that you want to associate this Access Point with. type: str bucket_account_id: + aliases: + - BucketAccountId description: - The AWS account ID associated with the S3 bucket associated with this access point. @@ -32,28 +36,22 @@ be performed on it. type: bool name: + aliases: + - Name description: - The name you want to assign to this Access Point. - If you dont specify a name, AWS CloudFormation generates a unique ID and uses that ID for the access point name. type: str policy: + aliases: + - Policy description: - The Access Point Policy you want to apply to this access point. type: dict - policy_status: - description: - - Not Provived. - suboptions: - is_public: - choices: - - 'false' - - 'true' - description: - - Specifies whether the policy is public or not. - type: str - type: dict public_access_block_configuration: + aliases: + - PublicAccessBlockConfiguration description: - The PublicAccessBlock configuration that you want to apply to this Access Point. @@ -63,6 +61,8 @@ The Meaning of Public in the Amazon Simple Storage Service Developer Guide. suboptions: block_public_acls: + aliases: + - BlockPublicAcls description: - Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. @@ -74,6 +74,8 @@ - Enabling this setting doesnt affect existing policies or ACLs. type: bool block_public_policy: + aliases: + - BlockPublicPolicy description: - Specifies whether Amazon S3 should block public bucket policies for buckets in this account. @@ -83,6 +85,8 @@ - Enabling this setting doesnt affect existing bucket policies. type: bool ignore_public_acls: + aliases: + - IgnorePublicAcls description: - Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. @@ -92,6 +96,8 @@ ACLs and doesnt prevent new public ACLs from being set. type: bool restrict_public_buckets: + aliases: + - RestrictPublicBuckets description: - Specifies whether Amazon S3 should restrict public bucket policies for this bucket. @@ -121,12 +127,16 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str vpc_configuration: + aliases: + - VpcConfiguration description: - If you include this field, Amazon S3 restricts access to this Access Point to requests from the specified Virtual Private Cloud (VPC).The Virtual Private Cloud (VPC) configuration for a bucket access point. suboptions: vpc_id: + aliases: + - VpcId description: - If this field is specified, this access point will only allow connections from the specified VPC ID. @@ -178,11 +188,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -194,27 +205,28 @@ def main(): ), ) - argument_spec["name"] = {"type": "str"} - argument_spec["bucket"] = {"type": "str"} - argument_spec["bucket_account_id"] = {"type": "str"} + argument_spec["name"] = {"type": "str", "aliases": ["Name"]} + argument_spec["bucket"] = {"type": "str", "aliases": ["Bucket"]} + argument_spec["bucket_account_id"] = {"type": "str", "aliases": ["BucketAccountId"]} argument_spec["vpc_configuration"] = { "type": "dict", - "options": {"vpc_id": {"type": "str"}}, + "options": {"vpc_id": {"type": "str", "aliases": ["VpcId"]}}, + "aliases": ["VpcConfiguration"], } argument_spec["public_access_block_configuration"] = { "type": "dict", "options": { - "block_public_acls": {"type": "bool"}, - "ignore_public_acls": {"type": "bool"}, - "block_public_policy": {"type": "bool"}, - "restrict_public_buckets": {"type": "bool"}, + "block_public_acls": {"type": "bool", "aliases": ["BlockPublicAcls"]}, + "ignore_public_acls": {"type": "bool", "aliases": ["IgnorePublicAcls"]}, + "block_public_policy": {"type": "bool", "aliases": ["BlockPublicPolicy"]}, + "restrict_public_buckets": { + "type": "bool", + "aliases": ["RestrictPublicBuckets"], + }, }, + "aliases": ["PublicAccessBlockConfiguration"], } - argument_spec["policy"] = {"type": "dict"} - argument_spec["policy_status"] = { - "type": "dict", - "options": {"is_public": {"type": "str", "choices": ["false", "true"]}}, - } + argument_spec["policy"] = {"type": "dict", "aliases": ["Policy"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -247,35 +259,34 @@ def main(): params["bucket_account_id"] = module.params.get("bucket_account_id") params["name"] = module.params.get("name") params["policy"] = module.params.get("policy") - params["policy_status"] = module.params.get("policy_status") params["public_access_block_configuration"] = module.params.get( "public_access_block_configuration" ) params["vpc_configuration"] = module.params.get("vpc_configuration") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation create_only_params = [ - "name", - "bucket", - "bucket_account_id", - "vpc_configuration", - "public_access_block_configuration", + "/properties/Name", + "/properties/Bucket", + "/properties/BucketAccountId", + "/properties/VpcConfiguration", ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["name"] + identifier = ["/properties/Name"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/s3_bucket.py b/plugins/modules/s3_bucket.py index 8f49d49f..4fa9d46a 100644 --- a/plugins/modules/s3_bucket.py +++ b/plugins/modules/s3_bucket.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -14,10 +14,14 @@ - Create and manage S3 buckets. options: accelerate_configuration: + aliases: + - AccelerateConfiguration description: - Configuration for the transfer acceleration state. suboptions: acceleration_status: + aliases: + - AccelerationStatus choices: - Enabled - Suspended @@ -26,6 +30,8 @@ type: str type: dict access_control: + aliases: + - AccessControl choices: - AuthenticatedRead - AwsExecRead @@ -40,48 +46,66 @@ the bucket. type: str analytics_configurations: + aliases: + - AnalyticsConfigurations description: - Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket. elements: dict suboptions: id: + aliases: + - Id description: - The ID that identifies the analytics configuration. type: str prefix: + aliases: + - Prefix description: - The prefix that an object must have to be included in the analytics results. type: str storage_class_analysis: + aliases: + - StorageClassAnalysis description: - Specifies data related to access patterns to be collected and made available to analyze the tradeoffs between different storage classes for an Amazon S3 bucket. suboptions: data_export: + aliases: + - DataExport description: - Specifies how data related to the storage class analysis for an Amazon S3 bucket should be exported. suboptions: destination: + aliases: + - Destination description: - Specifies information about where to publish analysis or configuration results for an Amazon S3 bucket and S3 Replication Time Control (S3 RTC). suboptions: bucket_account_id: + aliases: + - BucketAccountId description: - The account ID that owns the destination S3 bucket. type: str bucket_arn: + aliases: + - BucketArn description: - The Amazon Resource Name (ARN) of the bucket to which data is exported. type: str format: + aliases: + - Format choices: - CSV - ORC @@ -91,12 +115,16 @@ data to Amazon S3. type: str prefix: + aliases: + - Prefix description: - The prefix to use when exporting data. - The prefix is prepended to all results. type: str type: dict output_schema_version: + aliases: + - OutputSchemaVersion default: V_1 description: - The version of the output schema to use when exporting @@ -105,31 +133,43 @@ type: dict type: dict tag_filters: + aliases: + - TagFilters description: - Tags to use to identify a subset of objects for an Amazon S3 bucket. elements: dict suboptions: key: + aliases: + - Key description: - Not Provived. type: str value: + aliases: + - Value description: - Not Provived. type: str type: list type: list bucket_encryption: + aliases: + - BucketEncryption description: - Specifies default encryption for a bucket using server-side encryption with either Amazon S3-managed keys (SSE-S3) or AWS KMS-managed keys (SSE-KMS). suboptions: server_side_encryption_configuration: + aliases: + - ServerSideEncryptionConfiguration description: - Specifies the default server-side encryption configuration. elements: dict suboptions: bucket_key_enabled: + aliases: + - BucketKeyEnabled description: - Specifies whether Amazon S3 should use an S3 Bucket Key with server-side encryption using KMS (SSE-KMS) for new @@ -140,6 +180,8 @@ - By default, S3 Bucket Key is not enabled. type: bool server_side_encryption_by_default: + aliases: + - ServerSideEncryptionByDefault description: - Specifies the default server-side encryption to apply to new objects in the bucket. @@ -147,11 +189,15 @@ this default encryption will be applied. suboptions: kms_master_key_id: + aliases: + - KMSMasterKeyID description: - KMSMasterKeyID can only be used when you set the value of I(sse_algorithm) as aws:kms. type: str sse_algorithm: + aliases: + - SSEAlgorithm choices: - AES256 - aws:kms @@ -162,16 +208,22 @@ type: list type: dict bucket_name: + aliases: + - BucketName description: - A name for the bucket. - If you dont specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the bucket name. type: str cors_configuration: + aliases: + - CorsConfiguration description: - Rules that define cross-origin resource sharing of objects in this bucket. suboptions: cors_rules: + aliases: + - CorsRules description: - A set of origins and methods (cross-origin access that you want to allow). @@ -179,12 +231,16 @@ elements: dict suboptions: allowed_headers: + aliases: + - AllowedHeaders description: - Headers that are specified in the Access-Control-Request-Headers header. elements: str type: list allowed_methods: + aliases: + - AllowedMethods choices: - DELETE - GET @@ -196,12 +252,16 @@ elements: str type: list allowed_origins: + aliases: + - AllowedOrigins description: - One or more origins you want customers to be able to access the bucket from. elements: str type: list exposed_headers: + aliases: + - ExposedHeaders description: - One or more headers in the response that you want customers to be able to access from their applications (for example, @@ -209,10 +269,14 @@ elements: str type: list id: + aliases: + - Id description: - A unique identifier for this rule. type: str max_age: + aliases: + - MaxAge description: - The time in seconds that your browser is to cache the preflight response for the specified resource. @@ -229,20 +293,28 @@ be performed on it. type: bool intelligent_tiering_configurations: + aliases: + - IntelligentTieringConfigurations description: - Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket. elements: dict suboptions: id: + aliases: + - Id description: - The ID used to identify the S3 Intelligent-Tiering configuration. type: str prefix: + aliases: + - Prefix description: - An object key name prefix that identifies the subset of objects to which the rule applies. type: str status: + aliases: + - Status choices: - Disabled - Enabled @@ -250,20 +322,28 @@ - Specifies the status of the configuration. type: str tag_filters: + aliases: + - TagFilters description: - Tags to use to identify a subset of objects for an Amazon S3 bucket. elements: dict suboptions: key: + aliases: + - Key description: - Not Provived. type: str value: + aliases: + - Value description: - Not Provived. type: str type: list tierings: + aliases: + - Tierings description: - Specifies a list of S3 Intelligent-Tiering storage class tiers in the configuration. @@ -273,6 +353,8 @@ elements: dict suboptions: access_tier: + aliases: + - AccessTier choices: - ARCHIVE_ACCESS - DEEP_ARCHIVE_ACCESS @@ -283,6 +365,8 @@ tiers in the S3 Intelligent-Tiering storage class. type: str days: + aliases: + - Days description: - The number of consecutive days of no access after which an object will be eligible to be transitioned to the corresponding @@ -295,26 +379,36 @@ type: list type: list inventory_configurations: + aliases: + - InventoryConfigurations description: - The inventory configuration for an Amazon S3 bucket. elements: dict suboptions: destination: + aliases: + - Destination description: - Specifies information about where to publish analysis or configuration results for an Amazon S3 bucket and S3 Replication Time Control (S3 RTC). suboptions: bucket_account_id: + aliases: + - BucketAccountId description: - The account ID that owns the destination S3 bucket. type: str bucket_arn: + aliases: + - BucketArn description: - The Amazon Resource Name (ARN) of the bucket to which data is exported. type: str format: + aliases: + - Format choices: - CSV - ORC @@ -324,20 +418,28 @@ S3. type: str prefix: + aliases: + - Prefix description: - The prefix to use when exporting data. - The prefix is prepended to all results. type: str type: dict enabled: + aliases: + - Enabled description: - Specifies whether the inventory is enabled or disabled. type: bool id: + aliases: + - Id description: - The ID used to identify the inventory configuration. type: str included_object_versions: + aliases: + - IncludedObjectVersions choices: - All - Current @@ -345,6 +447,8 @@ - Object versions to include in the inventory list. type: str optional_fields: + aliases: + - OptionalFields choices: - BucketKeyStatus - ETag @@ -364,10 +468,14 @@ elements: str type: list prefix: + aliases: + - Prefix description: - The prefix that is prepended to all inventory results. type: str schedule_frequency: + aliases: + - ScheduleFrequency choices: - Daily - Weekly @@ -376,10 +484,14 @@ type: str type: list lifecycle_configuration: + aliases: + - LifecycleConfiguration description: - Rules that define how Amazon S3 manages objects during their lifetime. suboptions: rules: + aliases: + - Rules description: - 'You must specify at least one of the following properties: I(abort_incomplete_multipart_upload), I(expiration_date), I(expiration_in_days), I(noncurrent_version_expiration_in_days), @@ -388,35 +500,49 @@ elements: dict suboptions: abort_incomplete_multipart_upload: + aliases: + - AbortIncompleteMultipartUpload description: - Specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. suboptions: days_after_initiation: + aliases: + - DaysAfterInitiation description: - Specifies the number of days after which Amazon S3 aborts an incomplete multipart upload. type: int type: dict expiration_date: + aliases: + - ExpirationDate description: - The date value in ISO 8601 format. - The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ). type: str expiration_in_days: + aliases: + - ExpirationInDays description: - Not Provived. type: int expired_object_delete_marker: + aliases: + - ExpiredObjectDeleteMarker description: - Not Provived. type: bool id: + aliases: + - Id description: - Not Provived. type: str noncurrent_version_expiration: + aliases: + - NoncurrentVersionExpiration description: - Container for the expiration rule that describes when noncurrent objects are expired. @@ -426,22 +552,30 @@ objects lifetime. suboptions: newer_noncurrent_versions: + aliases: + - NewerNoncurrentVersions description: - Specified the number of newer noncurrent and current versions that must exists before performing the associated action. type: int noncurrent_days: + aliases: + - NoncurrentDays description: - Specified the number of days an object is noncurrent before Amazon S3 can perform the associated action. type: int type: dict noncurrent_version_expiration_in_days: + aliases: + - NoncurrentVersionExpirationInDays description: - Not Provived. type: int noncurrent_version_transition: + aliases: + - NoncurrentVersionTransition description: - Container for the transition rule that describes when noncurrent objects transition to the C(STANDARD_IA), C(ONEZONE_IA), @@ -455,12 +589,16 @@ the objects lifetime. suboptions: newer_noncurrent_versions: + aliases: + - NewerNoncurrentVersions description: - Specified the number of newer noncurrent and current versions that must exists before performing the associated action. type: int storage_class: + aliases: + - StorageClass choices: - DEEP_ARCHIVE - GLACIER @@ -473,12 +611,16 @@ - The class of storage used to store the object. type: str transition_in_days: + aliases: + - TransitionInDays description: - Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. type: int type: dict noncurrent_version_transitions: + aliases: + - NoncurrentVersionTransitions description: - Container for the transition rule that describes when noncurrent objects transition to the C(STANDARD_IA), C(ONEZONE_IA), @@ -493,12 +635,16 @@ elements: dict suboptions: newer_noncurrent_versions: + aliases: + - NewerNoncurrentVersions description: - Specified the number of newer noncurrent and current versions that must exists before performing the associated action. type: int storage_class: + aliases: + - StorageClass choices: - DEEP_ARCHIVE - GLACIER @@ -511,24 +657,34 @@ - The class of storage used to store the object. type: str transition_in_days: + aliases: + - TransitionInDays description: - Specifies the number of days an object is noncurrent before Amazon S3 can perform the associated action. type: int type: list object_size_greater_than: + aliases: + - ObjectSizeGreaterThan description: - Not Provived. type: str object_size_less_than: + aliases: + - ObjectSizeLessThan description: - Not Provived. type: str prefix: + aliases: + - Prefix description: - Not Provived. type: str status: + aliases: + - Status choices: - Disabled - Enabled @@ -536,26 +692,36 @@ - Not Provived. type: str tag_filters: + aliases: + - TagFilters description: - Tags to use to identify a subset of objects for an Amazon S3 bucket. elements: dict suboptions: key: + aliases: + - Key description: - Not Provived. type: str value: + aliases: + - Value description: - Not Provived. type: str type: list transition: + aliases: + - Transition description: - You must specify at least one of I(transition_date) and I(transition_in_days). suboptions: storage_class: + aliases: + - StorageClass choices: - DEEP_ARCHIVE - GLACIER @@ -568,22 +734,30 @@ - Not Provived. type: str transition_date: + aliases: + - TransitionDate description: - The date value in ISO 8601 format. - The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ). type: str transition_in_days: + aliases: + - TransitionInDays description: - Not Provived. type: int type: dict transitions: + aliases: + - Transitions description: - You must specify at least one of I(transition_date) and I(transition_in_days). elements: dict suboptions: storage_class: + aliases: + - StorageClass choices: - DEEP_ARCHIVE - GLACIER @@ -596,11 +770,15 @@ - Not Provived. type: str transition_date: + aliases: + - TransitionDate description: - The date value in ISO 8601 format. - The timezone is always UTC. (YYYY-MM-DDThh:mm:ssZ). type: str transition_in_days: + aliases: + - TransitionInDays description: - Not Provived. type: int @@ -608,10 +786,14 @@ type: list type: dict logging_configuration: + aliases: + - LoggingConfiguration description: - Settings that define where logs are stored. suboptions: destination_bucket_name: + aliases: + - DestinationBucketName description: - The name of an Amazon S3 bucket where Amazon S3 store server access log files. @@ -620,54 +802,76 @@ property is defined. type: str log_file_prefix: + aliases: + - LogFilePrefix description: - Not Provived. type: str type: dict metrics_configurations: + aliases: + - MetricsConfigurations description: - Settings that define a metrics configuration for the CloudWatch request metrics from the bucket. elements: dict suboptions: access_point_arn: + aliases: + - AccessPointArn description: - Not Provived. type: str id: + aliases: + - Id description: - Not Provived. type: str prefix: + aliases: + - Prefix description: - Not Provived. type: str tag_filters: + aliases: + - TagFilters description: - Tags to use to identify a subset of objects for an Amazon S3 bucket. elements: dict suboptions: key: + aliases: + - Key description: - Not Provived. type: str value: + aliases: + - Value description: - Not Provived. type: str type: list type: list notification_configuration: + aliases: + - NotificationConfiguration description: - Configuration that defines how Amazon S3 handles bucket notifications.Describes the notification configuration for an Amazon S3 bucket. suboptions: event_bridge_configuration: + aliases: + - EventBridgeConfiguration description: - Describes the Amazon EventBridge notification configuration for an Amazon S3 bucket. suboptions: event_bridge_enabled: + aliases: + - EventBridgeEnabled default: 'true' description: - Specifies whether to send notifications to Amazon EventBridge @@ -675,28 +879,38 @@ type: bool type: dict lambda_configurations: + aliases: + - LambdaConfigurations description: - Describes the AWS Lambda functions to invoke and the events for which to invoke them. elements: dict suboptions: event: + aliases: + - Event description: - The Amazon S3 bucket event for which to invoke the AWS Lambda function. type: str filter: + aliases: + - Filter description: - The filtering rules that determine which objects invoke the AWS Lambda function.Specifies object key name filtering rules. suboptions: s3_key: + aliases: + - S3Key description: - A container for object key name prefix and suffix filtering rules. suboptions: rules: + aliases: + - Rules description: - Specifies the Amazon S3 object key name to filter on and whether to filter on @@ -704,10 +918,14 @@ elements: dict suboptions: name: + aliases: + - Name description: - Not Provived. type: str value: + aliases: + - Value description: - Not Provived. type: str @@ -715,33 +933,45 @@ type: dict type: dict function: + aliases: + - Function description: - The Amazon Resource Name (ARN) of the AWS Lambda function that Amazon S3 invokes when the specified event type occurs. type: str type: list queue_configurations: + aliases: + - QueueConfigurations description: - The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages. elements: dict suboptions: event: + aliases: + - Event description: - The Amazon S3 bucket event about which you want to publish messages to Amazon SQS. type: str filter: + aliases: + - Filter description: - The filtering rules that determine which objects trigger notifications. suboptions: s3_key: + aliases: + - S3Key description: - A container for object key name prefix and suffix filtering rules. suboptions: rules: + aliases: + - Rules description: - Specifies the Amazon S3 object key name to filter on and whether to filter on @@ -749,10 +979,14 @@ elements: dict suboptions: name: + aliases: + - Name description: - Not Provived. type: str value: + aliases: + - Value description: - Not Provived. type: str @@ -760,6 +994,8 @@ type: dict type: dict queue: + aliases: + - Queue description: - The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 publishes a message when it detects events @@ -767,26 +1003,36 @@ type: str type: list topic_configurations: + aliases: + - TopicConfigurations description: - The topic to which notifications are sent and the events for which notifications are generated. elements: dict suboptions: event: + aliases: + - Event description: - The Amazon S3 bucket event about which to send notifications. type: str filter: + aliases: + - Filter description: - The filtering rules that determine for which objects to send notifications. suboptions: s3_key: + aliases: + - S3Key description: - A container for object key name prefix and suffix filtering rules. suboptions: rules: + aliases: + - Rules description: - Specifies the Amazon S3 object key name to filter on and whether to filter on @@ -794,10 +1040,14 @@ elements: dict suboptions: name: + aliases: + - Name description: - Not Provived. type: str value: + aliases: + - Value description: - Not Provived. type: str @@ -805,6 +1055,8 @@ type: dict type: dict topic: + aliases: + - Topic description: - The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events @@ -813,28 +1065,40 @@ type: list type: dict object_lock_configuration: + aliases: + - ObjectLockConfiguration description: - Places an Object Lock configuration on the specified bucket. suboptions: object_lock_enabled: + aliases: + - ObjectLockEnabled default: Enabled description: - Not Provived. type: str rule: + aliases: + - Rule description: - The Object Lock rule in place for the specified object. suboptions: default_retention: + aliases: + - DefaultRetention description: - The default retention period that you want to apply to new objects placed in the specified bucket. suboptions: days: + aliases: + - Days description: - Not Provived. type: int mode: + aliases: + - Mode choices: - COMPLIANCE - GOVERNANCE @@ -842,6 +1106,8 @@ - Not Provived. type: str years: + aliases: + - Years description: - Not Provived. type: int @@ -849,19 +1115,27 @@ type: dict type: dict object_lock_enabled: + aliases: + - ObjectLockEnabled description: - Indicates whether this bucket has an Object Lock configuration enabled. type: bool ownership_controls: + aliases: + - OwnershipControls description: - Specifies the container element for object ownership rules. suboptions: rules: + aliases: + - Rules description: - Not Provived. elements: dict suboptions: object_ownership: + aliases: + - ObjectOwnership choices: - BucketOwnerEnforced - BucketOwnerPreferred @@ -872,10 +1146,14 @@ type: list type: dict public_access_block_configuration: + aliases: + - PublicAccessBlockConfiguration description: - Configuration that defines how Amazon S3 handles public access. suboptions: block_public_acls: + aliases: + - BlockPublicAcls description: - Specifies whether Amazon S3 should block public access control lists (ACLs) for this bucket and objects in this bucket. @@ -886,6 +1164,8 @@ - Enabling this setting doesnt affect existing policies or ACLs. type: bool block_public_policy: + aliases: + - BlockPublicPolicy description: - Specifies whether Amazon S3 should block public bucket policies for this bucket. @@ -895,6 +1175,8 @@ - Enabling this setting doesnt affect existing bucket policies. type: bool ignore_public_acls: + aliases: + - IgnorePublicAcls description: - Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket. @@ -904,6 +1186,8 @@ ACLs and doesnt prevent new public ACLs from being set. type: bool restrict_public_buckets: + aliases: + - RestrictPublicBuckets description: - Specifies whether Amazon S3 should restrict public bucket policies for this bucket. @@ -922,6 +1206,8 @@ - Remove tags not listed in I(tags). type: bool replication_configuration: + aliases: + - ReplicationConfiguration description: - Configuration for replicating objects in an S3 bucket.A container for replication rules. @@ -929,21 +1215,29 @@ - The maximum size of a replication configuration is 2 MB. suboptions: role: + aliases: + - Role description: - The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that Amazon S3 assumes when replicating objects. type: str rules: + aliases: + - Rules description: - Specifies which Amazon S3 objects to replicate and where to store the replicas. elements: dict suboptions: delete_marker_replication: + aliases: + - DeleteMarkerReplication description: - Not Provived. suboptions: status: + aliases: + - Status choices: - Disabled - Enabled @@ -952,11 +1246,15 @@ type: str type: dict destination: + aliases: + - Destination description: - Specifies which Amazon S3 bucket to store replicated objects in and their storage class. suboptions: access_control_translation: + aliases: + - AccessControlTranslation description: - Specify this only in a cross-account scenario (where source and destination bucket owners are not the @@ -967,26 +1265,36 @@ owns the source object. suboptions: owner: + aliases: + - Owner default: Destination description: - Not Provived. type: str type: dict account: + aliases: + - Account description: - Not Provived. type: str bucket: + aliases: + - Bucket description: - Not Provived. type: str encryption_configuration: + aliases: + - EncryptionConfiguration description: - Specifies encryption-related information for an Amazon S3 bucket that is a destination for replicated objects. suboptions: replica_kms_key_id: + aliases: + - ReplicaKmsKeyID description: - Specifies the ID (Key ARN or Alias ARN) of the customer managed customer master @@ -995,19 +1303,27 @@ type: str type: dict metrics: + aliases: + - Metrics description: - Not Provived. suboptions: event_threshold: + aliases: + - EventThreshold description: - Not Provived. suboptions: minutes: + aliases: + - Minutes description: - Not Provived. type: int type: dict status: + aliases: + - Status choices: - Disabled - Enabled @@ -1016,10 +1332,14 @@ type: str type: dict replication_time: + aliases: + - ReplicationTime description: - Not Provived. suboptions: status: + aliases: + - Status choices: - Disabled - Enabled @@ -1027,16 +1347,22 @@ - Not Provived. type: str time: + aliases: + - Time description: - Not Provived. suboptions: minutes: + aliases: + - Minutes description: - Not Provived. type: int type: dict type: dict storage_class: + aliases: + - StorageClass choices: - DEEP_ARCHIVE - GLACIER @@ -1052,76 +1378,108 @@ type: str type: dict filter: + aliases: + - Filter description: - Not Provived. suboptions: and: + aliases: + - And description: - Not Provived. suboptions: prefix: + aliases: + - Prefix description: - Not Provived. type: str tag_filters: + aliases: + - TagFilters description: - Tags to use to identify a subset of objects for an Amazon S3 bucket. elements: dict suboptions: key: + aliases: + - Key description: - Not Provived. type: str value: + aliases: + - Value description: - Not Provived. type: str type: list type: dict prefix: + aliases: + - Prefix description: - Not Provived. type: str tag_filter: + aliases: + - TagFilter description: - Tags to use to identify a subset of objects for an Amazon S3 bucket. suboptions: key: + aliases: + - Key description: - Not Provived. type: str value: + aliases: + - Value description: - Not Provived. type: str type: dict type: dict id: + aliases: + - Id description: - A unique identifier for the rule. type: str prefix: + aliases: + - Prefix description: - An object key name prefix that identifies the object or objects to which the rule applies. type: str priority: + aliases: + - Priority description: - Not Provived. type: int source_selection_criteria: + aliases: + - SourceSelectionCriteria description: - A container that describes additional filters for identifying the source objects that you want to replicate. suboptions: replica_modifications: + aliases: + - ReplicaModifications description: - A filter that you can specify for selection for modifications on replicas. suboptions: status: + aliases: + - Status choices: - Disabled - Enabled @@ -1131,6 +1489,8 @@ type: str type: dict sse_kms_encrypted_objects: + aliases: + - SseKmsEncryptedObjects description: - A container for filter information for the selection of Amazon S3 objects encrypted with AWS KMS.A @@ -1138,6 +1498,8 @@ of S3 objects encrypted with AWS KMS. suboptions: status: + aliases: + - Status choices: - Disabled - Enabled @@ -1150,6 +1512,8 @@ type: dict type: dict status: + aliases: + - Status choices: - Disabled - Enabled @@ -1176,16 +1540,21 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). type: dict versioning_configuration: + aliases: + - VersioningConfiguration description: - Describes the versioning state of an Amazon S3 bucket. suboptions: status: + aliases: + - Status choices: - Enabled - Suspended @@ -1205,27 +1574,39 @@ - How many seconds to wait for an operation to complete before timing out. type: int website_configuration: + aliases: + - WebsiteConfiguration description: - Specifies website configuration parameters for an Amazon S3 bucket. suboptions: error_document: + aliases: + - ErrorDocument description: - The name of the error document for the website. type: str index_document: + aliases: + - IndexDocument description: - The name of the index document for the website. type: str redirect_all_requests_to: + aliases: + - RedirectAllRequestsTo description: - Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket. suboptions: host_name: + aliases: + - HostName description: - Name of the host where requests are redirected. type: str protocol: + aliases: + - Protocol choices: - http - https @@ -1236,11 +1617,15 @@ type: str type: dict routing_rules: + aliases: + - RoutingRules description: - Specifies the redirect behavior and when a redirect is applied. elements: dict suboptions: redirect_rule: + aliases: + - RedirectRule description: - Container for redirect information. - You can redirect requests to another host, to another page, @@ -1251,15 +1636,21 @@ code to return. suboptions: host_name: + aliases: + - HostName description: - The host name to use in the redirect request. type: str http_redirect_code: + aliases: + - HttpRedirectCode description: - The HTTP redirect code to use on the response. - Not required if one of the siblings is present. type: str protocol: + aliases: + - Protocol choices: - http - https @@ -1269,25 +1660,35 @@ original request. type: str replace_key_prefix_with: + aliases: + - ReplaceKeyPrefixWith description: - The object key prefix to use in the redirect request. type: str replace_key_with: + aliases: + - ReplaceKeyWith description: - The specific object key to use in the redirect request.d. type: str type: dict routing_rule_condition: + aliases: + - RoutingRuleCondition description: - A container for describing a condition that must be met for the specified redirect to apply.You must specify at least one of I(http_error_code_returned_equals) and I(key_prefix_equals). suboptions: http_error_code_returned_equals: + aliases: + - HttpErrorCodeReturnedEquals description: - The HTTP error code when the redirect is applied. type: str key_prefix_equals: + aliases: + - KeyPrefixEquals description: - The object key name prefix when the redirect is applied. @@ -1361,11 +1762,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -1380,8 +1782,13 @@ def main(): argument_spec["accelerate_configuration"] = { "type": "dict", "options": { - "acceleration_status": {"type": "str", "choices": ["Enabled", "Suspended"]} + "acceleration_status": { + "type": "str", + "choices": ["Enabled", "Suspended"], + "aliases": ["AccelerationStatus"], + } }, + "aliases": ["AccelerateConfiguration"], } argument_spec["access_control"] = { "type": "str", @@ -1395,6 +1802,7 @@ def main(): "PublicRead", "PublicReadWrite", ], + "aliases": ["AccessControl"], } argument_spec["analytics_configurations"] = { "type": "list", @@ -1403,7 +1811,11 @@ def main(): "tag_filters": { "type": "list", "elements": "dict", - "options": {"value": {"type": "str"}, "key": {"type": "str"}}, + "options": { + "value": {"type": "str", "aliases": ["Value"]}, + "key": {"type": "str", "aliases": ["Key"]}, + }, + "aliases": ["TagFilters"], }, "storage_class_analysis": { "type": "dict", @@ -1414,23 +1826,38 @@ def main(): "destination": { "type": "dict", "options": { - "bucket_arn": {"type": "str"}, - "bucket_account_id": {"type": "str"}, + "bucket_arn": { + "type": "str", + "aliases": ["BucketArn"], + }, + "bucket_account_id": { + "type": "str", + "aliases": ["BucketAccountId"], + }, "format": { "type": "str", "choices": ["CSV", "ORC", "Parquet"], + "aliases": ["Format"], }, - "prefix": {"type": "str"}, + "prefix": {"type": "str", "aliases": ["Prefix"]}, }, + "aliases": ["Destination"], + }, + "output_schema_version": { + "type": "str", + "default": "V_1", + "aliases": ["OutputSchemaVersion"], }, - "output_schema_version": {"type": "str", "default": "V_1"}, }, + "aliases": ["DataExport"], } }, + "aliases": ["StorageClassAnalysis"], }, - "id": {"type": "str"}, - "prefix": {"type": "str"}, + "id": {"type": "str", "aliases": ["Id"]}, + "prefix": {"type": "str", "aliases": ["Prefix"]}, }, + "aliases": ["AnalyticsConfigurations"], } argument_spec["bucket_encryption"] = { "type": "dict", @@ -1439,22 +1866,32 @@ def main(): "type": "list", "elements": "dict", "options": { - "bucket_key_enabled": {"type": "bool"}, + "bucket_key_enabled": { + "type": "bool", + "aliases": ["BucketKeyEnabled"], + }, "server_side_encryption_by_default": { "type": "dict", "options": { - "kms_master_key_id": {"type": "str"}, + "kms_master_key_id": { + "type": "str", + "aliases": ["KMSMasterKeyID"], + }, "sse_algorithm": { "type": "str", "choices": ["AES256", "aws:kms"], + "aliases": ["SSEAlgorithm"], }, }, + "aliases": ["ServerSideEncryptionByDefault"], }, }, + "aliases": ["ServerSideEncryptionConfiguration"], } }, + "aliases": ["BucketEncryption"], } - argument_spec["bucket_name"] = {"type": "str"} + argument_spec["bucket_name"] = {"type": "str", "aliases": ["BucketName"]} argument_spec["cors_configuration"] = { "type": "dict", "options": { @@ -1462,31 +1899,54 @@ def main(): "type": "list", "elements": "dict", "options": { - "allowed_headers": {"type": "list", "elements": "str"}, + "allowed_headers": { + "type": "list", + "elements": "str", + "aliases": ["AllowedHeaders"], + }, "allowed_methods": { "type": "list", "elements": "str", "choices": ["DELETE", "GET", "HEAD", "POST", "PUT"], + "aliases": ["AllowedMethods"], + }, + "allowed_origins": { + "type": "list", + "elements": "str", + "aliases": ["AllowedOrigins"], + }, + "exposed_headers": { + "type": "list", + "elements": "str", + "aliases": ["ExposedHeaders"], }, - "allowed_origins": {"type": "list", "elements": "str"}, - "exposed_headers": {"type": "list", "elements": "str"}, - "id": {"type": "str"}, - "max_age": {"type": "int"}, + "id": {"type": "str", "aliases": ["Id"]}, + "max_age": {"type": "int", "aliases": ["MaxAge"]}, }, + "aliases": ["CorsRules"], } }, + "aliases": ["CorsConfiguration"], } argument_spec["intelligent_tiering_configurations"] = { "type": "list", "elements": "dict", "options": { - "id": {"type": "str"}, - "prefix": {"type": "str"}, - "status": {"type": "str", "choices": ["Disabled", "Enabled"]}, + "id": {"type": "str", "aliases": ["Id"]}, + "prefix": {"type": "str", "aliases": ["Prefix"]}, + "status": { + "type": "str", + "choices": ["Disabled", "Enabled"], + "aliases": ["Status"], + }, "tag_filters": { "type": "list", "elements": "dict", - "options": {"value": {"type": "str"}, "key": {"type": "str"}}, + "options": { + "value": {"type": "str", "aliases": ["Value"]}, + "key": {"type": "str", "aliases": ["Key"]}, + }, + "aliases": ["TagFilters"], }, "tierings": { "type": "list", @@ -1495,11 +1955,14 @@ def main(): "access_tier": { "type": "str", "choices": ["ARCHIVE_ACCESS", "DEEP_ARCHIVE_ACCESS"], + "aliases": ["AccessTier"], }, - "days": {"type": "int"}, + "days": {"type": "int", "aliases": ["Days"]}, }, + "aliases": ["Tierings"], }, }, + "aliases": ["IntelligentTieringConfigurations"], } argument_spec["inventory_configurations"] = { "type": "list", @@ -1508,15 +1971,27 @@ def main(): "destination": { "type": "dict", "options": { - "bucket_arn": {"type": "str"}, - "bucket_account_id": {"type": "str"}, - "format": {"type": "str", "choices": ["CSV", "ORC", "Parquet"]}, - "prefix": {"type": "str"}, + "bucket_arn": {"type": "str", "aliases": ["BucketArn"]}, + "bucket_account_id": { + "type": "str", + "aliases": ["BucketAccountId"], + }, + "format": { + "type": "str", + "choices": ["CSV", "ORC", "Parquet"], + "aliases": ["Format"], + }, + "prefix": {"type": "str", "aliases": ["Prefix"]}, }, + "aliases": ["Destination"], + }, + "enabled": {"type": "bool", "aliases": ["Enabled"]}, + "id": {"type": "str", "aliases": ["Id"]}, + "included_object_versions": { + "type": "str", + "choices": ["All", "Current"], + "aliases": ["IncludedObjectVersions"], }, - "enabled": {"type": "bool"}, - "id": {"type": "str"}, - "included_object_versions": {"type": "str", "choices": ["All", "Current"]}, "optional_fields": { "type": "list", "elements": "str", @@ -1534,10 +2009,16 @@ def main(): "Size", "StorageClass", ], + "aliases": ["OptionalFields"], + }, + "prefix": {"type": "str", "aliases": ["Prefix"]}, + "schedule_frequency": { + "type": "str", + "choices": ["Daily", "Weekly"], + "aliases": ["ScheduleFrequency"], }, - "prefix": {"type": "str"}, - "schedule_frequency": {"type": "str", "choices": ["Daily", "Weekly"]}, }, + "aliases": ["InventoryConfigurations"], } argument_spec["lifecycle_configuration"] = { "type": "dict", @@ -1548,19 +2029,41 @@ def main(): "options": { "abort_incomplete_multipart_upload": { "type": "dict", - "options": {"days_after_initiation": {"type": "int"}}, + "options": { + "days_after_initiation": { + "type": "int", + "aliases": ["DaysAfterInitiation"], + } + }, + "aliases": ["AbortIncompleteMultipartUpload"], + }, + "expiration_date": {"type": "str", "aliases": ["ExpirationDate"]}, + "expiration_in_days": { + "type": "int", + "aliases": ["ExpirationInDays"], + }, + "expired_object_delete_marker": { + "type": "bool", + "aliases": ["ExpiredObjectDeleteMarker"], + }, + "id": {"type": "str", "aliases": ["Id"]}, + "noncurrent_version_expiration_in_days": { + "type": "int", + "aliases": ["NoncurrentVersionExpirationInDays"], }, - "expiration_date": {"type": "str"}, - "expiration_in_days": {"type": "int"}, - "expired_object_delete_marker": {"type": "bool"}, - "id": {"type": "str"}, - "noncurrent_version_expiration_in_days": {"type": "int"}, "noncurrent_version_expiration": { "type": "dict", "options": { - "noncurrent_days": {"type": "int"}, - "newer_noncurrent_versions": {"type": "int"}, + "noncurrent_days": { + "type": "int", + "aliases": ["NoncurrentDays"], + }, + "newer_noncurrent_versions": { + "type": "int", + "aliases": ["NewerNoncurrentVersions"], + }, }, + "aliases": ["NoncurrentVersionExpiration"], }, "noncurrent_version_transition": { "type": "dict", @@ -1576,10 +2079,18 @@ def main(): "ONEZONE_IA", "STANDARD_IA", ], + "aliases": ["StorageClass"], + }, + "transition_in_days": { + "type": "int", + "aliases": ["TransitionInDays"], + }, + "newer_noncurrent_versions": { + "type": "int", + "aliases": ["NewerNoncurrentVersions"], }, - "transition_in_days": {"type": "int"}, - "newer_noncurrent_versions": {"type": "int"}, }, + "aliases": ["NoncurrentVersionTransition"], }, "noncurrent_version_transitions": { "type": "list", @@ -1596,20 +2107,42 @@ def main(): "ONEZONE_IA", "STANDARD_IA", ], + "aliases": ["StorageClass"], + }, + "transition_in_days": { + "type": "int", + "aliases": ["TransitionInDays"], + }, + "newer_noncurrent_versions": { + "type": "int", + "aliases": ["NewerNoncurrentVersions"], }, - "transition_in_days": {"type": "int"}, - "newer_noncurrent_versions": {"type": "int"}, }, + "aliases": ["NoncurrentVersionTransitions"], + }, + "prefix": {"type": "str", "aliases": ["Prefix"]}, + "status": { + "type": "str", + "choices": ["Disabled", "Enabled"], + "aliases": ["Status"], }, - "prefix": {"type": "str"}, - "status": {"type": "str", "choices": ["Disabled", "Enabled"]}, "tag_filters": { "type": "list", "elements": "dict", - "options": {"value": {"type": "str"}, "key": {"type": "str"}}, + "options": { + "value": {"type": "str", "aliases": ["Value"]}, + "key": {"type": "str", "aliases": ["Key"]}, + }, + "aliases": ["TagFilters"], + }, + "object_size_greater_than": { + "type": "str", + "aliases": ["ObjectSizeGreaterThan"], + }, + "object_size_less_than": { + "type": "str", + "aliases": ["ObjectSizeLessThan"], }, - "object_size_greater_than": {"type": "str"}, - "object_size_less_than": {"type": "str"}, "transition": { "type": "dict", "options": { @@ -1624,10 +2157,18 @@ def main(): "ONEZONE_IA", "STANDARD_IA", ], + "aliases": ["StorageClass"], + }, + "transition_date": { + "type": "str", + "aliases": ["TransitionDate"], + }, + "transition_in_days": { + "type": "int", + "aliases": ["TransitionInDays"], }, - "transition_date": {"type": "str"}, - "transition_in_days": {"type": "int"}, }, + "aliases": ["Transition"], }, "transitions": { "type": "list", @@ -1644,35 +2185,54 @@ def main(): "ONEZONE_IA", "STANDARD_IA", ], + "aliases": ["StorageClass"], + }, + "transition_date": { + "type": "str", + "aliases": ["TransitionDate"], + }, + "transition_in_days": { + "type": "int", + "aliases": ["TransitionInDays"], }, - "transition_date": {"type": "str"}, - "transition_in_days": {"type": "int"}, }, + "aliases": ["Transitions"], }, }, + "aliases": ["Rules"], } }, + "aliases": ["LifecycleConfiguration"], } argument_spec["logging_configuration"] = { "type": "dict", "options": { - "destination_bucket_name": {"type": "str"}, - "log_file_prefix": {"type": "str"}, + "destination_bucket_name": { + "type": "str", + "aliases": ["DestinationBucketName"], + }, + "log_file_prefix": {"type": "str", "aliases": ["LogFilePrefix"]}, }, + "aliases": ["LoggingConfiguration"], } argument_spec["metrics_configurations"] = { "type": "list", "elements": "dict", "options": { - "access_point_arn": {"type": "str"}, - "id": {"type": "str"}, - "prefix": {"type": "str"}, + "access_point_arn": {"type": "str", "aliases": ["AccessPointArn"]}, + "id": {"type": "str", "aliases": ["Id"]}, + "prefix": {"type": "str", "aliases": ["Prefix"]}, "tag_filters": { "type": "list", "elements": "dict", - "options": {"value": {"type": "str"}, "key": {"type": "str"}}, + "options": { + "value": {"type": "str", "aliases": ["Value"]}, + "key": {"type": "str", "aliases": ["Key"]}, + }, + "aliases": ["TagFilters"], }, }, + "aliases": ["MetricsConfigurations"], } argument_spec["notification_configuration"] = { "type": "dict", @@ -1680,14 +2240,19 @@ def main(): "event_bridge_configuration": { "type": "dict", "options": { - "event_bridge_enabled": {"type": "bool", "default": "true"} + "event_bridge_enabled": { + "type": "bool", + "default": "true", + "aliases": ["EventBridgeEnabled"], + } }, + "aliases": ["EventBridgeConfiguration"], }, "lambda_configurations": { "type": "list", "elements": "dict", "options": { - "event": {"type": "str"}, + "event": {"type": "str", "aliases": ["Event"]}, "filter": { "type": "dict", "options": { @@ -1698,22 +2263,32 @@ def main(): "type": "list", "elements": "dict", "options": { - "name": {"type": "str"}, - "value": {"type": "str"}, + "name": { + "type": "str", + "aliases": ["Name"], + }, + "value": { + "type": "str", + "aliases": ["Value"], + }, }, + "aliases": ["Rules"], } }, + "aliases": ["S3Key"], } }, + "aliases": ["Filter"], }, - "function": {"type": "str"}, + "function": {"type": "str", "aliases": ["Function"]}, }, + "aliases": ["LambdaConfigurations"], }, "queue_configurations": { "type": "list", "elements": "dict", "options": { - "event": {"type": "str"}, + "event": {"type": "str", "aliases": ["Event"]}, "filter": { "type": "dict", "options": { @@ -1724,22 +2299,32 @@ def main(): "type": "list", "elements": "dict", "options": { - "name": {"type": "str"}, - "value": {"type": "str"}, + "name": { + "type": "str", + "aliases": ["Name"], + }, + "value": { + "type": "str", + "aliases": ["Value"], + }, }, + "aliases": ["Rules"], } }, + "aliases": ["S3Key"], } }, + "aliases": ["Filter"], }, - "queue": {"type": "str"}, + "queue": {"type": "str", "aliases": ["Queue"]}, }, + "aliases": ["QueueConfigurations"], }, "topic_configurations": { "type": "list", "elements": "dict", "options": { - "event": {"type": "str"}, + "event": {"type": "str", "aliases": ["Event"]}, "filter": { "type": "dict", "options": { @@ -1750,42 +2335,64 @@ def main(): "type": "list", "elements": "dict", "options": { - "name": {"type": "str"}, - "value": {"type": "str"}, + "name": { + "type": "str", + "aliases": ["Name"], + }, + "value": { + "type": "str", + "aliases": ["Value"], + }, }, + "aliases": ["Rules"], } }, + "aliases": ["S3Key"], } }, + "aliases": ["Filter"], }, - "topic": {"type": "str"}, + "topic": {"type": "str", "aliases": ["Topic"]}, }, + "aliases": ["TopicConfigurations"], }, }, + "aliases": ["NotificationConfiguration"], } argument_spec["object_lock_configuration"] = { "type": "dict", "options": { - "object_lock_enabled": {"type": "str", "default": "Enabled"}, + "object_lock_enabled": { + "type": "str", + "default": "Enabled", + "aliases": ["ObjectLockEnabled"], + }, "rule": { "type": "dict", "options": { "default_retention": { "type": "dict", "options": { - "years": {"type": "int"}, - "days": {"type": "int"}, + "years": {"type": "int", "aliases": ["Years"]}, + "days": {"type": "int", "aliases": ["Days"]}, "mode": { "type": "str", "choices": ["COMPLIANCE", "GOVERNANCE"], + "aliases": ["Mode"], }, }, + "aliases": ["DefaultRetention"], } }, + "aliases": ["Rule"], }, }, + "aliases": ["ObjectLockConfiguration"], + } + argument_spec["object_lock_enabled"] = { + "type": "bool", + "aliases": ["ObjectLockEnabled"], } - argument_spec["object_lock_enabled"] = {"type": "bool"} argument_spec["ownership_controls"] = { "type": "dict", "options": { @@ -1800,24 +2407,31 @@ def main(): "BucketOwnerPreferred", "ObjectWriter", ], + "aliases": ["ObjectOwnership"], } }, + "aliases": ["Rules"], } }, + "aliases": ["OwnershipControls"], } argument_spec["public_access_block_configuration"] = { "type": "dict", "options": { - "block_public_acls": {"type": "bool"}, - "block_public_policy": {"type": "bool"}, - "ignore_public_acls": {"type": "bool"}, - "restrict_public_buckets": {"type": "bool"}, + "block_public_acls": {"type": "bool", "aliases": ["BlockPublicAcls"]}, + "block_public_policy": {"type": "bool", "aliases": ["BlockPublicPolicy"]}, + "ignore_public_acls": {"type": "bool", "aliases": ["IgnorePublicAcls"]}, + "restrict_public_buckets": { + "type": "bool", + "aliases": ["RestrictPublicBuckets"], + }, }, + "aliases": ["PublicAccessBlockConfiguration"], } argument_spec["replication_configuration"] = { "type": "dict", "options": { - "role": {"type": "str"}, + "role": {"type": "str", "aliases": ["Role"]}, "rules": { "type": "list", "elements": "dict", @@ -1828,8 +2442,10 @@ def main(): "status": { "type": "str", "choices": ["Disabled", "Enabled"], + "aliases": ["Status"], } }, + "aliases": ["DeleteMarkerReplication"], }, "destination": { "type": "dict", @@ -1837,27 +2453,46 @@ def main(): "access_control_translation": { "type": "dict", "options": { - "owner": {"type": "str", "default": "Destination"} + "owner": { + "type": "str", + "default": "Destination", + "aliases": ["Owner"], + } }, + "aliases": ["AccessControlTranslation"], }, - "account": {"type": "str"}, - "bucket": {"type": "str"}, + "account": {"type": "str", "aliases": ["Account"]}, + "bucket": {"type": "str", "aliases": ["Bucket"]}, "encryption_configuration": { "type": "dict", - "options": {"replica_kms_key_id": {"type": "str"}}, + "options": { + "replica_kms_key_id": { + "type": "str", + "aliases": ["ReplicaKmsKeyID"], + } + }, + "aliases": ["EncryptionConfiguration"], }, "metrics": { "type": "dict", "options": { "event_threshold": { "type": "dict", - "options": {"minutes": {"type": "int"}}, + "options": { + "minutes": { + "type": "int", + "aliases": ["Minutes"], + } + }, + "aliases": ["EventThreshold"], }, "status": { "type": "str", "choices": ["Disabled", "Enabled"], + "aliases": ["Status"], }, }, + "aliases": ["Metrics"], }, "replication_time": { "type": "dict", @@ -1865,12 +2500,20 @@ def main(): "status": { "type": "str", "choices": ["Disabled", "Enabled"], + "aliases": ["Status"], }, "time": { "type": "dict", - "options": {"minutes": {"type": "int"}}, + "options": { + "minutes": { + "type": "int", + "aliases": ["Minutes"], + } + }, + "aliases": ["Time"], }, }, + "aliases": ["ReplicationTime"], }, "storage_class": { "type": "str", @@ -1884,8 +2527,10 @@ def main(): "STANDARD", "STANDARD_IA", ], + "aliases": ["StorageClass"], }, }, + "aliases": ["Destination"], }, "filter": { "type": "dict", @@ -1893,30 +2538,37 @@ def main(): "and": { "type": "dict", "options": { - "prefix": {"type": "str"}, + "prefix": {"type": "str", "aliases": ["Prefix"]}, "tag_filters": { "type": "list", "elements": "dict", "options": { - "value": {"type": "str"}, - "key": {"type": "str"}, + "value": { + "type": "str", + "aliases": ["Value"], + }, + "key": {"type": "str", "aliases": ["Key"]}, }, + "aliases": ["TagFilters"], }, }, + "aliases": ["And"], }, - "prefix": {"type": "str"}, + "prefix": {"type": "str", "aliases": ["Prefix"]}, "tag_filter": { "type": "dict", "options": { - "value": {"type": "str"}, - "key": {"type": "str"}, + "value": {"type": "str", "aliases": ["Value"]}, + "key": {"type": "str", "aliases": ["Key"]}, }, + "aliases": ["TagFilter"], }, }, + "aliases": ["Filter"], }, - "id": {"type": "str"}, - "prefix": {"type": "str"}, - "priority": {"type": "int"}, + "id": {"type": "str", "aliases": ["Id"]}, + "prefix": {"type": "str", "aliases": ["Prefix"]}, + "priority": {"type": "int", "aliases": ["Priority"]}, "source_selection_criteria": { "type": "dict", "options": { @@ -1926,8 +2578,10 @@ def main(): "status": { "type": "str", "choices": ["Disabled", "Enabled"], + "aliases": ["Status"], } }, + "aliases": ["ReplicaModifications"], }, "sse_kms_encrypted_objects": { "type": "dict", @@ -1935,17 +2589,26 @@ def main(): "status": { "type": "str", "choices": ["Disabled", "Enabled"], + "aliases": ["Status"], } }, + "aliases": ["SseKmsEncryptedObjects"], }, }, + "aliases": ["SourceSelectionCriteria"], + }, + "status": { + "type": "str", + "choices": ["Disabled", "Enabled"], + "aliases": ["Status"], }, - "status": {"type": "str", "choices": ["Disabled", "Enabled"]}, }, + "aliases": ["Rules"], }, }, + "aliases": ["ReplicationConfiguration"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["versioning_configuration"] = { "type": "dict", "options": { @@ -1953,14 +2616,16 @@ def main(): "type": "str", "default": "Suspended", "choices": ["Enabled", "Suspended"], + "aliases": ["Status"], } }, + "aliases": ["VersioningConfiguration"], } argument_spec["website_configuration"] = { "type": "dict", "options": { - "error_document": {"type": "str"}, - "index_document": {"type": "str"}, + "error_document": {"type": "str", "aliases": ["ErrorDocument"]}, + "index_document": {"type": "str", "aliases": ["IndexDocument"]}, "routing_rules": { "type": "list", "elements": "dict", @@ -1968,30 +2633,58 @@ def main(): "redirect_rule": { "type": "dict", "options": { - "host_name": {"type": "str"}, - "http_redirect_code": {"type": "str"}, - "protocol": {"type": "str", "choices": ["http", "https"]}, - "replace_key_prefix_with": {"type": "str"}, - "replace_key_with": {"type": "str"}, + "host_name": {"type": "str", "aliases": ["HostName"]}, + "http_redirect_code": { + "type": "str", + "aliases": ["HttpRedirectCode"], + }, + "protocol": { + "type": "str", + "choices": ["http", "https"], + "aliases": ["Protocol"], + }, + "replace_key_prefix_with": { + "type": "str", + "aliases": ["ReplaceKeyPrefixWith"], + }, + "replace_key_with": { + "type": "str", + "aliases": ["ReplaceKeyWith"], + }, }, + "aliases": ["RedirectRule"], }, "routing_rule_condition": { "type": "dict", "options": { - "key_prefix_equals": {"type": "str"}, - "http_error_code_returned_equals": {"type": "str"}, + "key_prefix_equals": { + "type": "str", + "aliases": ["KeyPrefixEquals"], + }, + "http_error_code_returned_equals": { + "type": "str", + "aliases": ["HttpErrorCodeReturnedEquals"], + }, }, + "aliases": ["RoutingRuleCondition"], }, }, + "aliases": ["RoutingRules"], }, "redirect_all_requests_to": { "type": "dict", "options": { - "host_name": {"type": "str"}, - "protocol": {"type": "str", "choices": ["http", "https"]}, + "host_name": {"type": "str", "aliases": ["HostName"]}, + "protocol": { + "type": "str", + "choices": ["http", "https"], + "aliases": ["Protocol"], + }, }, + "aliases": ["RedirectAllRequestsTo"], }, }, + "aliases": ["WebsiteConfiguration"], } argument_spec["state"] = { "type": "str", @@ -2050,22 +2743,23 @@ def main(): params["website_configuration"] = module.params.get("website_configuration") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["bucket_name", "object_lock_enabled"] + create_only_params = ["/properties/BucketName", "/properties/ObjectLockEnabled"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["bucket_name"] + identifier = ["/properties/BucketName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/s3_multi_region_access_point.py b/plugins/modules/s3_multi_region_access_point.py index 07f86167..2a31c536 100644 --- a/plugins/modules/s3_multi_region_access_point.py +++ b/plugins/modules/s3_multi_region_access_point.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -23,10 +23,14 @@ be performed on it. type: bool name: + aliases: + - Name description: - The name you want to assign to this Multi Region Access Point. type: str public_access_block_configuration: + aliases: + - PublicAccessBlockConfiguration description: - The PublicAccessBlock configuration that you want to apply to this Multi Region Access Point. @@ -36,6 +40,8 @@ The Meaning of Public in the Amazon Simple Storage Service Developer Guide. suboptions: block_public_acls: + aliases: + - BlockPublicAcls description: - Specifies whether Amazon S3 should block public access control lists (ACLs) for buckets in this account. @@ -47,6 +53,8 @@ - Enabling this setting doesnt affect existing policies or ACLs. type: bool block_public_policy: + aliases: + - BlockPublicPolicy description: - Specifies whether Amazon S3 should block public bucket policies for buckets in this account. @@ -56,6 +64,8 @@ - Enabling this setting doesnt affect existing bucket policies. type: bool ignore_public_acls: + aliases: + - IgnorePublicAcls description: - Specifies whether Amazon S3 should ignore public ACLs for buckets in this account. @@ -65,6 +75,8 @@ ACLs and doesnt prevent new public ACLs from being set. type: bool restrict_public_buckets: + aliases: + - RestrictPublicBuckets description: - Specifies whether Amazon S3 should restrict public bucket policies for this bucket. @@ -78,12 +90,22 @@ type: bool type: dict regions: + aliases: + - Regions description: - The name of the bucket that represents of the region belonging to this Multi Region Access Point. elements: dict suboptions: bucket: + aliases: + - Bucket + description: + - Not Provived. + type: str + bucket_account_id: + aliases: + - BucketAccountId description: - Not Provived. type: str @@ -150,11 +172,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -166,21 +189,29 @@ def main(): ), ) + argument_spec["name"] = {"type": "str", "aliases": ["Name"]} argument_spec["public_access_block_configuration"] = { "type": "dict", "options": { - "restrict_public_buckets": {"type": "bool"}, - "block_public_policy": {"type": "bool"}, - "block_public_acls": {"type": "bool"}, - "ignore_public_acls": {"type": "bool"}, + "block_public_acls": {"type": "bool", "aliases": ["BlockPublicAcls"]}, + "ignore_public_acls": {"type": "bool", "aliases": ["IgnorePublicAcls"]}, + "block_public_policy": {"type": "bool", "aliases": ["BlockPublicPolicy"]}, + "restrict_public_buckets": { + "type": "bool", + "aliases": ["RestrictPublicBuckets"], + }, }, + "aliases": ["PublicAccessBlockConfiguration"], } argument_spec["regions"] = { "type": "list", "elements": "dict", - "options": {"bucket": {"type": "str"}}, + "options": { + "bucket": {"type": "str", "aliases": ["Bucket"]}, + "bucket_account_id": {"type": "str", "aliases": ["BucketAccountId"]}, + }, + "aliases": ["Regions"], } - argument_spec["name"] = {"type": "str"} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -191,7 +222,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["name", "regions"], True], + ["state", "present", ["regions", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] @@ -216,22 +247,27 @@ def main(): params["regions"] = module.params.get("regions") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["name", "public_access_block_configuration", "regions"] + create_only_params = [ + "/properties/Name", + "/properties/PublicAccessBlockConfiguration", + "/properties/Regions", + ] # Necessary to handle when module does not support all the states - handlers = ["read", "create", "list", "delete"] + handlers = ["create", "read", "delete", "list"] state = module.params.get("state") - identifier = ["name"] + identifier = ["/properties/Name"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/s3_multi_region_access_point_policy.py b/plugins/modules/s3_multi_region_access_point_policy.py index 19b074de..3ff03691 100644 --- a/plugins/modules/s3_multi_region_access_point_policy.py +++ b/plugins/modules/s3_multi_region_access_point_policy.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -24,10 +24,14 @@ be performed on it. type: bool mrap_name: + aliases: + - MrapName description: - The name of the Multi Region Access Point to apply policy. type: str policy: + aliases: + - Policy description: - Policy document to apply to a Multi Region Access Point. type: dict @@ -93,11 +97,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -109,8 +114,8 @@ def main(): ), ) - argument_spec["mrap_name"] = {"type": "str"} - argument_spec["policy"] = {"type": "dict"} + argument_spec["mrap_name"] = {"type": "str", "aliases": ["MrapName"]} + argument_spec["policy"] = {"type": "dict", "aliases": ["Policy"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -143,22 +148,23 @@ def main(): params["policy"] = module.params.get("policy") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["mrap_name"] + create_only_params = ["/properties/MrapName"] # Necessary to handle when module does not support all the states handlers = ["update", "read", "list", "delete", "create"] state = module.params.get("state") - identifier = ["mrap_name"] + identifier = ["/properties/MrapName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/s3objectlambda_access_point.py b/plugins/modules/s3objectlambda_access_point.py index 068ddab6..0f250b93 100644 --- a/plugins/modules/s3objectlambda_access_point.py +++ b/plugins/modules/s3objectlambda_access_point.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -24,10 +24,14 @@ be performed on it. type: bool name: + aliases: + - Name description: - The name you want to assign to this Object lambda Access Point. type: str object_lambda_configuration: + aliases: + - ObjectLambdaConfiguration description: - The Object lambda Access Point Configuration that configures transformations to be applied on the objects on specified S3 ActionsConfiguration to be @@ -38,42 +42,60 @@ - Default setting for Cloudwatch metrics is disable. suboptions: allowed_features: + aliases: + - AllowedFeatures description: - Not Provived. elements: str type: list cloud_watch_metrics_enabled: + aliases: + - CloudWatchMetricsEnabled description: - Not Provived. type: bool supporting_access_point: + aliases: + - SupportingAccessPoint description: - Not Provived. type: str transformation_configurations: + aliases: + - TransformationConfigurations description: - Configuration to define what content transformation will be applied on which S3 Action. elements: dict suboptions: actions: + aliases: + - Actions description: - Not Provived. elements: str type: list content_transformation: + aliases: + - ContentTransformation description: - Not Provived. suboptions: aws_lambda: + aliases: + - AwsLambda description: - Not Provived. suboptions: function_arn: + aliases: + - FunctionArn description: - Not Provived. type: str function_payload: + aliases: + - FunctionPayload description: - Not Provived. type: str @@ -108,7 +130,7 @@ - How many seconds to wait for an operation to complete before timing out. type: int author: Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 0.2.0 extends_documentation_fragment: - amazon.aws.aws - amazon.aws.ec2 @@ -143,11 +165,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -159,33 +182,57 @@ def main(): ), ) - argument_spec["name"] = {"type": "str"} + argument_spec["name"] = {"type": "str", "aliases": ["Name"]} argument_spec["object_lambda_configuration"] = { "type": "dict", "options": { - "supporting_access_point": {"type": "str"}, - "allowed_features": {"type": "list", "elements": "str"}, - "cloud_watch_metrics_enabled": {"type": "bool"}, + "supporting_access_point": { + "type": "str", + "aliases": ["SupportingAccessPoint"], + }, + "allowed_features": { + "type": "list", + "elements": "str", + "aliases": ["AllowedFeatures"], + }, + "cloud_watch_metrics_enabled": { + "type": "bool", + "aliases": ["CloudWatchMetricsEnabled"], + }, "transformation_configurations": { "type": "list", "elements": "dict", "options": { - "actions": {"type": "list", "elements": "str"}, + "actions": { + "type": "list", + "elements": "str", + "aliases": ["Actions"], + }, "content_transformation": { "type": "dict", "options": { "aws_lambda": { "type": "dict", "options": { - "function_arn": {"type": "str"}, - "function_payload": {"type": "str"}, + "function_arn": { + "type": "str", + "aliases": ["FunctionArn"], + }, + "function_payload": { + "type": "str", + "aliases": ["FunctionPayload"], + }, }, + "aliases": ["AwsLambda"], } }, + "aliases": ["ContentTransformation"], }, }, + "aliases": ["TransformationConfigurations"], }, }, + "aliases": ["ObjectLambdaConfiguration"], } argument_spec["state"] = { "type": "str", @@ -197,7 +244,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["name", "object_lambda_configuration"], True], + ["state", "present", ["object_lambda_configuration", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] @@ -221,22 +268,23 @@ def main(): ) # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["name"] + create_only_params = ["/properties/Name"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["name"] + identifier = ["/properties/Name"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/s3objectlambda_access_point_policy.py b/plugins/modules/s3objectlambda_access_point_policy.py index f4e69bb7..ec3091d7 100644 --- a/plugins/modules/s3objectlambda_access_point_policy.py +++ b/plugins/modules/s3objectlambda_access_point_policy.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -23,10 +23,14 @@ be performed on it. type: bool object_lambda_access_point: + aliases: + - ObjectLambdaAccessPoint description: - The name of the Amazon S3 ObjectLambdaAccessPoint to which the policy applies. type: str policy_document: + aliases: + - PolicyDocument description: - A policy document containing permissions to add to the specified ObjectLambdaAccessPoint. - For more information, see Access Policy Language Overview (U(https://docs.aws.amazon.com/AmazonS3/latest/dev/access-policy-language-overview.html)) @@ -59,7 +63,7 @@ - How many seconds to wait for an operation to complete before timing out. type: int author: Ansible Cloud Team (@ansible-collections) -version_added: 0.1.0 +version_added: 0.2.0 extends_documentation_fragment: - amazon.aws.aws - amazon.aws.ec2 @@ -94,11 +98,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -110,8 +115,11 @@ def main(): ), ) - argument_spec["object_lambda_access_point"] = {"type": "str"} - argument_spec["policy_document"] = {"type": "dict"} + argument_spec["object_lambda_access_point"] = { + "type": "str", + "aliases": ["ObjectLambdaAccessPoint"], + } + argument_spec["policy_document"] = {"type": "dict", "aliases": ["PolicyDocument"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -146,22 +154,23 @@ def main(): params["policy_document"] = module.params.get("policy_document") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["object_lambda_access_point"] + create_only_params = ["/properties/ObjectLambdaAccessPoint"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete"] state = module.params.get("state") - identifier = ["object_lambda_access_point"] + identifier = ["/properties/ObjectLambdaAccessPoint"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ssm_document.py b/plugins/modules/ssm_document.py index ac79f0c1..40b11e8c 100644 --- a/plugins/modules/ssm_document.py +++ b/plugins/modules/ssm_document.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -15,12 +15,16 @@ - This document defines the actions that Systems Manager performs on your AWS resources. options: attachments: + aliases: + - Attachments description: - A list of key and value pairs that describe attachments to a version of a document. elements: dict suboptions: key: + aliases: + - Key choices: - AttachmentReference - S3FileUrl @@ -30,10 +34,14 @@ to a document. type: str name: + aliases: + - Name description: - The name of the document attachment file. type: str values: + aliases: + - Values description: - The value of a key-value pair that identifies the location of an attachment to a document. @@ -42,10 +50,14 @@ type: list type: list content: + aliases: + - Content description: - The content for the Systems Manager document in JSON, YAML or String format. type: dict document_format: + aliases: + - DocumentFormat choices: - JSON - TEXT @@ -56,6 +68,8 @@ - The document format can be either JSON or YAML. JSON is the default format. type: str document_type: + aliases: + - DocumentType choices: - ApplicationConfiguration - ApplicationConfigurationSchema @@ -83,6 +97,8 @@ be performed on it. type: bool name: + aliases: + - Name description: - A name for the Systems Manager document. type: str @@ -92,6 +108,8 @@ - Remove tags not listed in I(tags). type: bool requires: + aliases: + - Requires description: - A list of SSM documents required by a document. - For example, an ApplicationConfiguration document requires an ApplicationConfigurationSchema @@ -99,11 +117,15 @@ elements: dict suboptions: name: + aliases: + - Name description: - The name of the required SSM document. - The name can be an Amazon Resource Name (ARN). type: str version: + aliases: + - Version description: - The document version required by the current document. type: str @@ -126,17 +148,22 @@ type: str tags: aliases: + - Tags - resource_tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). type: dict target_type: + aliases: + - TargetType description: - Specify a target type to define the kinds of resources the document can run on. type: str update_method: + aliases: + - UpdateMethod choices: - NewVersion - Replace @@ -146,6 +173,8 @@ document; when set to NewVersion, the update will create a new version. type: str version_name: + aliases: + - VersionName description: - An optional field specifying the version of the artifact you are creating with the document. @@ -197,11 +226,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -213,7 +243,7 @@ def main(): ), ) - argument_spec["content"] = {"type": "dict"} + argument_spec["content"] = {"type": "dict", "aliases": ["Content"]} argument_spec["attachments"] = { "type": "list", "elements": "dict", @@ -221,13 +251,15 @@ def main(): "key": { "type": "str", "choices": ["AttachmentReference", "S3FileUrl", "SourceUrl"], + "aliases": ["Key"], }, - "values": {"type": "list", "elements": "str"}, - "name": {"type": "str"}, + "values": {"type": "list", "elements": "str", "aliases": ["Values"]}, + "name": {"type": "str", "aliases": ["Name"]}, }, + "aliases": ["Attachments"], } - argument_spec["name"] = {"type": "str"} - argument_spec["version_name"] = {"type": "str"} + argument_spec["name"] = {"type": "str", "aliases": ["Name"]} + argument_spec["version_name"] = {"type": "str", "aliases": ["VersionName"]} argument_spec["document_type"] = { "type": "str", "choices": [ @@ -245,23 +277,30 @@ def main(): "ProblemAnalysisTemplate", "Session", ], + "aliases": ["DocumentType"], } argument_spec["document_format"] = { "type": "str", "default": "JSON", "choices": ["JSON", "TEXT", "YAML"], + "aliases": ["DocumentFormat"], } - argument_spec["target_type"] = {"type": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["target_type"] = {"type": "str", "aliases": ["TargetType"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["requires"] = { "type": "list", "elements": "dict", - "options": {"name": {"type": "str"}, "version": {"type": "str"}}, + "options": { + "name": {"type": "str", "aliases": ["Name"]}, + "version": {"type": "str", "aliases": ["Version"]}, + }, + "aliases": ["Requires"], } argument_spec["update_method"] = { "type": "str", "default": "Replace", "choices": ["NewVersion", "Replace"], + "aliases": ["UpdateMethod"], } argument_spec["state"] = { "type": "str", @@ -274,7 +313,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["name", "content"], True], + ["state", "present", ["content", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] @@ -304,22 +343,23 @@ def main(): params["version_name"] = module.params.get("version_name") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["name", "document_type"] + create_only_params = ["/properties/Name", "/properties/DocumentType"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["name"] + identifier = ["/properties/Name"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ssm_resource_data_sync.py b/plugins/modules/ssm_resource_data_sync.py deleted file mode 100644 index 0ae4f85c..00000000 --- a/plugins/modules/ssm_resource_data_sync.py +++ /dev/null @@ -1,314 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# Copyright: (c) 2022, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette - - -DOCUMENTATION = r""" -module: ssm_resource_data_sync -short_description: Creates and manages a resource data sync -description: -- Creates and manages a resource data sync for AWS Systems Manager. -- A resource data sync helps you view data from multiple sources in a single location. -options: - bucket_name: - description: - - Not Provived. - type: str - bucket_prefix: - description: - - Not Provived. - type: str - bucket_region: - description: - - Not Provived. - type: str - force: - default: false - description: - - Cancel IN_PROGRESS and PENDING resource requestes. - - Because you can only perform a single operation on a given resource at a - time, there might be cases where you need to cancel the current resource - operation to make the resource available so that another operation may - be performed on it. - type: bool - kms_key_arn: - description: - - Not Provived. - type: str - s3_destination: - description: - - Not Provived. - suboptions: - bucket_name: - description: - - Not Provived. - type: str - bucket_prefix: - description: - - Not Provived. - type: str - bucket_region: - description: - - Not Provived. - type: str - kms_key_arn: - description: - - Not Provived. - type: str - sync_format: - description: - - Not Provived. - type: str - type: dict - state: - choices: - - present - - absent - - list - - describe - - get - default: present - description: - - Goal state for resource. - - I(state=present) creates the resource if it doesn't exist, or updates to - the provided state if the resource already exists. - - I(state=absent) ensures an existing instance is deleted. - - I(state=list) get all the existing resources. - - I(state=describe) or I(state=get) retrieves information on an existing resource. - type: str - sync_format: - description: - - Not Provived. - type: str - sync_name: - description: - - Not Provived. - type: str - sync_source: - description: - - Not Provived. - suboptions: - aws_organizations_source: - description: - - Not Provived. - suboptions: - organization_source_type: - description: - - Not Provived. - type: str - organizational_units: - description: - - Not Provived. - elements: str - type: list - type: dict - include_future_regions: - description: - - Not Provived. - type: bool - source_regions: - description: - - Not Provived. - elements: str - type: list - source_type: - description: - - Not Provived. - type: str - type: dict - sync_type: - description: - - Not Provived. - type: str - wait: - default: false - description: - - Wait for operation to complete before returning. - type: bool - wait_timeout: - default: 320 - description: - - How many seconds to wait for an operation to complete before timing out. - type: int -author: Ansible Cloud Team (@ansible-collections) -version_added: 0.3.0 -extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.cloud.boto3 -""" - -EXAMPLES = r""" -""" - -RETURN = r""" -result: - description: - - When I(state=list), it is a list containing dictionaries of resource information. - - Otherwise, it is a dictionary of resource information. - - When I(state=absent), it is an empty dictionary. - returned: always - type: complex - contains: - identifier: - description: The unique identifier of the resource. - type: str - properties: - description: The resource properties. - type: dict -""" - - -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - CloudControlResource, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, -) - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["s3_destination"] = { - "type": "dict", - "options": { - "kms_key_arn": {"type": "str"}, - "bucket_prefix": {"type": "str"}, - "bucket_name": {"type": "str"}, - "bucket_region": {"type": "str"}, - "sync_format": {"type": "str"}, - }, - } - argument_spec["kms_key_arn"] = {"type": "str"} - argument_spec["sync_source"] = { - "type": "dict", - "options": { - "include_future_regions": {"type": "bool"}, - "source_regions": {"type": "list", "elements": "str"}, - "source_type": {"type": "str"}, - "aws_organizations_source": { - "type": "dict", - "options": { - "organizational_units": {"type": "list", "elements": "str"}, - "organization_source_type": {"type": "str"}, - }, - }, - }, - } - argument_spec["bucket_name"] = {"type": "str"} - argument_spec["bucket_region"] = {"type": "str"} - argument_spec["sync_format"] = {"type": "str"} - argument_spec["sync_name"] = {"type": "str"} - argument_spec["sync_type"] = {"type": "str"} - argument_spec["bucket_prefix"] = {"type": "str"} - argument_spec["state"] = { - "type": "str", - "choices": ["present", "absent", "list", "describe", "get"], - "default": "present", - } - argument_spec["wait"] = {"type": "bool", "default": False} - argument_spec["wait_timeout"] = {"type": "int", "default": 320} - argument_spec["force"] = {"type": "bool", "default": False} - - required_if = [ - ["state", "present", ["sync_name"], True], - ["state", "absent", ["sync_name"], True], - ["state", "get", ["sync_name"], True], - ] - mutually_exclusive = [] - - module = AnsibleAmazonCloudModule( - argument_spec=argument_spec, - required_if=required_if, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - cloud = CloudControlResource(module) - - type_name = "AWS::SSM::ResourceDataSync" - - params = {} - - params["bucket_name"] = module.params.get("bucket_name") - params["bucket_prefix"] = module.params.get("bucket_prefix") - params["bucket_region"] = module.params.get("bucket_region") - params["kms_key_arn"] = module.params.get("kms_key_arn") - params["s3_destination"] = module.params.get("s3_destination") - params["sync_format"] = module.params.get("sync_format") - params["sync_name"] = module.params.get("sync_name") - params["sync_source"] = module.params.get("sync_source") - params["sync_type"] = module.params.get("sync_type") - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} - - # Only if resource is taggable - if module.params.get("tags") is not None: - _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - - # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = [ - "kms_key_arn", - "sync_format", - "bucket_prefix", - "sync_name", - "bucket_region", - "bucket_name", - "s3_destination", - "sync_type", - ] - - # Necessary to handle when module does not support all the states - handlers = ["create", "delete", "update", "list", "read"] - - state = module.params.get("state") - identifier = ["sync_name"] - - results = {"changed": False, "result": {}} - - if state == "list": - if "list" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be listed." - ) - results["result"] = cloud.list_resources(type_name, identifier) - - if state in ("describe", "get"): - if "read" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be read." - ) - results["result"] = cloud.get_resource(type_name, identifier) - - if state == "present": - results = cloud.present( - type_name, identifier, params_to_set, create_only_params - ) - - if state == "absent": - results["changed"] |= cloud.absent(type_name, identifier) - - module.exit_json(**results) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/wafv2_ip_set.py b/plugins/modules/wafv2_ip_set.py deleted file mode 100644 index 904d64c8..00000000 --- a/plugins/modules/wafv2_ip_set.py +++ /dev/null @@ -1,267 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# Copyright: (c) 2022, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette - - -DOCUMENTATION = r""" -module: wafv2_ip_set -short_description: Creates and manages and IP set -description: -- Creates and manages and IP set to identify web requests that originate from specific - IP addresses or ranges of IP addresses. -- For example, if you're receiving a lot of requests from a ranges of IP addresses, - you can configure AWS WAF to block them using an IP set that lists those IP addresses. -- For more information see U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-ipset.html). -options: - addresses: - description: - - IP address. - elements: str - type: list - description: - description: - - Description of the entity. - type: str - force: - default: false - description: - - Cancel IN_PROGRESS and PENDING resource requestes. - - Because you can only perform a single operation on a given resource at a - time, there might be cases where you need to cancel the current resource - operation to make the resource available so that another operation may - be performed on it. - type: bool - id: - description: - - Id of the IPSet. - type: str - identifier: - description: - - For compound primary identifiers, to specify the primary identifier as a - string, list each in the order that they are specified in the identifier - list definition, separated by '|'. - - For more details, visit U(https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html). - type: str - ip_address_version: - choices: - - IPV4 - - IPV6 - description: - - Type of addresses in the IPSet, use C(IPV4) for C(IPV4) IP addresses, C(IPV6) - for C(IPV6) address. - type: str - name: - description: - - Name of the IPSet. - type: str - purge_tags: - default: true - description: - - Remove tags not listed in I(tags). - type: bool - scope: - choices: - - CLOUDFRONT - - REGIONAL - description: - - Use C(CLOUDFRONT) for CloudFront IPSet, use C(REGIONAL) for Application - Load Balancer and API Gateway. - type: str - state: - choices: - - present - - absent - - list - - describe - - get - default: present - description: - - Goal state for resource. - - I(state=present) creates the resource if it doesn't exist, or updates to - the provided state if the resource already exists. - - I(state=absent) ensures an existing instance is deleted. - - I(state=list) get all the existing resources. - - I(state=describe) or I(state=get) retrieves information on an existing resource. - type: str - tags: - aliases: - - resource_tags - description: - - A dict of tags to apply to the resource. - - To remove all tags set I(tags={}) and I(purge_tags=true). - type: dict - wait: - default: false - description: - - Wait for operation to complete before returning. - type: bool - wait_timeout: - default: 320 - description: - - How many seconds to wait for an operation to complete before timing out. - type: int -author: Ansible Cloud Team (@ansible-collections) -version_added: 0.3.0 -extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.cloud.boto3 -""" - -EXAMPLES = r""" -""" - -RETURN = r""" -result: - description: - - When I(state=list), it is a list containing dictionaries of resource information. - - Otherwise, it is a dictionary of resource information. - - When I(state=absent), it is an empty dictionary. - returned: always - type: complex - contains: - identifier: - description: The unique identifier of the resource. - type: str - properties: - description: The resource properties. - type: dict -""" - - -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - CloudControlResource, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, -) - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["description"] = {"type": "str"} - argument_spec["name"] = {"type": "str"} - argument_spec["id"] = {"type": "str"} - argument_spec["scope"] = {"type": "str", "choices": ["CLOUDFRONT", "REGIONAL"]} - argument_spec["ip_address_version"] = {"type": "str", "choices": ["IPV4", "IPV6"]} - argument_spec["addresses"] = {"type": "list", "elements": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["state"] = { - "type": "str", - "choices": ["present", "absent", "list", "describe", "get"], - "default": "present", - } - argument_spec["wait"] = {"type": "bool", "default": False} - argument_spec["wait_timeout"] = {"type": "int", "default": 320} - argument_spec["force"] = {"type": "bool", "default": False} - argument_spec["purge_tags"] = {"type": "bool", "default": True} - argument_spec["identifier"] = {"type": "str"} - - required_if = [ - ["state", "list", ["name", "id"], True], - [ - "state", - "present", - ["addresses", "identifier", "scope", "id", "ip_address_version", "name"], - True, - ], - ["state", "absent", ["name", "id", "scope", "identifier"], True], - ["state", "get", ["name", "id", "scope", "identifier"], True], - ] - mutually_exclusive = [[("name", "id", "scope"), "identifier"]] - - module = AnsibleAmazonCloudModule( - argument_spec=argument_spec, - required_if=required_if, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - cloud = CloudControlResource(module) - - type_name = "AWS::WAFv2::IPSet" - - params = {} - - params["addresses"] = module.params.get("addresses") - params["description"] = module.params.get("description") - params["id"] = module.params.get("id") - params["identifier"] = module.params.get("identifier") - params["ip_address_version"] = module.params.get("ip_address_version") - params["name"] = module.params.get("name") - params["scope"] = module.params.get("scope") - params["tags"] = module.params.get("tags") - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} - - # Only if resource is taggable - if module.params.get("tags") is not None: - _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - - # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["name", "scope"] - - # Necessary to handle when module does not support all the states - handlers = ["create", "delete", "read", "update", "list"] - - state = module.params.get("state") - identifier = ["name", "id", "scope"] - if ( - state in ("present", "absent", "get", "describe") - and module.params.get("identifier") is None - ): - if ( - not module.params.get("name") - or not module.params.get("id") - or not module.params.get("scope") - ): - module.fail_json(f"You must specify both {*identifier, } identifiers.") - - results = {"changed": False, "result": {}} - - if state == "list": - if "list" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be listed." - ) - results["result"] = cloud.list_resources(type_name, identifier) - - if state in ("describe", "get"): - if "read" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be read." - ) - results["result"] = cloud.get_resource(type_name, identifier) - - if state == "present": - results = cloud.present( - type_name, identifier, params_to_set, create_only_params - ) - - if state == "absent": - results["changed"] |= cloud.absent(type_name, identifier) - - module.exit_json(**results) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/wafv2_logging_configuration.py b/plugins/modules/wafv2_logging_configuration.py index 92196171..b085e09f 100644 --- a/plugins/modules/wafv2_logging_configuration.py +++ b/plugins/modules/wafv2_logging_configuration.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -26,12 +26,16 @@ be performed on it. type: bool log_destination_configs: + aliases: + - LogDestinationConfigs description: - The Amazon Resource Names (ARNs) of the logging destinations that you want to associate with the web ACL. elements: str type: list logging_filter: + aliases: + - LoggingFilter description: - Filtering that specifies which web requests are kept in the logs and which are dropped. @@ -39,6 +43,8 @@ applied by matching rules during web ACL evaluation. suboptions: default_behavior: + aliases: + - DefaultBehavior choices: - DROP - KEEP @@ -47,11 +53,15 @@ conditions. type: str filters: + aliases: + - Filters description: - The filters that you want to apply to the logs. elements: dict suboptions: behavior: + aliases: + - Behavior choices: - DROP - KEEP @@ -60,15 +70,21 @@ requirement. type: str conditions: + aliases: + - Conditions description: - Match conditions for the filter. elements: dict suboptions: action_condition: + aliases: + - ActionCondition description: - A single action condition. suboptions: action: + aliases: + - Action choices: - ALLOW - BLOCK @@ -84,10 +100,14 @@ type: str type: dict label_name_condition: + aliases: + - LabelNameCondition description: - A single label name condition. suboptions: label_name: + aliases: + - LabelName description: - The label name that a log record must contain in order to meet the condition. @@ -101,6 +121,8 @@ type: dict type: list requirement: + aliases: + - Requirement choices: - MEETS_ALL - MEETS_ANY @@ -113,11 +135,15 @@ type: list type: dict redacted_fields: + aliases: + - RedactedFields description: - A key-value pair to associate with a resource. elements: dict suboptions: json_body: + aliases: + - JsonBody description: - Inspect the request body as JSON. The request body immediately follows the request headers. @@ -126,6 +152,8 @@ such as data from a form. suboptions: invalid_fallback_behavior: + aliases: + - InvalidFallbackBehavior choices: - EVALUATE_AS_STRING - MATCH @@ -135,12 +163,16 @@ JSON body. type: str match_pattern: + aliases: + - MatchPattern description: - The patterns to look for in the JSON body. - AWS WAF inspects the results of these pattern matches against the rule inspection criteria. suboptions: all: + aliases: + - All description: - Match all of the elements. - See also I(match_scope) in I(json_body). @@ -148,6 +180,8 @@ setting, but not both. type: dict included_paths: + aliases: + - IncludedPaths description: - Match only the specified include paths. - See also I(match_scope) in I(json_body). @@ -155,6 +189,8 @@ type: list type: dict match_scope: + aliases: + - MatchScope choices: - ALL - KEY @@ -165,17 +201,23 @@ type: str type: dict method: + aliases: + - Method description: - Inspect the HTTP method. - The method indicates the type of operation that the request is asking the origin to perform. type: dict query_string: + aliases: + - QueryString description: - Inspect the query string. - This is the part of a URL that appears after a ? character, if any. type: dict single_header: + aliases: + - SingleHeader description: - Inspect a single header. - Provide the name of the header to inspect, for example, User-Agent @@ -183,11 +225,15 @@ - This setting isnt case sensitive. suboptions: name: + aliases: + - Name description: - The name of the query header to inspect. type: str type: dict uri_path: + aliases: + - UriPath description: - Inspect the request URI path. - This is the part of a web request that identifies a resource, for @@ -195,6 +241,8 @@ type: dict type: list resource_arn: + aliases: + - ResourceArn description: - The Amazon Resource Name (ARN) of the web ACL that you want to associate with LogDestinationConfigs. @@ -261,11 +309,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -277,8 +326,12 @@ def main(): ), ) - argument_spec["resource_arn"] = {"type": "str"} - argument_spec["log_destination_configs"] = {"type": "list", "elements": "str"} + argument_spec["resource_arn"] = {"type": "str", "aliases": ["ResourceArn"]} + argument_spec["log_destination_configs"] = { + "type": "list", + "elements": "str", + "aliases": ["LogDestinationConfigs"], + } argument_spec["redacted_fields"] = { "type": "list", "elements": "dict", @@ -289,32 +342,56 @@ def main(): "invalid_fallback_behavior": { "type": "str", "choices": ["EVALUATE_AS_STRING", "MATCH", "NO_MATCH"], + "aliases": ["InvalidFallbackBehavior"], }, "match_pattern": { "type": "dict", "options": { - "all": {"type": "dict"}, - "included_paths": {"type": "list", "elements": "str"}, + "all": {"type": "dict", "aliases": ["All"]}, + "included_paths": { + "type": "list", + "elements": "str", + "aliases": ["IncludedPaths"], + }, }, + "aliases": ["MatchPattern"], + }, + "match_scope": { + "type": "str", + "choices": ["ALL", "KEY", "VALUE"], + "aliases": ["MatchScope"], }, - "match_scope": {"type": "str", "choices": ["ALL", "KEY", "VALUE"]}, }, + "aliases": ["JsonBody"], + }, + "method": {"type": "dict", "aliases": ["Method"]}, + "query_string": {"type": "dict", "aliases": ["QueryString"]}, + "single_header": { + "type": "dict", + "options": {"name": {"type": "str", "aliases": ["Name"]}}, + "aliases": ["SingleHeader"], }, - "method": {"type": "dict"}, - "query_string": {"type": "dict"}, - "single_header": {"type": "dict", "options": {"name": {"type": "str"}}}, - "uri_path": {"type": "dict"}, + "uri_path": {"type": "dict", "aliases": ["UriPath"]}, }, + "aliases": ["RedactedFields"], } argument_spec["logging_filter"] = { "type": "dict", "options": { - "default_behavior": {"type": "str", "choices": ["DROP", "KEEP"]}, + "default_behavior": { + "type": "str", + "choices": ["DROP", "KEEP"], + "aliases": ["DefaultBehavior"], + }, "filters": { "type": "list", "elements": "dict", "options": { - "behavior": {"type": "str", "choices": ["DROP", "KEEP"]}, + "behavior": { + "type": "str", + "choices": ["DROP", "KEEP"], + "aliases": ["Behavior"], + }, "conditions": { "type": "list", "elements": "dict", @@ -332,22 +409,34 @@ def main(): "COUNT", "EXCLUDED_AS_COUNT", ], + "aliases": ["Action"], } }, + "aliases": ["ActionCondition"], }, "label_name_condition": { "type": "dict", - "options": {"label_name": {"type": "str"}}, + "options": { + "label_name": { + "type": "str", + "aliases": ["LabelName"], + } + }, + "aliases": ["LabelNameCondition"], }, }, + "aliases": ["Conditions"], }, "requirement": { "type": "str", "choices": ["MEETS_ALL", "MEETS_ANY"], + "aliases": ["Requirement"], }, }, + "aliases": ["Filters"], }, }, + "aliases": ["LoggingFilter"], } argument_spec["state"] = { "type": "str", @@ -383,22 +472,23 @@ def main(): params["resource_arn"] = module.params.get("resource_arn") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["resource_arn"] + create_only_params = ["/properties/ResourceArn"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["resource_arn"] + identifier = ["/properties/ResourceArn"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/wafv2_regex_pattern_set.py b/plugins/modules/wafv2_regex_pattern_set.py deleted file mode 100644 index 7eb6e93c..00000000 --- a/plugins/modules/wafv2_regex_pattern_set.py +++ /dev/null @@ -1,255 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# Copyright: (c) 2022, Ansible Project -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette - - -DOCUMENTATION = r""" -module: wafv2_regex_pattern_set -short_description: Creates and manages an AWS WAFv2 Regex Pattern Set -description: -- Creates and manages an AWS WAFv2 Regex Pattern Set. -- Use an AWS WAFv2 Regex Pattern Set to have AWS WAF inspect a web request component - for a specific set of regular expression patterns. -options: - description: - description: - - Description of the entity. - type: str - force: - default: false - description: - - Cancel IN_PROGRESS and PENDING resource requestes. - - Because you can only perform a single operation on a given resource at a - time, there might be cases where you need to cancel the current resource - operation to make the resource available so that another operation may - be performed on it. - type: bool - id: - description: - - Id of the RegexPatternSet. - type: str - identifier: - description: - - For compound primary identifiers, to specify the primary identifier as a - string, list each in the order that they are specified in the identifier - list definition, separated by '|'. - - For more details, visit U(https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html). - type: str - name: - description: - - Name of the RegexPatternSet. - type: str - purge_tags: - default: true - description: - - Remove tags not listed in I(tags). - type: bool - regular_expression_list: - description: - - Not Provived. - elements: str - type: list - scope: - choices: - - CLOUDFRONT - - REGIONAL - description: - - Use CLOUDFRONT for CloudFront RegexPatternSet, use REGIONAL for Application - Load Balancer and API Gateway. - type: str - state: - choices: - - present - - absent - - list - - describe - - get - default: present - description: - - Goal state for resource. - - I(state=present) creates the resource if it doesn't exist, or updates to - the provided state if the resource already exists. - - I(state=absent) ensures an existing instance is deleted. - - I(state=list) get all the existing resources. - - I(state=describe) or I(state=get) retrieves information on an existing resource. - type: str - tags: - aliases: - - resource_tags - description: - - A dict of tags to apply to the resource. - - To remove all tags set I(tags={}) and I(purge_tags=true). - type: dict - wait: - default: false - description: - - Wait for operation to complete before returning. - type: bool - wait_timeout: - default: 320 - description: - - How many seconds to wait for an operation to complete before timing out. - type: int -author: Ansible Cloud Team (@ansible-collections) -version_added: 0.3.0 -extends_documentation_fragment: -- amazon.aws.aws -- amazon.aws.ec2 -- amazon.cloud.boto3 -""" - -EXAMPLES = r""" -""" - -RETURN = r""" -result: - description: - - When I(state=list), it is a list containing dictionaries of resource information. - - Otherwise, it is a dictionary of resource information. - - When I(state=absent), it is an empty dictionary. - returned: always - type: complex - contains: - identifier: - description: The unique identifier of the resource. - type: str - properties: - description: The resource properties. - type: dict -""" - - -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - CloudControlResource, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, -) - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["description"] = {"type": "str"} - argument_spec["name"] = {"type": "str"} - argument_spec["id"] = {"type": "str"} - argument_spec["regular_expression_list"] = {"type": "list", "elements": "str"} - argument_spec["scope"] = {"type": "str", "choices": ["CLOUDFRONT", "REGIONAL"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["state"] = { - "type": "str", - "choices": ["present", "absent", "list", "describe", "get"], - "default": "present", - } - argument_spec["wait"] = {"type": "bool", "default": False} - argument_spec["wait_timeout"] = {"type": "int", "default": 320} - argument_spec["force"] = {"type": "bool", "default": False} - argument_spec["purge_tags"] = {"type": "bool", "default": True} - argument_spec["identifier"] = {"type": "str"} - - required_if = [ - ["state", "list", ["name", "id"], True], - [ - "state", - "present", - ["regular_expression_list", "identifier", "scope", "id", "name"], - True, - ], - ["state", "absent", ["name", "id", "scope", "identifier"], True], - ["state", "get", ["name", "id", "scope", "identifier"], True], - ] - mutually_exclusive = [[("name", "id", "scope"), "identifier"]] - - module = AnsibleAmazonCloudModule( - argument_spec=argument_spec, - required_if=required_if, - mutually_exclusive=mutually_exclusive, - supports_check_mode=True, - ) - cloud = CloudControlResource(module) - - type_name = "AWS::WAFv2::RegexPatternSet" - - params = {} - - params["description"] = module.params.get("description") - params["id"] = module.params.get("id") - params["identifier"] = module.params.get("identifier") - params["name"] = module.params.get("name") - params["regular_expression_list"] = module.params.get("regular_expression_list") - params["scope"] = module.params.get("scope") - params["tags"] = module.params.get("tags") - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} - - # Only if resource is taggable - if module.params.get("tags") is not None: - _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) - - # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["name", "scope"] - - # Necessary to handle when module does not support all the states - handlers = ["create", "delete", "read", "update", "list"] - - state = module.params.get("state") - identifier = ["name", "id", "scope"] - if ( - state in ("present", "absent", "get", "describe") - and module.params.get("identifier") is None - ): - if ( - not module.params.get("name") - or not module.params.get("id") - or not module.params.get("scope") - ): - module.fail_json(f"You must specify both {*identifier, } identifiers.") - - results = {"changed": False, "result": {}} - - if state == "list": - if "list" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be listed." - ) - results["result"] = cloud.list_resources(type_name, identifier) - - if state in ("describe", "get"): - if "read" not in handlers: - module.exit_json( - **results, msg=f"Resource type {type_name} cannot be read." - ) - results["result"] = cloud.get_resource(type_name, identifier) - - if state == "present": - results = cloud.present( - type_name, identifier, params_to_set, create_only_params - ) - - if state == "absent": - results["changed"] |= cloud.absent(type_name, identifier) - - module.exit_json(**results) - - -if __name__ == "__main__": - main() diff --git a/plugins/modules/wafv2_web_acl_association.py b/plugins/modules/wafv2_web_acl_association.py index a95140ef..cb7fc97f 100644 --- a/plugins/modules/wafv2_web_acl_association.py +++ b/plugins/modules/wafv2_web_acl_association.py @@ -3,8 +3,8 @@ # Copyright: (c) 2022, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # template: header.j2 -# This module is autogenerated using the gouttelette generator tool -# See: https://github.com/ansible-collections/gouttelette +# This module is autogenerated using the ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder DOCUMENTATION = r""" @@ -32,6 +32,8 @@ - For more details, visit U(https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html). type: str resource_arn: + aliases: + - ResourceArn description: - Not Provived. type: str @@ -62,6 +64,8 @@ - How many seconds to wait for an operation to complete before timing out. type: int web_acl_arn: + aliases: + - WebACLArn description: - Not Provived. type: str @@ -101,11 +105,12 @@ CloudControlResource, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - snake_dict_to_camel_dict, + ansible_dict_to_boto3_tag_list, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - ansible_dict_to_boto3_tag_list, + scrub_none_parameters, ) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias def main(): @@ -117,8 +122,8 @@ def main(): ), ) - argument_spec["resource_arn"] = {"type": "str"} - argument_spec["web_acl_arn"] = {"type": "str"} + argument_spec["resource_arn"] = {"type": "str", "aliases": ["ResourceArn"]} + argument_spec["web_acl_arn"] = {"type": "str", "aliases": ["WebACLArn"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -131,7 +136,7 @@ def main(): required_if = [ ["state", "list", ["resource_arn"], True], - ["state", "present", ["web_acl_arn", "resource_arn", "identifier"], True], + ["state", "present", ["resource_arn", "identifier", "web_acl_arn"], True], ["state", "absent", ["resource_arn", "web_acl_arn", "identifier"], True], ["state", "get", ["resource_arn", "web_acl_arn", "identifier"], True], ] @@ -154,22 +159,23 @@ def main(): params["web_acl_arn"] = module.params.get("web_acl_arn") # The DesiredState we pass to AWS must be a JSONArray of non-null values - _params_to_set = {k: v for k, v in params.items() if v is not None} + _params_to_set = scrub_none_parameters(params) # Only if resource is taggable if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - params_to_set = snake_dict_to_camel_dict(_params_to_set, capitalize_first=True) + # Use the alias from argument_spec as key and avoid snake_to_camel conversions + params_to_set = map_key_to_alias(_params_to_set, argument_spec) # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["resource_arn", "web_acl_arn"] + create_only_params = ["/properties/ResourceArn", "/properties/WebACLArn"] # Necessary to handle when module does not support all the states handlers = ["create", "delete", "read", "update"] state = module.params.get("state") - identifier = ["resource_arn", "web_acl_arn"] + identifier = ["/properties/ResourceArn", "/properties/WebACLArn"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None @@ -177,7 +183,9 @@ def main(): if not module.params.get("resource_arn") or not module.params.get( "web_acl_arn" ): - module.fail_json(f"You must specify both {*identifier, } identifiers.") + module.fail_json( + "You must specify all the ('resource_arn', 'web_acl_arn') identifiers." + ) results = {"changed": False, "result": {}} diff --git a/tests/integration/targets/eks/tasks/cleanup.yml b/tests/integration/targets/eks/tasks/cleanup.yml index 0127886d..7d410491 100644 --- a/tests/integration/targets/eks/tasks/cleanup.yml +++ b/tests/integration/targets/eks/tasks/cleanup.yml @@ -1,17 +1,18 @@ - include_tasks: set_facts.yml + - name: Delete IAM role - community.aws.iam_role: - name: "{{ _result_create_iam_role.role_name }}" + amazon.cloud.iam_role: + role_name: "{{ _result_create_iam_role.result.identifier }}" state: absent ignore_errors: true - name: Delete IAM role - community.aws.iam_role: - name: "{{ _result_create_iam_role_fp.role_name }}" + amazon.cloud.iam_role: + role_name: "{{ _result_create_iam_role_fp.result.identifier }}" state: absent ignore_errors: true -- name: Delete a Fargate Profile b +- name: Delete a Fargate Profile b amazon.cloud.eks_fargate_profile: fargate_profile_name: "{{ eks_fargate_profile_name_b }}" cluster_name: "{{ eks_cluster_name }}" diff --git a/tests/integration/targets/eks/tasks/eks_cluster.yml b/tests/integration/targets/eks/tasks/eks_cluster.yml index d752a39a..1cb52f44 100644 --- a/tests/integration/targets/eks/tasks/eks_cluster.yml +++ b/tests/integration/targets/eks/tasks/eks_cluster.yml @@ -1,14 +1,14 @@ - include_tasks: set_facts.yml # Create a EKS Cluster to test Fargate Profile + - name: Ensure IAM instance role exists - community.aws.iam_role: - name: "{{ _resource_prefix }}-cluster-role" + amazon.cloud.iam_role: + role_name: "{{ _resource_prefix }}-cluster-role" assume_role_policy_document: "{{ lookup('file','eks_cluster-policy.json') }}" state: present - create_instance_profile: false - managed_policies: - - AmazonEKSServicePolicy - - AmazonEKSClusterPolicy + managed_policy_arns: + - arn:aws:iam::aws:policy/AmazonEKSServicePolicy + - arn:aws:iam::aws:policy/AmazonEKSClusterPolicy register: _result_create_iam_role - name: Create a VPC @@ -95,7 +95,7 @@ endpoint_private_access: false public_access_cidrs: - 0.0.0.0/0 - role_arn: "{{ _result_create_iam_role.arn }}" + role_arn: "{{ _result_create_iam_role.result.properties.arn }}" tags: Name: "{{ _resource_prefix }}-eks-cluster" wait_timeout: 900 diff --git a/tests/integration/targets/eks/tasks/eks_fargate_profile.yml b/tests/integration/targets/eks/tasks/eks_fargate_profile.yml index f434326c..10fba3ba 100644 --- a/tests/integration/targets/eks/tasks/eks_fargate_profile.yml +++ b/tests/integration/targets/eks/tasks/eks_fargate_profile.yml @@ -27,13 +27,12 @@ register: _result_delete_fp - name: Create IAM instance role - community.aws.iam_role: - name: "{{ _resource_prefix }}-fp-role" + amazon.cloud.iam_role: + role_name: "{{ _resource_prefix }}-fp-role" assume_role_policy_document: "{{ lookup('file', 'eks_fargate_profile-policy.json') }}" state: present - create_instance_profile: false - managed_policies: - - AmazonEKSFargatePodExecutionRolePolicy + managed_policy_arns: + - arn:aws:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy register: _result_create_iam_role_fp - name: Pause a few seconds to ensure IAM role is available to next task @@ -45,7 +44,7 @@ fargate_profile_name: '{{ eks_fargate_profile_name_a }}' state: present cluster_name: fake_cluster - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results | selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -64,7 +63,7 @@ fargate_profile_name: fake_profile cluster_name: '{{ eks_cluster_name }}' state: absent - pod_execution_role_arn: '{{ _result_create_iam_role_fp.arn }}' + pod_execution_role_arn: '{{ _result_create_iam_role_fp.result.properties.arn }}' subnets: >- {{_result_create_subnets.results | selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -81,7 +80,7 @@ fargate_profile_name: "{{ eks_fargate_profile_name_a }}" state: present cluster_name: "{{ _result_create_cluster.result.identifier }}" - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results | selectattr('subnet.tags.Name', 'contains', 'public') | map(attribute='subnet.id') }} @@ -101,7 +100,7 @@ fargate_profile_name: "{{ eks_fargate_profile_name_a }}" state: present cluster_name: "{{ eks_cluster_name }}" - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -120,7 +119,7 @@ amazon.cloud.eks_fargate_profile: fargate_profile_name: "{{ eks_fargate_profile_name_a }}" state: present - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -134,7 +133,7 @@ amazon.cloud.eks_fargate_profile: identifier: "{{ eks_cluster_name }}|{{ eks_fargate_profile_name_b }}" state: present - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -149,7 +148,7 @@ fargate_profile_name: "{{ eks_fargate_profile_name_a }}" state: present cluster_name: "{{ eks_cluster_name }}" - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -170,7 +169,7 @@ fargate_profile_name: "{{ eks_fargate_profile_name_a }}" state: present cluster_name: "{{ eks_cluster_name }}" - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -191,7 +190,7 @@ fargate_profile_name: "{{ eks_fargate_profile_name_a }}" state: present cluster_name: "{{ eks_cluster_name }}" - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -218,7 +217,7 @@ fargate_profile_name: "{{ eks_fargate_profile_name_a }}" state: present cluster_name: "{{ eks_cluster_name }}" - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -241,7 +240,7 @@ amazon.cloud.eks_fargate_profile: identifier: "{{ eks_cluster_name }}|{{ eks_fargate_profile_name_a }}" state: present - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -263,7 +262,7 @@ fargate_profile_name: "{{ eks_fargate_profile_name_a }}" state: present cluster_name: "{{ eks_cluster_name }}" - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results | selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -285,7 +284,7 @@ fargate_profile_name: "{{ eks_fargate_profile_name_a }}" state: present cluster_name: "{{ eks_cluster_name }}" - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results | selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -308,7 +307,7 @@ fargate_profile_name: "{{ eks_fargate_profile_name_a }}" state: present cluster_name: "{{ eks_cluster_name }}" - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -330,7 +329,7 @@ fargate_profile_name: "{{ eks_fargate_profile_name_a }}" state: present cluster_name: "{{ eks_cluster_name }}" - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -351,7 +350,7 @@ fargate_profile_name: "{{ eks_fargate_profile_name_a }}" state: present cluster_name: "{{ eks_cluster_name }}" - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -372,7 +371,7 @@ fargate_profile_name: "{{ eks_fargate_profile_name_b }}" state: present cluster_name: "{{ eks_cluster_name }}" - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} @@ -391,7 +390,7 @@ fargate_profile_name: "{{ eks_fargate_profile_name_b }}" state: present cluster_name: "{{ eks_cluster_name }}" - pod_execution_role_arn: "{{ _result_create_iam_role_fp.arn }}" + pod_execution_role_arn: "{{ _result_create_iam_role_fp.result.properties.arn }}" subnets: >- {{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }} diff --git a/tests/integration/targets/eks/tasks/set_facts.yml b/tests/integration/targets/eks/tasks/set_facts.yml index accf8775..508f0a88 100644 --- a/tests/integration/targets/eks/tasks/set_facts.yml +++ b/tests/integration/targets/eks/tasks/set_facts.yml @@ -51,5 +51,5 @@ selectors: - labels: - key: "test" - value: "test" + value: "test" namespace: "fp-default" diff --git a/tests/integration/targets/rds/aliases b/tests/integration/targets/rds/aliases new file mode 100644 index 00000000..4ef4b206 --- /dev/null +++ b/tests/integration/targets/rds/aliases @@ -0,0 +1 @@ +cloud/aws diff --git a/tests/integration/targets/rds/defaults/main.yml b/tests/integration/targets/rds/defaults/main.yml new file mode 100644 index 00000000..d99a3796 --- /dev/null +++ b/tests/integration/targets/rds/defaults/main.yml @@ -0,0 +1,17 @@ +option_group_name: '{{ resource_prefix }}rds-option-group' +engine_name: mysql +major_engine_version: 5.6 +option_group_description: '{{ resource_prefix }}rds-option-group test' +instance_id: '{{ resource_prefix }}' +username: test +password: test12345678 +db_instance_class: db.t2.small +storage_encrypted_db_instance_class: db.t2.small +allocated_storage: 20 +vpc_name: '{{ resource_prefix }}-vpc' +vpc_seed: '{{ resource_prefix }}' +vpc_cidr: 10.0.0.0/16 +subnet_cidr: 10.0.{{ 256 | random(seed=vpc_seed) }}.0/24 +sg_1_name: '{{ resource_prefix }}-sg-1' +sg_2_name: '{{ resource_prefix }}-sg-2' +sg_3_name: '{{ resource_prefix }}-sg-3' diff --git a/tests/integration/targets/rds/tasks/main.yml b/tests/integration/targets/rds/tasks/main.yml new file mode 100644 index 00000000..4da780a1 --- /dev/null +++ b/tests/integration/targets/rds/tasks/main.yml @@ -0,0 +1,606 @@ +- name: RDS integration tests + collections: + - amazon.aws + - amazon.cloud + module_defaults: + group/amazon.cloud.aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' + group/aws: + aws_access_key: '{{ aws_access_key }}' + aws_secret_key: '{{ aws_secret_key }}' + security_token: '{{ security_token | default(omit) }}' + region: '{{ aws_region }}' + + block: + - name: Create a VPC + amazon.aws.ec2_vpc_net: + name: '{{ vpc_name }}' + state: present + cidr_block: '{{ vpc_cidr }}' + register: vpc_result + + - name: Assert success + assert: + that: + - vpc_result is successful + - '"vpc" in vpc_result' + - '"cidr_block" in vpc_result.vpc' + - vpc_result.vpc.cidr_block == vpc_cidr + - '"id" in vpc_result.vpc' + - vpc_result.vpc.id.startswith("vpc-") + - '"state" in vpc_result.vpc' + - vpc_result.vpc.state == 'available' + - '"tags" in vpc_result.vpc' + + - name: 'Set fact: VPC ID' + set_fact: + vpc_id: '{{ vpc_result.vpc.id }}' + + - name: Create subnet + amazon.aws.ec2_vpc_subnet: + cidr: '{{ subnet_cidr}}' + vpc_id: '{{ vpc_id }}' + state: present + register: subnet_result + + - name: Assert success + assert: + that: + - subnet_result is successful + - '"subnet" in subnet_result' + - '"cidr_block" in subnet_result.subnet' + - subnet_result.subnet.cidr_block == subnet_cidr + - '"id" in subnet_result.subnet' + - subnet_result.subnet.id.startswith("subnet-") + - '"state" in subnet_result.subnet' + - subnet_result.subnet.state == 'available' + - '"tags" in subnet_result.subnet' + - subnet_result.subnet.vpc_id == vpc_id + + - name: 'Set fact: VPC subnet ID' + set_fact: + subnet_id: '{{ subnet_result.subnet.id }}' + + - name: Create security groups + amazon.aws.ec2_security_group: + name: '{{ item }}' + description: created by rds_instance integration tests + state: present + vpc_id: '{{ vpc_id }}' + register: sgs_result + loop: + - '{{ sg_1_name }}' + - '{{ sg_2_name }}' + - '{{ sg_3_name }}' + + - name: Assert success + assert: + that: + - sgs_result is successful + + - name: 'Set fact: security groups ID' + set_fact: + sg_1: '{{ sgs_result.results.0.group_id }}' + sg_2: '{{ sgs_result.results.1.group_id }}' + sg_3: '{{ sgs_result.results.2.group_id }}' + + # Add ignore_erros: true because it may throw ThrottlingException sometimes + - name: List all the option groups + amazon.cloud.rds_option_group: + state: list + register: option_groups_result + ignore_errors: true + + # - name: Assert success + # assert: + # that: + # - option_groups_result is successful + + - name: Create an RDS Mysql option group - CHECK_MODE + amazon.cloud.rds_option_group: + state: present + option_group_name: '{{ option_group_name }}' + engine_name: '{{ engine_name }}' + major_engine_version: '{{ major_engine_version }}' + option_group_description: '{{ option_group_description }}' + option_configurations: + - option_name: MEMCACHED + port: 11211 + vpc_security_group_memberships: + - '{{ sg_1 }}' + option_settings: + - name: MAX_SIMULTANEOUS_CONNECTIONS + value: '20' + - name: CHUNK_SIZE_GROWTH_FACTOR + value: '1.25' + check_mode: true + register: new_rds_mysql_option_group + + - name: Assert success - CHECK_MODE + assert: + that: + - new_rds_mysql_option_group.changed + + - name: Create an RDS Mysql option group + amazon.cloud.rds_option_group: + state: present + option_group_name: '{{ option_group_name }}' + engine_name: '{{ engine_name }}' + major_engine_version: '{{ major_engine_version }}' + option_group_description: '{{ option_group_description }}' + option_configurations: + - option_name: MEMCACHED + port: 11211 + vpc_security_group_memberships: + - '{{ sg_1 }}' + option_settings: + - name: MAX_SIMULTANEOUS_CONNECTIONS + value: '20' + - name: CHUNK_SIZE_GROWTH_FACTOR + value: '1.25' + register: new_rds_mysql_option_group + + - assert: + that: + - new_rds_mysql_option_group.changed + - "'engine_name' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.engine_name == "{{ engine_name }}" + - "'major_engine_version' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.major_engine_version == "{{ major_engine_version}}" + - "'identifier' in new_rds_mysql_option_group.result" + - new_rds_mysql_option_group.result.identifier == "{{ option_group_name }}" + - "'option_group_description' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.option_group_description == "{{ option_group_description }}" + - "'option_group_name' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.option_group_name == "{{ option_group_name }}" + - "'tags' in new_rds_mysql_option_group.result.properties" + - (new_rds_mysql_option_group.result.properties.tags | length) == 0 + + - name: Create an RDS Mysql option group (idempotency) - CHECK_MODE + amazon.cloud.rds_option_group: + state: present + option_group_name: '{{ option_group_name }}' + engine_name: '{{ engine_name }}' + major_engine_version: '{{ major_engine_version }}' + option_group_description: '{{ option_group_description }}' + option_configurations: + - option_name: MEMCACHED + port: 11211 + vpc_security_group_memberships: + - '{{ sg_1 }}' + option_settings: + - name: MAX_SIMULTANEOUS_CONNECTIONS + value: '20' + - name: CHUNK_SIZE_GROWTH_FACTOR + value: '1.25' + check_mode: true + register: new_rds_mysql_option_group + + - name: Assert success - CHECK_MODE + assert: + that: + - not new_rds_mysql_option_group.changed + + - name: Create an RDS Mysql option group (idempotency) + amazon.cloud.rds_option_group: + state: present + option_group_name: '{{ option_group_name }}' + engine_name: '{{ engine_name }}' + major_engine_version: '{{ major_engine_version }}' + option_group_description: '{{ option_group_description }}' + option_configurations: + - option_name: MEMCACHED + port: 11211 + vpc_security_group_memberships: + - '{{ sg_1 }}' + option_settings: + - name: MAX_SIMULTANEOUS_CONNECTIONS + value: '20' + - name: CHUNK_SIZE_GROWTH_FACTOR + value: '1.25' + register: new_rds_mysql_option_group + + - assert: + that: + - not new_rds_mysql_option_group.changed + + - name: Create an RDS Mysql option group - apply different changes (expected changed=true) + amazon.cloud.rds_option_group: + state: present + option_group_name: '{{ option_group_name }}' + engine_name: '{{ engine_name }}' + major_engine_version: '{{ major_engine_version }}' + option_group_description: '{{ option_group_description }}' + option_configurations: + - option_name: MEMCACHED + port: 11211 + vpc_security_group_memberships: + - '{{ sg_1 }}' + - '{{ sg_2 }}' + - '{{ sg_3 }}' + option_settings: + - name: MAX_SIMULTANEOUS_CONNECTIONS + value: '30' + wait: true + register: new_rds_mysql_option_group + + - assert: + that: + - new_rds_mysql_option_group.changed + - "'engine_name' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.engine_name == "{{ engine_name }}" + - "'major_engine_version' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.major_engine_version == "{{ major_engine_version}}" + - "'identifier' in new_rds_mysql_option_group.result" + - new_rds_mysql_option_group.result.identifier == "{{ option_group_name }}" + - "'option_group_description' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.option_group_description == "{{ option_group_description }}" + - "'option_group_name' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.option_group_name == "{{ option_group_name }}" + - "'tags' in new_rds_mysql_option_group.result.properties" + - (new_rds_mysql_option_group.result.properties.tags | length) == 0 + - "'vpc_security_group_memberships' in option_settings" + - (option_settings.vpc_security_group_memberships | length) == 3 + vars: + option_settings: '{{ new_rds_mysql_option_group.result.properties.option_configurations[0] }}' + + - name: Get info about an option group + amazon.cloud.rds_option_group: + state: get + option_group_name: '{{ option_group_name }}' + register: option_groups_result + + - name: Assert success + assert: + that: + - option_groups_result is successful + - "'engine_name' in option_groups_result.result.properties" + - option_groups_result.result.properties.engine_name == "{{ engine_name }}" + - "'major_engine_version' in option_groups_result.result.properties" + - option_groups_result.result.properties.major_engine_version == "{{ major_engine_version}}" + - "'identifier' in option_groups_result.result" + - option_groups_result.result.identifier == "{{ option_group_name }}" + - "'option_group_description' in option_groups_result.result.properties" + - option_groups_result.result.properties.option_group_description == "{{ option_group_description }}" + - "'option_group_name' in option_groups_result.result.properties" + - option_groups_result.result.properties.option_group_name == "{{ option_group_name }}" + - "'tags' in option_groups_result.result.properties" + - (option_groups_result.result.properties.tags | length) == 0 + - "'vpc_security_group_memberships' in option_settings" + - (option_settings.vpc_security_group_memberships | length) == 3 + vars: + option_settings: '{{ new_rds_mysql_option_group.result.properties.option_configurations[0] }}' + + - name: Create an RDS Mysql option group - apply same changes (expected changed=false) + amazon.cloud.rds_option_group: + state: present + option_group_name: '{{ option_group_name }}' + engine_name: '{{ engine_name }}' + major_engine_version: '{{ major_engine_version }}' + option_group_description: '{{ option_group_description }}' + option_configurations: + - option_name: MEMCACHED + port: 11211 + vpc_security_group_memberships: + - '{{ sg_1 }}' + - '{{ sg_2 }}' + - '{{ sg_3 }}' + option_settings: + - name: MAX_SIMULTANEOUS_CONNECTIONS + value: '30' + wait: true + register: new_rds_mysql_option_group + + - name: Assert success + assert: + that: + - not new_rds_mysql_option_group.changed + + - name: RDS Mysql option group - apply tags - CHECK_MODE + amazon.cloud.rds_option_group: + state: present + option_group_name: '{{ option_group_name }}' + engine_name: '{{ engine_name }}' + major_engine_version: '{{ major_engine_version }}' + option_group_description: '{{ option_group_description }}' + option_configurations: + - option_name: MEMCACHED + port: 11211 + vpc_security_group_memberships: + - '{{ sg_1 }}' + - '{{ sg_2 }}' + - '{{ sg_3 }}' + option_settings: + - name: CHUNK_SIZE_GROWTH_FACTOR + value: '1.2' + tags: + tag_one: '{{ option_group_name }} One' + Tag Two: two {{ option_group_name }} + check_mode: true + register: new_rds_mysql_option_group + + - name: Assert success - CHECK_MODE + assert: + that: + - new_rds_mysql_option_group.changed + + - name: RDS Mysql option group - apply tags + amazon.cloud.rds_option_group: + state: present + option_group_name: '{{ option_group_name }}' + engine_name: '{{ engine_name }}' + major_engine_version: '{{ major_engine_version }}' + option_group_description: '{{ option_group_description }}' + option_configurations: + - option_name: MEMCACHED + port: 11211 + vpc_security_group_memberships: + - '{{ sg_1 }}' + - '{{ sg_2 }}' + - '{{ sg_3 }}' + option_settings: + - name: CHUNK_SIZE_GROWTH_FACTOR + value: '1.2' + tags: + tag_one: '{{ option_group_name }} One' + Tag Two: two {{ option_group_name }} + wait: true + register: new_rds_mysql_option_group + + - assert: + that: + - new_rds_mysql_option_group.changed + - "'engine_name' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.engine_name == "{{ engine_name }}" + - "'major_engine_version' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.major_engine_version == "{{ major_engine_version}}" + - "'identifier' in new_rds_mysql_option_group.result" + - new_rds_mysql_option_group.result.identifier == "{{ option_group_name }}" + - "'option_group_description' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.option_group_description == "{{ option_group_description }}" + - "'option_group_name' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.option_group_name == "{{ option_group_name }}" + - "'tags' in new_rds_mysql_option_group.result.properties" + - (new_rds_mysql_option_group.result.properties.tags | length) == 2 + - new_rds_mysql_option_group.result.properties.tags["tag_one"] == "{{ option_group_name }} One" + - new_rds_mysql_option_group.result.properties.tags["Tag Two"] == "two {{ option_group_name }}" + + - name: RDS Mysql option group - apply tags (idempotency) + amazon.cloud.rds_option_group: + state: present + option_group_name: '{{ option_group_name }}' + engine_name: '{{ engine_name }}' + major_engine_version: '{{ major_engine_version }}' + option_group_description: '{{ option_group_description }}' + option_configurations: + - option_name: MEMCACHED + port: 11211 + vpc_security_group_memberships: + - '{{ sg_1 }}' + - '{{ sg_2 }}' + - '{{ sg_3 }}' + option_settings: + - name: CHUNK_SIZE_GROWTH_FACTOR + value: '1.2' + tags: + tag_one: '{{ option_group_name }} One' + Tag Two: two {{ option_group_name }} + register: new_rds_mysql_option_group + + - assert: + that: + - not new_rds_mysql_option_group.changed + + - name: RDS Mysql option group - update tags + amazon.cloud.rds_option_group: + state: present + option_group_name: '{{ option_group_name }}' + engine_name: '{{ engine_name }}' + major_engine_version: '{{ major_engine_version }}' + option_group_description: '{{ option_group_description }}' + option_configurations: + - option_name: MEMCACHED + port: 11211 + vpc_security_group_memberships: + - '{{ sg_1 }}' + - '{{ sg_2 }}' + - '{{ sg_3 }}' + option_settings: + - name: CHUNK_SIZE_GROWTH_FACTOR + value: '1.2' + tags: + tag_three: '{{ option_group_name }} Three' + Tag Two: two {{ option_group_name }} + wait: true + register: new_rds_mysql_option_group + + - assert: + that: + - new_rds_mysql_option_group.changed + - new_rds_mysql_option_group.changed + - "'engine_name' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.engine_name == "{{ engine_name }}" + - "'major_engine_version' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.major_engine_version == "{{ major_engine_version}}" + - "'identifier' in new_rds_mysql_option_group.result" + - new_rds_mysql_option_group.result.identifier == "{{ option_group_name }}" + - "'option_group_description' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.option_group_description == "{{ option_group_description }}" + - "'option_group_name' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.option_group_name == "{{ option_group_name }}" + - "'tags' in new_rds_mysql_option_group.result.properties" + - (new_rds_mysql_option_group.result.properties.tags | length) == 2 + - new_rds_mysql_option_group.result.properties.tags["tag_three"] == "{{ option_group_name }} Three" + - new_rds_mysql_option_group.result.properties.tags["Tag Two"] == "two {{ option_group_name }}" + + - name: RDS Mysql option group - update tags without purge (expected changed=true) + amazon.cloud.rds_option_group: + state: present + option_group_name: '{{ option_group_name }}' + engine_name: '{{ engine_name }}' + major_engine_version: '{{ major_engine_version }}' + option_group_description: '{{ option_group_description }}' + option_configurations: + - option_name: MEMCACHED + port: 11211 + vpc_security_group_memberships: + - '{{ sg_1 }}' + - '{{ sg_2 }}' + - '{{ sg_3 }}' + option_settings: + - name: CHUNK_SIZE_GROWTH_FACTOR + value: '1.2' + purge_tags: no + tags: + tag_one: '{{ option_group_name }} One' + wait: true + register: new_rds_mysql_option_group + + - assert: + that: + - new_rds_mysql_option_group.changed + - "'engine_name' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.engine_name == "{{ engine_name }}" + - "'major_engine_version' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.major_engine_version == "{{ major_engine_version}}" + - "'identifier' in new_rds_mysql_option_group.result" + - new_rds_mysql_option_group.result.identifier == "{{ option_group_name }}" + - "'option_group_description' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.option_group_description == "{{ option_group_description }}" + - "'option_group_name' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.option_group_name == "{{ option_group_name }}" + - "'tags' in new_rds_mysql_option_group.result.properties" + - (new_rds_mysql_option_group.result.properties.tags | length) == 3 + - new_rds_mysql_option_group.result.properties.tags["Tag Two"] == "two {{ option_group_name }}" + - new_rds_mysql_option_group.result.properties.tags["tag_one"] == "{{ option_group_name }} One" + - new_rds_mysql_option_group.result.properties.tags["tag_three"] == "{{ option_group_name }} Three" + + - name: RDS Mysql option group - update with CamelCase tags (expected changed=true) + amazon.cloud.rds_option_group: + state: present + option_group_name: '{{ option_group_name }}' + engine_name: '{{ engine_name }}' + major_engine_version: '{{ major_engine_version }}' + option_group_description: '{{ option_group_description }}' + option_configurations: + - option_name: MEMCACHED + port: 11211 + vpc_security_group_memberships: + - '{{ sg_1 }}' + - '{{ sg_2 }}' + - '{{ sg_3 }}' + option_settings: + - name: CHUNK_SIZE_GROWTH_FACTOR + value: '1.2' + tags: + lowercase spaced: hello cruel world + Title Case: Hello Cruel World + CamelCase: SimpleCamelCase + snake_case: simple_snake_case + wait: true + register: new_rds_mysql_option_group + + - assert: + that: + - new_rds_mysql_option_group.changed + - "'engine_name' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.engine_name == "{{ engine_name }}" + - "'major_engine_version' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.major_engine_version == "{{ major_engine_version}}" + - "'identifier' in new_rds_mysql_option_group.result" + - new_rds_mysql_option_group.result.identifier == "{{ option_group_name }}" + - "'option_group_description' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.option_group_description == "{{ option_group_description }}" + - "'option_group_name' in new_rds_mysql_option_group.result.properties" + - new_rds_mysql_option_group.result.properties.option_group_name == "{{ option_group_name }}" + - "'tags' in new_rds_mysql_option_group.result.properties" + - (new_rds_mysql_option_group.result.properties.tags | length) == 4 + - new_rds_mysql_option_group.result.properties.tags["lowercase spaced"] == 'hello cruel world' + - new_rds_mysql_option_group.result.properties.tags["Title Case"] == 'Hello Cruel World' + - new_rds_mysql_option_group.result.properties.tags["CamelCase"] == 'SimpleCamelCase' + - new_rds_mysql_option_group.result.properties.tags["snake_case"] == 'simple_snake_case' + + - name: RDS Mysql option group - do not specify any tag to ensure previous tags + are not removed + amazon.cloud.rds_option_group: + state: present + option_group_name: '{{ option_group_name }}' + engine_name: '{{ engine_name }}' + major_engine_version: '{{ major_engine_version }}' + option_group_description: '{{ option_group_description }}' + option_configurations: + - option_name: MEMCACHED + port: 11211 + vpc_security_group_memberships: + - '{{ sg_1 }}' + - '{{ sg_2 }}' + - '{{ sg_3 }}' + option_settings: + - name: CHUNK_SIZE_GROWTH_FACTOR + value: '1.2' + register: new_rds_mysql_option_group + + - assert: + that: + - not new_rds_mysql_option_group.changed + + - name: Delete an RDS Mysql option group - CHECK_MODE + amazon.cloud.rds_option_group: + state: absent + option_group_name: '{{ option_group_name }}' + check_mode: yes + register: deleted_rds_mysql_option_group + + - name: Assert success - CHECK_MODE + assert: + that: + - deleted_rds_mysql_option_group.changed + + - name: Delete an RDS Mysql option group + amazon.cloud.rds_option_group: + state: absent + option_group_name: '{{ option_group_name }}' + register: deleted_rds_mysql_option_group + + - name: Assert success + assert: + that: + - deleted_rds_mysql_option_group.changed + + always: + + - name: Delete an RDS Mysql option group + amazon.cloud.rds_option_group: + state: absent + option_group_name: '{{ option_group_name }}' + ignore_errors: true + + - name: Remove security groups + amazon.aws.ec2_security_group: + name: '{{ item }}' + description: created by rds_instance integration tests + state: absent + register: sgs_result + loop: + - '{{ sg_1_name }}' + - '{{ sg_2_name }}' + - '{{ sg_3_name }}' + ignore_errors: true + + - name: Remove subnet + amazon.aws.ec2_vpc_subnet: + cidr: '{{ subnet_cidr }}' + vpc_id: '{{ vpc_id }}' + state: absent + ignore_errors: true + + - name: Delete VPC + amazon.aws.ec2_vpc_net: + name: '{{ vpc_name }}' + cidr_block: '{{ vpc_cidr }}' + state: absent + purge_cidrs: yes + ignore_errors: true diff --git a/tests/integration/targets/s3/tasks/main.yml b/tests/integration/targets/s3/tasks/main.yml index 8d31badb..ff657be7 100644 --- a/tests/integration/targets/s3/tasks/main.yml +++ b/tests/integration/targets/s3/tasks/main.yml @@ -52,7 +52,7 @@ register: _result tags: - docs - + - assert: that: - _result is success @@ -127,7 +127,7 @@ register: _result tags: - docs - + - assert: that: - _result is success @@ -224,9 +224,9 @@ that: - _result is success - _result is not changed - + - include_tasks: tagging.yml - + - name: Delete S3 bucket - check_mode amazon.cloud.s3_bucket: bucket_name: "{{ output.result.identifier }}" diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt deleted file mode 100644 index 148fff3a..00000000 --- a/tests/sanity/ignore-2.10.txt +++ /dev/null @@ -1,614 +0,0 @@ -plugins/module_utils/core.py compile-2.7!skip -plugins/module_utils/core.py compile-3.5!skip -plugins/module_utils/core.py import-2.7!skip -plugins/module_utils/core.py import-3.5!skip -plugins/module_utils/core.py future-import-boilerplate!skip -plugins/module_utils/core.py metaclass-boilerplate!skip -plugins/module_utils/core.py compile-2.6!skip -plugins/module_utils/core.py import-2.6!skip -plugins/module_utils/utils.py compile-2.7!skip -plugins/module_utils/utils.py compile-3.5!skip -plugins/module_utils/utils.py import-2.7!skip -plugins/module_utils/utils.py import-3.5!skip -plugins/module_utils/utils.py future-import-boilerplate!skip -plugins/module_utils/utils.py metaclass-boilerplate!skip -plugins/module_utils/utils.py compile-2.6!skip -plugins/module_utils/utils.py import-2.6!skip -plugins/modules/backup_backup_vault.py compile-2.7!skip -plugins/modules/backup_backup_vault.py compile-3.5!skip -plugins/modules/backup_backup_vault.py import-2.7!skip -plugins/modules/backup_backup_vault.py import-3.5!skip -plugins/modules/backup_backup_vault.py future-import-boilerplate!skip -plugins/modules/backup_backup_vault.py metaclass-boilerplate!skip -plugins/modules/backup_backup_vault.py compile-2.6!skip -plugins/modules/backup_backup_vault.py import-2.6!skip -plugins/modules/backup_backup_vault.py validate-modules:no-log-needed -plugins/modules/backup_backup_vault.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_framework.py compile-2.7!skip -plugins/modules/backup_framework.py compile-3.5!skip -plugins/modules/backup_framework.py import-2.7!skip -plugins/modules/backup_framework.py import-3.5!skip -plugins/modules/backup_framework.py future-import-boilerplate!skip -plugins/modules/backup_framework.py metaclass-boilerplate!skip -plugins/modules/backup_framework.py compile-2.6!skip -plugins/modules/backup_framework.py import-2.6!skip -plugins/modules/backup_framework.py validate-modules:no-log-needed -plugins/modules/backup_framework.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_report_plan.py compile-2.7!skip -plugins/modules/backup_report_plan.py compile-3.5!skip -plugins/modules/backup_report_plan.py import-2.7!skip -plugins/modules/backup_report_plan.py import-3.5!skip -plugins/modules/backup_report_plan.py future-import-boilerplate!skip -plugins/modules/backup_report_plan.py metaclass-boilerplate!skip -plugins/modules/backup_report_plan.py compile-2.6!skip -plugins/modules/backup_report_plan.py import-2.6!skip -plugins/modules/backup_report_plan.py validate-modules:no-log-needed -plugins/modules/backup_report_plan.py validate-modules:parameter-state-invalid-choice -plugins/modules/eks_cluster.py compile-2.7!skip -plugins/modules/eks_cluster.py compile-3.5!skip -plugins/modules/eks_cluster.py import-2.7!skip -plugins/modules/eks_cluster.py import-3.5!skip -plugins/modules/eks_cluster.py future-import-boilerplate!skip -plugins/modules/eks_cluster.py metaclass-boilerplate!skip -plugins/modules/eks_cluster.py compile-2.6!skip -plugins/modules/eks_cluster.py import-2.6!skip -plugins/modules/eks_cluster.py validate-modules:no-log-needed -plugins/modules/eks_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/iam_role.py compile-2.7!skip -plugins/modules/iam_role.py compile-3.5!skip -plugins/modules/iam_role.py import-2.7!skip -plugins/modules/iam_role.py import-3.5!skip -plugins/modules/iam_role.py future-import-boilerplate!skip -plugins/modules/iam_role.py metaclass-boilerplate!skip -plugins/modules/iam_role.py compile-2.6!skip -plugins/modules/iam_role.py import-2.6!skip -plugins/modules/iam_role.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_code_signing_config.py compile-2.7!skip -plugins/modules/lambda_code_signing_config.py compile-3.5!skip -plugins/modules/lambda_code_signing_config.py import-2.7!skip -plugins/modules/lambda_code_signing_config.py import-3.5!skip -plugins/modules/lambda_code_signing_config.py future-import-boilerplate!skip -plugins/modules/lambda_code_signing_config.py metaclass-boilerplate!skip -plugins/modules/lambda_code_signing_config.py compile-2.6!skip -plugins/modules/lambda_code_signing_config.py import-2.6!skip -plugins/modules/lambda_code_signing_config.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_event_source_mapping.py compile-2.7!skip -plugins/modules/lambda_event_source_mapping.py compile-3.5!skip -plugins/modules/lambda_event_source_mapping.py import-2.7!skip -plugins/modules/lambda_event_source_mapping.py import-3.5!skip -plugins/modules/lambda_event_source_mapping.py future-import-boilerplate!skip -plugins/modules/lambda_event_source_mapping.py metaclass-boilerplate!skip -plugins/modules/lambda_event_source_mapping.py compile-2.6!skip -plugins/modules/lambda_event_source_mapping.py import-2.6!skip -plugins/modules/lambda_event_source_mapping.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_function.py compile-2.7!skip -plugins/modules/lambda_function.py compile-3.5!skip -plugins/modules/lambda_function.py import-2.7!skip -plugins/modules/lambda_function.py import-3.5!skip -plugins/modules/lambda_function.py future-import-boilerplate!skip -plugins/modules/lambda_function.py metaclass-boilerplate!skip -plugins/modules/lambda_function.py compile-2.6!skip -plugins/modules/lambda_function.py import-2.6!skip -plugins/modules/lambda_function.py validate-modules:no-log-needed -plugins/modules/lambda_function.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_log_group.py compile-2.7!skip -plugins/modules/logs_log_group.py compile-3.5!skip -plugins/modules/logs_log_group.py import-2.7!skip -plugins/modules/logs_log_group.py import-3.5!skip -plugins/modules/logs_log_group.py future-import-boilerplate!skip -plugins/modules/logs_log_group.py metaclass-boilerplate!skip -plugins/modules/logs_log_group.py compile-2.6!skip -plugins/modules/logs_log_group.py import-2.6!skip -plugins/modules/logs_log_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_query_definition.py compile-2.7!skip -plugins/modules/logs_query_definition.py compile-3.5!skip -plugins/modules/logs_query_definition.py import-2.7!skip -plugins/modules/logs_query_definition.py import-3.5!skip -plugins/modules/logs_query_definition.py future-import-boilerplate!skip -plugins/modules/logs_query_definition.py metaclass-boilerplate!skip -plugins/modules/logs_query_definition.py compile-2.6!skip -plugins/modules/logs_query_definition.py import-2.6!skip -plugins/modules/logs_query_definition.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_resource_policy.py compile-2.7!skip -plugins/modules/logs_resource_policy.py compile-3.5!skip -plugins/modules/logs_resource_policy.py import-2.7!skip -plugins/modules/logs_resource_policy.py import-3.5!skip -plugins/modules/logs_resource_policy.py future-import-boilerplate!skip -plugins/modules/logs_resource_policy.py metaclass-boilerplate!skip -plugins/modules/logs_resource_policy.py compile-2.6!skip -plugins/modules/logs_resource_policy.py import-2.6!skip -plugins/modules/logs_resource_policy.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_proxy.py compile-2.7!skip -plugins/modules/rds_db_proxy.py compile-3.5!skip -plugins/modules/rds_db_proxy.py import-2.7!skip -plugins/modules/rds_db_proxy.py import-3.5!skip -plugins/modules/rds_db_proxy.py future-import-boilerplate!skip -plugins/modules/rds_db_proxy.py metaclass-boilerplate!skip -plugins/modules/rds_db_proxy.py compile-2.6!skip -plugins/modules/rds_db_proxy.py import-2.6!skip -plugins/modules/rds_db_proxy.py validate-modules:no-log-needed -plugins/modules/rds_db_proxy.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_cluster.py compile-2.7!skip -plugins/modules/redshift_cluster.py compile-3.5!skip -plugins/modules/redshift_cluster.py import-2.7!skip -plugins/modules/redshift_cluster.py import-3.5!skip -plugins/modules/redshift_cluster.py future-import-boilerplate!skip -plugins/modules/redshift_cluster.py metaclass-boilerplate!skip -plugins/modules/redshift_cluster.py compile-2.6!skip -plugins/modules/redshift_cluster.py import-2.6!skip -plugins/modules/redshift_cluster.py validate-modules:no-log-needed -plugins/modules/redshift_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_event_subscription.py compile-2.7!skip -plugins/modules/redshift_event_subscription.py compile-3.5!skip -plugins/modules/redshift_event_subscription.py import-2.7!skip -plugins/modules/redshift_event_subscription.py import-3.5!skip -plugins/modules/redshift_event_subscription.py future-import-boilerplate!skip -plugins/modules/redshift_event_subscription.py metaclass-boilerplate!skip -plugins/modules/redshift_event_subscription.py compile-2.6!skip -plugins/modules/redshift_event_subscription.py import-2.6!skip -plugins/modules/redshift_event_subscription.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3_access_point.py compile-2.7!skip -plugins/modules/s3_access_point.py compile-3.5!skip -plugins/modules/s3_access_point.py import-2.7!skip -plugins/modules/s3_access_point.py import-3.5!skip -plugins/modules/s3_access_point.py future-import-boilerplate!skip -plugins/modules/s3_access_point.py metaclass-boilerplate!skip -plugins/modules/s3_access_point.py compile-2.6!skip -plugins/modules/s3_access_point.py import-2.6!skip -plugins/modules/s3_access_point.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3_bucket.py compile-2.7!skip -plugins/modules/s3_bucket.py compile-3.5!skip -plugins/modules/s3_bucket.py import-2.7!skip -plugins/modules/s3_bucket.py import-3.5!skip -plugins/modules/s3_bucket.py future-import-boilerplate!skip -plugins/modules/s3_bucket.py metaclass-boilerplate!skip -plugins/modules/s3_bucket.py compile-2.6!skip -plugins/modules/s3_bucket.py import-2.6!skip -plugins/modules/s3_bucket.py validate-modules:no-log-needed -plugins/modules/s3_bucket.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3_multi_region_access_point.py compile-2.7!skip -plugins/modules/s3_multi_region_access_point.py compile-3.5!skip -plugins/modules/s3_multi_region_access_point.py import-2.7!skip -plugins/modules/s3_multi_region_access_point.py import-3.5!skip -plugins/modules/s3_multi_region_access_point.py future-import-boilerplate!skip -plugins/modules/s3_multi_region_access_point.py metaclass-boilerplate!skip -plugins/modules/s3_multi_region_access_point.py compile-2.6!skip -plugins/modules/s3_multi_region_access_point.py import-2.6!skip -plugins/modules/s3_multi_region_access_point.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3_multi_region_access_point_policy.py compile-2.7!skip -plugins/modules/s3_multi_region_access_point_policy.py compile-3.5!skip -plugins/modules/s3_multi_region_access_point_policy.py import-2.7!skip -plugins/modules/s3_multi_region_access_point_policy.py import-3.5!skip -plugins/modules/s3_multi_region_access_point_policy.py future-import-boilerplate!skip -plugins/modules/s3_multi_region_access_point_policy.py metaclass-boilerplate!skip -plugins/modules/s3_multi_region_access_point_policy.py compile-2.6!skip -plugins/modules/s3_multi_region_access_point_policy.py import-2.6!skip -plugins/modules/s3_multi_region_access_point_policy.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3objectlambda_access_point.py compile-2.7!skip -plugins/modules/s3objectlambda_access_point.py compile-3.5!skip -plugins/modules/s3objectlambda_access_point.py import-2.7!skip -plugins/modules/s3objectlambda_access_point.py import-3.5!skip -plugins/modules/s3objectlambda_access_point.py future-import-boilerplate!skip -plugins/modules/s3objectlambda_access_point.py metaclass-boilerplate!skip -plugins/modules/s3objectlambda_access_point.py compile-2.6!skip -plugins/modules/s3objectlambda_access_point.py import-2.6!skip -plugins/modules/s3objectlambda_access_point.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3objectlambda_access_point_policy.py compile-2.7!skip -plugins/modules/s3objectlambda_access_point_policy.py compile-3.5!skip -plugins/modules/s3objectlambda_access_point_policy.py import-2.7!skip -plugins/modules/s3objectlambda_access_point_policy.py import-3.5!skip -plugins/modules/s3objectlambda_access_point_policy.py future-import-boilerplate!skip -plugins/modules/s3objectlambda_access_point_policy.py metaclass-boilerplate!skip -plugins/modules/s3objectlambda_access_point_policy.py compile-2.6!skip -plugins/modules/s3objectlambda_access_point_policy.py import-2.6!skip -plugins/modules/s3objectlambda_access_point_policy.py validate-modules:parameter-state-invalid-choice -plugins/modules/eks_fargate_profile.py compile-2.7!skip -plugins/modules/eks_fargate_profile.py compile-3.5!skip -plugins/modules/eks_fargate_profile.py import-2.7!skip -plugins/modules/eks_fargate_profile.py import-3.5!skip -plugins/modules/eks_fargate_profile.py future-import-boilerplate!skip -plugins/modules/eks_fargate_profile.py metaclass-boilerplate!skip -plugins/modules/eks_fargate_profile.py compile-2.6!skip -plugins/modules/eks_fargate_profile.py import-2.6!skip -plugins/modules/eks_fargate_profile.py validate-modules:no-log-needed -plugins/modules/eks_fargate_profile.py validate-modules:parameter-state-invalid-choice -plugins/modules/dynamodb_global_table.py compile-2.7!skip -plugins/modules/dynamodb_global_table.py compile-3.5!skip -plugins/modules/dynamodb_global_table.py import-2.7!skip -plugins/modules/dynamodb_global_table.py import-3.5!skip -plugins/modules/dynamodb_global_table.py future-import-boilerplate!skip -plugins/modules/dynamodb_global_table.py metaclass-boilerplate!skip -plugins/modules/dynamodb_global_table.py compile-2.6!skip -plugins/modules/dynamodb_global_table.py import-2.6!skip -plugins/modules/dynamodb_global_table.py validate-modules:no-log-needed -plugins/modules/dynamodb_global_table.py validate-modules:parameter-state-invalid-choice -plugins/modules/eks_addon.py compile-2.7!skip -plugins/modules/eks_addon.py compile-3.5!skip -plugins/modules/eks_addon.py import-2.7!skip -plugins/modules/eks_addon.py import-3.5!skip -plugins/modules/eks_addon.py future-import-boilerplate!skip -plugins/modules/eks_addon.py metaclass-boilerplate!skip -plugins/modules/eks_addon.py compile-2.6!skip -plugins/modules/eks_addon.py import-2.6!skip -plugins/modules/eks_addon.py validate-modules:parameter-state-invalid-choice -plugins/modules/iam_server_certificate.py compile-2.7!skip -plugins/modules/iam_server_certificate.py compile-3.5!skip -plugins/modules/iam_server_certificate.py import-2.7!skip -plugins/modules/iam_server_certificate.py import-3.5!skip -plugins/modules/iam_server_certificate.py future-import-boilerplate!skip -plugins/modules/iam_server_certificate.py metaclass-boilerplate!skip -plugins/modules/iam_server_certificate.py compile-2.6!skip -plugins/modules/iam_server_certificate.py import-2.6!skip -plugins/modules/iam_server_certificate.py validate-modules:no-log-needed -plugins/modules/iam_server_certificate.py validate-modules:parameter-state-invalid-choice -plugins/modules/kms_alias.py compile-2.7!skip -plugins/modules/kms_alias.py compile-3.5!skip -plugins/modules/kms_alias.py import-2.7!skip -plugins/modules/kms_alias.py import-3.5!skip -plugins/modules/kms_alias.py future-import-boilerplate!skip -plugins/modules/kms_alias.py metaclass-boilerplate!skip -plugins/modules/kms_alias.py compile-2.6!skip -plugins/modules/kms_alias.py import-2.6!skip -plugins/modules/kms_alias.py validate-modules:parameter-state-invalid-choice -plugins/modules/kms_replica_key.py compile-2.7!skip -plugins/modules/kms_replica_key.py compile-3.5!skip -plugins/modules/kms_replica_key.py import-2.7!skip -plugins/modules/kms_replica_key.py import-3.5!skip -plugins/modules/kms_replica_key.py future-import-boilerplate!skip -plugins/modules/kms_replica_key.py metaclass-boilerplate!skip -plugins/modules/kms_replica_key.py compile-2.6!skip -plugins/modules/kms_replica_key.py import-2.6!skip -plugins/modules/kms_replica_key.py validate-modules:no-log-needed -plugins/modules/kms_replica_key.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_proxy_endpoint.py compile-2.7!skip -plugins/modules/rds_db_proxy_endpoint.py compile-3.5!skip -plugins/modules/rds_db_proxy_endpoint.py import-2.7!skip -plugins/modules/rds_db_proxy_endpoint.py import-3.5!skip -plugins/modules/rds_db_proxy_endpoint.py future-import-boilerplate!skip -plugins/modules/rds_db_proxy_endpoint.py metaclass-boilerplate!skip -plugins/modules/rds_db_proxy_endpoint.py compile-2.6!skip -plugins/modules/rds_db_proxy_endpoint.py import-2.6!skip -plugins/modules/rds_db_proxy_endpoint.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_endpoint_access.py compile-2.7!skip -plugins/modules/redshift_endpoint_access.py compile-3.5!skip -plugins/modules/redshift_endpoint_access.py import-2.7!skip -plugins/modules/redshift_endpoint_access.py import-3.5!skip -plugins/modules/redshift_endpoint_access.py future-import-boilerplate!skip -plugins/modules/redshift_endpoint_access.py metaclass-boilerplate!skip -plugins/modules/redshift_endpoint_access.py compile-2.6!skip -plugins/modules/redshift_endpoint_access.py import-2.6!skip -plugins/modules/redshift_endpoint_access.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_endpoint_authorization.py compile-2.7!skip -plugins/modules/redshift_endpoint_authorization.py compile-3.5!skip -plugins/modules/redshift_endpoint_authorization.py import-2.7!skip -plugins/modules/redshift_endpoint_authorization.py import-3.5!skip -plugins/modules/redshift_endpoint_authorization.py future-import-boilerplate!skip -plugins/modules/redshift_endpoint_authorization.py metaclass-boilerplate!skip -plugins/modules/redshift_endpoint_authorization.py compile-2.6!skip -plugins/modules/redshift_endpoint_authorization.py import-2.6!skip -plugins/modules/redshift_endpoint_authorization.py validate-modules:no-log-needed -plugins/modules/redshift_endpoint_authorization.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_scheduled_action.py compile-2.7!skip -plugins/modules/redshift_scheduled_action.py compile-3.5!skip -plugins/modules/redshift_scheduled_action.py import-2.7!skip -plugins/modules/redshift_scheduled_action.py import-3.5!skip -plugins/modules/redshift_scheduled_action.py future-import-boilerplate!skip -plugins/modules/redshift_scheduled_action.py metaclass-boilerplate!skip -plugins/modules/redshift_scheduled_action.py compile-2.6!skip -plugins/modules/redshift_scheduled_action.py import-2.6!skip -plugins/modules/redshift_scheduled_action.py validate-modules:parameter-state-invalid-choice -plugins/modules/route53_dnssec.py compile-2.7!skip -plugins/modules/route53_dnssec.py compile-3.5!skip -plugins/modules/route53_dnssec.py import-2.7!skip -plugins/modules/route53_dnssec.py import-3.5!skip -plugins/modules/route53_dnssec.py future-import-boilerplate!skip -plugins/modules/route53_dnssec.py metaclass-boilerplate!skip -plugins/modules/route53_dnssec.py compile-2.6!skip -plugins/modules/route53_dnssec.py import-2.6!skip -plugins/modules/route53_dnssec.py validate-modules:parameter-state-invalid-choice -plugins/modules/route53_key_signing_key.py compile-2.7!skip -plugins/modules/route53_key_signing_key.py compile-3.5!skip -plugins/modules/route53_key_signing_key.py import-2.7!skip -plugins/modules/route53_key_signing_key.py import-3.5!skip -plugins/modules/route53_key_signing_key.py future-import-boilerplate!skip -plugins/modules/route53_key_signing_key.py metaclass-boilerplate!skip -plugins/modules/route53_key_signing_key.py compile-2.6!skip -plugins/modules/route53_key_signing_key.py import-2.6!skip -plugins/modules/route53_key_signing_key.py validate-modules:no-log-needed -plugins/modules/route53_key_signing_key.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudtrail_trail.py compile-2.7!skip -plugins/modules/cloudtrail_trail.py compile-3.5!skip -plugins/modules/cloudtrail_trail.py import-2.7!skip -plugins/modules/cloudtrail_trail.py import-3.5!skip -plugins/modules/cloudtrail_trail.py future-import-boilerplate!skip -plugins/modules/cloudtrail_trail.py metaclass-boilerplate!skip -plugins/modules/cloudtrail_trail.py compile-2.6!skip -plugins/modules/cloudtrail_trail.py import-2.6!skip -plugins/modules/cloudtrail_trail.py validate-modules:no-log-needed -plugins/modules/cloudtrail_trail.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudtrail_event_data_store.py compile-2.7!skip -plugins/modules/cloudtrail_event_data_store.py compile-3.5!skip -plugins/modules/cloudtrail_event_data_store.py import-2.7!skip -plugins/modules/cloudtrail_event_data_store.py import-3.5!skip -plugins/modules/cloudtrail_event_data_store.py future-import-boilerplate!skip -plugins/modules/cloudtrail_event_data_store.py metaclass-boilerplate!skip -plugins/modules/cloudtrail_event_data_store.py compile-2.6!skip -plugins/modules/cloudtrail_event_data_store.py import-2.6!skip -plugins/modules/cloudtrail_event_data_store.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudwatch_composite_alarm.py compile-2.7!skip -plugins/modules/cloudwatch_composite_alarm.py compile-3.5!skip -plugins/modules/cloudwatch_composite_alarm.py import-2.7!skip -plugins/modules/cloudwatch_composite_alarm.py import-3.5!skip -plugins/modules/cloudwatch_composite_alarm.py future-import-boilerplate!skip -plugins/modules/cloudwatch_composite_alarm.py metaclass-boilerplate!skip -plugins/modules/cloudwatch_composite_alarm.py compile-2.6!skip -plugins/modules/cloudwatch_composite_alarm.py import-2.6!skip -plugins/modules/cloudwatch_composite_alarm.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudwatch_metric_stream.py compile-2.7!skip -plugins/modules/cloudwatch_metric_stream.py compile-3.5!skip -plugins/modules/cloudwatch_metric_stream.py import-2.7!skip -plugins/modules/cloudwatch_metric_stream.py import-3.5!skip -plugins/modules/cloudwatch_metric_stream.py future-import-boilerplate!skip -plugins/modules/cloudwatch_metric_stream.py metaclass-boilerplate!skip -plugins/modules/cloudwatch_metric_stream.py compile-2.6!skip -plugins/modules/cloudwatch_metric_stream.py import-2.6!skip -plugins/modules/cloudwatch_metric_stream.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_instance.py compile-2.7!skip -plugins/modules/rds_db_instance.py compile-3.5!skip -plugins/modules/rds_db_instance.py import-2.7!skip -plugins/modules/rds_db_instance.py import-3.5!skip -plugins/modules/rds_db_instance.py future-import-boilerplate!skip -plugins/modules/rds_db_instance.py metaclass-boilerplate!skip -plugins/modules/rds_db_instance.py compile-2.6!skip -plugins/modules/rds_db_instance.py import-2.6!skip -plugins/modules/rds_db_instance.py validate-modules:no-log-needed -plugins/modules/rds_db_instance.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_cluster_parameter_group.py compile-2.7!skip -plugins/modules/rds_db_cluster_parameter_group.py compile-3.5!skip -plugins/modules/rds_db_cluster_parameter_group.py import-2.7!skip -plugins/modules/rds_db_cluster_parameter_group.py import-3.5!skip -plugins/modules/rds_db_cluster_parameter_group.py future-import-boilerplate!skip -plugins/modules/rds_db_cluster_parameter_group.py metaclass-boilerplate!skip -plugins/modules/rds_db_cluster_parameter_group.py compile-2.6!skip -plugins/modules/rds_db_cluster_parameter_group.py import-2.6!skip -plugins/modules/rds_db_cluster_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_subnet_group.py compile-2.7!skip -plugins/modules/rds_db_subnet_group.py compile-3.5!skip -plugins/modules/rds_db_subnet_group.py import-2.7!skip -plugins/modules/rds_db_subnet_group.py import-3.5!skip -plugins/modules/rds_db_subnet_group.py future-import-boilerplate!skip -plugins/modules/rds_db_subnet_group.py metaclass-boilerplate!skip -plugins/modules/rds_db_subnet_group.py compile-2.6!skip -plugins/modules/rds_db_subnet_group.py import-2.6!skip -plugins/modules/rds_db_subnet_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_global_cluster.py compile-2.7!skip -plugins/modules/rds_global_cluster.py compile-3.5!skip -plugins/modules/rds_global_cluster.py import-2.7!skip -plugins/modules/rds_global_cluster.py import-3.5!skip -plugins/modules/rds_global_cluster.py future-import-boilerplate!skip -plugins/modules/rds_global_cluster.py metaclass-boilerplate!skip -plugins/modules/rds_global_cluster.py compile-2.6!skip -plugins/modules/rds_global_cluster.py import-2.6!skip -plugins/modules/rds_global_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_option_group.py compile-2.7!skip -plugins/modules/rds_option_group.py compile-3.5!skip -plugins/modules/rds_option_group.py import-2.7!skip -plugins/modules/rds_option_group.py import-3.5!skip -plugins/modules/rds_option_group.py future-import-boilerplate!skip -plugins/modules/rds_option_group.py metaclass-boilerplate!skip -plugins/modules/rds_option_group.py compile-2.6!skip -plugins/modules/rds_option_group.py import-2.6!skip -plugins/modules/rds_option_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/ssm_document.py compile-2.7!skip -plugins/modules/ssm_document.py compile-3.5!skip -plugins/modules/ssm_document.py import-2.7!skip -plugins/modules/ssm_document.py import-3.5!skip -plugins/modules/ssm_document.py future-import-boilerplate!skip -plugins/modules/ssm_document.py metaclass-boilerplate!skip -plugins/modules/ssm_document.py compile-2.6!skip -plugins/modules/ssm_document.py import-2.6!skip -plugins/modules/ssm_document.py validate-modules:parameter-state-invalid-choice -plugins/modules/ssm_resource_data_sync.py compile-2.7!skip -plugins/modules/ssm_resource_data_sync.py compile-3.5!skip -plugins/modules/ssm_resource_data_sync.py import-2.7!skip -plugins/modules/ssm_resource_data_sync.py import-3.5!skip -plugins/modules/ssm_resource_data_sync.py future-import-boilerplate!skip -plugins/modules/ssm_resource_data_sync.py metaclass-boilerplate!skip -plugins/modules/ssm_resource_data_sync.py compile-2.6!skip -plugins/modules/ssm_resource_data_sync.py import-2.6!skip -plugins/modules/ssm_resource_data_sync.py validate-modules:no-log-needed -plugins/modules/ssm_resource_data_sync.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_ip_set.py compile-2.7!skip -plugins/modules/wafv2_ip_set.py compile-3.5!skip -plugins/modules/wafv2_ip_set.py import-2.7!skip -plugins/modules/wafv2_ip_set.py import-3.5!skip -plugins/modules/wafv2_ip_set.py future-import-boilerplate!skip -plugins/modules/wafv2_ip_set.py metaclass-boilerplate!skip -plugins/modules/wafv2_ip_set.py compile-2.6!skip -plugins/modules/wafv2_ip_set.py import-2.6!skip -plugins/modules/wafv2_ip_set.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_logging_configuration.py compile-2.7!skip -plugins/modules/wafv2_logging_configuration.py compile-3.5!skip -plugins/modules/wafv2_logging_configuration.py import-2.7!skip -plugins/modules/wafv2_logging_configuration.py import-3.5!skip -plugins/modules/wafv2_logging_configuration.py future-import-boilerplate!skip -plugins/modules/wafv2_logging_configuration.py metaclass-boilerplate!skip -plugins/modules/wafv2_logging_configuration.py compile-2.6!skip -plugins/modules/wafv2_logging_configuration.py import-2.6!skip -plugins/modules/wafv2_logging_configuration.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_regex_pattern_set.py compile-2.7!skip -plugins/modules/wafv2_regex_pattern_set.py compile-3.5!skip -plugins/modules/wafv2_regex_pattern_set.py import-2.7!skip -plugins/modules/wafv2_regex_pattern_set.py import-3.5!skip -plugins/modules/wafv2_regex_pattern_set.py future-import-boilerplate!skip -plugins/modules/wafv2_regex_pattern_set.py metaclass-boilerplate!skip -plugins/modules/wafv2_regex_pattern_set.py compile-2.6!skip -plugins/modules/wafv2_regex_pattern_set.py import-2.6!skip -plugins/modules/wafv2_regex_pattern_set.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_web_acl_association.py compile-2.7!skip -plugins/modules/wafv2_web_acl_association.py compile-3.5!skip -plugins/modules/wafv2_web_acl_association.py import-2.7!skip -plugins/modules/wafv2_web_acl_association.py import-3.5!skip -plugins/modules/wafv2_web_acl_association.py future-import-boilerplate!skip -plugins/modules/wafv2_web_acl_association.py metaclass-boilerplate!skip -plugins/modules/wafv2_web_acl_association.py compile-2.6!skip -plugins/modules/wafv2_web_acl_association.py import-2.6!skip -plugins/modules/wafv2_web_acl_association.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecr_repository.py compile-2.7!skip -plugins/modules/ecr_repository.py compile-3.5!skip -plugins/modules/ecr_repository.py import-2.7!skip -plugins/modules/ecr_repository.py import-3.5!skip -plugins/modules/ecr_repository.py future-import-boilerplate!skip -plugins/modules/ecr_repository.py metaclass-boilerplate!skip -plugins/modules/ecr_repository.py compile-2.6!skip -plugins/modules/ecr_repository.py import-2.6!skip -plugins/modules/ecr_repository.py validate-modules:no-log-needed -plugins/modules/ecr_repository.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecs_capacity_provider.py compile-2.7!skip -plugins/modules/ecs_capacity_provider.py compile-3.5!skip -plugins/modules/ecs_capacity_provider.py import-2.7!skip -plugins/modules/ecs_capacity_provider.py import-3.5!skip -plugins/modules/ecs_capacity_provider.py future-import-boilerplate!skip -plugins/modules/ecs_capacity_provider.py metaclass-boilerplate!skip -plugins/modules/ecs_capacity_provider.py compile-2.6!skip -plugins/modules/ecs_capacity_provider.py import-2.6!skip -plugins/modules/ecs_capacity_provider.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecs_cluster.py compile-2.7!skip -plugins/modules/ecs_cluster.py compile-3.5!skip -plugins/modules/ecs_cluster.py import-2.7!skip -plugins/modules/ecs_cluster.py import-3.5!skip -plugins/modules/ecs_cluster.py future-import-boilerplate!skip -plugins/modules/ecs_cluster.py metaclass-boilerplate!skip -plugins/modules/ecs_cluster.py compile-2.6!skip -plugins/modules/ecs_cluster.py import-2.6!skip -plugins/modules/ecs_cluster.py validate-modules:no-log-needed -plugins/modules/ecs_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecs_cluster_capacity_provider_associations.py compile-2.7!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py compile-3.5!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py import-2.7!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py import-3.5!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py future-import-boilerplate!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py metaclass-boilerplate!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py compile-2.6!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py import-2.6!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecs_primary_task_set.py compile-2.7!skip -plugins/modules/ecs_primary_task_set.py compile-3.5!skip -plugins/modules/ecs_primary_task_set.py import-2.7!skip -plugins/modules/ecs_primary_task_set.py import-3.5!skip -plugins/modules/ecs_primary_task_set.py future-import-boilerplate!skip -plugins/modules/ecs_primary_task_set.py metaclass-boilerplate!skip -plugins/modules/ecs_primary_task_set.py compile-2.6!skip -plugins/modules/ecs_primary_task_set.py import-2.6!skip -plugins/modules/ecs_primary_task_set.py validate-modules:parameter-state-invalid-choice -plugins/modules/iam_instance_profile.py compile-2.7!skip -plugins/modules/iam_instance_profile.py compile-3.5!skip -plugins/modules/iam_instance_profile.py import-2.7!skip -plugins/modules/iam_instance_profile.py import-3.5!skip -plugins/modules/iam_instance_profile.py future-import-boilerplate!skip -plugins/modules/iam_instance_profile.py metaclass-boilerplate!skip -plugins/modules/iam_instance_profile.py compile-2.6!skip -plugins/modules/iam_instance_profile.py import-2.6!skip -plugins/modules/iam_instance_profile.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_metric_filter.py compile-2.7!skip -plugins/modules/logs_metric_filter.py compile-3.5!skip -plugins/modules/logs_metric_filter.py import-2.7!skip -plugins/modules/logs_metric_filter.py import-3.5!skip -plugins/modules/logs_metric_filter.py future-import-boilerplate!skip -plugins/modules/logs_metric_filter.py metaclass-boilerplate!skip -plugins/modules/logs_metric_filter.py compile-2.6!skip -plugins/modules/logs_metric_filter.py import-2.6!skip -plugins/modules/logs_metric_filter.py validate-modules:no-log-needed -plugins/modules/logs_metric_filter.py validate-modules:parameter-state-invalid-choice -plugins/modules/ec2_placement_group.py compile-2.7!skip -plugins/modules/ec2_placement_group.py compile-3.5!skip -plugins/modules/ec2_placement_group.py import-2.7!skip -plugins/modules/ec2_placement_group.py import-3.5!skip -plugins/modules/ec2_placement_group.py future-import-boilerplate!skip -plugins/modules/ec2_placement_group.py metaclass-boilerplate!skip -plugins/modules/ec2_placement_group.py compile-2.6!skip -plugins/modules/ec2_placement_group.py import-2.6!skip -plugins/modules/ec2_placement_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/autoscaling_launch_configuration.py compile-2.7!skip -plugins/modules/autoscaling_launch_configuration.py compile-3.5!skip -plugins/modules/autoscaling_launch_configuration.py import-2.7!skip -plugins/modules/autoscaling_launch_configuration.py import-3.5!skip -plugins/modules/autoscaling_launch_configuration.py future-import-boilerplate!skip -plugins/modules/autoscaling_launch_configuration.py metaclass-boilerplate!skip -plugins/modules/autoscaling_launch_configuration.py compile-2.6!skip -plugins/modules/autoscaling_launch_configuration.py import-2.6!skip -plugins/modules/autoscaling_launch_configuration.py validate-modules:no-log-needed -plugins/modules/autoscaling_launch_configuration.py validate-modules:parameter-state-invalid-choice -plugins/modules/autoscaling_lifecycle_hook.py compile-2.7!skip -plugins/modules/autoscaling_lifecycle_hook.py compile-3.5!skip -plugins/modules/autoscaling_lifecycle_hook.py import-2.7!skip -plugins/modules/autoscaling_lifecycle_hook.py import-3.5!skip -plugins/modules/autoscaling_lifecycle_hook.py future-import-boilerplate!skip -plugins/modules/autoscaling_lifecycle_hook.py metaclass-boilerplate!skip -plugins/modules/autoscaling_lifecycle_hook.py compile-2.6!skip -plugins/modules/autoscaling_lifecycle_hook.py import-2.6!skip -plugins/modules/autoscaling_lifecycle_hook.py validate-modules:parameter-state-invalid-choice -plugins/modules/autoscaling_warm_pool.py compile-2.7!skip -plugins/modules/autoscaling_warm_pool.py compile-3.5!skip -plugins/modules/autoscaling_warm_pool.py import-2.7!skip -plugins/modules/autoscaling_warm_pool.py import-3.5!skip -plugins/modules/autoscaling_warm_pool.py future-import-boilerplate!skip -plugins/modules/autoscaling_warm_pool.py metaclass-boilerplate!skip -plugins/modules/autoscaling_warm_pool.py compile-2.6!skip -plugins/modules/autoscaling_warm_pool.py import-2.6!skip -plugins/modules/autoscaling_warm_pool.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_acl.py compile-2.7!skip -plugins/modules/memorydb_acl.py compile-3.5!skip -plugins/modules/memorydb_acl.py import-2.7!skip -plugins/modules/memorydb_acl.py import-3.5!skip -plugins/modules/memorydb_acl.py future-import-boilerplate!skip -plugins/modules/memorydb_acl.py metaclass-boilerplate!skip -plugins/modules/memorydb_acl.py compile-2.6!skip -plugins/modules/memorydb_acl.py import-2.6!skip -plugins/modules/memorydb_acl.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_cluster.py compile-2.7!skip -plugins/modules/memorydb_cluster.py compile-3.5!skip -plugins/modules/memorydb_cluster.py import-2.7!skip -plugins/modules/memorydb_cluster.py import-3.5!skip -plugins/modules/memorydb_cluster.py future-import-boilerplate!skip -plugins/modules/memorydb_cluster.py metaclass-boilerplate!skip -plugins/modules/memorydb_cluster.py compile-2.6!skip -plugins/modules/memorydb_cluster.py import-2.6!skip -plugins/modules/memorydb_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_parameter_group.py compile-2.7!skip -plugins/modules/memorydb_parameter_group.py compile-3.5!skip -plugins/modules/memorydb_parameter_group.py import-2.7!skip -plugins/modules/memorydb_parameter_group.py import-3.5!skip -plugins/modules/memorydb_parameter_group.py future-import-boilerplate!skip -plugins/modules/memorydb_parameter_group.py metaclass-boilerplate!skip -plugins/modules/memorydb_parameter_group.py compile-2.6!skip -plugins/modules/memorydb_parameter_group.py import-2.6!skip -plugins/modules/memorydb_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_subnet_group.py compile-2.7!skip -plugins/modules/memorydb_subnet_group.py compile-3.5!skip -plugins/modules/memorydb_subnet_group.py import-2.7!skip -plugins/modules/memorydb_subnet_group.py import-3.5!skip -plugins/modules/memorydb_subnet_group.py future-import-boilerplate!skip -plugins/modules/memorydb_subnet_group.py metaclass-boilerplate!skip -plugins/modules/memorydb_subnet_group.py compile-2.6!skip -plugins/modules/memorydb_subnet_group.py import-2.6!skip -plugins/modules/memorydb_subnet_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_user.py compile-2.7!skip -plugins/modules/memorydb_user.py compile-3.5!skip -plugins/modules/memorydb_user.py import-2.7!skip -plugins/modules/memorydb_user.py import-3.5!skip -plugins/modules/memorydb_user.py future-import-boilerplate!skip -plugins/modules/memorydb_user.py metaclass-boilerplate!skip -plugins/modules/memorydb_user.py compile-2.6!skip -plugins/modules/memorydb_user.py import-2.6!skip -plugins/modules/memorydb_user.py validate-modules:parameter-state-invalid-choice -plugins/modules/eks_addon.py validate-modules:mutually_exclusive-type -plugins/modules/eks_fargate_profile.py validate-modules:mutually_exclusive-type -plugins/modules/redshift_endpoint_authorization.py validate-modules:mutually_exclusive-type -plugins/modules/route53_key_signing_key.py validate-modules:mutually_exclusive-type -plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusive-type -plugins/modules/ecs_primary_task_set.py validate-modules:mutually_exclusive-type -plugins/modules/logs_metric_filter.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_ip_set.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_regex_pattern_set.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_web_acl_association.py validate-modules:mutually_exclusive-type diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt deleted file mode 100644 index 3744d9e6..00000000 --- a/tests/sanity/ignore-2.11.txt +++ /dev/null @@ -1,613 +0,0 @@ -plugins/module_utils/core.py compile-2.7!skip -plugins/module_utils/core.py compile-3.5!skip -plugins/module_utils/core.py import-2.7!skip -plugins/module_utils/core.py import-3.5!skip -plugins/module_utils/core.py future-import-boilerplate!skip -plugins/module_utils/core.py metaclass-boilerplate!skip -plugins/module_utils/core.py compile-2.6!skip -plugins/module_utils/core.py import-2.6!skip -plugins/module_utils/utils.py compile-2.7!skip -plugins/module_utils/utils.py compile-3.5!skip -plugins/module_utils/utils.py import-2.7!skip -plugins/module_utils/utils.py import-3.5!skip -plugins/module_utils/utils.py future-import-boilerplate!skip -plugins/module_utils/utils.py metaclass-boilerplate!skip -plugins/module_utils/utils.py compile-2.6!skip -plugins/module_utils/utils.py import-2.6!skip -plugins/modules/backup_backup_vault.py compile-2.7!skip -plugins/modules/backup_backup_vault.py compile-3.5!skip -plugins/modules/backup_backup_vault.py import-2.7!skip -plugins/modules/backup_backup_vault.py import-3.5!skip -plugins/modules/backup_backup_vault.py future-import-boilerplate!skip -plugins/modules/backup_backup_vault.py metaclass-boilerplate!skip -plugins/modules/backup_backup_vault.py compile-2.6!skip -plugins/modules/backup_backup_vault.py import-2.6!skip -plugins/modules/backup_backup_vault.py validate-modules:no-log-needed -plugins/modules/backup_backup_vault.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_framework.py compile-2.7!skip -plugins/modules/backup_framework.py compile-3.5!skip -plugins/modules/backup_framework.py import-2.7!skip -plugins/modules/backup_framework.py import-3.5!skip -plugins/modules/backup_framework.py future-import-boilerplate!skip -plugins/modules/backup_framework.py metaclass-boilerplate!skip -plugins/modules/backup_framework.py compile-2.6!skip -plugins/modules/backup_framework.py import-2.6!skip -plugins/modules/backup_framework.py validate-modules:no-log-needed -plugins/modules/backup_framework.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_report_plan.py compile-2.7!skip -plugins/modules/backup_report_plan.py compile-3.5!skip -plugins/modules/backup_report_plan.py import-2.7!skip -plugins/modules/backup_report_plan.py import-3.5!skip -plugins/modules/backup_report_plan.py future-import-boilerplate!skip -plugins/modules/backup_report_plan.py metaclass-boilerplate!skip -plugins/modules/backup_report_plan.py compile-2.6!skip -plugins/modules/backup_report_plan.py import-2.6!skip -plugins/modules/backup_report_plan.py validate-modules:no-log-needed -plugins/modules/backup_report_plan.py validate-modules:parameter-state-invalid-choice -plugins/modules/eks_cluster.py compile-2.7!skip -plugins/modules/eks_cluster.py compile-3.5!skip -plugins/modules/eks_cluster.py import-2.7!skip -plugins/modules/eks_cluster.py import-3.5!skip -plugins/modules/eks_cluster.py future-import-boilerplate!skip -plugins/modules/eks_cluster.py metaclass-boilerplate!skip -plugins/modules/eks_cluster.py compile-2.6!skip -plugins/modules/eks_cluster.py import-2.6!skip -plugins/modules/eks_cluster.py validate-modules:no-log-needed -plugins/modules/eks_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/iam_role.py compile-2.7!skip -plugins/modules/iam_role.py compile-3.5!skip -plugins/modules/iam_role.py import-2.7!skip -plugins/modules/iam_role.py import-3.5!skip -plugins/modules/iam_role.py future-import-boilerplate!skip -plugins/modules/iam_role.py metaclass-boilerplate!skip -plugins/modules/iam_role.py compile-2.6!skip -plugins/modules/iam_role.py import-2.6!skip -plugins/modules/iam_role.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_code_signing_config.py compile-2.7!skip -plugins/modules/lambda_code_signing_config.py compile-3.5!skip -plugins/modules/lambda_code_signing_config.py import-2.7!skip -plugins/modules/lambda_code_signing_config.py import-3.5!skip -plugins/modules/lambda_code_signing_config.py future-import-boilerplate!skip -plugins/modules/lambda_code_signing_config.py metaclass-boilerplate!skip -plugins/modules/lambda_code_signing_config.py compile-2.6!skip -plugins/modules/lambda_code_signing_config.py import-2.6!skip -plugins/modules/lambda_code_signing_config.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_event_source_mapping.py compile-2.7!skip -plugins/modules/lambda_event_source_mapping.py compile-3.5!skip -plugins/modules/lambda_event_source_mapping.py import-2.7!skip -plugins/modules/lambda_event_source_mapping.py import-3.5!skip -plugins/modules/lambda_event_source_mapping.py future-import-boilerplate!skip -plugins/modules/lambda_event_source_mapping.py metaclass-boilerplate!skip -plugins/modules/lambda_event_source_mapping.py compile-2.6!skip -plugins/modules/lambda_event_source_mapping.py import-2.6!skip -plugins/modules/lambda_event_source_mapping.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_function.py compile-2.7!skip -plugins/modules/lambda_function.py compile-3.5!skip -plugins/modules/lambda_function.py import-2.7!skip -plugins/modules/lambda_function.py import-3.5!skip -plugins/modules/lambda_function.py future-import-boilerplate!skip -plugins/modules/lambda_function.py metaclass-boilerplate!skip -plugins/modules/lambda_function.py compile-2.6!skip -plugins/modules/lambda_function.py import-2.6!skip -plugins/modules/lambda_function.py validate-modules:no-log-needed -plugins/modules/lambda_function.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_log_group.py compile-2.7!skip -plugins/modules/logs_log_group.py compile-3.5!skip -plugins/modules/logs_log_group.py import-2.7!skip -plugins/modules/logs_log_group.py import-3.5!skip -plugins/modules/logs_log_group.py future-import-boilerplate!skip -plugins/modules/logs_log_group.py metaclass-boilerplate!skip -plugins/modules/logs_log_group.py compile-2.6!skip -plugins/modules/logs_log_group.py import-2.6!skip -plugins/modules/logs_log_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_query_definition.py compile-2.7!skip -plugins/modules/logs_query_definition.py compile-3.5!skip -plugins/modules/logs_query_definition.py import-2.7!skip -plugins/modules/logs_query_definition.py import-3.5!skip -plugins/modules/logs_query_definition.py future-import-boilerplate!skip -plugins/modules/logs_query_definition.py metaclass-boilerplate!skip -plugins/modules/logs_query_definition.py compile-2.6!skip -plugins/modules/logs_query_definition.py import-2.6!skip -plugins/modules/logs_query_definition.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_resource_policy.py compile-2.7!skip -plugins/modules/logs_resource_policy.py compile-3.5!skip -plugins/modules/logs_resource_policy.py import-2.7!skip -plugins/modules/logs_resource_policy.py import-3.5!skip -plugins/modules/logs_resource_policy.py future-import-boilerplate!skip -plugins/modules/logs_resource_policy.py metaclass-boilerplate!skip -plugins/modules/logs_resource_policy.py compile-2.6!skip -plugins/modules/logs_resource_policy.py import-2.6!skip -plugins/modules/logs_resource_policy.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_proxy.py compile-2.7!skip -plugins/modules/rds_db_proxy.py compile-3.5!skip -plugins/modules/rds_db_proxy.py import-2.7!skip -plugins/modules/rds_db_proxy.py import-3.5!skip -plugins/modules/rds_db_proxy.py future-import-boilerplate!skip -plugins/modules/rds_db_proxy.py metaclass-boilerplate!skip -plugins/modules/rds_db_proxy.py compile-2.6!skip -plugins/modules/rds_db_proxy.py import-2.6!skip -plugins/modules/rds_db_proxy.py validate-modules:no-log-needed -plugins/modules/rds_db_proxy.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_cluster.py compile-2.7!skip -plugins/modules/redshift_cluster.py compile-3.5!skip -plugins/modules/redshift_cluster.py import-2.7!skip -plugins/modules/redshift_cluster.py import-3.5!skip -plugins/modules/redshift_cluster.py future-import-boilerplate!skip -plugins/modules/redshift_cluster.py metaclass-boilerplate!skip -plugins/modules/redshift_cluster.py compile-2.6!skip -plugins/modules/redshift_cluster.py import-2.6!skip -plugins/modules/redshift_cluster.py validate-modules:no-log-needed -plugins/modules/redshift_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_event_subscription.py compile-2.7!skip -plugins/modules/redshift_event_subscription.py compile-3.5!skip -plugins/modules/redshift_event_subscription.py import-2.7!skip -plugins/modules/redshift_event_subscription.py import-3.5!skip -plugins/modules/redshift_event_subscription.py future-import-boilerplate!skip -plugins/modules/redshift_event_subscription.py metaclass-boilerplate!skip -plugins/modules/redshift_event_subscription.py compile-2.6!skip -plugins/modules/redshift_event_subscription.py import-2.6!skip -plugins/modules/redshift_event_subscription.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3_access_point.py compile-2.7!skip -plugins/modules/s3_access_point.py compile-3.5!skip -plugins/modules/s3_access_point.py import-2.7!skip -plugins/modules/s3_access_point.py import-3.5!skip -plugins/modules/s3_access_point.py future-import-boilerplate!skip -plugins/modules/s3_access_point.py metaclass-boilerplate!skip -plugins/modules/s3_access_point.py compile-2.6!skip -plugins/modules/s3_access_point.py import-2.6!skip -plugins/modules/s3_access_point.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3_bucket.py compile-2.7!skip -plugins/modules/s3_bucket.py compile-3.5!skip -plugins/modules/s3_bucket.py import-2.7!skip -plugins/modules/s3_bucket.py import-3.5!skip -plugins/modules/s3_bucket.py future-import-boilerplate!skip -plugins/modules/s3_bucket.py metaclass-boilerplate!skip -plugins/modules/s3_bucket.py compile-2.6!skip -plugins/modules/s3_bucket.py import-2.6!skip -plugins/modules/s3_bucket.py validate-modules:no-log-needed -plugins/modules/s3_bucket.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3_multi_region_access_point.py compile-2.7!skip -plugins/modules/s3_multi_region_access_point.py compile-3.5!skip -plugins/modules/s3_multi_region_access_point.py import-2.7!skip -plugins/modules/s3_multi_region_access_point.py import-3.5!skip -plugins/modules/s3_multi_region_access_point.py future-import-boilerplate!skip -plugins/modules/s3_multi_region_access_point.py metaclass-boilerplate!skip -plugins/modules/s3_multi_region_access_point.py compile-2.6!skip -plugins/modules/s3_multi_region_access_point.py import-2.6!skip -plugins/modules/s3_multi_region_access_point.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3_multi_region_access_point_policy.py compile-2.7!skip -plugins/modules/s3_multi_region_access_point_policy.py compile-3.5!skip -plugins/modules/s3_multi_region_access_point_policy.py import-2.7!skip -plugins/modules/s3_multi_region_access_point_policy.py import-3.5!skip -plugins/modules/s3_multi_region_access_point_policy.py future-import-boilerplate!skip -plugins/modules/s3_multi_region_access_point_policy.py metaclass-boilerplate!skip -plugins/modules/s3_multi_region_access_point_policy.py compile-2.6!skip -plugins/modules/s3_multi_region_access_point_policy.py import-2.6!skip -plugins/modules/s3_multi_region_access_point_policy.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3objectlambda_access_point.py compile-2.7!skip -plugins/modules/s3objectlambda_access_point.py compile-3.5!skip -plugins/modules/s3objectlambda_access_point.py import-2.7!skip -plugins/modules/s3objectlambda_access_point.py import-3.5!skip -plugins/modules/s3objectlambda_access_point.py future-import-boilerplate!skip -plugins/modules/s3objectlambda_access_point.py metaclass-boilerplate!skip -plugins/modules/s3objectlambda_access_point.py compile-2.6!skip -plugins/modules/s3objectlambda_access_point.py import-2.6!skip -plugins/modules/s3objectlambda_access_point.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3objectlambda_access_point_policy.py compile-2.7!skip -plugins/modules/s3objectlambda_access_point_policy.py compile-3.5!skip -plugins/modules/s3objectlambda_access_point_policy.py import-2.7!skip -plugins/modules/s3objectlambda_access_point_policy.py import-3.5!skip -plugins/modules/s3objectlambda_access_point_policy.py future-import-boilerplate!skip -plugins/modules/s3objectlambda_access_point_policy.py metaclass-boilerplate!skip -plugins/modules/s3objectlambda_access_point_policy.py compile-2.6!skip -plugins/modules/s3objectlambda_access_point_policy.py import-2.6!skip -plugins/modules/s3objectlambda_access_point_policy.py validate-modules:parameter-state-invalid-choice -plugins/modules/eks_fargate_profile.py compile-2.7!skip -plugins/modules/eks_fargate_profile.py compile-3.5!skip -plugins/modules/eks_fargate_profile.py import-2.7!skip -plugins/modules/eks_fargate_profile.py import-3.5!skip -plugins/modules/eks_fargate_profile.py future-import-boilerplate!skip -plugins/modules/eks_fargate_profile.py metaclass-boilerplate!skip -plugins/modules/eks_fargate_profile.py compile-2.6!skip -plugins/modules/eks_fargate_profile.py import-2.6!skip -plugins/modules/eks_fargate_profile.py validate-modules:no-log-needed -plugins/modules/eks_fargate_profile.py validate-modules:parameter-state-invalid-choice -plugins/modules/dynamodb_global_table.py compile-2.7!skip -plugins/modules/dynamodb_global_table.py compile-3.5!skip -plugins/modules/dynamodb_global_table.py import-2.7!skip -plugins/modules/dynamodb_global_table.py import-3.5!skip -plugins/modules/dynamodb_global_table.py future-import-boilerplate!skip -plugins/modules/dynamodb_global_table.py metaclass-boilerplate!skip -plugins/modules/dynamodb_global_table.py compile-2.6!skip -plugins/modules/dynamodb_global_table.py import-2.6!skip -plugins/modules/dynamodb_global_table.py validate-modules:no-log-needed -plugins/modules/dynamodb_global_table.py validate-modules:parameter-state-invalid-choice -plugins/modules/eks_addon.py compile-2.7!skip -plugins/modules/eks_addon.py compile-3.5!skip -plugins/modules/eks_addon.py import-2.7!skip -plugins/modules/eks_addon.py import-3.5!skip -plugins/modules/eks_addon.py future-import-boilerplate!skip -plugins/modules/eks_addon.py metaclass-boilerplate!skip -plugins/modules/eks_addon.py compile-2.6!skip -plugins/modules/eks_addon.py import-2.6!skip -plugins/modules/eks_addon.py validate-modules:parameter-state-invalid-choice -plugins/modules/iam_server_certificate.py compile-2.7!skip -plugins/modules/iam_server_certificate.py compile-3.5!skip -plugins/modules/iam_server_certificate.py import-2.7!skip -plugins/modules/iam_server_certificate.py import-3.5!skip -plugins/modules/iam_server_certificate.py future-import-boilerplate!skip -plugins/modules/iam_server_certificate.py metaclass-boilerplate!skip -plugins/modules/iam_server_certificate.py compile-2.6!skip -plugins/modules/iam_server_certificate.py import-2.6!skip -plugins/modules/iam_server_certificate.py validate-modules:no-log-needed -plugins/modules/iam_server_certificate.py validate-modules:parameter-state-invalid-choice -plugins/modules/kms_alias.py compile-2.7!skip -plugins/modules/kms_alias.py compile-3.5!skip -plugins/modules/kms_alias.py import-2.7!skip -plugins/modules/kms_alias.py import-3.5!skip -plugins/modules/kms_alias.py future-import-boilerplate!skip -plugins/modules/kms_alias.py metaclass-boilerplate!skip -plugins/modules/kms_alias.py compile-2.6!skip -plugins/modules/kms_alias.py import-2.6!skip -plugins/modules/kms_alias.py validate-modules:parameter-state-invalid-choice -plugins/modules/kms_replica_key.py compile-2.7!skip -plugins/modules/kms_replica_key.py compile-3.5!skip -plugins/modules/kms_replica_key.py import-2.7!skip -plugins/modules/kms_replica_key.py import-3.5!skip -plugins/modules/kms_replica_key.py future-import-boilerplate!skip -plugins/modules/kms_replica_key.py metaclass-boilerplate!skip -plugins/modules/kms_replica_key.py compile-2.6!skip -plugins/modules/kms_replica_key.py import-2.6!skip -plugins/modules/kms_replica_key.py validate-modules:no-log-needed -plugins/modules/kms_replica_key.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_proxy_endpoint.py compile-2.7!skip -plugins/modules/rds_db_proxy_endpoint.py compile-3.5!skip -plugins/modules/rds_db_proxy_endpoint.py import-2.7!skip -plugins/modules/rds_db_proxy_endpoint.py import-3.5!skip -plugins/modules/rds_db_proxy_endpoint.py future-import-boilerplate!skip -plugins/modules/rds_db_proxy_endpoint.py metaclass-boilerplate!skip -plugins/modules/rds_db_proxy_endpoint.py compile-2.6!skip -plugins/modules/rds_db_proxy_endpoint.py import-2.6!skip -plugins/modules/rds_db_proxy_endpoint.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_endpoint_access.py compile-2.7!skip -plugins/modules/redshift_endpoint_access.py compile-3.5!skip -plugins/modules/redshift_endpoint_access.py import-2.7!skip -plugins/modules/redshift_endpoint_access.py import-3.5!skip -plugins/modules/redshift_endpoint_access.py future-import-boilerplate!skip -plugins/modules/redshift_endpoint_access.py metaclass-boilerplate!skip -plugins/modules/redshift_endpoint_access.py compile-2.6!skip -plugins/modules/redshift_endpoint_access.py import-2.6!skip -plugins/modules/redshift_endpoint_access.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_endpoint_authorization.py compile-2.7!skip -plugins/modules/redshift_endpoint_authorization.py compile-3.5!skip -plugins/modules/redshift_endpoint_authorization.py import-2.7!skip -plugins/modules/redshift_endpoint_authorization.py import-3.5!skip -plugins/modules/redshift_endpoint_authorization.py future-import-boilerplate!skip -plugins/modules/redshift_endpoint_authorization.py metaclass-boilerplate!skip -plugins/modules/redshift_endpoint_authorization.py compile-2.6!skip -plugins/modules/redshift_endpoint_authorization.py import-2.6!skip -plugins/modules/redshift_endpoint_authorization.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_scheduled_action.py compile-2.7!skip -plugins/modules/redshift_scheduled_action.py compile-3.5!skip -plugins/modules/redshift_scheduled_action.py import-2.7!skip -plugins/modules/redshift_scheduled_action.py import-3.5!skip -plugins/modules/redshift_scheduled_action.py future-import-boilerplate!skip -plugins/modules/redshift_scheduled_action.py metaclass-boilerplate!skip -plugins/modules/redshift_scheduled_action.py compile-2.6!skip -plugins/modules/redshift_scheduled_action.py import-2.6!skip -plugins/modules/redshift_scheduled_action.py validate-modules:parameter-state-invalid-choice -plugins/modules/route53_dnssec.py compile-2.7!skip -plugins/modules/route53_dnssec.py compile-3.5!skip -plugins/modules/route53_dnssec.py import-2.7!skip -plugins/modules/route53_dnssec.py import-3.5!skip -plugins/modules/route53_dnssec.py future-import-boilerplate!skip -plugins/modules/route53_dnssec.py metaclass-boilerplate!skip -plugins/modules/route53_dnssec.py compile-2.6!skip -plugins/modules/route53_dnssec.py import-2.6!skip -plugins/modules/route53_dnssec.py validate-modules:parameter-state-invalid-choice -plugins/modules/route53_key_signing_key.py compile-2.7!skip -plugins/modules/route53_key_signing_key.py compile-3.5!skip -plugins/modules/route53_key_signing_key.py import-2.7!skip -plugins/modules/route53_key_signing_key.py import-3.5!skip -plugins/modules/route53_key_signing_key.py future-import-boilerplate!skip -plugins/modules/route53_key_signing_key.py metaclass-boilerplate!skip -plugins/modules/route53_key_signing_key.py compile-2.6!skip -plugins/modules/route53_key_signing_key.py import-2.6!skip -plugins/modules/route53_key_signing_key.py validate-modules:no-log-needed -plugins/modules/route53_key_signing_key.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudtrail_trail.py compile-2.7!skip -plugins/modules/cloudtrail_trail.py compile-3.5!skip -plugins/modules/cloudtrail_trail.py import-2.7!skip -plugins/modules/cloudtrail_trail.py import-3.5!skip -plugins/modules/cloudtrail_trail.py future-import-boilerplate!skip -plugins/modules/cloudtrail_trail.py metaclass-boilerplate!skip -plugins/modules/cloudtrail_trail.py compile-2.6!skip -plugins/modules/cloudtrail_trail.py import-2.6!skip -plugins/modules/cloudtrail_trail.py validate-modules:no-log-needed -plugins/modules/cloudtrail_trail.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudtrail_event_data_store.py compile-2.7!skip -plugins/modules/cloudtrail_event_data_store.py compile-3.5!skip -plugins/modules/cloudtrail_event_data_store.py import-2.7!skip -plugins/modules/cloudtrail_event_data_store.py import-3.5!skip -plugins/modules/cloudtrail_event_data_store.py future-import-boilerplate!skip -plugins/modules/cloudtrail_event_data_store.py metaclass-boilerplate!skip -plugins/modules/cloudtrail_event_data_store.py compile-2.6!skip -plugins/modules/cloudtrail_event_data_store.py import-2.6!skip -plugins/modules/cloudtrail_event_data_store.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudwatch_composite_alarm.py compile-2.7!skip -plugins/modules/cloudwatch_composite_alarm.py compile-3.5!skip -plugins/modules/cloudwatch_composite_alarm.py import-2.7!skip -plugins/modules/cloudwatch_composite_alarm.py import-3.5!skip -plugins/modules/cloudwatch_composite_alarm.py future-import-boilerplate!skip -plugins/modules/cloudwatch_composite_alarm.py metaclass-boilerplate!skip -plugins/modules/cloudwatch_composite_alarm.py compile-2.6!skip -plugins/modules/cloudwatch_composite_alarm.py import-2.6!skip -plugins/modules/cloudwatch_composite_alarm.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudwatch_metric_stream.py compile-2.7!skip -plugins/modules/cloudwatch_metric_stream.py compile-3.5!skip -plugins/modules/cloudwatch_metric_stream.py import-2.7!skip -plugins/modules/cloudwatch_metric_stream.py import-3.5!skip -plugins/modules/cloudwatch_metric_stream.py future-import-boilerplate!skip -plugins/modules/cloudwatch_metric_stream.py metaclass-boilerplate!skip -plugins/modules/cloudwatch_metric_stream.py compile-2.6!skip -plugins/modules/cloudwatch_metric_stream.py import-2.6!skip -plugins/modules/cloudwatch_metric_stream.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_instance.py compile-2.7!skip -plugins/modules/rds_db_instance.py compile-3.5!skip -plugins/modules/rds_db_instance.py import-2.7!skip -plugins/modules/rds_db_instance.py import-3.5!skip -plugins/modules/rds_db_instance.py future-import-boilerplate!skip -plugins/modules/rds_db_instance.py metaclass-boilerplate!skip -plugins/modules/rds_db_instance.py compile-2.6!skip -plugins/modules/rds_db_instance.py import-2.6!skip -plugins/modules/rds_db_instance.py validate-modules:no-log-needed -plugins/modules/rds_db_instance.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_cluster_parameter_group.py compile-2.7!skip -plugins/modules/rds_db_cluster_parameter_group.py compile-3.5!skip -plugins/modules/rds_db_cluster_parameter_group.py import-2.7!skip -plugins/modules/rds_db_cluster_parameter_group.py import-3.5!skip -plugins/modules/rds_db_cluster_parameter_group.py future-import-boilerplate!skip -plugins/modules/rds_db_cluster_parameter_group.py metaclass-boilerplate!skip -plugins/modules/rds_db_cluster_parameter_group.py compile-2.6!skip -plugins/modules/rds_db_cluster_parameter_group.py import-2.6!skip -plugins/modules/rds_db_cluster_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_subnet_group.py compile-2.7!skip -plugins/modules/rds_db_subnet_group.py compile-3.5!skip -plugins/modules/rds_db_subnet_group.py import-2.7!skip -plugins/modules/rds_db_subnet_group.py import-3.5!skip -plugins/modules/rds_db_subnet_group.py future-import-boilerplate!skip -plugins/modules/rds_db_subnet_group.py metaclass-boilerplate!skip -plugins/modules/rds_db_subnet_group.py compile-2.6!skip -plugins/modules/rds_db_subnet_group.py import-2.6!skip -plugins/modules/rds_db_subnet_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_global_cluster.py compile-2.7!skip -plugins/modules/rds_global_cluster.py compile-3.5!skip -plugins/modules/rds_global_cluster.py import-2.7!skip -plugins/modules/rds_global_cluster.py import-3.5!skip -plugins/modules/rds_global_cluster.py future-import-boilerplate!skip -plugins/modules/rds_global_cluster.py metaclass-boilerplate!skip -plugins/modules/rds_global_cluster.py compile-2.6!skip -plugins/modules/rds_global_cluster.py import-2.6!skip -plugins/modules/rds_global_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_option_group.py compile-2.7!skip -plugins/modules/rds_option_group.py compile-3.5!skip -plugins/modules/rds_option_group.py import-2.7!skip -plugins/modules/rds_option_group.py import-3.5!skip -plugins/modules/rds_option_group.py future-import-boilerplate!skip -plugins/modules/rds_option_group.py metaclass-boilerplate!skip -plugins/modules/rds_option_group.py compile-2.6!skip -plugins/modules/rds_option_group.py import-2.6!skip -plugins/modules/rds_option_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/ssm_document.py compile-2.7!skip -plugins/modules/ssm_document.py compile-3.5!skip -plugins/modules/ssm_document.py import-2.7!skip -plugins/modules/ssm_document.py import-3.5!skip -plugins/modules/ssm_document.py future-import-boilerplate!skip -plugins/modules/ssm_document.py metaclass-boilerplate!skip -plugins/modules/ssm_document.py compile-2.6!skip -plugins/modules/ssm_document.py import-2.6!skip -plugins/modules/ssm_document.py validate-modules:parameter-state-invalid-choice -plugins/modules/ssm_resource_data_sync.py compile-2.7!skip -plugins/modules/ssm_resource_data_sync.py compile-3.5!skip -plugins/modules/ssm_resource_data_sync.py import-2.7!skip -plugins/modules/ssm_resource_data_sync.py import-3.5!skip -plugins/modules/ssm_resource_data_sync.py future-import-boilerplate!skip -plugins/modules/ssm_resource_data_sync.py metaclass-boilerplate!skip -plugins/modules/ssm_resource_data_sync.py compile-2.6!skip -plugins/modules/ssm_resource_data_sync.py import-2.6!skip -plugins/modules/ssm_resource_data_sync.py validate-modules:no-log-needed -plugins/modules/ssm_resource_data_sync.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_ip_set.py compile-2.7!skip -plugins/modules/wafv2_ip_set.py compile-3.5!skip -plugins/modules/wafv2_ip_set.py import-2.7!skip -plugins/modules/wafv2_ip_set.py import-3.5!skip -plugins/modules/wafv2_ip_set.py future-import-boilerplate!skip -plugins/modules/wafv2_ip_set.py metaclass-boilerplate!skip -plugins/modules/wafv2_ip_set.py compile-2.6!skip -plugins/modules/wafv2_ip_set.py import-2.6!skip -plugins/modules/wafv2_ip_set.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_logging_configuration.py compile-2.7!skip -plugins/modules/wafv2_logging_configuration.py compile-3.5!skip -plugins/modules/wafv2_logging_configuration.py import-2.7!skip -plugins/modules/wafv2_logging_configuration.py import-3.5!skip -plugins/modules/wafv2_logging_configuration.py future-import-boilerplate!skip -plugins/modules/wafv2_logging_configuration.py metaclass-boilerplate!skip -plugins/modules/wafv2_logging_configuration.py compile-2.6!skip -plugins/modules/wafv2_logging_configuration.py import-2.6!skip -plugins/modules/wafv2_logging_configuration.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_regex_pattern_set.py compile-2.7!skip -plugins/modules/wafv2_regex_pattern_set.py compile-3.5!skip -plugins/modules/wafv2_regex_pattern_set.py import-2.7!skip -plugins/modules/wafv2_regex_pattern_set.py import-3.5!skip -plugins/modules/wafv2_regex_pattern_set.py future-import-boilerplate!skip -plugins/modules/wafv2_regex_pattern_set.py metaclass-boilerplate!skip -plugins/modules/wafv2_regex_pattern_set.py compile-2.6!skip -plugins/modules/wafv2_regex_pattern_set.py import-2.6!skip -plugins/modules/wafv2_regex_pattern_set.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_web_acl_association.py compile-2.7!skip -plugins/modules/wafv2_web_acl_association.py compile-3.5!skip -plugins/modules/wafv2_web_acl_association.py import-2.7!skip -plugins/modules/wafv2_web_acl_association.py import-3.5!skip -plugins/modules/wafv2_web_acl_association.py future-import-boilerplate!skip -plugins/modules/wafv2_web_acl_association.py metaclass-boilerplate!skip -plugins/modules/wafv2_web_acl_association.py compile-2.6!skip -plugins/modules/wafv2_web_acl_association.py import-2.6!skip -plugins/modules/wafv2_web_acl_association.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecr_repository.py compile-2.7!skip -plugins/modules/ecr_repository.py compile-3.5!skip -plugins/modules/ecr_repository.py import-2.7!skip -plugins/modules/ecr_repository.py import-3.5!skip -plugins/modules/ecr_repository.py future-import-boilerplate!skip -plugins/modules/ecr_repository.py metaclass-boilerplate!skip -plugins/modules/ecr_repository.py compile-2.6!skip -plugins/modules/ecr_repository.py import-2.6!skip -plugins/modules/ecr_repository.py validate-modules:no-log-needed -plugins/modules/ecr_repository.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecs_capacity_provider.py compile-2.7!skip -plugins/modules/ecs_capacity_provider.py compile-3.5!skip -plugins/modules/ecs_capacity_provider.py import-2.7!skip -plugins/modules/ecs_capacity_provider.py import-3.5!skip -plugins/modules/ecs_capacity_provider.py future-import-boilerplate!skip -plugins/modules/ecs_capacity_provider.py metaclass-boilerplate!skip -plugins/modules/ecs_capacity_provider.py compile-2.6!skip -plugins/modules/ecs_capacity_provider.py import-2.6!skip -plugins/modules/ecs_capacity_provider.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecs_cluster.py compile-2.7!skip -plugins/modules/ecs_cluster.py compile-3.5!skip -plugins/modules/ecs_cluster.py import-2.7!skip -plugins/modules/ecs_cluster.py import-3.5!skip -plugins/modules/ecs_cluster.py future-import-boilerplate!skip -plugins/modules/ecs_cluster.py metaclass-boilerplate!skip -plugins/modules/ecs_cluster.py compile-2.6!skip -plugins/modules/ecs_cluster.py import-2.6!skip -plugins/modules/ecs_cluster.py validate-modules:no-log-needed -plugins/modules/ecs_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecs_cluster_capacity_provider_associations.py compile-2.7!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py compile-3.5!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py import-2.7!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py import-3.5!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py future-import-boilerplate!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py metaclass-boilerplate!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py compile-2.6!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py import-2.6!skip -plugins/modules/ecs_cluster_capacity_provider_associations.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecs_primary_task_set.py compile-2.7!skip -plugins/modules/ecs_primary_task_set.py compile-3.5!skip -plugins/modules/ecs_primary_task_set.py import-2.7!skip -plugins/modules/ecs_primary_task_set.py import-3.5!skip -plugins/modules/ecs_primary_task_set.py future-import-boilerplate!skip -plugins/modules/ecs_primary_task_set.py metaclass-boilerplate!skip -plugins/modules/ecs_primary_task_set.py compile-2.6!skip -plugins/modules/ecs_primary_task_set.py import-2.6!skip -plugins/modules/ecs_primary_task_set.py validate-modules:parameter-state-invalid-choice -plugins/modules/iam_instance_profile.py compile-2.7!skip -plugins/modules/iam_instance_profile.py compile-3.5!skip -plugins/modules/iam_instance_profile.py import-2.7!skip -plugins/modules/iam_instance_profile.py import-3.5!skip -plugins/modules/iam_instance_profile.py future-import-boilerplate!skip -plugins/modules/iam_instance_profile.py metaclass-boilerplate!skip -plugins/modules/iam_instance_profile.py compile-2.6!skip -plugins/modules/iam_instance_profile.py import-2.6!skip -plugins/modules/iam_instance_profile.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_metric_filter.py compile-2.7!skip -plugins/modules/logs_metric_filter.py compile-3.5!skip -plugins/modules/logs_metric_filter.py import-2.7!skip -plugins/modules/logs_metric_filter.py import-3.5!skip -plugins/modules/logs_metric_filter.py future-import-boilerplate!skip -plugins/modules/logs_metric_filter.py metaclass-boilerplate!skip -plugins/modules/logs_metric_filter.py compile-2.6!skip -plugins/modules/logs_metric_filter.py import-2.6!skip -plugins/modules/logs_metric_filter.py validate-modules:no-log-needed -plugins/modules/logs_metric_filter.py validate-modules:parameter-state-invalid-choice -plugins/modules/ec2_placement_group.py compile-2.7!skip -plugins/modules/ec2_placement_group.py compile-3.5!skip -plugins/modules/ec2_placement_group.py import-2.7!skip -plugins/modules/ec2_placement_group.py import-3.5!skip -plugins/modules/ec2_placement_group.py future-import-boilerplate!skip -plugins/modules/ec2_placement_group.py metaclass-boilerplate!skip -plugins/modules/ec2_placement_group.py compile-2.6!skip -plugins/modules/ec2_placement_group.py import-2.6!skip -plugins/modules/ec2_placement_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/autoscaling_launch_configuration.py compile-2.7!skip -plugins/modules/autoscaling_launch_configuration.py compile-3.5!skip -plugins/modules/autoscaling_launch_configuration.py import-2.7!skip -plugins/modules/autoscaling_launch_configuration.py import-3.5!skip -plugins/modules/autoscaling_launch_configuration.py future-import-boilerplate!skip -plugins/modules/autoscaling_launch_configuration.py metaclass-boilerplate!skip -plugins/modules/autoscaling_launch_configuration.py compile-2.6!skip -plugins/modules/autoscaling_launch_configuration.py import-2.6!skip -plugins/modules/autoscaling_launch_configuration.py validate-modules:no-log-needed -plugins/modules/autoscaling_launch_configuration.py validate-modules:parameter-state-invalid-choice -plugins/modules/autoscaling_lifecycle_hook.py compile-2.7!skip -plugins/modules/autoscaling_lifecycle_hook.py compile-3.5!skip -plugins/modules/autoscaling_lifecycle_hook.py import-2.7!skip -plugins/modules/autoscaling_lifecycle_hook.py import-3.5!skip -plugins/modules/autoscaling_lifecycle_hook.py future-import-boilerplate!skip -plugins/modules/autoscaling_lifecycle_hook.py metaclass-boilerplate!skip -plugins/modules/autoscaling_lifecycle_hook.py compile-2.6!skip -plugins/modules/autoscaling_lifecycle_hook.py import-2.6!skip -plugins/modules/autoscaling_lifecycle_hook.py validate-modules:parameter-state-invalid-choice -plugins/modules/autoscaling_warm_pool.py compile-2.7!skip -plugins/modules/autoscaling_warm_pool.py compile-3.5!skip -plugins/modules/autoscaling_warm_pool.py import-2.7!skip -plugins/modules/autoscaling_warm_pool.py import-3.5!skip -plugins/modules/autoscaling_warm_pool.py future-import-boilerplate!skip -plugins/modules/autoscaling_warm_pool.py metaclass-boilerplate!skip -plugins/modules/autoscaling_warm_pool.py compile-2.6!skip -plugins/modules/autoscaling_warm_pool.py import-2.6!skip -plugins/modules/autoscaling_warm_pool.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_acl.py compile-2.7!skip -plugins/modules/memorydb_acl.py compile-3.5!skip -plugins/modules/memorydb_acl.py import-2.7!skip -plugins/modules/memorydb_acl.py import-3.5!skip -plugins/modules/memorydb_acl.py future-import-boilerplate!skip -plugins/modules/memorydb_acl.py metaclass-boilerplate!skip -plugins/modules/memorydb_acl.py compile-2.6!skip -plugins/modules/memorydb_acl.py import-2.6!skip -plugins/modules/memorydb_acl.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_cluster.py compile-2.7!skip -plugins/modules/memorydb_cluster.py compile-3.5!skip -plugins/modules/memorydb_cluster.py import-2.7!skip -plugins/modules/memorydb_cluster.py import-3.5!skip -plugins/modules/memorydb_cluster.py future-import-boilerplate!skip -plugins/modules/memorydb_cluster.py metaclass-boilerplate!skip -plugins/modules/memorydb_cluster.py compile-2.6!skip -plugins/modules/memorydb_cluster.py import-2.6!skip -plugins/modules/memorydb_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_parameter_group.py compile-2.7!skip -plugins/modules/memorydb_parameter_group.py compile-3.5!skip -plugins/modules/memorydb_parameter_group.py import-2.7!skip -plugins/modules/memorydb_parameter_group.py import-3.5!skip -plugins/modules/memorydb_parameter_group.py future-import-boilerplate!skip -plugins/modules/memorydb_parameter_group.py metaclass-boilerplate!skip -plugins/modules/memorydb_parameter_group.py compile-2.6!skip -plugins/modules/memorydb_parameter_group.py import-2.6!skip -plugins/modules/memorydb_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_subnet_group.py compile-2.7!skip -plugins/modules/memorydb_subnet_group.py compile-3.5!skip -plugins/modules/memorydb_subnet_group.py import-2.7!skip -plugins/modules/memorydb_subnet_group.py import-3.5!skip -plugins/modules/memorydb_subnet_group.py future-import-boilerplate!skip -plugins/modules/memorydb_subnet_group.py metaclass-boilerplate!skip -plugins/modules/memorydb_subnet_group.py compile-2.6!skip -plugins/modules/memorydb_subnet_group.py import-2.6!skip -plugins/modules/memorydb_subnet_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_user.py compile-2.7!skip -plugins/modules/memorydb_user.py compile-3.5!skip -plugins/modules/memorydb_user.py import-2.7!skip -plugins/modules/memorydb_user.py import-3.5!skip -plugins/modules/memorydb_user.py future-import-boilerplate!skip -plugins/modules/memorydb_user.py metaclass-boilerplate!skip -plugins/modules/memorydb_user.py compile-2.6!skip -plugins/modules/memorydb_user.py import-2.6!skip -plugins/modules/memorydb_user.py validate-modules:parameter-state-invalid-choice -plugins/modules/eks_addon.py validate-modules:mutually_exclusive-type -plugins/modules/eks_fargate_profile.py validate-modules:mutually_exclusive-type -plugins/modules/redshift_endpoint_authorization.py validate-modules:mutually_exclusive-type -plugins/modules/route53_key_signing_key.py validate-modules:mutually_exclusive-type -plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusive-type -plugins/modules/ecs_primary_task_set.py validate-modules:mutually_exclusive-type -plugins/modules/logs_metric_filter.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_ip_set.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_regex_pattern_set.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_web_acl_association.py validate-modules:mutually_exclusive-type diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt deleted file mode 100644 index 103dcf38..00000000 --- a/tests/sanity/ignore-2.12.txt +++ /dev/null @@ -1,94 +0,0 @@ -plugins/modules/backup_backup_vault.py validate-modules:no-log-needed -plugins/modules/backup_backup_vault.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_framework.py validate-modules:no-log-needed -plugins/modules/backup_framework.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_report_plan.py validate-modules:no-log-needed -plugins/modules/backup_report_plan.py validate-modules:parameter-state-invalid-choice -plugins/modules/eks_cluster.py validate-modules:no-log-needed -plugins/modules/eks_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/iam_role.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_code_signing_config.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_event_source_mapping.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_function.py validate-modules:no-log-needed -plugins/modules/lambda_function.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_log_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_query_definition.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_resource_policy.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_proxy.py validate-modules:no-log-needed -plugins/modules/rds_db_proxy.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_cluster.py validate-modules:no-log-needed -plugins/modules/redshift_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_event_subscription.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3_access_point.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3_bucket.py validate-modules:no-log-needed -plugins/modules/s3_bucket.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3_multi_region_access_point.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3_multi_region_access_point_policy.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3objectlambda_access_point.py validate-modules:parameter-state-invalid-choice -plugins/modules/s3objectlambda_access_point_policy.py validate-modules:parameter-state-invalid-choice -plugins/modules/eks_fargate_profile.py validate-modules:no-log-needed -plugins/modules/eks_fargate_profile.py validate-modules:parameter-state-invalid-choice -plugins/modules/dynamodb_global_table.py validate-modules:no-log-needed -plugins/modules/dynamodb_global_table.py validate-modules:parameter-state-invalid-choice -plugins/modules/eks_addon.py validate-modules:parameter-state-invalid-choice -plugins/modules/iam_server_certificate.py validate-modules:no-log-needed -plugins/modules/iam_server_certificate.py validate-modules:parameter-state-invalid-choice -plugins/modules/kms_alias.py validate-modules:parameter-state-invalid-choice -plugins/modules/kms_replica_key.py validate-modules:no-log-needed -plugins/modules/kms_replica_key.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_proxy_endpoint.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_endpoint_access.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_endpoint_authorization.py validate-modules:parameter-state-invalid-choice -plugins/modules/redshift_scheduled_action.py validate-modules:parameter-state-invalid-choice -plugins/modules/route53_dnssec.py validate-modules:parameter-state-invalid-choice -plugins/modules/route53_key_signing_key.py validate-modules:no-log-needed -plugins/modules/route53_key_signing_key.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudtrail_trail.py validate-modules:no-log-needed -plugins/modules/cloudtrail_trail.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudtrail_event_data_store.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudwatch_composite_alarm.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudwatch_metric_stream.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_instance.py validate-modules:no-log-needed -plugins/modules/rds_db_instance.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_cluster_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_subnet_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_global_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_option_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/ssm_document.py validate-modules:parameter-state-invalid-choice -plugins/modules/ssm_resource_data_sync.py validate-modules:no-log-needed -plugins/modules/ssm_resource_data_sync.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_ip_set.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_logging_configuration.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_regex_pattern_set.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_web_acl_association.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecr_repository.py validate-modules:no-log-needed -plugins/modules/ecr_repository.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecs_capacity_provider.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecs_cluster.py validate-modules:no-log-needed -plugins/modules/ecs_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecs_cluster_capacity_provider_associations.py validate-modules:parameter-state-invalid-choice -plugins/modules/ecs_primary_task_set.py validate-modules:parameter-state-invalid-choice -plugins/modules/iam_instance_profile.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_metric_filter.py validate-modules:no-log-needed -plugins/modules/logs_metric_filter.py validate-modules:parameter-state-invalid-choice -plugins/modules/ec2_placement_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/autoscaling_launch_configuration.py validate-modules:no-log-needed -plugins/modules/autoscaling_launch_configuration.py validate-modules:parameter-state-invalid-choice -plugins/modules/autoscaling_lifecycle_hook.py validate-modules:parameter-state-invalid-choice -plugins/modules/autoscaling_warm_pool.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_acl.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_subnet_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/memorydb_user.py validate-modules:parameter-state-invalid-choice -plugins/modules/eks_addon.py validate-modules:mutually_exclusive-type -plugins/modules/eks_fargate_profile.py validate-modules:mutually_exclusive-type -plugins/modules/redshift_endpoint_authorization.py validate-modules:mutually_exclusive-type -plugins/modules/route53_key_signing_key.py validate-modules:mutually_exclusive-type -plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusive-type -plugins/modules/ecs_primary_task_set.py validate-modules:mutually_exclusive-type -plugins/modules/logs_metric_filter.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_ip_set.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_regex_pattern_set.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_web_acl_association.py validate-modules:mutually_exclusive-type -tools/update_constants.py shebang!skip diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index 103dcf38..732b8179 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -1,18 +1,11 @@ plugins/modules/backup_backup_vault.py validate-modules:no-log-needed plugins/modules/backup_backup_vault.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_framework.py validate-modules:no-log-needed -plugins/modules/backup_framework.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_report_plan.py validate-modules:no-log-needed -plugins/modules/backup_report_plan.py validate-modules:parameter-state-invalid-choice plugins/modules/eks_cluster.py validate-modules:no-log-needed plugins/modules/eks_cluster.py validate-modules:parameter-state-invalid-choice plugins/modules/iam_role.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_code_signing_config.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_event_source_mapping.py validate-modules:parameter-state-invalid-choice plugins/modules/lambda_function.py validate-modules:no-log-needed plugins/modules/lambda_function.py validate-modules:parameter-state-invalid-choice plugins/modules/logs_log_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_query_definition.py validate-modules:parameter-state-invalid-choice plugins/modules/logs_resource_policy.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_proxy.py validate-modules:no-log-needed plugins/modules/rds_db_proxy.py validate-modules:parameter-state-invalid-choice @@ -34,8 +27,6 @@ plugins/modules/eks_addon.py validate-modules:parameter-state-invalid-choice plugins/modules/iam_server_certificate.py validate-modules:no-log-needed plugins/modules/iam_server_certificate.py validate-modules:parameter-state-invalid-choice plugins/modules/kms_alias.py validate-modules:parameter-state-invalid-choice -plugins/modules/kms_replica_key.py validate-modules:no-log-needed -plugins/modules/kms_replica_key.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_proxy_endpoint.py validate-modules:parameter-state-invalid-choice plugins/modules/redshift_endpoint_access.py validate-modules:parameter-state-invalid-choice plugins/modules/redshift_endpoint_authorization.py validate-modules:parameter-state-invalid-choice @@ -45,7 +36,6 @@ plugins/modules/route53_key_signing_key.py validate-modules:no-log-needed plugins/modules/route53_key_signing_key.py validate-modules:parameter-state-invalid-choice plugins/modules/cloudtrail_trail.py validate-modules:no-log-needed plugins/modules/cloudtrail_trail.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudtrail_event_data_store.py validate-modules:parameter-state-invalid-choice plugins/modules/cloudwatch_composite_alarm.py validate-modules:parameter-state-invalid-choice plugins/modules/cloudwatch_metric_stream.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_instance.py validate-modules:no-log-needed @@ -55,11 +45,7 @@ plugins/modules/rds_db_subnet_group.py validate-modules:parameter-state-invalid- plugins/modules/rds_global_cluster.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_option_group.py validate-modules:parameter-state-invalid-choice plugins/modules/ssm_document.py validate-modules:parameter-state-invalid-choice -plugins/modules/ssm_resource_data_sync.py validate-modules:no-log-needed -plugins/modules/ssm_resource_data_sync.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_ip_set.py validate-modules:parameter-state-invalid-choice plugins/modules/wafv2_logging_configuration.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_regex_pattern_set.py validate-modules:parameter-state-invalid-choice plugins/modules/wafv2_web_acl_association.py validate-modules:parameter-state-invalid-choice plugins/modules/ecr_repository.py validate-modules:no-log-needed plugins/modules/ecr_repository.py validate-modules:parameter-state-invalid-choice @@ -71,7 +57,6 @@ plugins/modules/ecs_primary_task_set.py validate-modules:parameter-state-invalid plugins/modules/iam_instance_profile.py validate-modules:parameter-state-invalid-choice plugins/modules/logs_metric_filter.py validate-modules:no-log-needed plugins/modules/logs_metric_filter.py validate-modules:parameter-state-invalid-choice -plugins/modules/ec2_placement_group.py validate-modules:parameter-state-invalid-choice plugins/modules/autoscaling_launch_configuration.py validate-modules:no-log-needed plugins/modules/autoscaling_launch_configuration.py validate-modules:parameter-state-invalid-choice plugins/modules/autoscaling_lifecycle_hook.py validate-modules:parameter-state-invalid-choice @@ -88,7 +73,6 @@ plugins/modules/route53_key_signing_key.py validate-modules:mutually_exclusive-t plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusive-type plugins/modules/ecs_primary_task_set.py validate-modules:mutually_exclusive-type plugins/modules/logs_metric_filter.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_ip_set.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_regex_pattern_set.py validate-modules:mutually_exclusive-type plugins/modules/wafv2_web_acl_association.py validate-modules:mutually_exclusive-type +plugins/modules/memorydb_user.py validate-modules:no-log-needed tools/update_constants.py shebang!skip diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 103dcf38..732b8179 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -1,18 +1,11 @@ plugins/modules/backup_backup_vault.py validate-modules:no-log-needed plugins/modules/backup_backup_vault.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_framework.py validate-modules:no-log-needed -plugins/modules/backup_framework.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_report_plan.py validate-modules:no-log-needed -plugins/modules/backup_report_plan.py validate-modules:parameter-state-invalid-choice plugins/modules/eks_cluster.py validate-modules:no-log-needed plugins/modules/eks_cluster.py validate-modules:parameter-state-invalid-choice plugins/modules/iam_role.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_code_signing_config.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_event_source_mapping.py validate-modules:parameter-state-invalid-choice plugins/modules/lambda_function.py validate-modules:no-log-needed plugins/modules/lambda_function.py validate-modules:parameter-state-invalid-choice plugins/modules/logs_log_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_query_definition.py validate-modules:parameter-state-invalid-choice plugins/modules/logs_resource_policy.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_proxy.py validate-modules:no-log-needed plugins/modules/rds_db_proxy.py validate-modules:parameter-state-invalid-choice @@ -34,8 +27,6 @@ plugins/modules/eks_addon.py validate-modules:parameter-state-invalid-choice plugins/modules/iam_server_certificate.py validate-modules:no-log-needed plugins/modules/iam_server_certificate.py validate-modules:parameter-state-invalid-choice plugins/modules/kms_alias.py validate-modules:parameter-state-invalid-choice -plugins/modules/kms_replica_key.py validate-modules:no-log-needed -plugins/modules/kms_replica_key.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_proxy_endpoint.py validate-modules:parameter-state-invalid-choice plugins/modules/redshift_endpoint_access.py validate-modules:parameter-state-invalid-choice plugins/modules/redshift_endpoint_authorization.py validate-modules:parameter-state-invalid-choice @@ -45,7 +36,6 @@ plugins/modules/route53_key_signing_key.py validate-modules:no-log-needed plugins/modules/route53_key_signing_key.py validate-modules:parameter-state-invalid-choice plugins/modules/cloudtrail_trail.py validate-modules:no-log-needed plugins/modules/cloudtrail_trail.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudtrail_event_data_store.py validate-modules:parameter-state-invalid-choice plugins/modules/cloudwatch_composite_alarm.py validate-modules:parameter-state-invalid-choice plugins/modules/cloudwatch_metric_stream.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_instance.py validate-modules:no-log-needed @@ -55,11 +45,7 @@ plugins/modules/rds_db_subnet_group.py validate-modules:parameter-state-invalid- plugins/modules/rds_global_cluster.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_option_group.py validate-modules:parameter-state-invalid-choice plugins/modules/ssm_document.py validate-modules:parameter-state-invalid-choice -plugins/modules/ssm_resource_data_sync.py validate-modules:no-log-needed -plugins/modules/ssm_resource_data_sync.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_ip_set.py validate-modules:parameter-state-invalid-choice plugins/modules/wafv2_logging_configuration.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_regex_pattern_set.py validate-modules:parameter-state-invalid-choice plugins/modules/wafv2_web_acl_association.py validate-modules:parameter-state-invalid-choice plugins/modules/ecr_repository.py validate-modules:no-log-needed plugins/modules/ecr_repository.py validate-modules:parameter-state-invalid-choice @@ -71,7 +57,6 @@ plugins/modules/ecs_primary_task_set.py validate-modules:parameter-state-invalid plugins/modules/iam_instance_profile.py validate-modules:parameter-state-invalid-choice plugins/modules/logs_metric_filter.py validate-modules:no-log-needed plugins/modules/logs_metric_filter.py validate-modules:parameter-state-invalid-choice -plugins/modules/ec2_placement_group.py validate-modules:parameter-state-invalid-choice plugins/modules/autoscaling_launch_configuration.py validate-modules:no-log-needed plugins/modules/autoscaling_launch_configuration.py validate-modules:parameter-state-invalid-choice plugins/modules/autoscaling_lifecycle_hook.py validate-modules:parameter-state-invalid-choice @@ -88,7 +73,6 @@ plugins/modules/route53_key_signing_key.py validate-modules:mutually_exclusive-t plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusive-type plugins/modules/ecs_primary_task_set.py validate-modules:mutually_exclusive-type plugins/modules/logs_metric_filter.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_ip_set.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_regex_pattern_set.py validate-modules:mutually_exclusive-type plugins/modules/wafv2_web_acl_association.py validate-modules:mutually_exclusive-type +plugins/modules/memorydb_user.py validate-modules:no-log-needed tools/update_constants.py shebang!skip diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 63cd5a51..e3496db4 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -5,24 +5,15 @@ plugins/modules/route53_key_signing_key.py validate-modules:mutually_exclusive-t plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusive-type plugins/modules/ecs_primary_task_set.py validate-modules:mutually_exclusive-type plugins/modules/logs_metric_filter.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_ip_set.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_regex_pattern_set.py validate-modules:mutually_exclusive-type plugins/modules/wafv2_web_acl_association.py validate-modules:mutually_exclusive-type plugins/modules/backup_backup_vault.py validate-modules:no-log-needed plugins/modules/backup_backup_vault.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_framework.py validate-modules:no-log-needed -plugins/modules/backup_framework.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_report_plan.py validate-modules:no-log-needed -plugins/modules/backup_report_plan.py validate-modules:parameter-state-invalid-choice plugins/modules/eks_cluster.py validate-modules:no-log-needed plugins/modules/eks_cluster.py validate-modules:parameter-state-invalid-choice plugins/modules/iam_role.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_code_signing_config.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_event_source_mapping.py validate-modules:parameter-state-invalid-choice plugins/modules/lambda_function.py validate-modules:no-log-needed plugins/modules/lambda_function.py validate-modules:parameter-state-invalid-choice plugins/modules/logs_log_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_query_definition.py validate-modules:parameter-state-invalid-choice plugins/modules/logs_resource_policy.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_proxy.py validate-modules:no-log-needed plugins/modules/rds_db_proxy.py validate-modules:parameter-state-invalid-choice @@ -44,8 +35,6 @@ plugins/modules/eks_addon.py validate-modules:parameter-state-invalid-choice plugins/modules/iam_server_certificate.py validate-modules:no-log-needed plugins/modules/iam_server_certificate.py validate-modules:parameter-state-invalid-choice plugins/modules/kms_alias.py validate-modules:parameter-state-invalid-choice -plugins/modules/kms_replica_key.py validate-modules:no-log-needed -plugins/modules/kms_replica_key.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_proxy_endpoint.py validate-modules:parameter-state-invalid-choice plugins/modules/redshift_endpoint_access.py validate-modules:parameter-state-invalid-choice plugins/modules/redshift_endpoint_authorization.py validate-modules:parameter-state-invalid-choice @@ -55,7 +44,6 @@ plugins/modules/route53_key_signing_key.py validate-modules:no-log-needed plugins/modules/route53_key_signing_key.py validate-modules:parameter-state-invalid-choice plugins/modules/cloudtrail_trail.py validate-modules:no-log-needed plugins/modules/cloudtrail_trail.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudtrail_event_data_store.py validate-modules:parameter-state-invalid-choice plugins/modules/cloudwatch_composite_alarm.py validate-modules:parameter-state-invalid-choice plugins/modules/cloudwatch_metric_stream.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_instance.py validate-modules:no-log-needed @@ -65,11 +53,7 @@ plugins/modules/rds_db_subnet_group.py validate-modules:parameter-state-invalid- plugins/modules/rds_global_cluster.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_option_group.py validate-modules:parameter-state-invalid-choice plugins/modules/ssm_document.py validate-modules:parameter-state-invalid-choice -plugins/modules/ssm_resource_data_sync.py validate-modules:no-log-needed -plugins/modules/ssm_resource_data_sync.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_ip_set.py validate-modules:parameter-state-invalid-choice plugins/modules/wafv2_logging_configuration.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_regex_pattern_set.py validate-modules:parameter-state-invalid-choice plugins/modules/wafv2_web_acl_association.py validate-modules:parameter-state-invalid-choice plugins/modules/ecr_repository.py validate-modules:no-log-needed plugins/modules/ecr_repository.py validate-modules:parameter-state-invalid-choice @@ -81,7 +65,6 @@ plugins/modules/ecs_primary_task_set.py validate-modules:parameter-state-invalid plugins/modules/iam_instance_profile.py validate-modules:parameter-state-invalid-choice plugins/modules/logs_metric_filter.py validate-modules:no-log-needed plugins/modules/logs_metric_filter.py validate-modules:parameter-state-invalid-choice -plugins/modules/ec2_placement_group.py validate-modules:parameter-state-invalid-choice plugins/modules/autoscaling_launch_configuration.py validate-modules:no-log-needed plugins/modules/autoscaling_launch_configuration.py validate-modules:parameter-state-invalid-choice plugins/modules/autoscaling_lifecycle_hook.py validate-modules:parameter-state-invalid-choice @@ -91,4 +74,5 @@ plugins/modules/memorydb_cluster.py validate-modules:parameter-state-invalid-cho plugins/modules/memorydb_parameter_group.py validate-modules:parameter-state-invalid-choice plugins/modules/memorydb_subnet_group.py validate-modules:parameter-state-invalid-choice plugins/modules/memorydb_user.py validate-modules:parameter-state-invalid-choice +plugins/modules/memorydb_user.py validate-modules:no-log-needed tools/update_constants.py shebang!skip diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 63cd5a51..e3496db4 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -5,24 +5,15 @@ plugins/modules/route53_key_signing_key.py validate-modules:mutually_exclusive-t plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusive-type plugins/modules/ecs_primary_task_set.py validate-modules:mutually_exclusive-type plugins/modules/logs_metric_filter.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_ip_set.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_regex_pattern_set.py validate-modules:mutually_exclusive-type plugins/modules/wafv2_web_acl_association.py validate-modules:mutually_exclusive-type plugins/modules/backup_backup_vault.py validate-modules:no-log-needed plugins/modules/backup_backup_vault.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_framework.py validate-modules:no-log-needed -plugins/modules/backup_framework.py validate-modules:parameter-state-invalid-choice -plugins/modules/backup_report_plan.py validate-modules:no-log-needed -plugins/modules/backup_report_plan.py validate-modules:parameter-state-invalid-choice plugins/modules/eks_cluster.py validate-modules:no-log-needed plugins/modules/eks_cluster.py validate-modules:parameter-state-invalid-choice plugins/modules/iam_role.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_code_signing_config.py validate-modules:parameter-state-invalid-choice -plugins/modules/lambda_event_source_mapping.py validate-modules:parameter-state-invalid-choice plugins/modules/lambda_function.py validate-modules:no-log-needed plugins/modules/lambda_function.py validate-modules:parameter-state-invalid-choice plugins/modules/logs_log_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/logs_query_definition.py validate-modules:parameter-state-invalid-choice plugins/modules/logs_resource_policy.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_proxy.py validate-modules:no-log-needed plugins/modules/rds_db_proxy.py validate-modules:parameter-state-invalid-choice @@ -44,8 +35,6 @@ plugins/modules/eks_addon.py validate-modules:parameter-state-invalid-choice plugins/modules/iam_server_certificate.py validate-modules:no-log-needed plugins/modules/iam_server_certificate.py validate-modules:parameter-state-invalid-choice plugins/modules/kms_alias.py validate-modules:parameter-state-invalid-choice -plugins/modules/kms_replica_key.py validate-modules:no-log-needed -plugins/modules/kms_replica_key.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_proxy_endpoint.py validate-modules:parameter-state-invalid-choice plugins/modules/redshift_endpoint_access.py validate-modules:parameter-state-invalid-choice plugins/modules/redshift_endpoint_authorization.py validate-modules:parameter-state-invalid-choice @@ -55,7 +44,6 @@ plugins/modules/route53_key_signing_key.py validate-modules:no-log-needed plugins/modules/route53_key_signing_key.py validate-modules:parameter-state-invalid-choice plugins/modules/cloudtrail_trail.py validate-modules:no-log-needed plugins/modules/cloudtrail_trail.py validate-modules:parameter-state-invalid-choice -plugins/modules/cloudtrail_event_data_store.py validate-modules:parameter-state-invalid-choice plugins/modules/cloudwatch_composite_alarm.py validate-modules:parameter-state-invalid-choice plugins/modules/cloudwatch_metric_stream.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_instance.py validate-modules:no-log-needed @@ -65,11 +53,7 @@ plugins/modules/rds_db_subnet_group.py validate-modules:parameter-state-invalid- plugins/modules/rds_global_cluster.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_option_group.py validate-modules:parameter-state-invalid-choice plugins/modules/ssm_document.py validate-modules:parameter-state-invalid-choice -plugins/modules/ssm_resource_data_sync.py validate-modules:no-log-needed -plugins/modules/ssm_resource_data_sync.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_ip_set.py validate-modules:parameter-state-invalid-choice plugins/modules/wafv2_logging_configuration.py validate-modules:parameter-state-invalid-choice -plugins/modules/wafv2_regex_pattern_set.py validate-modules:parameter-state-invalid-choice plugins/modules/wafv2_web_acl_association.py validate-modules:parameter-state-invalid-choice plugins/modules/ecr_repository.py validate-modules:no-log-needed plugins/modules/ecr_repository.py validate-modules:parameter-state-invalid-choice @@ -81,7 +65,6 @@ plugins/modules/ecs_primary_task_set.py validate-modules:parameter-state-invalid plugins/modules/iam_instance_profile.py validate-modules:parameter-state-invalid-choice plugins/modules/logs_metric_filter.py validate-modules:no-log-needed plugins/modules/logs_metric_filter.py validate-modules:parameter-state-invalid-choice -plugins/modules/ec2_placement_group.py validate-modules:parameter-state-invalid-choice plugins/modules/autoscaling_launch_configuration.py validate-modules:no-log-needed plugins/modules/autoscaling_launch_configuration.py validate-modules:parameter-state-invalid-choice plugins/modules/autoscaling_lifecycle_hook.py validate-modules:parameter-state-invalid-choice @@ -91,4 +74,5 @@ plugins/modules/memorydb_cluster.py validate-modules:parameter-state-invalid-cho plugins/modules/memorydb_parameter_group.py validate-modules:parameter-state-invalid-choice plugins/modules/memorydb_subnet_group.py validate-modules:parameter-state-invalid-choice plugins/modules/memorydb_user.py validate-modules:parameter-state-invalid-choice +plugins/modules/memorydb_user.py validate-modules:no-log-needed tools/update_constants.py shebang!skip diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 84441c7c..720753f3 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -22,22 +22,6 @@ plugins/modules/backup_backup_vault.py future-import-boilerplate!skip plugins/modules/backup_backup_vault.py metaclass-boilerplate!skip plugins/modules/backup_backup_vault.py compile-2.6!skip plugins/modules/backup_backup_vault.py import-2.6!skip -plugins/modules/backup_framework.py compile-2.7!skip -plugins/modules/backup_framework.py compile-3.5!skip -plugins/modules/backup_framework.py import-2.7!skip -plugins/modules/backup_framework.py import-3.5!skip -plugins/modules/backup_framework.py future-import-boilerplate!skip -plugins/modules/backup_framework.py metaclass-boilerplate!skip -plugins/modules/backup_framework.py compile-2.6!skip -plugins/modules/backup_framework.py import-2.6!skip -plugins/modules/backup_report_plan.py compile-2.7!skip -plugins/modules/backup_report_plan.py compile-3.5!skip -plugins/modules/backup_report_plan.py import-2.7!skip -plugins/modules/backup_report_plan.py import-3.5!skip -plugins/modules/backup_report_plan.py future-import-boilerplate!skip -plugins/modules/backup_report_plan.py metaclass-boilerplate!skip -plugins/modules/backup_report_plan.py compile-2.6!skip -plugins/modules/backup_report_plan.py import-2.6!skip plugins/modules/eks_cluster.py compile-2.7!skip plugins/modules/eks_cluster.py compile-3.5!skip plugins/modules/eks_cluster.py import-2.7!skip @@ -54,22 +38,6 @@ plugins/modules/iam_role.py future-import-boilerplate!skip plugins/modules/iam_role.py metaclass-boilerplate!skip plugins/modules/iam_role.py compile-2.6!skip plugins/modules/iam_role.py import-2.6!skip -plugins/modules/lambda_code_signing_config.py compile-2.7!skip -plugins/modules/lambda_code_signing_config.py compile-3.5!skip -plugins/modules/lambda_code_signing_config.py import-2.7!skip -plugins/modules/lambda_code_signing_config.py import-3.5!skip -plugins/modules/lambda_code_signing_config.py future-import-boilerplate!skip -plugins/modules/lambda_code_signing_config.py metaclass-boilerplate!skip -plugins/modules/lambda_code_signing_config.py compile-2.6!skip -plugins/modules/lambda_code_signing_config.py import-2.6!skip -plugins/modules/lambda_event_source_mapping.py compile-2.7!skip -plugins/modules/lambda_event_source_mapping.py compile-3.5!skip -plugins/modules/lambda_event_source_mapping.py import-2.7!skip -plugins/modules/lambda_event_source_mapping.py import-3.5!skip -plugins/modules/lambda_event_source_mapping.py future-import-boilerplate!skip -plugins/modules/lambda_event_source_mapping.py metaclass-boilerplate!skip -plugins/modules/lambda_event_source_mapping.py compile-2.6!skip -plugins/modules/lambda_event_source_mapping.py import-2.6!skip plugins/modules/lambda_function.py compile-2.7!skip plugins/modules/lambda_function.py compile-3.5!skip plugins/modules/lambda_function.py import-2.7!skip @@ -86,14 +54,6 @@ plugins/modules/logs_log_group.py future-import-boilerplate!skip plugins/modules/logs_log_group.py metaclass-boilerplate!skip plugins/modules/logs_log_group.py compile-2.6!skip plugins/modules/logs_log_group.py import-2.6!skip -plugins/modules/logs_query_definition.py compile-2.7!skip -plugins/modules/logs_query_definition.py compile-3.5!skip -plugins/modules/logs_query_definition.py import-2.7!skip -plugins/modules/logs_query_definition.py import-3.5!skip -plugins/modules/logs_query_definition.py future-import-boilerplate!skip -plugins/modules/logs_query_definition.py metaclass-boilerplate!skip -plugins/modules/logs_query_definition.py compile-2.6!skip -plugins/modules/logs_query_definition.py import-2.6!skip plugins/modules/logs_resource_policy.py compile-2.7!skip plugins/modules/logs_resource_policy.py compile-3.5!skip plugins/modules/logs_resource_policy.py import-2.7!skip @@ -214,14 +174,6 @@ plugins/modules/kms_alias.py future-import-boilerplate!skip plugins/modules/kms_alias.py metaclass-boilerplate!skip plugins/modules/kms_alias.py compile-2.6!skip plugins/modules/kms_alias.py import-2.6!skip -plugins/modules/kms_replica_key.py compile-2.7!skip -plugins/modules/kms_replica_key.py compile-3.5!skip -plugins/modules/kms_replica_key.py import-2.7!skip -plugins/modules/kms_replica_key.py import-3.5!skip -plugins/modules/kms_replica_key.py future-import-boilerplate!skip -plugins/modules/kms_replica_key.py metaclass-boilerplate!skip -plugins/modules/kms_replica_key.py compile-2.6!skip -plugins/modules/kms_replica_key.py import-2.6!skip plugins/modules/rds_db_proxy_endpoint.py compile-2.7!skip plugins/modules/rds_db_proxy_endpoint.py compile-3.5!skip plugins/modules/rds_db_proxy_endpoint.py import-2.7!skip @@ -278,14 +230,6 @@ plugins/modules/cloudtrail_trail.py future-import-boilerplate!skip plugins/modules/cloudtrail_trail.py metaclass-boilerplate!skip plugins/modules/cloudtrail_trail.py compile-2.6!skip plugins/modules/cloudtrail_trail.py import-2.6!skip -plugins/modules/cloudtrail_event_data_store.py compile-2.7!skip -plugins/modules/cloudtrail_event_data_store.py compile-3.5!skip -plugins/modules/cloudtrail_event_data_store.py import-2.7!skip -plugins/modules/cloudtrail_event_data_store.py import-3.5!skip -plugins/modules/cloudtrail_event_data_store.py future-import-boilerplate!skip -plugins/modules/cloudtrail_event_data_store.py metaclass-boilerplate!skip -plugins/modules/cloudtrail_event_data_store.py compile-2.6!skip -plugins/modules/cloudtrail_event_data_store.py import-2.6!skip plugins/modules/cloudwatch_composite_alarm.py compile-2.7!skip plugins/modules/cloudwatch_composite_alarm.py compile-3.5!skip plugins/modules/cloudwatch_composite_alarm.py import-2.7!skip @@ -350,22 +294,6 @@ plugins/modules/ssm_document.py future-import-boilerplate!skip plugins/modules/ssm_document.py metaclass-boilerplate!skip plugins/modules/ssm_document.py compile-2.6!skip plugins/modules/ssm_document.py import-2.6!skip -plugins/modules/ssm_resource_data_sync.py compile-2.7!skip -plugins/modules/ssm_resource_data_sync.py compile-3.5!skip -plugins/modules/ssm_resource_data_sync.py import-2.7!skip -plugins/modules/ssm_resource_data_sync.py import-3.5!skip -plugins/modules/ssm_resource_data_sync.py future-import-boilerplate!skip -plugins/modules/ssm_resource_data_sync.py metaclass-boilerplate!skip -plugins/modules/ssm_resource_data_sync.py compile-2.6!skip -plugins/modules/ssm_resource_data_sync.py import-2.6!skip -plugins/modules/wafv2_ip_set.py compile-2.7!skip -plugins/modules/wafv2_ip_set.py compile-3.5!skip -plugins/modules/wafv2_ip_set.py import-2.7!skip -plugins/modules/wafv2_ip_set.py import-3.5!skip -plugins/modules/wafv2_ip_set.py future-import-boilerplate!skip -plugins/modules/wafv2_ip_set.py metaclass-boilerplate!skip -plugins/modules/wafv2_ip_set.py compile-2.6!skip -plugins/modules/wafv2_ip_set.py import-2.6!skip plugins/modules/wafv2_logging_configuration.py compile-2.7!skip plugins/modules/wafv2_logging_configuration.py compile-3.5!skip plugins/modules/wafv2_logging_configuration.py import-2.7!skip @@ -374,14 +302,6 @@ plugins/modules/wafv2_logging_configuration.py future-import-boilerplate!skip plugins/modules/wafv2_logging_configuration.py metaclass-boilerplate!skip plugins/modules/wafv2_logging_configuration.py compile-2.6!skip plugins/modules/wafv2_logging_configuration.py import-2.6!skip -plugins/modules/wafv2_regex_pattern_set.py compile-2.7!skip -plugins/modules/wafv2_regex_pattern_set.py compile-3.5!skip -plugins/modules/wafv2_regex_pattern_set.py import-2.7!skip -plugins/modules/wafv2_regex_pattern_set.py import-3.5!skip -plugins/modules/wafv2_regex_pattern_set.py future-import-boilerplate!skip -plugins/modules/wafv2_regex_pattern_set.py metaclass-boilerplate!skip -plugins/modules/wafv2_regex_pattern_set.py compile-2.6!skip -plugins/modules/wafv2_regex_pattern_set.py import-2.6!skip plugins/modules/wafv2_web_acl_association.py compile-2.7!skip plugins/modules/wafv2_web_acl_association.py compile-3.5!skip plugins/modules/wafv2_web_acl_association.py import-2.7!skip @@ -446,14 +366,6 @@ plugins/modules/logs_metric_filter.py future-import-boilerplate!skip plugins/modules/logs_metric_filter.py metaclass-boilerplate!skip plugins/modules/logs_metric_filter.py compile-2.6!skip plugins/modules/logs_metric_filter.py import-2.6!skip -plugins/modules/ec2_placement_group.py compile-2.7!skip -plugins/modules/ec2_placement_group.py compile-3.5!skip -plugins/modules/ec2_placement_group.py import-2.7!skip -plugins/modules/ec2_placement_group.py import-3.5!skip -plugins/modules/ec2_placement_group.py future-import-boilerplate!skip -plugins/modules/ec2_placement_group.py metaclass-boilerplate!skip -plugins/modules/ec2_placement_group.py compile-2.6!skip -plugins/modules/ec2_placement_group.py import-2.6!skip plugins/modules/autoscaling_launch_configuration.py compile-2.7!skip plugins/modules/autoscaling_launch_configuration.py compile-3.5!skip plugins/modules/autoscaling_launch_configuration.py import-2.7!skip @@ -525,6 +437,5 @@ plugins/modules/route53_key_signing_key.py validate-modules:mutually_exclusive-t plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusive-type plugins/modules/ecs_primary_task_set.py validate-modules:mutually_exclusive-type plugins/modules/logs_metric_filter.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_ip_set.py validate-modules:mutually_exclusive-type -plugins/modules/wafv2_regex_pattern_set.py validate-modules:mutually_exclusive-type plugins/modules/wafv2_web_acl_association.py validate-modules:mutually_exclusive-type +lugins/modules/eks_cluster.py compile-2.7!skip diff --git a/tests/unit/module_utils/test_utils.py b/tests/unit/module_utils/test_utils.py index bc6a83d5..40bfe765 100644 --- a/tests/unit/module_utils/test_utils.py +++ b/tests/unit/module_utils/test_utils.py @@ -7,12 +7,15 @@ __metaclass__ = type + from ansible_collections.amazon.cloud.plugins.module_utils.utils import ( ansible_dict_to_boto3_tag_list, boto3_tag_list_to_ansible_dict, diff_dicts, normalize_response, tag_merge, + merge_list_of_dicts, + ensure_json_dumps, ) @@ -295,3 +298,233 @@ def test_tag_merge_dicts(): tag_merge(dict_1, dict_2) assert dict_1 == expected + + +def test_merge_list_of_dicts_simple(): + old = [{"foo": "bar"}] + new = [{"foo": "gaz", "someotherkey": {"blah": "asdf"}}] + expected = [{"foo": "gaz", "someotherkey": {"blah": "asdf"}}] + + result = merge_list_of_dicts(old, new) + assert result == expected + + +def test_merge_list_of_dicts_rds_1(): + old = [ + { + "VpcSecurityGroupMemberships": [ + "sg-0529298fedfbd1554", + ], + "OptionSettings": [ + {"Value": "20", "Name": "MAX_SIMULTANEOUS_CONNECTIONS"}, + {"Value": "10", "Name": "A"}, + {"Value": "40", "Name": "B"}, + ], + "Port": 11211, + "OptionName": "MEMCACHED", + "DBSecurityGroupMemberships": [], + } + ] + + new = [ + { + "OptionName": "MEMCACHED", + "Port": 11211, + "VpcSecurityGroupMemberships": ["sg-0529298fedfbd1554", "sg-test"], + "OptionSettings": [ + {"Name": "MAX_SIMULTANEOUS_CONNECTIONS", "Value": "30"}, + {"Name": "CHUNK_SIZE_GROWTH_FACTOR", "Value": "1.25"}, + ], + } + ] + expected = [ + { + "OptionName": "MEMCACHED", + "Port": 11211, + "VpcSecurityGroupMemberships": ["sg-0529298fedfbd1554", "sg-test"], + "OptionSettings": [ + {"Name": "MAX_SIMULTANEOUS_CONNECTIONS", "Value": "30"}, + {"Name": "CHUNK_SIZE_GROWTH_FACTOR", "Value": "1.25"}, + {"Value": "10", "Name": "A"}, + {"Value": "40", "Name": "B"}, + ], + "DBSecurityGroupMemberships": [], + } + ] + + result = merge_list_of_dicts(old, new) + assert result == expected + + +def test_merge_list_of_dicts_rds_2(): + old = [ + { + "VpcSecurityGroupMemberships": [ + "sg-042d845c4e8b78406", + "sg-04de45a62e4b6abc4", + "sg-0cf1c9abae707d8c3", + ], + "OptionSettings": [ + {"Value": "30", "Name": "MAX_SIMULTANEOUS_CONNECTIONS"}, + {"Value": "0", "Name": "ERROR_ON_MEMORY_EXHAUSTED"}, + {"Value": "1", "Name": "DAEMON_MEMCACHED_R_BATCH_SIZE"}, + {"Value": "1024", "Name": "BACKLOG_QUEUE_LIMIT"}, + {"Value": "5", "Name": "INNODB_API_BK_COMMIT_INTERVAL"}, + {"Value": "1.25", "Name": "CHUNK_SIZE_GROWTH_FACTOR"}, + {"Value": "v", "Name": "VERBOSITY"}, + {"Value": "0", "Name": "INNODB_API_DISABLE_ROWLOCK"}, + {"Value": "auto", "Name": "BINDING_PROTOCOL"}, + {"Value": "48", "Name": "CHUNK_SIZE"}, + {"Value": "0", "Name": "INNODB_API_TRX_LEVEL"}, + {"Value": "0", "Name": "CAS_DISABLED"}, + {"Value": "1", "Name": "DAEMON_MEMCACHED_W_BATCH_SIZE"}, + {"Value": "0", "Name": "INNODB_API_ENABLE_MDL"}, + ], + "Port": 11211, + "OptionName": "MEMCACHED", + "DBSecurityGroupMemberships": [], + } + ] + new = [ + { + "OptionName": "MEMCACHED", + "Port": 11211, + "VpcSecurityGroupMemberships": [ + "sg-04de45a62e4b6abc4", + "sg-0cf1c9abae707d8c3", + "sg-042d845c4e8b78406", + ], + "OptionSettings": [{"Name": "MAX_SIMULTANEOUS_CONNECTIONS", "Value": "30"}], + } + ] + expected = [ + { + "VpcSecurityGroupMemberships": [ + "sg-042d845c4e8b78406", + "sg-04de45a62e4b6abc4", + "sg-0cf1c9abae707d8c3", + ], + "OptionSettings": [ + {"Value": "30", "Name": "MAX_SIMULTANEOUS_CONNECTIONS"}, + {"Value": "0", "Name": "ERROR_ON_MEMORY_EXHAUSTED"}, + {"Value": "1", "Name": "DAEMON_MEMCACHED_R_BATCH_SIZE"}, + {"Value": "1024", "Name": "BACKLOG_QUEUE_LIMIT"}, + {"Value": "5", "Name": "INNODB_API_BK_COMMIT_INTERVAL"}, + {"Value": "1.25", "Name": "CHUNK_SIZE_GROWTH_FACTOR"}, + {"Value": "v", "Name": "VERBOSITY"}, + {"Value": "0", "Name": "INNODB_API_DISABLE_ROWLOCK"}, + {"Value": "auto", "Name": "BINDING_PROTOCOL"}, + {"Value": "48", "Name": "CHUNK_SIZE"}, + {"Value": "0", "Name": "INNODB_API_TRX_LEVEL"}, + {"Value": "0", "Name": "CAS_DISABLED"}, + {"Value": "1", "Name": "DAEMON_MEMCACHED_W_BATCH_SIZE"}, + {"Value": "0", "Name": "INNODB_API_ENABLE_MDL"}, + ], + "Port": 11211, + "OptionName": "MEMCACHED", + "DBSecurityGroupMemberships": [], + } + ] + + result = merge_list_of_dicts(old, new) + assert result == expected + + +def test_merge_list_of_dicts_iam(): + old = [ + { + "PolicyName": "dr-lambda-policy", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents", + ], + "Resource": "arn:aws:logs:*:*:*", + "Effect": "Allow", + }, + { + "Action": "lambda:InvokeFunction", + "Resource": "*", + "Effect": "Allow", + }, + ], + }, + } + ] + new = [ + { + "PolicyName": "dr-lambda-policy", + "PolicyDocument": "{'Version': '2012-10-17', \ + 'Statement': [{'Effect': 'Allow', 'Action': ['logs:CreateLogGroup', 'logs:CreateLogStream', 'logs:PutLogEvents'], \ + 'Resource': 'arn:aws:logs:*:*:*'}]}", + } + ] + expected = [ + { + "PolicyName": "dr-lambda-policy", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "logs:CreateLogGroup", + "logs:CreateLogStream", + "logs:PutLogEvents", + ], + "Resource": "arn:aws:logs:*:*:*", + "Effect": "Allow", + }, + { + "Action": "lambda:InvokeFunction", + "Resource": "*", + "Effect": "Allow", + }, + ], + }, + } + ] + + result = merge_list_of_dicts(old, new) + assert result == expected + + +def test_swap_quotes(): + policy = { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Principal": {"Service": "lambda.amazonaws.com"}, + "Action": "sts:AssumeRole", + } + ], + }, + "ManagedPolicyArns": ["arn:aws:iam::721066863947:policy/dr-lambda-policy"], + "Policies": [ + { + "PolicyName": "dr-lambda-policy", + "PolicyDocument": "{'Version': '2012-10-17', \ + 'Statement': [{'Effect': 'Allow', \ + 'Action': ['logs:CreateLogGroup', 'logs:CreateLogStream', 'logs:PutLogEvents'], \ + 'Resource': 'arn:aws:logs:*:*:*'}, {'Effect': 'Allow', \ + 'Action': 'lambda:InvokeFunction', 'Resource': '*'}]}", + } + ], + "RoleName": "dr-lambda-role", + } + + expected = '{"AssumeRolePolicyDocument": {"Version": "2012-10-17", \ + "Statement": [{"Effect": "Allow", "Principal": {"Service": "lambda.amazonaws.com"}, \ + "Action": "sts:AssumeRole"}]}, "ManagedPolicyArns": ["arn:aws:iam::721066863947:policy/dr-lambda-policy"], \ + "Policies": [{"PolicyName": "dr-lambda-policy", "PolicyDocument": "{\\"Version\\": \\"2012-10-17\\", \ + \\"Statement\\": [{\\"Effect\\": \\"Allow\\", \\"Action\\": [\\"logs:CreateLogGroup\\", \ + \\"logs:CreateLogStream\\", \\"logs:PutLogEvents\\"], \\"Resource\\": \\"arn:aws:logs:*:*:*\\"}, \ + {\\"Effect\\": \\"Allow\\", \\"Action\\": \\"lambda:InvokeFunction\\", \\"Resource\\": \\"*\\"}]}"}], \ + "RoleName": "dr-lambda-role"}' + + ensure_json_dumps(policy) == expected diff --git a/tools/update_constants.py b/tools/update_constants.py index 546bc143..2e480a94 100755 --- a/tools/update_constants.py +++ b/tools/update_constants.py @@ -18,8 +18,12 @@ def main() -> None: """Read collection info and update aws user agent if needed.""" - parser = ArgumentParser(description="Update collection constants with galaxy.yml version") - parser.add_argument("--path", help="The path to the collection", type=PosixPath, default="") + parser = ArgumentParser( + description="Update collection constants with galaxy.yml version" + ) + parser.add_argument( + "--path", help="The path to the collection", type=PosixPath, default="" + ) args = parser.parse_args() # Read collection information from galaxy.yml @@ -40,7 +44,12 @@ def main() -> None: for line in item.read_text().split("\n"): m = re.match(variable_regex, line) if m and m.group(1) != galaxy_version: - logger.info("-- %s -- match variable [%s] with value [%s]", item.name, variable_name, m.group(1)) + logger.info( + "-- %s -- match variable [%s] with value [%s]", + item.name, + variable_name, + m.group(1), + ) updated_content.append(f'{variable_name} = "{galaxy_version}"') continue updated_content.append(line) diff --git a/tox.ini b/tox.ini index 94eb47f4..1cb9fabf 100644 --- a/tox.ini +++ b/tox.ini @@ -68,11 +68,11 @@ exclude = .git,.tox,tests/unit/compat/ [testenv:prepare_release] -deps = +deps = pyyaml antsibull-changelog -allowlist_externals = +allowlist_externals = {toxinidir}/tools/update_constants.py commands =