From 6bd3a5ec75bea2569a039e02650e594ed6577eb2 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Fri, 30 Jun 2023 10:10:59 +0200 Subject: [PATCH 01/32] Add the original option name as an alias to avoid issues when snake cased option names are not correctly reversed to the original CamelCase. Use the alias via the CloudControl API rather than performinng that CamelCase transformations. Signed-off-by: Alina Buzachis --- config/modules.yaml | 1 + meta/runtime.yml | 5 + plugins/module_utils/core.py | 35 +- plugins/module_utils/utils.py | 16 + .../autoscaling_launch_configuration.py | 212 +++- plugins/modules/autoscaling_lifecycle_hook.py | 79 +- plugins/modules/autoscaling_warm_pool.py | 51 +- plugins/modules/backup_backup_vault.py | 76 +- plugins/modules/backup_framework.py | 101 +- plugins/modules/backup_report_plan.py | 97 +- .../modules/cloudtrail_event_data_store.py | 133 ++- plugins/modules/cloudtrail_trail.py | 270 ++++- plugins/modules/cloudwatch_composite_alarm.py | 84 +- plugins/modules/cloudwatch_metric_stream.py | 120 ++- plugins/modules/dynamodb_global_table.py | 461 +++++++-- plugins/modules/ec2_placement_group.py | 38 +- plugins/modules/ecr_repository.py | 78 +- plugins/modules/ecs_capacity_provider.py | 77 +- plugins/modules/ecs_cluster.py | 120 ++- ..._cluster_capacity_provider_associations.py | 82 +- plugins/modules/ecs_primary_task_set.py | 41 +- plugins/modules/eks_addon.py | 69 +- plugins/modules/eks_cluster.py | 184 ++-- plugins/modules/eks_fargate_profile.py | 185 ++-- plugins/modules/iam_instance_profile.py | 35 +- plugins/modules/iam_role.py | 77 +- plugins/modules/iam_server_certificate.py | 90 +- plugins/modules/kms_alias.py | 28 +- plugins/modules/kms_replica_key.py | 51 +- plugins/modules/lambda_code_signing_config.py | 46 +- .../modules/lambda_event_source_mapping.py | 238 ++++- plugins/modules/lambda_function.py | 201 +++- plugins/modules/logs_log_group.py | 76 +- plugins/modules/logs_metric_filter.py | 81 +- plugins/modules/logs_query_definition.py | 41 +- plugins/modules/logs_resource_policy.py | 28 +- plugins/modules/memorydb_acl.py | 33 +- plugins/modules/memorydb_cluster.py | 169 +++- plugins/modules/memorydb_parameter_group.py | 48 +- plugins/modules/memorydb_subnet_group.py | 45 +- plugins/modules/memorydb_user.py | 49 +- .../modules/rds_db_cluster_parameter_group.py | 43 +- plugins/modules/rds_db_instance.py | 495 +++++++-- plugins/modules/rds_db_proxy.py | 105 +- plugins/modules/rds_db_proxy_endpoint.py | 72 +- plugins/modules/rds_db_subnet_group.py | 46 +- plugins/modules/rds_global_cluster.py | 61 +- plugins/modules/rds_option_group.py | 99 +- plugins/modules/redshift_cluster.py | 334 ++++-- plugins/modules/redshift_endpoint_access.py | 85 +- .../redshift_endpoint_authorization.py | 56 +- .../modules/redshift_event_subscription.py | 61 +- plugins/modules/redshift_scheduled_action.py | 107 +- plugins/modules/route53_dnssec.py | 24 +- plugins/modules/route53_key_signing_key.py | 51 +- plugins/modules/s3_access_point.py | 88 +- plugins/modules/s3_bucket.py | 955 +++++++++++++++--- .../modules/s3_multi_region_access_point.py | 64 +- .../s3_multi_region_access_point_policy.py | 28 +- .../modules/s3objectlambda_access_point.py | 82 +- .../s3objectlambda_access_point_policy.py | 38 +- plugins/modules/ssm_document.py | 75 +- plugins/modules/ssm_resource_data_sync.py | 125 ++- plugins/modules/wafv2_ip_set.py | 76 +- .../modules/wafv2_logging_configuration.py | 137 ++- plugins/modules/wafv2_regex_pattern_set.py | 60 +- plugins/modules/wafv2_web_acl_association.py | 39 +- tests/integration/targets/s3/tasks/main.yml | 15 +- tests/sanity/ignore-2.12.txt | 1 - tests/sanity/ignore-2.13.txt | 1 - tests/sanity/ignore-2.14.txt | 1 - tests/sanity/ignore-2.15.txt | 84 -- tools/update_constants.py | 15 +- 73 files changed, 5571 insertions(+), 1903 deletions(-) diff --git a/config/modules.yaml b/config/modules.yaml index 10e246bc..29ce44f7 100644 --- a/config/modules.yaml +++ b/config/modules.yaml @@ -443,6 +443,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..75105ec2 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -59,6 +59,11 @@ action_groups: - autoscaling_launch_configuration - autoscaling_lifecycle_hook - autoscaling_warm_pool + - 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 diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index 4777195a..312a023c 100644 --- a/plugins/module_utils/core.py +++ b/plugins/module_utils/core.py @@ -54,12 +54,18 @@ to_async, diff_dicts, snake_to_camel, + camel_to_snake, json_patch, get_patch, ) 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 +from ansible_collections.amazon.aws.plugins.module_utils.transformation import ( + scrub_none_parameters, +) # pylint: disable=unused-import + BOTO3_IMP_ERR = None try: @@ -227,7 +233,9 @@ def get_resource( identifier: Dict = {} if isinstance(primary_identifier, list): - primary_identifier = self.get_identifier(identifier, primary_identifier) + for id in primary_identifier: + identifier[id] = self.module.params.get(camel_to_snake(id)) + primary_identifier = json.dumps(identifier) elif isinstance(primary_identifier, dict): primary_identifier = json.dumps(primary_identifier) try: @@ -258,10 +266,17 @@ def present( identifier: Dict = {} resource = None + + if "PromotionTier" in params: + params.pop("PromotionTier") + if self.module.params.get("identifier"): identifier = self.module.params.get("identifier") else: - identifier = self.get_identifier(identifier, primary_identifier) + for id in primary_identifier: + identifier[id] = self.module.params.get(camel_to_snake(id)) + identifier = json.dumps(identifier) + try: resource = self.client.get_resource( TypeName=type_name, Identifier=identifier, aws_retry=True @@ -351,8 +366,9 @@ 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) - + for id in primary_identifier: + identifier[id] = self.module.params.get(camel_to_snake(id)) + identifier = json.dumps(identifier) try: response = self.client.get_resource( TypeName=type_name, Identifier=identifier, aws_retry=True @@ -446,15 +462,8 @@ 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) + in_progress_requests = self.check_in_progress_requests(type_name, identifier) if not self.module.check_mode: diff --git a/plugins/module_utils/utils.py b/plugins/module_utils/utils.py index 1f7528f9..eddf4fee 100644 --- a/plugins/module_utils/utils.py +++ b/plugins/module_utils/utils.py @@ -205,6 +205,22 @@ def boto3_tag_list_to_ansible_dict( ) +def map_key_to_alias(data, mapping): + mapped_data = {} + 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", {}), + ) + else: + mapped_data[mapped_key] = value + return mapped_data + + def diff_dicts(existing: Dict, new: Dict) -> Union[bool, Dict]: result: Dict = {} diff --git a/plugins/modules/autoscaling_launch_configuration.py b/plugins/modules/autoscaling_launch_configuration.py index 4fd7d436..7a7ac164 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"], + ["InstanceType", "launch_configuration_name", "ImageId"], 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 alis 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", + "AssociatePublicIpAddress", + "BlockDeviceMappings", + "ClassicLinkVPCId", + "ClassicLinkVPCSecurityGroups", + "EbsOptimized", + "IamInstanceProfile", + "ImageId", + "InstanceId", + "InstanceMonitoring", + "InstanceType", + "KernelId", + "KeyName", + "LaunchConfigurationName", + "MetadataOptions", + "PlacementTenancy", + "RamDiskId", + "SecurityGroups", + "SpotPrice", + "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 = ["LaunchConfigurationName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index 5c80fee8..6ca5e338 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"], @@ -181,15 +216,16 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["auto_scaling_group_name"], True], + ["state", "list", ["AutoScalingGroupName"], True], [ "state", "present", [ - "lifecycle_transition", + "AutoScalingGroupName", + "identifier", "lifecycle_hook_name", + "LifecycleTransition", "auto_scaling_group_name", - "identifier", ], True, ], @@ -233,28 +269,29 @@ 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 alis 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 = ["AutoScalingGroupName", "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 = ["AutoScalingGroupName", "LifecycleHookName"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): - if not module.params.get("auto_scaling_group_name") or not module.params.get( - "lifecycle_hook_name" + if not module.params.get("AutoScalingGroupName") or not module.params.get( + "LifecycleHookName" ): module.fail_json(f"You must specify both {*identifier, } identifiers.") diff --git a/plugins/modules/autoscaling_warm_pool.py b/plugins/modules/autoscaling_warm_pool.py index 97179a8b..ca0e42c5 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", @@ -147,7 +169,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["auto_scaling_group_name"], True], + ["state", "present", ["auto_scaling_group_name", "AutoScalingGroupName"], True], ["state", "absent", ["auto_scaling_group_name"], True], ["state", "get", ["auto_scaling_group_name"], True], ] @@ -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 alis 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 = ["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 = ["AutoScalingGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/backup_backup_vault.py b/plugins/modules/backup_backup_vault.py index 8bfaa786..a08f1e70 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,7 +114,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -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,24 +182,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,11 +221,11 @@ 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"]} argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["backup_vault_name"], True], + ["state", "present", ["backup_vault_name", "BackupVaultName"], True], ["state", "absent", ["backup_vault_name"], True], ["state", "get", ["backup_vault_name"], True], ] @@ -217,22 +252,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 alis 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 = ["BackupVaultName", "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 = ["BackupVaultName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/backup_framework.py b/plugins/modules/backup_framework.py index b883051d..6c3fe275 100644 --- a/plugins/modules/backup_framework.py +++ b/plugins/modules/backup_framework.py @@ -3,9 +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 -# 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,35 +23,49 @@ be performed on it. type: bool framework_arn: + aliases: + - FrameworkArn description: - An Amazon Resource Name (ARN) that uniquely identifies Framework as a resource. type: str framework_controls: + aliases: + - FrameworkControls 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: + aliases: + - ControlInputParameters description: - A list of I(parameter_name) and I(parameter_value) pairs. elements: dict suboptions: parameter_name: + aliases: + - ParameterName description: - Not Provived. type: str parameter_value: + aliases: + - ParameterValue description: - Not Provived. type: str type: list control_name: + aliases: + - ControlName description: - The name of a control. - This name is between 1 and 256 characters. type: str control_scope: + aliases: + - ControlScope description: - The scope of a control. - The control scope defines what the control will evaluate. @@ -60,23 +73,31 @@ backup plans with a specific tag, or all backup plans.' suboptions: compliance_resource_ids: + aliases: + - ComplianceResourceIds description: - The ID of the only AWS resource that you want your control scope to contain. elements: str type: list compliance_resource_types: + aliases: + - ComplianceResourceTypes description: - Describes whether the control scope includes one or more types of resources, such as EFS or RDS. elements: str type: list tags: + aliases: + - Tags description: - A key-value pair to associate with a resource. elements: dict suboptions: key: + aliases: + - Key description: - The key name of the tag. - You can specify a value that is 1 to 128 Unicode @@ -87,6 +108,8 @@ ., /, =, +, and -.' type: str value: + aliases: + - Value description: - The value for the tag. - You can specify a value that is 0 to 256 Unicode @@ -100,21 +123,29 @@ type: dict type: list framework_description: + aliases: + - FrameworkDescription description: - An optional description of the framework with a maximum 1,024 characters. type: str framework_name: + aliases: + - FrameworkName 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: + aliases: + - FrameworkTags description: - A key-value pair to associate with a resource. elements: dict suboptions: key: + aliases: + - Key description: - The key name of the tag. - You can specify a value that is 1 to 128 Unicode characters in length @@ -123,6 +154,8 @@ letters, digits, whitespace, _, ., /, =, +, and -.' type: str value: + aliases: + - Value description: - The value for the tag. - You can specify a value that is 0 to 256 Unicode characters in length @@ -154,7 +187,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -205,11 +238,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(): @@ -221,40 +255,62 @@ def main(): ), ) - argument_spec["framework_name"] = {"type": "str"} - argument_spec["framework_description"] = {"type": "str"} - argument_spec["framework_arn"] = {"type": "str"} + argument_spec["framework_name"] = {"type": "str", "aliases": ["FrameworkName"]} + argument_spec["framework_description"] = { + "type": "str", + "aliases": ["FrameworkDescription"], + } + argument_spec["framework_arn"] = {"type": "str", "aliases": ["FrameworkArn"]} argument_spec["framework_controls"] = { "type": "list", "elements": "dict", "options": { - "control_name": {"type": "str"}, + "control_name": {"type": "str", "aliases": ["ControlName"]}, "control_input_parameters": { "type": "list", "elements": "dict", "options": { - "parameter_name": {"type": "str"}, - "parameter_value": {"type": "str"}, + "parameter_name": {"type": "str", "aliases": ["ParameterName"]}, + "parameter_value": {"type": "str", "aliases": ["ParameterValue"]}, }, + "aliases": ["ControlInputParameters"], }, "control_scope": { "type": "dict", "options": { - "compliance_resource_ids": {"type": "list", "elements": "str"}, - "compliance_resource_types": {"type": "list", "elements": "str"}, + "compliance_resource_ids": { + "type": "list", + "elements": "str", + "aliases": ["ComplianceResourceIds"], + }, + "compliance_resource_types": { + "type": "list", + "elements": "str", + "aliases": ["ComplianceResourceTypes"], + }, "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"], }, }, + "aliases": ["ControlScope"], }, }, + "aliases": ["FrameworkControls"], } argument_spec["framework_tags"] = { "type": "list", "elements": "dict", - "options": {"key": {"type": "str"}, "value": {"type": "str"}}, + "options": { + "key": {"type": "str", "aliases": ["Key"]}, + "value": {"type": "str", "aliases": ["Value"]}, + }, + "aliases": ["FrameworkTags"], } argument_spec["state"] = { "type": "str", @@ -264,11 +320,11 @@ 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"]} argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["framework_arn", "framework_controls"], True], + ["state", "present", ["framework_arn", "FrameworkControls"], True], ["state", "absent", ["framework_arn"], True], ["state", "get", ["framework_arn"], True], ] @@ -294,22 +350,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 alis 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 = ["framework_name"] + create_only_params = ["FrameworkName"] # 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"] + identifier = ["FrameworkArn"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/backup_report_plan.py b/plugins/modules/backup_report_plan.py index a2cc9ed4..9a6ccfb3 100644 --- a/plugins/modules/backup_report_plan.py +++ b/plugins/modules/backup_report_plan.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""" @@ -28,22 +28,30 @@ - Remove tags not listed in I(tags). type: bool report_delivery_channel: + aliases: + - ReportDeliveryChannel 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: + aliases: + - 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: + aliases: + - S3BucketName description: - The unique name of the S3 bucket that receives your reports. type: str s3_key_prefix: + aliases: + - S3KeyPrefix 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.' @@ -51,26 +59,36 @@ type: str type: dict report_plan_arn: + aliases: + - ReportPlanArn 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: + aliases: + - ReportPlanDescription description: - An optional description of the report plan with a maximum of 1,024 characters. type: str report_plan_name: + aliases: + - ReportPlanName 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: + aliases: + - ReportPlanTags description: - A key-value pair to associate with a resource. elements: dict suboptions: key: + aliases: + - Key description: - The key name of the tag. - You can specify a value that is 1 to 128 Unicode characters in length @@ -79,6 +97,8 @@ letters, digits, whitespace, _, ., /, =, +, and -.' type: str value: + aliases: + - Value description: - The value for the tag. - You can specify a value that is 0 to 256 Unicode characters in length @@ -88,31 +108,43 @@ type: str type: list report_setting: + aliases: + - ReportSetting description: - Identifies the report template for the report. - Reports are built using a report template. suboptions: accounts: + aliases: + - Accounts description: - The list of AWS accounts that a report covers. elements: str type: list framework_arns: + aliases: + - FrameworkArns description: - The Amazon Resource Names (ARNs) of the frameworks a report covers. elements: str type: list organization_units: + aliases: + - OrganizationUnits description: - The list of AWS organization units that a report covers. elements: str type: list regions: + aliases: + - Regions description: - The list of AWS regions that a report covers. elements: str type: list report_template: + aliases: + - ReportTemplate description: - Identifies the report template for the report. - Reports are built using a report template. @@ -138,7 +170,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -189,11 +221,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(): @@ -205,31 +238,48 @@ def main(): ), ) - 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_name"] = {"type": "str", "aliases": ["ReportPlanName"]} + argument_spec["report_plan_arn"] = {"type": "str", "aliases": ["ReportPlanArn"]} + argument_spec["report_plan_description"] = { + "type": "str", + "aliases": ["ReportPlanDescription"], + } argument_spec["report_plan_tags"] = { "type": "list", "elements": "dict", - "options": {"key": {"type": "str"}, "value": {"type": "str"}}, + "options": { + "key": {"type": "str", "aliases": ["Key"]}, + "value": {"type": "str", "aliases": ["Value"]}, + }, + "aliases": ["ReportPlanTags"], } argument_spec["report_delivery_channel"] = { "type": "dict", "options": { - "formats": {"type": "list", "elements": "str"}, - "s3_bucket_name": {"type": "str"}, - "s3_key_prefix": {"type": "str"}, + "formats": {"type": "list", "elements": "str", "aliases": ["Formats"]}, + "s3_bucket_name": {"type": "str", "aliases": ["S3BucketName"]}, + "s3_key_prefix": {"type": "str", "aliases": ["S3KeyPrefix"]}, }, + "aliases": ["ReportDeliveryChannel"], } 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"}, + "report_template": {"type": "str", "aliases": ["ReportTemplate"]}, + "framework_arns": { + "type": "list", + "elements": "str", + "aliases": ["FrameworkArns"], + }, + "accounts": {"type": "list", "elements": "str", "aliases": ["Accounts"]}, + "organization_units": { + "type": "list", + "elements": "str", + "aliases": ["OrganizationUnits"], + }, + "regions": {"type": "list", "elements": "str", "aliases": ["Regions"]}, }, + "aliases": ["ReportSetting"], } argument_spec["state"] = { "type": "str", @@ -239,14 +289,14 @@ 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"]} argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ [ "state", "present", - ["report_plan_arn", "report_delivery_channel", "report_setting"], + ["ReportDeliveryChannel", "ReportSetting", "report_plan_arn"], True, ], ["state", "absent", ["report_plan_arn"], True], @@ -275,22 +325,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 alis 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 = ["report_plan_name"] + create_only_params = ["ReportPlanName"] # 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"] + identifier = ["ReportPlanArn"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/cloudtrail_event_data_store.py b/plugins/modules/cloudtrail_event_data_store.py index 7b027520..448c5aa1 100644 --- a/plugins/modules/cloudtrail_event_data_store.py +++ b/plugins/modules/cloudtrail_event_data_store.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 new event data store. options: advanced_event_selectors: + aliases: + - AdvancedEventSelectors description: - Advanced event selectors let you create fine-grained selectors for the following AWS CloudTrail event record ?elds. @@ -22,11 +24,15 @@ 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 @@ -34,6 +40,8 @@ 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. @@ -42,6 +50,8 @@ elements: str type: list field: + aliases: + - Field description: - A field in an event record on which to filter events to be logged. @@ -50,6 +60,8 @@ 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 @@ -57,12 +69,16 @@ 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 @@ -70,6 +86,8 @@ 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 @@ -78,12 +96,16 @@ 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 event_data_store_arn: + aliases: + - EventDataStoreArn description: - The ARN of the event data store. type: str @@ -96,22 +118,36 @@ operation to make the resource available so that another operation may be performed on it. type: bool + ingestion_enabled: + aliases: + - IngestionEnabled + description: + - Indicates whether the event data store is ingesting events. + type: bool kms_key_id: + aliases: + - KmsKeyId 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: + aliases: + - MultiRegionEnabled 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: + aliases: + - Name description: - The name of the event data store. type: str organization_enabled: + aliases: + - OrganizationEnabled description: - Indicates that an event data store is collecting logged events for an organization. type: bool @@ -121,6 +157,8 @@ - Remove tags not listed in I(tags). type: bool retention_period: + aliases: + - RetentionPeriod description: - The retention period, in days. type: int @@ -142,12 +180,14 @@ type: str tags: aliases: - - resource_tags + - 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: + aliases: + - TerminationProtectionEnabled description: - Indicates whether the event data store is protected from termination. type: bool @@ -197,11 +237,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(): @@ -217,30 +258,72 @@ def main(): "type": "list", "elements": "dict", "options": { - "name": {"type": "str"}, + "name": {"type": "str", "aliases": ["Name"]}, "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"}, + "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_data_store_arn"] = { + "type": "str", + "aliases": ["EventDataStoreArn"], + } + argument_spec["multi_region_enabled"] = { + "type": "bool", + "aliases": ["MultiRegionEnabled"], + } + argument_spec["name"] = {"type": "str", "aliases": ["Name"]} + argument_spec["organization_enabled"] = { + "type": "bool", + "aliases": ["OrganizationEnabled"], + } + argument_spec["retention_period"] = {"type": "int", "aliases": ["RetentionPeriod"]} + argument_spec["termination_protection_enabled"] = { + "type": "bool", + "aliases": ["TerminationProtectionEnabled"], + } + argument_spec["kms_key_id"] = {"type": "str", "aliases": ["KmsKeyId"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["ingestion_enabled"] = { + "type": "bool", + "aliases": ["IngestionEnabled"], } - 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"], @@ -272,6 +355,7 @@ def main(): params["advanced_event_selectors"] = module.params.get("advanced_event_selectors") params["event_data_store_arn"] = module.params.get("event_data_store_arn") + params["ingestion_enabled"] = module.params.get("ingestion_enabled") 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") @@ -283,13 +367,14 @@ 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 alis 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 = {} @@ -298,7 +383,7 @@ def main(): handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["event_data_store_arn"] + identifier = ["EventDataStoreArn"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/cloudtrail_trail.py b/plugins/modules/cloudtrail_trail.py index 9c4218e2..1c3d5ba4 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,14 @@ type: str tags: aliases: - - resource_tags + - 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 +373,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 +390,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 +456,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"]} + 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 +518,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", ["trail_name", "IsLogging", "S3BucketName"], True], ["state", "absent", ["trail_name"], True], ["state", "get", ["trail_name"], True], ] @@ -324,6 +536,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 +560,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 alis 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 = ["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 = ["TrailName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/cloudwatch_composite_alarm.py b/plugins/modules/cloudwatch_composite_alarm.py index 0818dd6c..3e8ab9c3 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"], @@ -174,7 +219,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["alarm_rule", "alarm_name"], True], + ["state", "present", ["AlarmRule", "alarm_name"], True], ["state", "absent", ["alarm_name"], True], ["state", "get", ["alarm_name"], True], ] @@ -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 alis 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 = ["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 = ["AlarmName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index 2784c6ec..233d8046 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,7 +167,7 @@ type: list tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -172,11 +218,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 +238,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"]} + 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"], @@ -230,12 +302,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - [ - "state", - "present", - ["output_format", "role_arn", "name", "firehose_arn"], - True, - ], + ["state", "present", ["OutputFormat", "RoleArn", "FirehoseArn", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] @@ -266,22 +333,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 alis 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 = ["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 = ["Name"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/dynamodb_global_table.py b/plugins/modules/dynamodb_global_table.py index bf9ef019..20f1e35e 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,351 @@ 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: {} + 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 +533,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 +581,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 +679,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 +700,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 +738,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 +819,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": {}, + "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 +1042,7 @@ def main(): [ "state", "present", - ["key_schema", "attribute_definitions", "replicas", "table_name"], + ["table_name", "Replicas", "KeySchema", "AttributeDefinitions"], True, ], ["state", "absent", ["table_name"], True], @@ -749,22 +1079,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 alis 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 = ["LocalSecondaryIndexes", "TableName", "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 = ["TableName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ec2_placement_group.py b/plugins/modules/ec2_placement_group.py index 3e7f8e3d..ac2658cf 100644 --- a/plugins/modules/ec2_placement_group.py +++ b/plugins/modules/ec2_placement_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""" @@ -26,10 +26,14 @@ be performed on it. type: bool group_name: + aliases: + - GroupName description: - The Group Name of Placement Group. type: str partition_count: + aliases: + - PartitionCount description: - The number of partitions. - Valid only when **Strategy** is set to partition. @@ -40,6 +44,8 @@ - Remove tags not listed in I(tags). type: bool spread_level: + aliases: + - SpreadLevel description: - The Spread Level of Placement Group is an enum where it accepts either host or rack when strategy is spread. @@ -61,12 +67,14 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str strategy: + aliases: + - Strategy description: - The placement strategy. type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -117,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(): @@ -133,11 +142,11 @@ def main(): ), ) - 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["strategy"] = {"type": "str", "aliases": ["Strategy"]} + argument_spec["group_name"] = {"type": "str", "aliases": ["GroupName"]} + argument_spec["spread_level"] = {"type": "str", "aliases": ["SpreadLevel"]} + argument_spec["partition_count"] = {"type": "int", "aliases": ["PartitionCount"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -174,22 +183,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 alis 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 = ["strategy", "spread_level", "partition_count"] + create_only_params = ["Strategy", "SpreadLevel", "PartitionCount"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "delete", "list"] state = module.params.get("state") - identifier = ["group_name"] + identifier = ["GroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ecr_repository.py b/plugins/modules/ecr_repository.py index 3e02df57..89747df0 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,7 +149,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -178,11 +200,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 +220,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"]} 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 +296,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 alis 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", + "RepositoryName", + "EncryptionConfiguration", + "EncryptionType", + "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 = ["RepositoryName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ecs_capacity_provider.py b/plugins/modules/ecs_capacity_provider.py index 47c53071..a98e3150 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,7 +116,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -147,11 +167,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 +187,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"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -196,7 +236,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["auto_scaling_group_provider", "name"], True], + ["state", "present", ["AutoScalingGroupProvider", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] @@ -221,22 +261,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 alis 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 = ["AutoScalingGroupArn", "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 = ["Name"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ecs_cluster.py b/plugins/modules/ecs_cluster.py index f1551de1..a7ebd99a 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,7 +194,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -203,11 +245,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 +262,16 @@ def main(): ), ) - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} - argument_spec["cluster_name"] = {"type": "str"} + argument_spec["tags"] = {"type": "dict", "aliases": ["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 +279,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 +373,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 alis 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 = ["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 = ["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..16fefd9f 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,58 @@ capacity providers and a default capacity provider strategy with a cluster. options: capacity_providers: - choices: - - FARGATE - - FARGATE_SPOT + aliases: + - CapacityProviders + any_of: + - enum: + - FARGATE + - FARGATE_SPOT + type: string + - maxLength: 2048 + minLength: 1 + type: string 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 + any_of: + - enum: + - FARGATE + - FARGATE_SPOT + type: string + - maxLength: 2048 + minLength: 1 + type: string 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 +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(): @@ -140,20 +163,29 @@ def main(): argument_spec["capacity_providers"] = { "type": "list", "elements": "str", - "choices": ["FARGATE", "FARGATE_SPOT"], + "any_of": [ + {"type": "string", "enum": ["FARGATE", "FARGATE_SPOT"]}, + {"type": "string", "minLength": 1, "maxLength": 2048}, + ], + "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"}, + "base": {"type": "int", "aliases": ["Base"]}, + "weight": {"type": "int", "aliases": ["Weight"]}, "capacity_provider": { "type": "str", - "choices": ["FARGATE", "FARGATE_SPOT"], + "any_of": [ + {"type": "string", "enum": ["FARGATE", "FARGATE_SPOT"]}, + {"type": "string", "minLength": 1, "maxLength": 2048}, + ], + "aliases": ["CapacityProvider"], }, }, + "aliases": ["DefaultCapacityProviderStrategy"], } argument_spec["state"] = { "type": "str", @@ -168,7 +200,12 @@ def main(): [ "state", "present", - ["cluster", "capacity_providers", "default_capacity_provider_strategy"], + [ + "cluster", + "CapacityProviders", + "DefaultCapacityProviderStrategy", + "Cluster", + ], True, ], ["state", "absent", ["cluster"], True], @@ -195,22 +232,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 alis 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 = ["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 = ["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..5f709442 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"], @@ -138,8 +145,13 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["cluster"], True], - ["state", "present", ["service", "cluster", "task_set_id", "identifier"], True], + ["state", "list", ["Cluster"], True], + [ + "state", + "present", + ["cluster", "Service", "Cluster", "identifier", "TaskSetId", "service"], + True, + ], ["state", "absent", ["cluster", "service", "identifier"], True], ["state", "get", ["cluster", "service", "identifier"], True], ] @@ -163,27 +175,28 @@ 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 alis 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 = ["Cluster", "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 = ["Cluster", "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"): + if not module.params.get("Cluster") or not module.params.get("Service"): module.fail_json(f"You must specify both {*identifier, } identifiers.") results = {"changed": False, "result": {}} diff --git a/plugins/modules/eks_addon.py b/plugins/modules/eks_addon.py index 5bd04ab0..b294d502 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,7 +102,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -139,11 +153,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 +170,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["configuration_values"] = { + "type": "str", + "aliases": ["ConfigurationValues"], } - argument_spec["service_account_role_arn"] = {"type": "str"} - argument_spec["configuration_values"] = {"type": "str"} - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -178,8 +203,13 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["cluster_name"], True], - ["state", "present", ["cluster_name", "identifier", "addon_name"], True], + ["state", "list", ["ClusterName"], True], + [ + "state", + "present", + ["addon_name", "AddonName", "identifier", "ClusterName", "cluster_name"], + True, + ], ["state", "absent", ["cluster_name", "addon_name", "identifier"], True], ["state", "get", ["cluster_name", "addon_name", "identifier"], True], ] @@ -208,27 +238,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 alis 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 = ["ClusterName", "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 = ["ClusterName", "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"): + if not module.params.get("ClusterName") or not module.params.get("AddonName"): module.fail_json(f"You must specify both {*identifier, } identifiers.") results = {"changed": False, "result": {}} diff --git a/plugins/modules/eks_cluster.py b/plugins/modules/eks_cluster.py index a28562ae..c96dd750 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. @@ -47,10 +55,14 @@ be performed on it. type: bool kubernetes_network_config: + aliases: + - KubernetesNetworkConfig description: - The Kubernetes network configuration for the cluster. suboptions: ip_family: + aliases: + - IpFamily choices: - ipv4 - ipv6 @@ -60,6 +72,8 @@ 1.10.1 or later of the Amazon VPC CNI add-on. type: str service_ipv4_cidr: + aliases: + - ServiceIpv4Cidr description: - The CIDR block to assign Kubernetes service IP addresses from. - If you dont specify a block, Kubernetes assigns addresses from either @@ -70,22 +84,30 @@ 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 +121,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 +171,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 +192,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 +203,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 +217,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 +228,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 +239,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 +264,14 @@ type: str tags: aliases: - - resource_tags + - 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 @@ -246,36 +296,6 @@ """ EXAMPLES = r""" -- name: Set the cluster name - set_fact: - eks_cluster_name: '{{ _resource_prefix }}-cluster' - -- name: Create EKS cluster - amazon.cloud.eks_cluster: - name: '{{ eks_cluster_name }}' - resources_vpc_config: - security_group_ids: "{{ _result_create_security_groups.results | map(attribute='group_id') }}" - subnet_ids: "{{ _result_create_subnets.results | map(attribute='subnet.id') }}" - endpoint_public_access: true - endpoint_private_access: false - public_access_cidrs: - - 0.0.0.0/0 - role_arn: '{{ _result_create_iam_role.arn }}' - tags: - Name: '{{ _resource_prefix }}-eks-cluster' - wait_timeout: 900 - register: _result_create_cluster - -- name: Describe EKS cluster - amazon.cloud.eks_cluster: - name: '{{ eks_cluster_name }}' - state: describe - register: _result_get_cluster - -- name: List EKS clusters - amazon.cloud.eks_cluster: - state: list - register: _result_list_clusters """ RETURN = r""" @@ -303,11 +323,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 +344,26 @@ def main(): "type": "list", "elements": "dict", "options": { - "provider": {"type": "dict", "options": {"key_arn": {"type": "str"}}}, - "resources": {"type": "list", "elements": "str"}, + "provider": { + "type": "dict", + "options": {"key_arn": {"type": "str", "aliases": ["KeyArn"]}}, + "aliases": ["Provider"], + }, + "resources": {"type": "list", "elements": "str", "aliases": ["Resources"]}, }, + "aliases": ["EncryptionConfig"], } argument_spec["kubernetes_network_config"] = { "type": "dict", "options": { - "service_ipv4_cidr": {"type": "str"}, - "ip_family": {"type": "str", "choices": ["ipv4", "ipv6"]}, + "service_ipv4_cidr": {"type": "str", "aliases": ["ServiceIpv4Cidr"]}, + "ip_family": { + "type": "str", + "choices": ["ipv4", "ipv6"], + "aliases": ["IpFamily"], + }, }, + "aliases": ["KubernetesNetworkConfig"], } argument_spec["logging"] = { "type": "dict", @@ -353,38 +384,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"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -396,7 +455,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["resources_vpc_config", "role_arn", "name"], True], + ["state", "present", ["ResourcesVpcConfig", "RoleArn", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] @@ -425,30 +484,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 alis 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", + "OutpostConfig", + "EncryptionConfig", + "KubernetesNetworkConfig", + "Name", + "RoleArn", + "SubnetIds", + "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 = ["Name"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/eks_fargate_profile.py b/plugins/modules/eks_fargate_profile.py index d93aca13..cb82e3b7 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,13 +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: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -119,103 +137,6 @@ """ EXAMPLES = r""" -- name: Set the cluster name - set_fact: - eks_cluster_name: '{{ _resource_prefix }}-cluster' - -- name: Define EKS facts - set_fact: - eks_fargate_profile_name_a: '{{ _resource_prefix }}-fp-a' - eks_fargate_profile_name_b: '{{ _resource_prefix }}-fp-b' - eks_subnets: - - zone: a - cidr: 10.0.1.0/24 - type: private - tag: internal-elb - - zone: b - cidr: 10.0.2.0/24 - type: public - tag: elb - eks_security_groups: - - name: '{{ eks_cluster_name }}-control-plane-sg' - description: EKS Control Plane Security Group - rules: - - group_name: '{{ eks_cluster_name }}-workers-sg' - group_desc: EKS Worker Security Group - ports: 443 - proto: tcp - rules_egress: - - group_name: '{{ eks_cluster_name }}-workers-sg' - group_desc: EKS Worker Security Group - from_port: 1025 - to_port: 65535 - proto: tcp - - name: '{{ eks_cluster_name }}-workers-sg' - description: EKS Worker Security Group - rules: - - group_name: '{{ eks_cluster_name }}-workers-sg' - proto: tcp - from_port: 1 - to_port: 65535 - - group_name: '{{ eks_cluster_name }}-control-plane-sg' - ports: 10250 - proto: tcp - -- name: Define selector - set_fact: - selectors: - - labels: - - key: test - value: test - namespace: fp-default - -- name: Define the tags - set_fact: - tags: - Foo: foo - bar: Bar - -- name: Create Fargate Profile a with wait - amazon.cloud.eks_fargate_profile: - 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 }}' - subnets: "{{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }}" - selectors: '{{ selectors }}' - wait: true - tags: '{{ tags }}' - register: _result_create_fp - -- name: List Fargate Profiles - amazon.cloud.eks_fargate_profile: - state: list - cluster_name: '{{ eks_cluster_name }}' - register: _result_list_fp - -- name: Update tags in Fargate Profile a with wait (check mode) - amazon.cloud.eks_fargate_profile: - 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 }}' - subnets: "{{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }}" - selectors: '{{ selectors }}' - wait: true - tags: - env: test - test: foo - check_mode: true - register: _result_update_tags_fp - -- name: Delete Fargate Profile a - amazon.cloud.eks_fargate_profile: - fargate_profile_name: '{{ eks_fargate_profile_name_a }}' - cluster_name: '{{ eks_cluster_name }}' - state: absent - wait: true - wait_timeout: 900 - register: _result_delete_fp """ RETURN = r""" @@ -243,11 +164,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 +181,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"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -288,16 +225,17 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["cluster_name"], True], + ["state", "list", ["ClusterName"], True], [ "state", "present", [ + "PodExecutionRoleArn", "identifier", - "selectors", - "pod_execution_role_arn", - "fargate_profile_name", + "Selectors", + "ClusterName", "cluster_name", + "fargate_profile_name", ], True, ], @@ -332,34 +270,35 @@ 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 alis 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", + "ClusterName", + "FargateProfileName", + "PodExecutionRoleArn", + "Subnets", + "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 = ["ClusterName", "FargateProfileName"] 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( - "fargate_profile_name" + if not module.params.get("ClusterName") or not module.params.get( + "FargateProfileName" ): module.fail_json(f"You must specify both {*identifier, } identifiers.") diff --git a/plugins/modules/iam_instance_profile.py b/plugins/modules/iam_instance_profile.py index 4f095890..f9c0ec8e 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 alis 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 = ["InstanceProfileName", "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 = ["InstanceProfileName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index a50d5c2f..06b756fb 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,7 +113,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -144,11 +164,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 +181,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"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -184,7 +222,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["assume_role_policy_document", "role_name"], True], + ["state", "present", ["AssumeRolePolicyDocument", "role_name"], True], ["state", "absent", ["role_name"], True], ["state", "get", ["role_name"], True], ] @@ -215,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 alis 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 = ["Path", "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 = ["RoleName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/iam_server_certificate.py b/plugins/modules/iam_server_certificate.py index b6d2bd2a..7d378034 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,7 +75,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -89,42 +99,6 @@ """ EXAMPLES = r""" -- name: Load the certificate data - set_fact: - cert_a_data: '{{ lookup("file", path_cert_a) }}' - cert_b_data: '{{ lookup("file", path_cert_b) }}' - chain_cert_data: '{{ lookup("file", path_intermediate_cert) }}' - -- name: Create Certificate - amazon.cloud.iam_server_certificate: - server_certificate_name: '{{ cert_name }}' - state: present - certificate_body: '{{ cert_a_data }}' - private_key: '{{ lookup("file", path_cert_key) }}' - wait: true - register: create_cert - -- name: Delete certificate - amazon.cloud.iam_server_certificate: - server_certificate_name: '{{ cert_name }}' - state: absent - register: delete_cert - -- name: Create Certificate with Chain and path - amazon.cloud.iam_server_certificate: - server_certificate_name: '{{ cert_name }}' - state: present - certificate_body: '{{ cert_a_data }}' - private_key: '{{ lookup("file", path_cert_key) }}' - certificate_chain: '{{ chain_cert_data }}' - path: /example/ - register: create_cert - -- name: Gather information about a certificate - amazon.cloud.iam_server_certificate: - server_certificate_name: '{{ cert_name }}' - state: get - register: create_info """ RETURN = r""" @@ -152,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(): @@ -168,12 +143,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"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -211,27 +192,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 alis 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", + "ServerCertificateName", + "PrivateKey", + "CertificateBody", + "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 = ["ServerCertificateName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/kms_alias.py b/plugins/modules/kms_alias.py index 170b9dca..5a357bfb 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"], @@ -127,7 +132,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["target_key_id", "alias_name"], True], + ["state", "present", ["AliasName", "alias_name", "TargetKeyId"], True], ["state", "absent", ["alias_name"], True], ["state", "get", ["alias_name"], True], ] @@ -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 alis 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 = ["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 = ["AliasName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/kms_replica_key.py b/plugins/modules/kms_replica_key.py index 88ad46a7..daf72458 100644 --- a/plugins/modules/kms_replica_key.py +++ b/plugins/modules/kms_replica_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""" @@ -16,12 +16,16 @@ primary key. options: description: + aliases: + - 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: + aliases: + - Enabled description: - Specifies whether the AWS KMS key is enabled. - Disabled AWS KMS keys cannot be used in cryptographic operations. @@ -36,15 +40,21 @@ be performed on it. type: bool key_id: + aliases: + - KeyId description: - Not Provived. type: str key_policy: + aliases: + - KeyPolicy 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: + aliases: + - PendingWindowInDays 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. @@ -52,6 +62,8 @@ - The default value is 30 days. type: int primary_key_arn: + aliases: + - PrimaryKeyArn description: - Identifies the primary AWS KMS key to create a replica of. - Specify the Amazon Resource Name (ARN) of the AWS KMS key. @@ -81,7 +93,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -132,11 +144,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,13 +161,16 @@ def main(): ), ) - 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["primary_key_arn"] = {"type": "str", "aliases": ["PrimaryKeyArn"]} + argument_spec["description"] = {"type": "str", "aliases": ["Description"]} + argument_spec["enabled"] = {"type": "bool", "aliases": ["Enabled"]} + argument_spec["key_policy"] = {"type": "dict", "aliases": ["KeyPolicy"]} + argument_spec["pending_window_in_days"] = { + "type": "int", + "aliases": ["PendingWindowInDays"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["key_id"] = {"type": "str", "aliases": ["KeyId"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -166,7 +182,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["primary_key_arn", "key_policy", "key_id"], True], + ["state", "present", ["KeyPolicy", "key_id", "PrimaryKeyArn"], True], ["state", "absent", ["key_id"], True], ["state", "get", ["key_id"], True], ] @@ -193,22 +209,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 alis 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 = ["primary_key_arn"] + create_only_params = ["PrimaryKeyArn"] # 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"] + identifier = ["KeyId"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/lambda_code_signing_config.py b/plugins/modules/lambda_code_signing_config.py index d36ac50f..9e24bcd2 100644 --- a/plugins/modules/lambda_code_signing_config.py +++ b/plugins/modules/lambda_code_signing_config.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 code signing for AWS Lambda. options: allowed_publishers: + aliases: + - AllowedPublishers 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 @@ -21,21 +23,29 @@ will be expected to be signed by profiles from this list. suboptions: signing_profile_version_arns: + aliases: + - SigningProfileVersionArns description: - List of Signing profile version Arns. elements: str type: list type: dict code_signing_config_arn: + aliases: + - CodeSigningConfigArn description: - A unique Arn for CodeSigningConfig resource. type: str code_signing_policies: + aliases: + - CodeSigningPolicies 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: + aliases: + - UntrustedArtifactOnDeployment choices: - Enforce - Warn @@ -47,6 +57,8 @@ type: str type: dict description: + aliases: + - Description description: - A description of the CodeSigningConfig. type: str @@ -121,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(): @@ -137,12 +150,17 @@ def main(): ), ) - argument_spec["description"] = {"type": "str"} + argument_spec["description"] = {"type": "str", "aliases": ["Description"]} argument_spec["allowed_publishers"] = { "type": "dict", "options": { - "signing_profile_version_arns": {"type": "list", "elements": "str"} + "signing_profile_version_arns": { + "type": "list", + "elements": "str", + "aliases": ["SigningProfileVersionArns"], + } }, + "aliases": ["AllowedPublishers"], } argument_spec["code_signing_policies"] = { "type": "dict", @@ -151,10 +169,15 @@ def main(): "type": "str", "default": "Warn", "choices": ["Enforce", "Warn"], + "aliases": ["UntrustedArtifactOnDeployment"], } }, + "aliases": ["CodeSigningPolicies"], + } + argument_spec["code_signing_config_arn"] = { + "type": "str", + "aliases": ["CodeSigningConfigArn"], } - argument_spec["code_signing_config_arn"] = {"type": "str"} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -165,7 +188,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["code_signing_config_arn", "allowed_publishers"], True], + ["state", "present", ["code_signing_config_arn", "AllowedPublishers"], True], ["state", "absent", ["code_signing_config_arn"], True], ["state", "get", ["code_signing_config_arn"], True], ] @@ -189,13 +212,14 @@ def main(): 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} + _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 alis 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 = {} @@ -204,7 +228,7 @@ def main(): handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["code_signing_config_arn"] + identifier = ["CodeSigningConfigArn"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/lambda_event_source_mapping.py b/plugins/modules/lambda_event_source_mapping.py index 75acc9e4..0419ad70 100644 --- a/plugins/modules/lambda_event_source_mapping.py +++ b/plugins/modules/lambda_event_source_mapping.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,60 +14,115 @@ - Create a mapping between an event source and an AWS Lambda function. options: amazon_managed_kafka_event_source_config: + aliases: + - AmazonManagedKafkaEventSourceConfig description: - Specific configuration settings for an MSK event source.Specific configuration settings for an MSK event source. suboptions: consumer_group_id: + aliases: + - ConsumerGroupId 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: + aliases: + - BatchSize description: - The maximum number of items to retrieve in a single batch. type: int bisect_batch_on_function_error: + aliases: + - BisectBatchOnFunctionError description: - (Streams) If the function returns an error, split the batch in two and retry. type: bool destination_config: + aliases: + - DestinationConfig 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: + aliases: + - OnFailure description: - The destination configuration for failed invocations.A destination for events that failed processing. suboptions: destination: + aliases: + - Destination description: - The Amazon Resource Name (ARN) of the destination resource. type: str type: dict type: dict + document_db_event_source_config: + aliases: + - DocumentDBEventSourceConfig + description: + - Document db event source config.Document db event source config. + suboptions: + collection_name: + aliases: + - CollectionName + description: + - The collection name to connect to. + type: str + database_name: + aliases: + - DatabaseName + description: + - The database name to connect to. + type: str + full_document: + aliases: + - FullDocument + choices: + - Default + - UpdateLookup + description: + - Include full document in change stream response. + - The default option will only send the changes made to documents + to Lambda. + - If you want the complete document sent to Lambda, set this to UpdateLookup. + type: str + type: dict enabled: + aliases: + - Enabled description: - Disables the event source mapping to pause polling and invocation. type: bool event_source_arn: + aliases: + - EventSourceArn description: - The Amazon Resource Name (ARN) of the event source. type: str filter_criteria: + aliases: + - FilterCriteria description: - The filter criteria to control event filtering.The filter criteria to control event filtering. suboptions: filters: + aliases: + - Filters description: - The filter object that defines parameters for ESM filtering. elements: dict suboptions: pattern: + aliases: + - Pattern description: - The filter pattern that defines which events should be passed for invocations. @@ -84,10 +139,14 @@ be performed on it. type: bool function_name: + aliases: + - FunctionName description: - The name of the Lambda function. type: str function_response_types: + aliases: + - FunctionResponseTypes choices: - ReportBatchItemFailures description: @@ -95,39 +154,55 @@ elements: str type: list id: + aliases: + - Id description: - Event Source Mapping Identifier UUID. type: str maximum_batching_window_in_seconds: + aliases: + - MaximumBatchingWindowInSeconds description: - (Streams) The maximum amount of time to gather records before invoking the function, in seconds. type: int maximum_record_age_in_seconds: + aliases: + - MaximumRecordAgeInSeconds description: - (Streams) The maximum age of a record that Lambda sends to a function for processing. type: int maximum_retry_attempts: + aliases: + - MaximumRetryAttempts description: - (Streams) The maximum number of times to retry when the function returns an error. type: int parallelization_factor: + aliases: + - ParallelizationFactor description: - (Streams) The number of batches to process from each shard concurrently. type: int queues: + aliases: + - Queues description: - (ActiveMQ) A list of ActiveMQ queues. elements: str type: list scaling_config: + aliases: + - ScalingConfig description: - The scaling configuration for the event source.The scaling configuration for the event source. suboptions: maximum_concurrency: + aliases: + - MaximumConcurrency description: - The maximum number of concurrent functions that the event source can invoke.The maximum number of concurrent functions that an @@ -135,16 +210,22 @@ type: int type: dict self_managed_event_source: + aliases: + - SelfManagedEventSource description: - Self-managed event source endpoints.The configuration used by AWS Lambda to access a self-managed event source. suboptions: endpoints: + aliases: + - 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: + aliases: + - KafkaBootstrapServers description: - The URL of a Kafka server. elements: str @@ -152,21 +233,29 @@ type: dict type: dict self_managed_kafka_event_source_config: + aliases: + - SelfManagedKafkaEventSourceConfig 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: + aliases: + - ConsumerGroupId description: - The identifier for the Kafka Consumer Group to join. type: str type: dict source_access_configurations: + aliases: + - SourceAccessConfigurations description: - The configuration used by AWS Lambda to access event source. elements: dict suboptions: type: + aliases: + - Type choices: - BASIC_AUTH - CLIENT_CERTIFICATE_TLS_AUTH @@ -180,16 +269,22 @@ - The type of source access configuration. type: str uri: + aliases: + - URI description: - The URI for the source access configuration resource. type: str type: list starting_position: + aliases: + - StartingPosition 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: + aliases: + - StartingPositionTimestamp description: - With StartingPosition set to C(AT_TIMESTAMP), the time from which to start reading, in Unix time seconds. @@ -211,11 +306,15 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str topics: + aliases: + - Topics description: - (Kafka) A list of Kafka topics. elements: str type: list tumbling_window_in_seconds: + aliases: + - TumblingWindowInSeconds description: - (Streams) Tumbling window (non-overlapping time window) duration to perform aggregations. @@ -266,11 +365,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(): @@ -282,36 +382,64 @@ def main(): ), ) - argument_spec["id"] = {"type": "str"} - argument_spec["batch_size"] = {"type": "int"} - argument_spec["bisect_batch_on_function_error"] = {"type": "bool"} + argument_spec["id"] = {"type": "str", "aliases": ["Id"]} + argument_spec["batch_size"] = {"type": "int", "aliases": ["BatchSize"]} + argument_spec["bisect_batch_on_function_error"] = { + "type": "bool", + "aliases": ["BisectBatchOnFunctionError"], + } argument_spec["destination_config"] = { "type": "dict", "options": { - "on_failure": {"type": "dict", "options": {"destination": {"type": "str"}}} + "on_failure": { + "type": "dict", + "options": {"destination": {"type": "str", "aliases": ["Destination"]}}, + "aliases": ["OnFailure"], + } }, + "aliases": ["DestinationConfig"], } - argument_spec["enabled"] = {"type": "bool"} - argument_spec["event_source_arn"] = {"type": "str"} + argument_spec["enabled"] = {"type": "bool", "aliases": ["Enabled"]} + argument_spec["event_source_arn"] = {"type": "str", "aliases": ["EventSourceArn"]} argument_spec["filter_criteria"] = { "type": "dict", "options": { "filters": { "type": "list", "elements": "dict", - "options": {"pattern": {"type": "str"}}, + "options": {"pattern": {"type": "str", "aliases": ["Pattern"]}}, + "aliases": ["Filters"], } }, + "aliases": ["FilterCriteria"], + } + argument_spec["function_name"] = {"type": "str", "aliases": ["FunctionName"]} + argument_spec["maximum_batching_window_in_seconds"] = { + "type": "int", + "aliases": ["MaximumBatchingWindowInSeconds"], + } + argument_spec["maximum_record_age_in_seconds"] = { + "type": "int", + "aliases": ["MaximumRecordAgeInSeconds"], + } + argument_spec["maximum_retry_attempts"] = { + "type": "int", + "aliases": ["MaximumRetryAttempts"], } - 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["parallelization_factor"] = { + "type": "int", + "aliases": ["ParallelizationFactor"], + } + argument_spec["starting_position"] = { + "type": "str", + "aliases": ["StartingPosition"], + } + argument_spec["starting_position_timestamp"] = { + "type": "int", + "aliases": ["StartingPositionTimestamp"], + } + argument_spec["topics"] = {"type": "list", "elements": "str", "aliases": ["Topics"]} + argument_spec["queues"] = {"type": "list", "elements": "str", "aliases": ["Queues"]} argument_spec["source_access_configurations"] = { "type": "list", "elements": "dict", @@ -328,15 +456,21 @@ def main(): "VPC_SECURITY_GROUP", "VPC_SUBNET", ], + "aliases": ["Type"], }, - "uri": {"type": "str"}, + "uri": {"type": "str", "aliases": ["URI"]}, }, + "aliases": ["SourceAccessConfigurations"], + } + argument_spec["tumbling_window_in_seconds"] = { + "type": "int", + "aliases": ["TumblingWindowInSeconds"], } - argument_spec["tumbling_window_in_seconds"] = {"type": "int"} argument_spec["function_response_types"] = { "type": "list", "elements": "str", "choices": ["ReportBatchItemFailures"], + "aliases": ["FunctionResponseTypes"], } argument_spec["self_managed_event_source"] = { "type": "dict", @@ -344,22 +478,50 @@ def main(): "endpoints": { "type": "dict", "options": { - "kafka_bootstrap_servers": {"type": "list", "elements": "str"} + "kafka_bootstrap_servers": { + "type": "list", + "elements": "str", + "aliases": ["KafkaBootstrapServers"], + } }, + "aliases": ["Endpoints"], } }, + "aliases": ["SelfManagedEventSource"], } argument_spec["amazon_managed_kafka_event_source_config"] = { "type": "dict", - "options": {"consumer_group_id": {"type": "str"}}, + "options": { + "consumer_group_id": {"type": "str", "aliases": ["ConsumerGroupId"]} + }, + "aliases": ["AmazonManagedKafkaEventSourceConfig"], } argument_spec["self_managed_kafka_event_source_config"] = { "type": "dict", - "options": {"consumer_group_id": {"type": "str"}}, + "options": { + "consumer_group_id": {"type": "str", "aliases": ["ConsumerGroupId"]} + }, + "aliases": ["SelfManagedKafkaEventSourceConfig"], } argument_spec["scaling_config"] = { "type": "dict", - "options": {"maximum_concurrency": {"type": "int"}}, + "options": { + "maximum_concurrency": {"type": "int", "aliases": ["MaximumConcurrency"]} + }, + "aliases": ["ScalingConfig"], + } + argument_spec["document_db_event_source_config"] = { + "type": "dict", + "options": { + "database_name": {"type": "str", "aliases": ["DatabaseName"]}, + "collection_name": {"type": "str", "aliases": ["CollectionName"]}, + "full_document": { + "type": "str", + "choices": ["Default", "UpdateLookup"], + "aliases": ["FullDocument"], + }, + }, + "aliases": ["DocumentDBEventSourceConfig"], } argument_spec["state"] = { "type": "str", @@ -371,7 +533,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["id", "function_name"], True], + ["state", "present", ["FunctionName", "id"], True], ["state", "absent", ["id"], True], ["state", "get", ["id"], True], ] @@ -397,6 +559,9 @@ def main(): "bisect_batch_on_function_error" ) params["destination_config"] = module.params.get("destination_config") + params["document_db_event_source_config"] = module.params.get( + "document_db_event_source_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") @@ -430,29 +595,30 @@ 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 alis 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 = [ - "event_source_arn", - "starting_position", - "starting_position_timestamp", - "self_managed_event_source", - "amazon_managed_kafka_event_source_config", - "self_managed_kafka_event_source_config", + "EventSourceArn", + "StartingPosition", + "StartingPositionTimestamp", + "SelfManagedEventSource", + "AmazonManagedKafkaEventSourceConfig", + "SelfManagedKafkaEventSourceConfig", ] # Necessary to handle when module does not support all the states handlers = ["create", "delete", "list", "read", "update"] state = module.params.get("state") - identifier = ["id"] + identifier = ["Id"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/lambda_function.py b/plugins/modules/lambda_function.py index 247ee4da..77d579db 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 @@ -101,6 +133,8 @@ elements: dict suboptions: local_mount_path: + aliases: + - LocalMountPath description: - The path where the function can access the file system, starting with /mnt/. @@ -116,11 +150,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 +166,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 +231,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,6 +272,8 @@ 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 @@ -230,12 +298,14 @@ type: str tags: aliases: - - resource_tags + - 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 +313,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 +331,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 +343,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 +403,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 +420,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 +450,89 @@ 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": {}, + "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": {"local_mount_path": {"type": "str", "aliases": ["LocalMountPath"]}}, + "aliases": ["FileSystemConfigs"], } - 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["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["code_signing_config_arn"] = { + "type": "str", + "aliases": ["CodeSigningConfigArn"], + } + argument_spec["layers"] = {"type": "list", "elements": "str", "aliases": ["Layers"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["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 +545,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["role", "function_name", "code"], True], + ["state", "present", ["function_name", "Role", "Code"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] @@ -471,22 +591,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 alis 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 = ["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 = ["FunctionName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/logs_log_group.py b/plugins/modules/logs_log_group.py index 5a65299a..6b063824 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,7 +100,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -114,37 +124,6 @@ """ EXAMPLES = r""" -- name: Create log group - amazon.cloud.logs_log_group: - state: present - log_group_name: '{{ log_group_name }}' - retention_in_days: 7 - tags: - testkey: testvalue - wait: true - register: output - -- name: Describe log group - amazon.cloud.logs_log_group: - state: describe - log_group_name: '{{ log_group_name }}' - register: output - -- name: Update log group - amazon.cloud.logs_log_group: - state: present - log_group_name: '{{ log_group_name }}' - tags: - anotherkey: anothervalue - purge_tags: false - wait: true - register: output - -- name: Delete log group - amazon.cloud.logs_log_group: - state: absent - log_group_name: '{{ log_group_name }}' - register: output """ RETURN = r""" @@ -172,11 +151,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 +168,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 +192,7 @@ def main(): 400, 545, 731, + 1096, 1827, 2192, 2557, @@ -216,8 +200,9 @@ def main(): 3288, 3653, ], + "aliases": ["RetentionInDays"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -254,22 +239,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 alis 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 = ["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 = ["LogGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index 8d5bd599..a823f2f5 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,72 @@ - 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: + $comment: Namespaces can be up to 256 characters long; valid characters + include 0-9A-Za-z.-_/# + 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 +209,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 +226,21 @@ 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": { + "$comment": "Namespaces can be up to 256 characters long; valid characters include 0-9A-Za-z.-_/#", + "type": "str", + "aliases": ["MetricNamespace"], + }, + "metric_value": {"type": "str", "aliases": ["MetricValue"]}, "unit": { "type": "str", "choices": [ @@ -241,13 +272,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", @@ -260,16 +297,17 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["log_group_name"], True], + ["state", "list", ["LogGroupName"], True], [ "state", "present", [ + "FilterPattern", "identifier", "log_group_name", "filter_name", - "metric_transformations", - "filter_pattern", + "LogGroupName", + "MetricTransformations", ], True, ], @@ -297,29 +335,28 @@ 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 alis 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 = ["FilterName", "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 = ["LogGroupName", "FilterName"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): - if not module.params.get("log_group_name") or not module.params.get( - "filter_name" - ): + if not module.params.get("LogGroupName") or not module.params.get("FilterName"): module.fail_json(f"You must specify both {*identifier, } identifiers.") results = {"changed": False, "result": {}} diff --git a/plugins/modules/logs_query_definition.py b/plugins/modules/logs_query_definition.py index d0f61800..2d41d769 100644 --- a/plugins/modules/logs_query_definition.py +++ b/plugins/modules/logs_query_definition.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,19 +23,27 @@ be performed on it. type: bool log_group_names: + aliases: + - LogGroupNames description: - I(log_group) name. elements: str type: list name: + aliases: + - Name description: - A name for the saved query definition. type: str query_definition_id: + aliases: + - QueryDefinitionId description: - Unique identifier of a query definition. type: str query_string: + aliases: + - QueryString description: - The query string to use for this definition. type: str @@ -101,11 +109,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,10 +126,17 @@ def main(): ), ) - 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["name"] = {"type": "str", "aliases": ["Name"]} + argument_spec["query_string"] = {"type": "str", "aliases": ["QueryString"]} + argument_spec["log_group_names"] = { + "type": "list", + "elements": "str", + "aliases": ["LogGroupNames"], + } + argument_spec["query_definition_id"] = { + "type": "str", + "aliases": ["QueryDefinitionId"], + } argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -131,7 +147,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["query_definition_id", "query_string", "name"], True], + ["state", "present", ["query_definition_id", "Name", "QueryString"], True], ["state", "absent", ["query_definition_id"], True], ["state", "get", ["query_definition_id"], True], ] @@ -155,13 +171,14 @@ def main(): 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} + _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 alis 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 = {} @@ -170,7 +187,7 @@ def main(): handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["query_definition_id"] + identifier = ["QueryDefinitionId"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/logs_resource_policy.py b/plugins/modules/logs_resource_policy.py index bb37b67d..437a3cf0 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", ["PolicyName", "PolicyDocument", "policy_name"], 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 alis 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 = ["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 = ["PolicyName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_acl.py b/plugins/modules/memorydb_acl.py index bfb45013..12efa4d5 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: - - resource_tags + - 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: + $comment: List of users. + 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 @@ -123,11 +128,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 +145,14 @@ def main(): ), ) - argument_spec["acl_name"] = {"type": "str"} + argument_spec["acl_name"] = {"type": "str", "aliases": ["ACLName"]} argument_spec["user_names"] = { "type": "list", + "$comment": "List of users.", "elements": "str", + "aliases": ["UserNames"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -156,7 +164,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["acl_name"], True], + ["state", "present", ["acl_name", "ACLName"], True], ["state", "absent", ["acl_name"], True], ["state", "get", ["acl_name"], True], ] @@ -179,24 +187,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 alis 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 = ["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 = ["ACLName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index caf5c4fa..416265e4 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 @@ -26,16 +30,22 @@ to true when you create a cluster. type: bool cluster_endpoint: + aliases: + - ClusterEndpoint 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 +55,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 +85,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,19 +100,27 @@ 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 @@ -102,11 +130,15 @@ - 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 +147,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 +164,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 +201,21 @@ - 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: - - resource_tags + - 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 @@ -244,11 +290,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 +307,64 @@ 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["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["cluster_endpoint"] = { + "type": "dict", + "options": {}, + "aliases": ["ClusterEndpoint"], + } + argument_spec["auto_minor_version_upgrade"] = { + "type": "bool", + "aliases": ["AutoMinorVersionUpgrade"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -295,7 +376,12 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["acl_name", "cluster_name", "node_type"], True], + [ + "state", + "present", + ["NodeType", "ACLName", "cluster_name", "ClusterName"], + True, + ], ["state", "absent", ["cluster_name"], True], ["state", "get", ["cluster_name"], True], ] @@ -341,33 +427,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 alis 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", + "ClusterName", + "TLSEnabled", + "DataTiering", + "KmsKeyId", + "Port", + "SubnetGroupName", + "SnapshotArns", + "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 = ["ClusterName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_parameter_group.py b/plugins/modules/memorydb_parameter_group.py index ab51a7d3..97eebbea 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,7 +74,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -82,7 +90,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 @@ -132,11 +140,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 +157,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"]} + argument_spec["parameters"] = {"type": "dict", "aliases": ["Parameters"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -164,7 +176,12 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["family", "parameter_group_name"], True], + [ + "state", + "present", + ["parameter_group_name", "Family", "ParameterGroupName"], + True, + ], ["state", "absent", ["parameter_group_name"], True], ["state", "get", ["parameter_group_name"], True], ] @@ -189,24 +206,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 alis 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 = ["ParameterGroupName", "Family", "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 = ["ParameterGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_subnet_group.py b/plugins/modules/memorydb_subnet_group.py index 1a938822..abcae2eb 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,18 +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: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -79,7 +85,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 @@ -133,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(): @@ -149,10 +156,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"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -164,7 +175,12 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["subnet_group_name", "subnet_ids"], True], + [ + "state", + "present", + ["subnet_group_name", "SubnetGroupName", "SubnetIds"], + True, + ], ["state", "absent", ["subnet_group_name"], True], ["state", "get", ["subnet_group_name"], True], ] @@ -188,24 +204,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 alis 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 = ["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 = ["SubnetGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_user.py b/plugins/modules/memorydb_user.py index 171369ce..bb5b1c0b 100644 --- a/plugins/modules/memorydb_user.py +++ b/plugins/modules/memorydb_user.py @@ -14,20 +14,29 @@ - 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: + $comment: List of 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 +76,14 @@ type: str tags: aliases: - - resource_tags + - 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,26 @@ 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"]}, + "type": { + "type": "str", + "choices": ["iam", "password"], + "aliases": ["Type"], + }, "passwords": { "type": "list", + "$comment": "List of passwords.", "elements": "str", - "no_log": True, + "aliases": ["Passwords"], }, }, + "aliases": ["AuthenticationMode"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["resource_tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -163,7 +181,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["user_name"], True], + ["state", "present", ["user_name", "UserName"], True], ["state", "absent", ["user_name"], True], ["state", "get", ["user_name"], True], ] @@ -187,24 +205,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 alis 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 = ["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 = ["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..5ee46f86 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,7 +75,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -118,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(): @@ -134,11 +143,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"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -153,7 +165,7 @@ def main(): [ "state", "present", - ["family", "db_cluster_parameter_group_name", "parameters", "description"], + ["Description", "Family", "db_cluster_parameter_group_name", "Parameters"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], @@ -182,22 +194,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 alis 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 = ["DBClusterParameterGroupName", "Description", "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 = ["DBClusterParameterGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_db_instance.py b/plugins/modules/rds_db_instance.py index d321fd53..20720365 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,21 @@ - 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: + aliases: + - CertificateDetails 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 +105,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 +136,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 +159,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 +176,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 +199,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 +208,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 +226,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 +258,36 @@ 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: + aliases: + - 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 +301,67 @@ 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: + aliases: + - MasterUserSecret description: - Contains the secret managed by RDS in AWS Secrets Manager for the master user password. suboptions: kms_key_id: + aliases: + - KmsKeyId 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 +370,79 @@ - 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 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 +451,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 +481,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 +545,70 @@ 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: - - resource_tags + - 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 +661,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 +678,247 @@ 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_details"] = { + "type": "dict", + "options": {}, + "aliases": ["CertificateDetails"], + } + 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["endpoint"] = {"type": "dict", "options": {}, "aliases": ["Endpoint"]} + 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["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"} + "options": {"kms_key_id": {"type": "str", "aliases": ["KmsKeyId"]}}, + "aliases": ["MasterUserSecret"], + } + 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["preferred_backup_window"] = { + "type": "str", + "aliases": ["PreferredBackupWindow"], + } + argument_spec["preferred_maintenance_window"] = { + "type": "str", + "aliases": ["PreferredMaintenanceWindow"], + } 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"]} + 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"], @@ -717,6 +1026,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" ) @@ -741,36 +1053,37 @@ def main(): 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 alis 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", + "CharacterSetName", + "CustomIAMInstanceProfile", + "DBClusterIdentifier", + "DBInstanceIdentifier", + "DBName", + "DBSubnetGroupName", + "KmsKeyId", + "MasterUsername", + "NcharCharacterSetName", + "Port", + "SourceRegion", + "StorageEncrypted", + "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 = ["DBInstanceIdentifier"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index 44f8e5a7..eff2cb28 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,21 @@ type: str tags: aliases: - - resource_tags + - 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 +179,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 +214,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 +235,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 +255,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"]} + 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 +298,14 @@ def main(): [ "state", "present", - ["vpc_subnet_ids", "role_arn", "auth", "db_proxy_name", "engine_family"], + [ + "EngineFamily", + "RoleArn", + "VpcSubnetIds", + "Auth", + "DBProxyName", + "db_proxy_name", + ], True, ], ["state", "absent", ["db_proxy_name"], True], @@ -279,22 +337,23 @@ 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 alis 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 = ["DBProxyName", "EngineFamily", "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 = ["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..5a35639a 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,31 @@ type: str tags: aliases: - - resource_tags + - 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 +138,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 +155,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"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -155,7 +190,12 @@ def main(): [ "state", "present", - ["db_proxy_endpoint_name", "vpc_subnet_ids", "db_proxy_name"], + [ + "DBProxyEndpointName", + "DBProxyName", + "VpcSubnetIds", + "db_proxy_endpoint_name", + ], True, ], ["state", "absent", ["db_proxy_endpoint_name"], True], @@ -178,26 +218,28 @@ 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 alis 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 = ["DBProxyName", "DBProxyEndpointName", "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 = ["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..59996ab0 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,13 +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: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -111,11 +117,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 +134,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"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -145,7 +162,7 @@ def main(): [ "state", "present", - ["db_subnet_group_name", "db_subnet_group_description", "subnet_ids"], + ["DBSubnetGroupDescription", "db_subnet_group_name", "SubnetIds"], True, ], ["state", "absent", ["db_subnet_group_name"], True], @@ -173,22 +190,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 alis 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 = ["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 = ["DBSubnetGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_global_cluster.py b/plugins/modules/rds_global_cluster.py index 214c955a..e54b62b5 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 alis 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", + "GlobalClusterIdentifier", + "SourceDBClusterIdentifier", + "StorageEncrypted", + "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 = ["GlobalClusterIdentifier"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_option_group.py b/plugins/modules/rds_option_group.py index ea68814b..5f8b49ec 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,7 +133,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -158,11 +184,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 +201,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"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -210,10 +256,10 @@ def main(): "state", "present", [ - "engine_name", + "MajorEngineVersion", + "EngineName", + "OptionGroupDescription", "option_group_name", - "major_engine_version", - "option_group_description", ], True, ], @@ -242,27 +288,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 alis 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", + "EngineName", + "MajorEngineVersion", + "OptionGroupDescription", + "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 = ["OptionGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index 9bb6dc12..1323aed6 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,27 @@ ) 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: + aliases: + - 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 +202,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 +226,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 +264,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 +273,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 +283,45 @@ 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 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,14 @@ type: str tags: aliases: - - resource_tags + - 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 +467,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 +484,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["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"]} + 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["endpoint"] = {"type": "dict", "options": {}, "aliases": ["Endpoint"]} + 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,12 +649,12 @@ def main(): "state", "present", [ - "cluster_type", - "master_user_password", - "db_name", + "MasterUserPassword", + "DBName", + "ClusterType", "cluster_identifier", - "master_username", - "node_type", + "MasterUsername", + "NodeType", ], True, ], @@ -553,30 +750,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 alis 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", + "ClusterIdentifier", + "OwnerAccount", + "SnapshotIdentifier", + "DBName", + "SnapshotClusterIdentifier", + "ClusterSubnetGroupName", + "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 = ["ClusterIdentifier"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index dc1ef25b..2a0c93a9 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,11 @@ def main(): "state", "present", [ + "EndpointName", + "VpcSecurityGroupIds", + "SubnetGroupName", "endpoint_name", - "subnet_group_name", - "vpc_security_group_ids", - "cluster_identifier", + "ClusterIdentifier", ], True, ], @@ -202,32 +192,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 alis 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", + "EndpointName", + "ClusterIdentifier", + "ResourceOwner", + "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 = ["EndpointName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index 7820d7b0..bfe5aaee 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", @@ -136,8 +150,19 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["cluster_identifier"], True], - ["state", "present", ["account", "identifier", "cluster_identifier"], True], + ["state", "list", ["ClusterIdentifier"], True], + [ + "state", + "present", + [ + "Account", + "cluster_identifier", + "identifier", + "ClusterIdentifier", + "account", + ], + True, + ], ["state", "absent", ["cluster_identifier", "account", "identifier"], True], ["state", "get", ["cluster_identifier", "account", "identifier"], True], ] @@ -161,28 +186,29 @@ 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 alis 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 = ["ClusterIdentifier", "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 = ["ClusterIdentifier", "Account"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): - if not module.params.get("cluster_identifier") or not module.params.get( - "account" + if not module.params.get("ClusterIdentifier") or not module.params.get( + "Account" ): module.fail_json(f"You must specify both {*identifier, } identifiers.") diff --git a/plugins/modules/redshift_event_subscription.py b/plugins/modules/redshift_event_subscription.py index 0e149c24..2b57cb3f 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,12 +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: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -145,11 +159,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 +176,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 +190,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"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -193,7 +221,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["subscription_name"], True], + ["state", "present", ["SubscriptionName", "subscription_name"], True], ["state", "absent", ["subscription_name"], True], ["state", "get", ["subscription_name"], True], ] @@ -221,22 +249,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 alis 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 = ["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 = ["SubscriptionName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_scheduled_action.py b/plugins/modules/redshift_scheduled_action.py index 9b07b0fa..6c9b95c4 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"], @@ -228,7 +288,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["scheduled_action_name"], True], + ["state", "present", ["scheduled_action_name", "ScheduledActionName"], True], ["state", "absent", ["scheduled_action_name"], True], ["state", "get", ["scheduled_action_name"], True], ] @@ -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 alis 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 = ["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 = ["ScheduledActionName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/route53_dnssec.py b/plugins/modules/route53_dnssec.py index 26ebaefa..b956e73e 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"], @@ -115,7 +118,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["hosted_zone_id"], True], + ["state", "present", ["HostedZoneId", "hosted_zone_id"], True], ["state", "absent", ["hosted_zone_id"], True], ["state", "get", ["hosted_zone_id"], True], ] @@ -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 alis 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 = ["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 = ["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..c952edbe 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"], @@ -145,16 +161,18 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["hosted_zone_id"], True], + ["state", "list", ["HostedZoneId"], True], [ "state", "present", [ + "HostedZoneId", + "Name", + "Status", "identifier", "hosted_zone_id", - "status", - "key_management_service_arn", "name", + "KeyManagementServiceArn", ], True, ], @@ -184,27 +202,28 @@ 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 alis 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 = ["HostedZoneId", "Name", "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 = ["HostedZoneId", "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"): + if not module.params.get("HostedZoneId") or not module.params.get("Name"): module.fail_json(f"You must specify both {*identifier, } identifiers.") results = {"changed": False, "result": {}} diff --git a/plugins/modules/s3_access_point.py b/plugins/modules/s3_access_point.py index ab6a7cb3..2bf08bdb 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"], @@ -225,7 +237,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["bucket", "name"], True], + ["state", "present", ["Bucket", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] @@ -247,35 +259,29 @@ 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 alis 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", - ] + create_only_params = ["Name", "Bucket", "BucketAccountId", "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 = ["Name"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/s3_bucket.py b/plugins/modules/s3_bucket.py index 8f49d49f..b4204bb6 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,20 @@ type: str tags: aliases: - - resource_tags + - 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 +1573,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 +1616,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 +1635,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 +1659,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. @@ -1304,36 +1704,6 @@ """ EXAMPLES = r""" -- name: Create S3 bucket - amazon.cloud.s3_bucket: - bucket_name: '{{ bucket_name }}' - state: present - register: output - -- name: Describe S3 bucket - amazon.cloud.s3_bucket: - state: describe - bucket_name: '{{ output.result.identifier }}' - register: _result - -- name: List S3 buckets - amazon.cloud.s3_bucket: - state: list - register: _result - -- name: Update S3 bucket public access block configuration and tags (diff=true) - amazon.cloud.s3_bucket: - bucket_name: '{{ output.result.identifier }}' - state: present - public_access_block_configuration: - block_public_acls: false - block_public_policy: false - ignore_public_acls: false - restrict_public_buckets: false - tags: - mykey: myval - diff: true - register: _result """ RETURN = r""" @@ -1361,11 +1731,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 +1751,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 +1771,7 @@ def main(): "PublicRead", "PublicReadWrite", ], + "aliases": ["AccessControl"], } argument_spec["analytics_configurations"] = { "type": "list", @@ -1403,7 +1780,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 +1795,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 +1835,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 +1868,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"], }, - "allowed_origins": {"type": "list", "elements": "str"}, - "exposed_headers": {"type": "list", "elements": "str"}, - "id": {"type": "str"}, - "max_age": {"type": "int"}, + "exposed_headers": { + "type": "list", + "elements": "str", + "aliases": ["ExposedHeaders"], + }, + "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 +1924,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 +1940,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 +1978,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 +1998,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 +2048,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 +2076,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 +2126,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 +2154,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 +2209,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 +2232,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 +2268,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 +2304,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 +2376,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 +2411,10 @@ def main(): "status": { "type": "str", "choices": ["Disabled", "Enabled"], + "aliases": ["Status"], } }, + "aliases": ["DeleteMarkerReplication"], }, "destination": { "type": "dict", @@ -1837,27 +2422,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 +2469,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 +2496,10 @@ def main(): "STANDARD", "STANDARD_IA", ], + "aliases": ["StorageClass"], }, }, + "aliases": ["Destination"], }, "filter": { "type": "dict", @@ -1893,30 +2507,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 +2547,10 @@ def main(): "status": { "type": "str", "choices": ["Disabled", "Enabled"], + "aliases": ["Status"], } }, + "aliases": ["ReplicaModifications"], }, "sse_kms_encrypted_objects": { "type": "dict", @@ -1935,17 +2558,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"]} argument_spec["versioning_configuration"] = { "type": "dict", "options": { @@ -1953,14 +2585,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 +2602,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 +2712,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 alis 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 = ["BucketName", "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 = ["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..c5fc3781 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,23 @@ 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 alis 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 = ["Name", "PublicAccessBlockConfiguration", "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 = ["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..02bd3671 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"], @@ -121,7 +126,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["mrap_name", "policy"], True], + ["state", "present", ["mrap_name", "MrapName", "Policy"], True], ["state", "absent", ["mrap_name"], True], ["state", "get", ["mrap_name"], True], ] @@ -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 alis 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 = ["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 = ["MrapName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/s3objectlambda_access_point.py b/plugins/modules/s3objectlambda_access_point.py index 068ddab6..86774f0c 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", ["ObjectLambdaConfiguration", "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 alis 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 = ["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 = ["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..fea0f77c 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"], @@ -122,7 +130,12 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["object_lambda_access_point", "policy_document"], True], + [ + "state", + "present", + ["PolicyDocument", "ObjectLambdaAccessPoint", "object_lambda_access_point"], + True, + ], ["state", "absent", ["object_lambda_access_point"], True], ["state", "get", ["object_lambda_access_point"], True], ] @@ -146,22 +159,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 alis 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 = ["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 = ["ObjectLambdaAccessPoint"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ssm_document.py b/plugins/modules/ssm_document.py index ac79f0c1..0b93e5bc 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,21 @@ type: str tags: aliases: - - resource_tags + - 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 +172,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 +225,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 +242,7 @@ def main(): ), ) - argument_spec["content"] = {"type": "dict"} + argument_spec["content"] = {"type": "dict", "aliases": ["Content"]} argument_spec["attachments"] = { "type": "list", "elements": "dict", @@ -221,13 +250,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 +276,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"]} 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 +312,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 +342,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 alis 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 = ["Name", "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 = ["Name"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ssm_resource_data_sync.py b/plugins/modules/ssm_resource_data_sync.py index 0ae4f85c..bf6090ab 100644 --- a/plugins/modules/ssm_resource_data_sync.py +++ b/plugins/modules/ssm_resource_data_sync.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 @@ - A resource data sync helps you view data from multiple sources in a single location. options: bucket_name: + aliases: + - BucketName description: - Not Provived. type: str bucket_prefix: + aliases: + - BucketPrefix description: - Not Provived. type: str bucket_region: + aliases: + - BucketRegion description: - Not Provived. type: str @@ -36,30 +42,44 @@ be performed on it. type: bool kms_key_arn: + aliases: + - KMSKeyArn description: - Not Provived. type: str s3_destination: + aliases: + - S3Destination description: - Not Provived. suboptions: bucket_name: + aliases: + - BucketName description: - Not Provived. type: str bucket_prefix: + aliases: + - BucketPrefix description: - Not Provived. type: str bucket_region: + aliases: + - BucketRegion description: - Not Provived. type: str kms_key_arn: + aliases: + - KMSKeyArn description: - Not Provived. type: str sync_format: + aliases: + - SyncFormat description: - Not Provived. type: str @@ -81,46 +101,66 @@ - I(state=describe) or I(state=get) retrieves information on an existing resource. type: str sync_format: + aliases: + - SyncFormat description: - Not Provived. type: str sync_name: + aliases: + - SyncName description: - Not Provived. type: str sync_source: + aliases: + - SyncSource description: - Not Provived. suboptions: aws_organizations_source: + aliases: + - AwsOrganizationsSource description: - Not Provived. suboptions: organization_source_type: + aliases: + - OrganizationSourceType description: - Not Provived. type: str organizational_units: + aliases: + - OrganizationalUnits description: - Not Provived. elements: str type: list type: dict include_future_regions: + aliases: + - IncludeFutureRegions description: - Not Provived. type: bool source_regions: + aliases: + - SourceRegions description: - Not Provived. elements: str type: list source_type: + aliases: + - SourceType description: - Not Provived. type: str type: dict sync_type: + aliases: + - SyncType description: - Not Provived. type: str @@ -170,11 +210,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(): @@ -189,35 +230,52 @@ def main(): 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"}, + "kms_key_arn": {"type": "str", "aliases": ["KMSKeyArn"]}, + "bucket_prefix": {"type": "str", "aliases": ["BucketPrefix"]}, + "bucket_name": {"type": "str", "aliases": ["BucketName"]}, + "bucket_region": {"type": "str", "aliases": ["BucketRegion"]}, + "sync_format": {"type": "str", "aliases": ["SyncFormat"]}, }, + "aliases": ["S3Destination"], } - argument_spec["kms_key_arn"] = {"type": "str"} + argument_spec["kms_key_arn"] = {"type": "str", "aliases": ["KMSKeyArn"]} argument_spec["sync_source"] = { "type": "dict", "options": { - "include_future_regions": {"type": "bool"}, - "source_regions": {"type": "list", "elements": "str"}, - "source_type": {"type": "str"}, + "include_future_regions": { + "type": "bool", + "aliases": ["IncludeFutureRegions"], + }, + "source_regions": { + "type": "list", + "elements": "str", + "aliases": ["SourceRegions"], + }, + "source_type": {"type": "str", "aliases": ["SourceType"]}, "aws_organizations_source": { "type": "dict", "options": { - "organizational_units": {"type": "list", "elements": "str"}, - "organization_source_type": {"type": "str"}, + "organizational_units": { + "type": "list", + "elements": "str", + "aliases": ["OrganizationalUnits"], + }, + "organization_source_type": { + "type": "str", + "aliases": ["OrganizationSourceType"], + }, }, + "aliases": ["AwsOrganizationsSource"], }, }, + "aliases": ["SyncSource"], } - 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["bucket_name"] = {"type": "str", "aliases": ["BucketName"]} + argument_spec["bucket_region"] = {"type": "str", "aliases": ["BucketRegion"]} + argument_spec["sync_format"] = {"type": "str", "aliases": ["SyncFormat"]} + argument_spec["sync_name"] = {"type": "str", "aliases": ["SyncName"]} + argument_spec["sync_type"] = {"type": "str", "aliases": ["SyncType"]} + argument_spec["bucket_prefix"] = {"type": "str", "aliases": ["BucketPrefix"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -228,7 +286,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["sync_name"], True], + ["state", "present", ["sync_name", "SyncName"], True], ["state", "absent", ["sync_name"], True], ["state", "get", ["sync_name"], True], ] @@ -257,31 +315,32 @@ def main(): 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} + _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 alis 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 = [ - "kms_key_arn", - "sync_format", - "bucket_prefix", - "sync_name", - "bucket_region", - "bucket_name", - "s3_destination", - "sync_type", + "KMSKeyArn", + "SyncFormat", + "BucketPrefix", + "SyncName", + "BucketRegion", + "BucketName", + "S3Destination", + "SyncType", ] # 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"] + identifier = ["SyncName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/wafv2_ip_set.py b/plugins/modules/wafv2_ip_set.py index 904d64c8..2122f75d 100644 --- a/plugins/modules/wafv2_ip_set.py +++ b/plugins/modules/wafv2_ip_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""" @@ -18,11 +18,15 @@ - For more information see U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-wafv2-ipset.html). options: addresses: + aliases: + - Addresses description: - IP address. elements: str type: list description: + aliases: + - Description description: - Description of the entity. type: str @@ -36,6 +40,8 @@ be performed on it. type: bool id: + aliases: + - Id description: - Id of the IPSet. type: str @@ -47,6 +53,8 @@ - For more details, visit U(https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html). type: str ip_address_version: + aliases: + - IPAddressVersion choices: - IPV4 - IPV6 @@ -55,6 +63,8 @@ for C(IPV6) address. type: str name: + aliases: + - Name description: - Name of the IPSet. type: str @@ -64,6 +74,8 @@ - Remove tags not listed in I(tags). type: bool scope: + aliases: + - Scope choices: - CLOUDFRONT - REGIONAL @@ -89,7 +101,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -140,11 +152,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(): @@ -156,13 +169,25 @@ def main(): ), ) - 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["description"] = {"type": "str", "aliases": ["Description"]} + argument_spec["name"] = {"type": "str", "aliases": ["Name"]} + argument_spec["id"] = {"type": "str", "aliases": ["Id"]} + argument_spec["scope"] = { + "type": "str", + "choices": ["CLOUDFRONT", "REGIONAL"], + "aliases": ["Scope"], + } + argument_spec["ip_address_version"] = { + "type": "str", + "choices": ["IPV4", "IPV6"], + "aliases": ["IPAddressVersion"], + } + argument_spec["addresses"] = { + "type": "list", + "elements": "str", + "aliases": ["Addresses"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -175,11 +200,19 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["name", "id"], True], + ["state", "list", ["Name", "Id"], True], [ "state", "present", - ["addresses", "identifier", "scope", "id", "ip_address_version", "name"], + [ + "scope", + "IPAddressVersion", + "identifier", + "Addresses", + "name", + "id", + "Scope", + ], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], @@ -209,30 +242,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 alis 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", "scope"] + 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"] + 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") + 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.") diff --git a/plugins/modules/wafv2_logging_configuration.py b/plugins/modules/wafv2_logging_configuration.py index 92196171..1d83d32d 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", @@ -359,7 +448,12 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["resource_arn", "log_destination_configs"], True], + [ + "state", + "present", + ["ResourceArn", "LogDestinationConfigs", "resource_arn"], + True, + ], ["state", "absent", ["resource_arn"], True], ["state", "get", ["resource_arn"], True], ] @@ -383,22 +477,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 alis 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 = ["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 = ["ResourceArn"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/wafv2_regex_pattern_set.py b/plugins/modules/wafv2_regex_pattern_set.py index 7eb6e93c..b6300dfd 100644 --- a/plugins/modules/wafv2_regex_pattern_set.py +++ b/plugins/modules/wafv2_regex_pattern_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""" @@ -16,6 +16,8 @@ for a specific set of regular expression patterns. options: description: + aliases: + - Description description: - Description of the entity. type: str @@ -29,6 +31,8 @@ be performed on it. type: bool id: + aliases: + - Id description: - Id of the RegexPatternSet. type: str @@ -40,6 +44,8 @@ - For more details, visit U(https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-identifier.html). type: str name: + aliases: + - Name description: - Name of the RegexPatternSet. type: str @@ -49,11 +55,15 @@ - Remove tags not listed in I(tags). type: bool regular_expression_list: + aliases: + - RegularExpressionList description: - Not Provived. elements: str type: list scope: + aliases: + - Scope choices: - CLOUDFRONT - REGIONAL @@ -79,7 +89,7 @@ type: str tags: aliases: - - resource_tags + - Tags description: - A dict of tags to apply to the resource. - To remove all tags set I(tags={}) and I(purge_tags=true). @@ -130,11 +140,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(): @@ -146,12 +157,20 @@ def main(): ), ) - 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["description"] = {"type": "str", "aliases": ["Description"]} + argument_spec["name"] = {"type": "str", "aliases": ["Name"]} + argument_spec["id"] = {"type": "str", "aliases": ["Id"]} + argument_spec["regular_expression_list"] = { + "type": "list", + "elements": "str", + "aliases": ["RegularExpressionList"], + } + argument_spec["scope"] = { + "type": "str", + "choices": ["CLOUDFRONT", "REGIONAL"], + "aliases": ["Scope"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -164,11 +183,11 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["name", "id"], True], + ["state", "list", ["Name", "Id"], True], [ "state", "present", - ["regular_expression_list", "identifier", "scope", "id", "name"], + ["scope", "identifier", "RegularExpressionList", "name", "id", "Scope"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], @@ -197,30 +216,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 alis 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", "scope"] + 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"] + 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") + 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.") diff --git a/plugins/modules/wafv2_web_acl_association.py b/plugins/modules/wafv2_web_acl_association.py index a95140ef..126328cf 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"], @@ -130,8 +135,13 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["resource_arn"], True], - ["state", "present", ["web_acl_arn", "resource_arn", "identifier"], True], + ["state", "list", ["ResourceArn"], True], + [ + "state", + "present", + ["identifier", "WebACLArn", "ResourceArn", "web_acl_arn", "resource_arn"], + True, + ], ["state", "absent", ["resource_arn", "web_acl_arn", "identifier"], True], ["state", "get", ["resource_arn", "web_acl_arn", "identifier"], True], ] @@ -154,29 +164,28 @@ 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 alis 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 = ["ResourceArn", "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 = ["ResourceArn", "WebACLArn"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): - if not module.params.get("resource_arn") or not module.params.get( - "web_acl_arn" - ): + if not module.params.get("ResourceArn") or not module.params.get("WebACLArn"): module.fail_json(f"You must specify both {*identifier, } identifiers.") results = {"changed": False, "result": {}} diff --git a/tests/integration/targets/s3/tasks/main.yml b/tests/integration/targets/s3/tasks/main.yml index 8d31badb..13db84c3 100644 --- a/tests/integration/targets/s3/tasks/main.yml +++ b/tests/integration/targets/s3/tasks/main.yml @@ -9,7 +9,7 @@ - amazon.cloud block: - - name: Set S3 bucket name + - name: Set S3 bucket name set_fact: bucket_name: "{{ lookup('password', '/dev/null') | to_uuid }}" @@ -52,7 +52,7 @@ register: _result tags: - docs - + - assert: that: - _result is success @@ -127,14 +127,17 @@ register: _result tags: - docs - + - assert: that: - _result is success - _result is changed - "'diff' in _result" - _result.diff.after != {} - - _result.diff.before == {} + # public_access_block_configuration settings are now all true by default and + # they will be always returned by the API. That's why _result.diff.before won't be + # expected to be empty anymore. + # - _result.diff.before == {} - name: Update S3 bucket public access block configuration and tags - idempotence (diff=true) amazon.cloud.s3_bucket: @@ -224,9 +227,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.12.txt b/tests/sanity/ignore-2.12.txt index 103dcf38..0d450e7e 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -91,4 +91,3 @@ 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..0d450e7e 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -91,4 +91,3 @@ 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.14.txt b/tests/sanity/ignore-2.14.txt index 103dcf38..0d450e7e 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -91,4 +91,3 @@ 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.15.txt b/tests/sanity/ignore-2.15.txt index 63cd5a51..ff9c0297 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -8,87 +8,3 @@ 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 -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 -tools/update_constants.py shebang!skip 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) From 1aae5fe0abfb500358d613e7b6d2cb4a41ba15fd Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Fri, 30 Jun 2023 10:58:48 +0200 Subject: [PATCH 02/32] Handle camel_to_snake for required_if and mutually_exclusive Signed-off-by: Alina Buzachis --- plugins/module_utils/core.py | 39 +++++++------------ .../autoscaling_launch_configuration.py | 2 +- plugins/modules/autoscaling_lifecycle_hook.py | 15 +++---- plugins/modules/autoscaling_warm_pool.py | 2 +- plugins/modules/backup_backup_vault.py | 2 +- plugins/modules/backup_framework.py | 2 +- plugins/modules/backup_report_plan.py | 2 +- plugins/modules/cloudtrail_trail.py | 2 +- plugins/modules/cloudwatch_composite_alarm.py | 2 +- plugins/modules/cloudwatch_metric_stream.py | 7 +++- plugins/modules/dynamodb_global_table.py | 2 +- plugins/modules/ecs_capacity_provider.py | 2 +- ..._cluster_capacity_provider_associations.py | 7 +--- plugins/modules/ecs_primary_task_set.py | 15 +++---- plugins/modules/eks_addon.py | 15 +++---- plugins/modules/eks_cluster.py | 2 +- plugins/modules/eks_fargate_profile.py | 17 ++++---- plugins/modules/iam_instance_profile.py | 2 +- plugins/modules/iam_role.py | 2 +- plugins/modules/kms_alias.py | 2 +- plugins/modules/kms_replica_key.py | 2 +- plugins/modules/lambda_code_signing_config.py | 2 +- .../modules/lambda_event_source_mapping.py | 2 +- plugins/modules/lambda_function.py | 2 +- plugins/modules/logs_metric_filter.py | 17 ++++---- plugins/modules/logs_query_definition.py | 2 +- plugins/modules/logs_resource_policy.py | 2 +- plugins/modules/memorydb_acl.py | 2 +- plugins/modules/memorydb_cluster.py | 7 +--- plugins/modules/memorydb_parameter_group.py | 7 +--- plugins/modules/memorydb_subnet_group.py | 7 +--- plugins/modules/memorydb_user.py | 2 +- .../modules/rds_db_cluster_parameter_group.py | 2 +- plugins/modules/rds_db_proxy.py | 9 +---- plugins/modules/rds_db_proxy_endpoint.py | 7 +--- plugins/modules/rds_db_subnet_group.py | 2 +- plugins/modules/rds_option_group.py | 6 +-- plugins/modules/redshift_cluster.py | 10 ++--- plugins/modules/redshift_endpoint_access.py | 7 ++-- .../redshift_endpoint_authorization.py | 23 ++++------- .../modules/redshift_event_subscription.py | 2 +- plugins/modules/redshift_scheduled_action.py | 2 +- plugins/modules/route53_dnssec.py | 2 +- plugins/modules/route53_key_signing_key.py | 16 ++++---- plugins/modules/s3_access_point.py | 2 +- .../modules/s3_multi_region_access_point.py | 2 +- .../s3_multi_region_access_point_policy.py | 2 +- .../modules/s3objectlambda_access_point.py | 2 +- .../s3objectlambda_access_point_policy.py | 7 +--- plugins/modules/ssm_document.py | 2 +- plugins/modules/ssm_resource_data_sync.py | 2 +- plugins/modules/wafv2_ip_set.py | 22 ++++------- .../modules/wafv2_logging_configuration.py | 7 +--- plugins/modules/wafv2_regex_pattern_set.py | 14 ++++--- plugins/modules/wafv2_web_acl_association.py | 17 ++++---- 55 files changed, 148 insertions(+), 214 deletions(-) diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index 312a023c..2355ecb2 100644 --- a/plugins/module_utils/core.py +++ b/plugins/module_utils/core.py @@ -153,9 +153,9 @@ 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) + additional_properties[id] = self.module.params.get( + camel_to_snake(id) + ) params["ResourceModel"] = json.dumps(additional_properties) if i == 0 or "NextToken" in response: @@ -263,19 +263,12 @@ def present( ) -> bool: results = {"changed": False, "result": {}} create_only_params = create_only_params or [] - identifier: Dict = {} - resource = None if "PromotionTier" in params: params.pop("PromotionTier") - if self.module.params.get("identifier"): - identifier = self.module.params.get("identifier") - else: - for id in primary_identifier: - identifier[id] = self.module.params.get(camel_to_snake(id)) - identifier = json.dumps(identifier) + identifier = self.get_identifier(primary_identifier) try: resource = self.client.get_resource( @@ -360,15 +353,10 @@ def wait_for_in_progress_requests( def absent(self, type_name: str, primary_identifier: List): changed: bool = False - identifier: Dict = {} response: Dict = {} - if self.module.params.get("identifier"): - identifier = self.module.params.get("identifier") - else: - for id in primary_identifier: - identifier[id] = self.module.params.get(camel_to_snake(id)) - identifier = json.dumps(identifier) + identifier = self.get_identifier(primary_identifier) + try: response = self.client.get_resource( TypeName=type_name, Identifier=identifier, aws_retry=True @@ -529,14 +517,13 @@ def update_resource( return results - def get_identifier(self, identifier: dict, primary_identifier: list): - 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) + def get_identifier(self, primary_identifier: list): + identifier: Dict = {} + if self.module.params.get("identifier"): + identifier = self.module.params.get("identifier") + else: + for id in primary_identifier: + identifier[id] = self.module.params.get(camel_to_snake(id)) return json.dumps(identifier) diff --git a/plugins/modules/autoscaling_launch_configuration.py b/plugins/modules/autoscaling_launch_configuration.py index 7a7ac164..6b06fd28 100644 --- a/plugins/modules/autoscaling_launch_configuration.py +++ b/plugins/modules/autoscaling_launch_configuration.py @@ -420,7 +420,7 @@ def main(): [ "state", "present", - ["InstanceType", "launch_configuration_name", "ImageId"], + ["instance_type", "launch_configuration_name", "image_id"], True, ], ["state", "absent", ["launch_configuration_name"], True], diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index 6ca5e338..c5460836 100644 --- a/plugins/modules/autoscaling_lifecycle_hook.py +++ b/plugins/modules/autoscaling_lifecycle_hook.py @@ -216,16 +216,15 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["AutoScalingGroupName"], True], + ["state", "list", ["auto_scaling_group_name"], True], [ "state", "present", [ - "AutoScalingGroupName", + "auto_scaling_group_name", "identifier", + "lifecycle_transition", "lifecycle_hook_name", - "LifecycleTransition", - "auto_scaling_group_name", ], True, ], @@ -290,10 +289,12 @@ def main(): state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): - if not module.params.get("AutoScalingGroupName") or not module.params.get( - "LifecycleHookName" + 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( + f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/autoscaling_warm_pool.py b/plugins/modules/autoscaling_warm_pool.py index ca0e42c5..4a85a5d2 100644 --- a/plugins/modules/autoscaling_warm_pool.py +++ b/plugins/modules/autoscaling_warm_pool.py @@ -169,7 +169,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["auto_scaling_group_name", "AutoScalingGroupName"], True], + ["state", "present", ["auto_scaling_group_name"], True], ["state", "absent", ["auto_scaling_group_name"], True], ["state", "get", ["auto_scaling_group_name"], True], ] diff --git a/plugins/modules/backup_backup_vault.py b/plugins/modules/backup_backup_vault.py index a08f1e70..240b13f5 100644 --- a/plugins/modules/backup_backup_vault.py +++ b/plugins/modules/backup_backup_vault.py @@ -225,7 +225,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["backup_vault_name", "BackupVaultName"], True], + ["state", "present", ["backup_vault_name"], True], ["state", "absent", ["backup_vault_name"], True], ["state", "get", ["backup_vault_name"], True], ] diff --git a/plugins/modules/backup_framework.py b/plugins/modules/backup_framework.py index 6c3fe275..62aaa9af 100644 --- a/plugins/modules/backup_framework.py +++ b/plugins/modules/backup_framework.py @@ -324,7 +324,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["framework_arn", "FrameworkControls"], True], + ["state", "present", ["framework_controls", "framework_arn"], True], ["state", "absent", ["framework_arn"], True], ["state", "get", ["framework_arn"], True], ] diff --git a/plugins/modules/backup_report_plan.py b/plugins/modules/backup_report_plan.py index 9a6ccfb3..30fdbb50 100644 --- a/plugins/modules/backup_report_plan.py +++ b/plugins/modules/backup_report_plan.py @@ -296,7 +296,7 @@ def main(): [ "state", "present", - ["ReportDeliveryChannel", "ReportSetting", "report_plan_arn"], + ["report_delivery_channel", "report_setting", "report_plan_arn"], True, ], ["state", "absent", ["report_plan_arn"], True], diff --git a/plugins/modules/cloudtrail_trail.py b/plugins/modules/cloudtrail_trail.py index 1c3d5ba4..94f4583a 100644 --- a/plugins/modules/cloudtrail_trail.py +++ b/plugins/modules/cloudtrail_trail.py @@ -518,7 +518,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["trail_name", "IsLogging", "S3BucketName"], True], + ["state", "present", ["is_logging", "trail_name", "s3_bucket_name"], True], ["state", "absent", ["trail_name"], True], ["state", "get", ["trail_name"], True], ] diff --git a/plugins/modules/cloudwatch_composite_alarm.py b/plugins/modules/cloudwatch_composite_alarm.py index 3e8ab9c3..c150ff33 100644 --- a/plugins/modules/cloudwatch_composite_alarm.py +++ b/plugins/modules/cloudwatch_composite_alarm.py @@ -219,7 +219,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["AlarmRule", "alarm_name"], True], + ["state", "present", ["alarm_name", "alarm_rule"], True], ["state", "absent", ["alarm_name"], True], ["state", "get", ["alarm_name"], True], ] diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index 233d8046..c86f7575 100644 --- a/plugins/modules/cloudwatch_metric_stream.py +++ b/plugins/modules/cloudwatch_metric_stream.py @@ -302,7 +302,12 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["OutputFormat", "RoleArn", "FirehoseArn", "name"], True], + [ + "state", + "present", + ["firehose_arn", "name", "output_format", "role_arn"], + True, + ], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/dynamodb_global_table.py b/plugins/modules/dynamodb_global_table.py index 20f1e35e..ac889940 100644 --- a/plugins/modules/dynamodb_global_table.py +++ b/plugins/modules/dynamodb_global_table.py @@ -1042,7 +1042,7 @@ def main(): [ "state", "present", - ["table_name", "Replicas", "KeySchema", "AttributeDefinitions"], + ["attribute_definitions", "table_name", "replicas", "key_schema"], True, ], ["state", "absent", ["table_name"], True], diff --git a/plugins/modules/ecs_capacity_provider.py b/plugins/modules/ecs_capacity_provider.py index a98e3150..cd4377aa 100644 --- a/plugins/modules/ecs_capacity_provider.py +++ b/plugins/modules/ecs_capacity_provider.py @@ -236,7 +236,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["AutoScalingGroupProvider", "name"], True], + ["state", "present", ["auto_scaling_group_provider", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/ecs_cluster_capacity_provider_associations.py b/plugins/modules/ecs_cluster_capacity_provider_associations.py index 16fefd9f..342219c9 100644 --- a/plugins/modules/ecs_cluster_capacity_provider_associations.py +++ b/plugins/modules/ecs_cluster_capacity_provider_associations.py @@ -200,12 +200,7 @@ def main(): [ "state", "present", - [ - "cluster", - "CapacityProviders", - "DefaultCapacityProviderStrategy", - "Cluster", - ], + ["capacity_providers", "cluster", "default_capacity_provider_strategy"], True, ], ["state", "absent", ["cluster"], True], diff --git a/plugins/modules/ecs_primary_task_set.py b/plugins/modules/ecs_primary_task_set.py index 5f709442..75f4facd 100644 --- a/plugins/modules/ecs_primary_task_set.py +++ b/plugins/modules/ecs_primary_task_set.py @@ -145,13 +145,8 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["Cluster"], True], - [ - "state", - "present", - ["cluster", "Service", "Cluster", "identifier", "TaskSetId", "service"], - True, - ], + ["state", "list", ["cluster"], True], + ["state", "present", ["identifier", "cluster", "task_set_id", "service"], True], ["state", "absent", ["cluster", "service", "identifier"], True], ["state", "get", ["cluster", "service", "identifier"], True], ] @@ -196,8 +191,10 @@ def main(): 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.") + if not module.params.get("cluster") or not module.params.get("service"): + module.fail_json( + f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/eks_addon.py b/plugins/modules/eks_addon.py index b294d502..16d4076c 100644 --- a/plugins/modules/eks_addon.py +++ b/plugins/modules/eks_addon.py @@ -203,13 +203,8 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["ClusterName"], True], - [ - "state", - "present", - ["addon_name", "AddonName", "identifier", "ClusterName", "cluster_name"], - True, - ], + ["state", "list", ["cluster_name"], True], + ["state", "present", ["identifier", "addon_name", "cluster_name"], True], ["state", "absent", ["cluster_name", "addon_name", "identifier"], True], ["state", "get", ["cluster_name", "addon_name", "identifier"], True], ] @@ -259,8 +254,10 @@ def main(): state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): - if not module.params.get("ClusterName") or not module.params.get("AddonName"): - module.fail_json(f"You must specify both {*identifier, } identifiers.") + if not module.params.get("cluster_name") or not module.params.get("addon_name"): + module.fail_json( + f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/eks_cluster.py b/plugins/modules/eks_cluster.py index c96dd750..d43250ae 100644 --- a/plugins/modules/eks_cluster.py +++ b/plugins/modules/eks_cluster.py @@ -455,7 +455,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["ResourcesVpcConfig", "RoleArn", "name"], True], + ["state", "present", ["name", "resources_vpc_config", "role_arn"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/eks_fargate_profile.py b/plugins/modules/eks_fargate_profile.py index cb82e3b7..6158b564 100644 --- a/plugins/modules/eks_fargate_profile.py +++ b/plugins/modules/eks_fargate_profile.py @@ -225,17 +225,16 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["ClusterName"], True], + ["state", "list", ["cluster_name"], True], [ "state", "present", [ - "PodExecutionRoleArn", - "identifier", - "Selectors", - "ClusterName", "cluster_name", + "selectors", "fargate_profile_name", + "pod_execution_role_arn", + "identifier", ], True, ], @@ -297,10 +296,12 @@ def main(): state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): - if not module.params.get("ClusterName") or not module.params.get( - "FargateProfileName" + 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( + f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/iam_instance_profile.py b/plugins/modules/iam_instance_profile.py index f9c0ec8e..5d916efa 100644 --- a/plugins/modules/iam_instance_profile.py +++ b/plugins/modules/iam_instance_profile.py @@ -139,7 +139,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["Roles", "instance_profile_name"], True], + ["state", "present", ["roles", "instance_profile_name"], True], ["state", "absent", ["instance_profile_name"], True], ["state", "get", ["instance_profile_name"], True], ] diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index 06b756fb..e063b91b 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -222,7 +222,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["AssumeRolePolicyDocument", "role_name"], True], + ["state", "present", ["role_name", "assume_role_policy_document"], True], ["state", "absent", ["role_name"], True], ["state", "get", ["role_name"], True], ] diff --git a/plugins/modules/kms_alias.py b/plugins/modules/kms_alias.py index 5a357bfb..3cf7e5e2 100644 --- a/plugins/modules/kms_alias.py +++ b/plugins/modules/kms_alias.py @@ -132,7 +132,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["AliasName", "alias_name", "TargetKeyId"], True], + ["state", "present", ["alias_name", "target_key_id"], True], ["state", "absent", ["alias_name"], True], ["state", "get", ["alias_name"], True], ] diff --git a/plugins/modules/kms_replica_key.py b/plugins/modules/kms_replica_key.py index daf72458..12d4a040 100644 --- a/plugins/modules/kms_replica_key.py +++ b/plugins/modules/kms_replica_key.py @@ -182,7 +182,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["KeyPolicy", "key_id", "PrimaryKeyArn"], True], + ["state", "present", ["key_id", "key_policy", "primary_key_arn"], True], ["state", "absent", ["key_id"], True], ["state", "get", ["key_id"], True], ] diff --git a/plugins/modules/lambda_code_signing_config.py b/plugins/modules/lambda_code_signing_config.py index 9e24bcd2..05e174ec 100644 --- a/plugins/modules/lambda_code_signing_config.py +++ b/plugins/modules/lambda_code_signing_config.py @@ -188,7 +188,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["code_signing_config_arn", "AllowedPublishers"], True], + ["state", "present", ["allowed_publishers", "code_signing_config_arn"], True], ["state", "absent", ["code_signing_config_arn"], True], ["state", "get", ["code_signing_config_arn"], True], ] diff --git a/plugins/modules/lambda_event_source_mapping.py b/plugins/modules/lambda_event_source_mapping.py index 0419ad70..0b11ce86 100644 --- a/plugins/modules/lambda_event_source_mapping.py +++ b/plugins/modules/lambda_event_source_mapping.py @@ -533,7 +533,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["FunctionName", "id"], True], + ["state", "present", ["function_name", "id"], True], ["state", "absent", ["id"], True], ["state", "get", ["id"], True], ] diff --git a/plugins/modules/lambda_function.py b/plugins/modules/lambda_function.py index 77d579db..d1f642fc 100644 --- a/plugins/modules/lambda_function.py +++ b/plugins/modules/lambda_function.py @@ -545,7 +545,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["function_name", "Role", "Code"], True], + ["state", "present", ["code", "function_name", "role"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index a823f2f5..eb18ec4e 100644 --- a/plugins/modules/logs_metric_filter.py +++ b/plugins/modules/logs_metric_filter.py @@ -297,17 +297,16 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["LogGroupName"], True], + ["state", "list", ["log_group_name"], True], [ "state", "present", [ - "FilterPattern", - "identifier", "log_group_name", + "filter_pattern", "filter_name", - "LogGroupName", - "MetricTransformations", + "identifier", + "metric_transformations", ], True, ], @@ -356,8 +355,12 @@ def main(): state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): - if not module.params.get("LogGroupName") or not module.params.get("FilterName"): - module.fail_json(f"You must specify both {*identifier, } identifiers.") + if not module.params.get("log_group_name") or not module.params.get( + "filter_name" + ): + module.fail_json( + f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/logs_query_definition.py b/plugins/modules/logs_query_definition.py index 2d41d769..b905662d 100644 --- a/plugins/modules/logs_query_definition.py +++ b/plugins/modules/logs_query_definition.py @@ -147,7 +147,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["query_definition_id", "Name", "QueryString"], True], + ["state", "present", ["name", "query_string", "query_definition_id"], True], ["state", "absent", ["query_definition_id"], True], ["state", "get", ["query_definition_id"], True], ] diff --git a/plugins/modules/logs_resource_policy.py b/plugins/modules/logs_resource_policy.py index 437a3cf0..9dabc074 100644 --- a/plugins/modules/logs_resource_policy.py +++ b/plugins/modules/logs_resource_policy.py @@ -126,7 +126,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["PolicyName", "PolicyDocument", "policy_name"], True], + ["state", "present", ["policy_document", "policy_name"], True], ["state", "absent", ["policy_name"], True], ["state", "get", ["policy_name"], True], ] diff --git a/plugins/modules/memorydb_acl.py b/plugins/modules/memorydb_acl.py index 12efa4d5..f9f703e7 100644 --- a/plugins/modules/memorydb_acl.py +++ b/plugins/modules/memorydb_acl.py @@ -164,7 +164,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["acl_name", "ACLName"], True], + ["state", "present", ["acl_name"], True], ["state", "absent", ["acl_name"], True], ["state", "get", ["acl_name"], True], ] diff --git a/plugins/modules/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index 416265e4..fe5e6548 100644 --- a/plugins/modules/memorydb_cluster.py +++ b/plugins/modules/memorydb_cluster.py @@ -376,12 +376,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - [ - "state", - "present", - ["NodeType", "ACLName", "cluster_name", "ClusterName"], - True, - ], + ["state", "present", ["node_type", "acl_name", "cluster_name"], True], ["state", "absent", ["cluster_name"], True], ["state", "get", ["cluster_name"], True], ] diff --git a/plugins/modules/memorydb_parameter_group.py b/plugins/modules/memorydb_parameter_group.py index 97eebbea..46c34ef3 100644 --- a/plugins/modules/memorydb_parameter_group.py +++ b/plugins/modules/memorydb_parameter_group.py @@ -176,12 +176,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - [ - "state", - "present", - ["parameter_group_name", "Family", "ParameterGroupName"], - True, - ], + ["state", "present", ["parameter_group_name", "family"], True], ["state", "absent", ["parameter_group_name"], True], ["state", "get", ["parameter_group_name"], True], ] diff --git a/plugins/modules/memorydb_subnet_group.py b/plugins/modules/memorydb_subnet_group.py index abcae2eb..fc805b2e 100644 --- a/plugins/modules/memorydb_subnet_group.py +++ b/plugins/modules/memorydb_subnet_group.py @@ -175,12 +175,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - [ - "state", - "present", - ["subnet_group_name", "SubnetGroupName", "SubnetIds"], - True, - ], + ["state", "present", ["subnet_group_name", "subnet_ids"], True], ["state", "absent", ["subnet_group_name"], True], ["state", "get", ["subnet_group_name"], True], ] diff --git a/plugins/modules/memorydb_user.py b/plugins/modules/memorydb_user.py index bb5b1c0b..ffdec4d9 100644 --- a/plugins/modules/memorydb_user.py +++ b/plugins/modules/memorydb_user.py @@ -181,7 +181,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["user_name", "UserName"], True], + ["state", "present", ["user_name"], True], ["state", "absent", ["user_name"], True], ["state", "get", ["user_name"], True], ] diff --git a/plugins/modules/rds_db_cluster_parameter_group.py b/plugins/modules/rds_db_cluster_parameter_group.py index 5ee46f86..c86891a6 100644 --- a/plugins/modules/rds_db_cluster_parameter_group.py +++ b/plugins/modules/rds_db_cluster_parameter_group.py @@ -165,7 +165,7 @@ def main(): [ "state", "present", - ["Description", "Family", "db_cluster_parameter_group_name", "Parameters"], + ["parameters", "db_cluster_parameter_group_name", "description", "family"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], diff --git a/plugins/modules/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index eff2cb28..763b576b 100644 --- a/plugins/modules/rds_db_proxy.py +++ b/plugins/modules/rds_db_proxy.py @@ -298,14 +298,7 @@ def main(): [ "state", "present", - [ - "EngineFamily", - "RoleArn", - "VpcSubnetIds", - "Auth", - "DBProxyName", - "db_proxy_name", - ], + ["auth", "vpc_subnet_ids", "db_proxy_name", "role_arn", "engine_family"], True, ], ["state", "absent", ["db_proxy_name"], True], diff --git a/plugins/modules/rds_db_proxy_endpoint.py b/plugins/modules/rds_db_proxy_endpoint.py index 5a35639a..1bda3416 100644 --- a/plugins/modules/rds_db_proxy_endpoint.py +++ b/plugins/modules/rds_db_proxy_endpoint.py @@ -190,12 +190,7 @@ def main(): [ "state", "present", - [ - "DBProxyEndpointName", - "DBProxyName", - "VpcSubnetIds", - "db_proxy_endpoint_name", - ], + ["vpc_subnet_ids", "db_proxy_name", "db_proxy_endpoint_name"], True, ], ["state", "absent", ["db_proxy_endpoint_name"], True], diff --git a/plugins/modules/rds_db_subnet_group.py b/plugins/modules/rds_db_subnet_group.py index 59996ab0..eaa3a3b2 100644 --- a/plugins/modules/rds_db_subnet_group.py +++ b/plugins/modules/rds_db_subnet_group.py @@ -162,7 +162,7 @@ def main(): [ "state", "present", - ["DBSubnetGroupDescription", "db_subnet_group_name", "SubnetIds"], + ["db_subnet_group_description", "subnet_ids", "db_subnet_group_name"], True, ], ["state", "absent", ["db_subnet_group_name"], True], diff --git a/plugins/modules/rds_option_group.py b/plugins/modules/rds_option_group.py index 5f8b49ec..a2874d5d 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -256,10 +256,10 @@ def main(): "state", "present", [ - "MajorEngineVersion", - "EngineName", - "OptionGroupDescription", "option_group_name", + "engine_name", + "major_engine_version", + "option_group_description", ], True, ], diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index 1323aed6..be3ece5f 100644 --- a/plugins/modules/redshift_cluster.py +++ b/plugins/modules/redshift_cluster.py @@ -649,12 +649,12 @@ def main(): "state", "present", [ - "MasterUserPassword", - "DBName", - "ClusterType", "cluster_identifier", - "MasterUsername", - "NodeType", + "master_user_password", + "node_type", + "cluster_type", + "master_username", + "db_name", ], True, ], diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index 2a0c93a9..62ea7f96 100644 --- a/plugins/modules/redshift_endpoint_access.py +++ b/plugins/modules/redshift_endpoint_access.py @@ -163,11 +163,10 @@ def main(): "state", "present", [ - "EndpointName", - "VpcSecurityGroupIds", - "SubnetGroupName", + "subnet_group_name", + "cluster_identifier", "endpoint_name", - "ClusterIdentifier", + "vpc_security_group_ids", ], True, ], diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index bfe5aaee..dfe2cf3b 100644 --- a/plugins/modules/redshift_endpoint_authorization.py +++ b/plugins/modules/redshift_endpoint_authorization.py @@ -150,19 +150,8 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["ClusterIdentifier"], True], - [ - "state", - "present", - [ - "Account", - "cluster_identifier", - "identifier", - "ClusterIdentifier", - "account", - ], - True, - ], + ["state", "list", ["cluster_identifier"], True], + ["state", "present", ["identifier", "cluster_identifier", "account"], True], ["state", "absent", ["cluster_identifier", "account", "identifier"], True], ["state", "get", ["cluster_identifier", "account", "identifier"], True], ] @@ -207,10 +196,12 @@ def main(): state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): - if not module.params.get("ClusterIdentifier") or not module.params.get( - "Account" + 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( + f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_event_subscription.py b/plugins/modules/redshift_event_subscription.py index 2b57cb3f..cd815160 100644 --- a/plugins/modules/redshift_event_subscription.py +++ b/plugins/modules/redshift_event_subscription.py @@ -221,7 +221,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["SubscriptionName", "subscription_name"], True], + ["state", "present", ["subscription_name"], True], ["state", "absent", ["subscription_name"], True], ["state", "get", ["subscription_name"], True], ] diff --git a/plugins/modules/redshift_scheduled_action.py b/plugins/modules/redshift_scheduled_action.py index 6c9b95c4..813af3a6 100644 --- a/plugins/modules/redshift_scheduled_action.py +++ b/plugins/modules/redshift_scheduled_action.py @@ -288,7 +288,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["scheduled_action_name", "ScheduledActionName"], True], + ["state", "present", ["scheduled_action_name"], True], ["state", "absent", ["scheduled_action_name"], True], ["state", "get", ["scheduled_action_name"], True], ] diff --git a/plugins/modules/route53_dnssec.py b/plugins/modules/route53_dnssec.py index b956e73e..db281e32 100644 --- a/plugins/modules/route53_dnssec.py +++ b/plugins/modules/route53_dnssec.py @@ -118,7 +118,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["HostedZoneId", "hosted_zone_id"], True], + ["state", "present", ["hosted_zone_id"], True], ["state", "absent", ["hosted_zone_id"], True], ["state", "get", ["hosted_zone_id"], True], ] diff --git a/plugins/modules/route53_key_signing_key.py b/plugins/modules/route53_key_signing_key.py index c952edbe..7c27f97a 100644 --- a/plugins/modules/route53_key_signing_key.py +++ b/plugins/modules/route53_key_signing_key.py @@ -161,18 +161,16 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["HostedZoneId"], True], + ["state", "list", ["hosted_zone_id"], True], [ "state", "present", [ - "HostedZoneId", - "Name", - "Status", - "identifier", "hosted_zone_id", "name", - "KeyManagementServiceArn", + "key_management_service_arn", + "status", + "identifier", ], True, ], @@ -223,8 +221,10 @@ def main(): state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): - if not module.params.get("HostedZoneId") or not module.params.get("Name"): - module.fail_json(f"You must specify both {*identifier, } identifiers.") + if not module.params.get("hosted_zone_id") or not module.params.get("name"): + module.fail_json( + f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/s3_access_point.py b/plugins/modules/s3_access_point.py index 2bf08bdb..a0f1d487 100644 --- a/plugins/modules/s3_access_point.py +++ b/plugins/modules/s3_access_point.py @@ -237,7 +237,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["Bucket", "name"], True], + ["state", "present", ["name", "bucket"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/s3_multi_region_access_point.py b/plugins/modules/s3_multi_region_access_point.py index c5fc3781..288aefc2 100644 --- a/plugins/modules/s3_multi_region_access_point.py +++ b/plugins/modules/s3_multi_region_access_point.py @@ -222,7 +222,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["Regions", "name"], True], + ["state", "present", ["name", "regions"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/s3_multi_region_access_point_policy.py b/plugins/modules/s3_multi_region_access_point_policy.py index 02bd3671..f720a9f1 100644 --- a/plugins/modules/s3_multi_region_access_point_policy.py +++ b/plugins/modules/s3_multi_region_access_point_policy.py @@ -126,7 +126,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["mrap_name", "MrapName", "Policy"], True], + ["state", "present", ["mrap_name", "policy"], True], ["state", "absent", ["mrap_name"], True], ["state", "get", ["mrap_name"], True], ] diff --git a/plugins/modules/s3objectlambda_access_point.py b/plugins/modules/s3objectlambda_access_point.py index 86774f0c..571b4046 100644 --- a/plugins/modules/s3objectlambda_access_point.py +++ b/plugins/modules/s3objectlambda_access_point.py @@ -244,7 +244,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["ObjectLambdaConfiguration", "name"], True], + ["state", "present", ["name", "object_lambda_configuration"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/s3objectlambda_access_point_policy.py b/plugins/modules/s3objectlambda_access_point_policy.py index fea0f77c..b7ee5303 100644 --- a/plugins/modules/s3objectlambda_access_point_policy.py +++ b/plugins/modules/s3objectlambda_access_point_policy.py @@ -130,12 +130,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - [ - "state", - "present", - ["PolicyDocument", "ObjectLambdaAccessPoint", "object_lambda_access_point"], - True, - ], + ["state", "present", ["policy_document", "object_lambda_access_point"], True], ["state", "absent", ["object_lambda_access_point"], True], ["state", "get", ["object_lambda_access_point"], True], ] diff --git a/plugins/modules/ssm_document.py b/plugins/modules/ssm_document.py index 0b93e5bc..57c3090b 100644 --- a/plugins/modules/ssm_document.py +++ b/plugins/modules/ssm_document.py @@ -312,7 +312,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["Content", "name"], True], + ["state", "present", ["content", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/ssm_resource_data_sync.py b/plugins/modules/ssm_resource_data_sync.py index bf6090ab..f44a9e7d 100644 --- a/plugins/modules/ssm_resource_data_sync.py +++ b/plugins/modules/ssm_resource_data_sync.py @@ -286,7 +286,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["sync_name", "SyncName"], True], + ["state", "present", ["sync_name"], True], ["state", "absent", ["sync_name"], True], ["state", "get", ["sync_name"], True], ] diff --git a/plugins/modules/wafv2_ip_set.py b/plugins/modules/wafv2_ip_set.py index 2122f75d..99b4dfdf 100644 --- a/plugins/modules/wafv2_ip_set.py +++ b/plugins/modules/wafv2_ip_set.py @@ -200,19 +200,11 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["Name", "Id"], True], + ["state", "list", ["name", "id"], True], [ "state", "present", - [ - "scope", - "IPAddressVersion", - "identifier", - "Addresses", - "name", - "id", - "Scope", - ], + ["scope", "ip_address_version", "name", "addresses", "id", "identifier"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], @@ -264,11 +256,13 @@ def main(): 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") + 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.") + module.fail_json( + f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/wafv2_logging_configuration.py b/plugins/modules/wafv2_logging_configuration.py index 1d83d32d..1ebd1c6f 100644 --- a/plugins/modules/wafv2_logging_configuration.py +++ b/plugins/modules/wafv2_logging_configuration.py @@ -448,12 +448,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - [ - "state", - "present", - ["ResourceArn", "LogDestinationConfigs", "resource_arn"], - True, - ], + ["state", "present", ["log_destination_configs", "resource_arn"], True], ["state", "absent", ["resource_arn"], True], ["state", "get", ["resource_arn"], True], ] diff --git a/plugins/modules/wafv2_regex_pattern_set.py b/plugins/modules/wafv2_regex_pattern_set.py index b6300dfd..c94a898e 100644 --- a/plugins/modules/wafv2_regex_pattern_set.py +++ b/plugins/modules/wafv2_regex_pattern_set.py @@ -183,11 +183,11 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["Name", "Id"], True], + ["state", "list", ["name", "id"], True], [ "state", "present", - ["scope", "identifier", "RegularExpressionList", "name", "id", "Scope"], + ["regular_expression_list", "scope", "name", "id", "identifier"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], @@ -238,11 +238,13 @@ def main(): 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") + 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.") + module.fail_json( + f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/wafv2_web_acl_association.py b/plugins/modules/wafv2_web_acl_association.py index 126328cf..303e5614 100644 --- a/plugins/modules/wafv2_web_acl_association.py +++ b/plugins/modules/wafv2_web_acl_association.py @@ -135,13 +135,8 @@ def main(): argument_spec["identifier"] = {"type": "str"} required_if = [ - ["state", "list", ["ResourceArn"], True], - [ - "state", - "present", - ["identifier", "WebACLArn", "ResourceArn", "web_acl_arn", "resource_arn"], - True, - ], + ["state", "list", ["resource_arn"], True], + ["state", "present", ["identifier", "web_acl_arn", "resource_arn"], True], ["state", "absent", ["resource_arn", "web_acl_arn", "identifier"], True], ["state", "get", ["resource_arn", "web_acl_arn", "identifier"], True], ] @@ -185,8 +180,12 @@ def main(): state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None ): - if not module.params.get("ResourceArn") or not module.params.get("WebACLArn"): - module.fail_json(f"You must specify both {*identifier, } identifiers.") + if not module.params.get("resource_arn") or not module.params.get( + "web_acl_arn" + ): + module.fail_json( + f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + ) results = {"changed": False, "result": {}} From a77ad204dbd3a31dd242312430dea2b37330d785 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Fri, 30 Jun 2023 11:27:48 +0200 Subject: [PATCH 03/32] Cleanup documentation Signed-off-by: Alina Buzachis --- plugins/module_utils/core.py | 26 ++++++++++--------- .../autoscaling_launch_configuration.py | 2 +- plugins/modules/autoscaling_lifecycle_hook.py | 4 +-- plugins/modules/backup_backup_vault.py | 3 ++- plugins/modules/backup_framework.py | 5 ++-- plugins/modules/backup_report_plan.py | 5 ++-- .../modules/cloudtrail_event_data_store.py | 3 ++- plugins/modules/cloudtrail_trail.py | 3 ++- plugins/modules/cloudwatch_metric_stream.py | 5 ++-- plugins/modules/dynamodb_global_table.py | 2 +- plugins/modules/ec2_placement_group.py | 3 ++- plugins/modules/ecr_repository.py | 3 ++- plugins/modules/ecs_capacity_provider.py | 5 ++-- plugins/modules/ecs_cluster.py | 3 ++- ..._cluster_capacity_provider_associations.py | 2 +- plugins/modules/ecs_primary_task_set.py | 2 +- plugins/modules/eks_addon.py | 5 ++-- plugins/modules/eks_cluster.py | 5 ++-- plugins/modules/eks_fargate_profile.py | 7 ++--- plugins/modules/iam_instance_profile.py | 2 +- plugins/modules/iam_role.py | 3 ++- plugins/modules/iam_server_certificate.py | 3 ++- plugins/modules/kms_alias.py | 2 +- plugins/modules/kms_replica_key.py | 5 ++-- .../modules/lambda_event_source_mapping.py | 2 +- plugins/modules/lambda_function.py | 5 ++-- plugins/modules/logs_log_group.py | 3 ++- plugins/modules/logs_metric_filter.py | 12 +++------ plugins/modules/logs_query_definition.py | 2 +- plugins/modules/logs_resource_policy.py | 2 +- plugins/modules/memorydb_acl.py | 5 ++-- plugins/modules/memorydb_cluster.py | 5 ++-- plugins/modules/memorydb_parameter_group.py | 3 ++- plugins/modules/memorydb_subnet_group.py | 5 ++-- plugins/modules/memorydb_user.py | 11 +++----- .../modules/rds_db_cluster_parameter_group.py | 5 ++-- plugins/modules/rds_db_instance.py | 3 ++- plugins/modules/rds_db_proxy.py | 5 ++-- plugins/modules/rds_db_proxy_endpoint.py | 5 ++-- plugins/modules/rds_db_subnet_group.py | 5 ++-- plugins/modules/rds_option_group.py | 7 ++--- plugins/modules/redshift_cluster.py | 9 ++++--- plugins/modules/redshift_endpoint_access.py | 2 +- .../redshift_endpoint_authorization.py | 2 +- .../modules/redshift_event_subscription.py | 3 ++- plugins/modules/route53_key_signing_key.py | 4 +-- plugins/modules/s3_bucket.py | 3 ++- .../s3objectlambda_access_point_policy.py | 2 +- plugins/modules/ssm_document.py | 3 ++- plugins/modules/wafv2_ip_set.py | 5 ++-- plugins/modules/wafv2_regex_pattern_set.py | 5 ++-- plugins/modules/wafv2_web_acl_association.py | 2 +- 52 files changed, 128 insertions(+), 105 deletions(-) diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index 2355ecb2..2f5996b5 100644 --- a/plugins/module_utils/core.py +++ b/plugins/module_utils/core.py @@ -230,12 +230,9 @@ def get_resource( ) -> List: # This is the "describe" equivalent for AWS Cloud Control API response: Dict = {} - identifier: Dict = {} if isinstance(primary_identifier, list): - for id in primary_identifier: - identifier[id] = self.module.params.get(camel_to_snake(id)) - primary_identifier = json.dumps(identifier) + primary_identifier = self.get_identifier(primary_identifier) elif isinstance(primary_identifier, dict): primary_identifier = json.dumps(primary_identifier) try: @@ -264,11 +261,15 @@ def present( results = {"changed": False, "result": {}} create_only_params = create_only_params or [] resource = None + identifier: Dict = {} if "PromotionTier" in params: params.pop("PromotionTier") - identifier = self.get_identifier(primary_identifier) + if self.module.params.get("identifier"): + identifier = self.module.params.get("identifier") + else: + identifier = self.get_identifier(primary_identifier) try: resource = self.client.get_resource( @@ -353,9 +354,13 @@ def wait_for_in_progress_requests( def absent(self, type_name: str, primary_identifier: List): changed: bool = False + identifier: Dict = {} response: Dict = {} - identifier = self.get_identifier(primary_identifier) + if self.module.params.get("identifier"): + identifier = self.module.params.get("identifier") + else: + identifier = self.get_identifier(primary_identifier) try: response = self.client.get_resource( @@ -517,13 +522,10 @@ def update_resource( return results - def get_identifier(self, primary_identifier: list): + def get_identifier(self, primary_identifier: list) -> Dict: identifier: Dict = {} - if self.module.params.get("identifier"): - identifier = self.module.params.get("identifier") - else: - for id in primary_identifier: - identifier[id] = self.module.params.get(camel_to_snake(id)) + for id in primary_identifier: + identifier[id] = self.module.params.get(camel_to_snake(id)) return json.dumps(identifier) diff --git a/plugins/modules/autoscaling_launch_configuration.py b/plugins/modules/autoscaling_launch_configuration.py index 6b06fd28..6669fcd9 100644 --- a/plugins/modules/autoscaling_launch_configuration.py +++ b/plugins/modules/autoscaling_launch_configuration.py @@ -420,7 +420,7 @@ def main(): [ "state", "present", - ["instance_type", "launch_configuration_name", "image_id"], + ["image_id", "launch_configuration_name", "instance_type"], True, ], ["state", "absent", ["launch_configuration_name"], True], diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index c5460836..725635a1 100644 --- a/plugins/modules/autoscaling_lifecycle_hook.py +++ b/plugins/modules/autoscaling_lifecycle_hook.py @@ -221,10 +221,10 @@ def main(): "state", "present", [ - "auto_scaling_group_name", - "identifier", "lifecycle_transition", + "identifier", "lifecycle_hook_name", + "auto_scaling_group_name", ], True, ], diff --git a/plugins/modules/backup_backup_vault.py b/plugins/modules/backup_backup_vault.py index 240b13f5..8332772c 100644 --- a/plugins/modules/backup_backup_vault.py +++ b/plugins/modules/backup_backup_vault.py @@ -115,6 +115,7 @@ 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). @@ -221,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": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ diff --git a/plugins/modules/backup_framework.py b/plugins/modules/backup_framework.py index 62aaa9af..2152029a 100644 --- a/plugins/modules/backup_framework.py +++ b/plugins/modules/backup_framework.py @@ -188,6 +188,7 @@ 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). @@ -320,11 +321,11 @@ 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": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["framework_controls", "framework_arn"], True], + ["state", "present", ["framework_arn", "framework_controls"], True], ["state", "absent", ["framework_arn"], True], ["state", "get", ["framework_arn"], True], ] diff --git a/plugins/modules/backup_report_plan.py b/plugins/modules/backup_report_plan.py index 30fdbb50..746d042d 100644 --- a/plugins/modules/backup_report_plan.py +++ b/plugins/modules/backup_report_plan.py @@ -171,6 +171,7 @@ 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). @@ -289,14 +290,14 @@ 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": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ [ "state", "present", - ["report_delivery_channel", "report_setting", "report_plan_arn"], + ["report_setting", "report_plan_arn", "report_delivery_channel"], True, ], ["state", "absent", ["report_plan_arn"], True], diff --git a/plugins/modules/cloudtrail_event_data_store.py b/plugins/modules/cloudtrail_event_data_store.py index 448c5aa1..10bb133b 100644 --- a/plugins/modules/cloudtrail_event_data_store.py +++ b/plugins/modules/cloudtrail_event_data_store.py @@ -181,6 +181,7 @@ 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). @@ -319,7 +320,7 @@ def main(): "aliases": ["TerminationProtectionEnabled"], } argument_spec["kms_key_id"] = {"type": "str", "aliases": ["KmsKeyId"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["ingestion_enabled"] = { "type": "bool", "aliases": ["IngestionEnabled"], diff --git a/plugins/modules/cloudtrail_trail.py b/plugins/modules/cloudtrail_trail.py index 94f4583a..e2d4a1f0 100644 --- a/plugins/modules/cloudtrail_trail.py +++ b/plugins/modules/cloudtrail_trail.py @@ -317,6 +317,7 @@ 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). @@ -499,7 +500,7 @@ def main(): 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"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["trail_name"] = {"type": "str", "aliases": ["TrailName"]} argument_spec["insight_selectors"] = { "type": "list", diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index c86f7575..08d2897f 100644 --- a/plugins/modules/cloudwatch_metric_stream.py +++ b/plugins/modules/cloudwatch_metric_stream.py @@ -168,6 +168,7 @@ 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). @@ -286,7 +287,7 @@ def main(): }, "aliases": ["StatisticsConfigurations"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["include_linked_accounts_metrics"] = { "type": "bool", "aliases": ["IncludeLinkedAccountsMetrics"], @@ -305,7 +306,7 @@ def main(): [ "state", "present", - ["firehose_arn", "name", "output_format", "role_arn"], + ["role_arn", "name", "firehose_arn", "output_format"], True, ], ["state", "absent", ["name"], True], diff --git a/plugins/modules/dynamodb_global_table.py b/plugins/modules/dynamodb_global_table.py index ac889940..09a9ac71 100644 --- a/plugins/modules/dynamodb_global_table.py +++ b/plugins/modules/dynamodb_global_table.py @@ -1042,7 +1042,7 @@ def main(): [ "state", "present", - ["attribute_definitions", "table_name", "replicas", "key_schema"], + ["attribute_definitions", "table_name", "key_schema", "replicas"], True, ], ["state", "absent", ["table_name"], True], diff --git a/plugins/modules/ec2_placement_group.py b/plugins/modules/ec2_placement_group.py index ac2658cf..9dd25a0f 100644 --- a/plugins/modules/ec2_placement_group.py +++ b/plugins/modules/ec2_placement_group.py @@ -75,6 +75,7 @@ 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). @@ -146,7 +147,7 @@ def main(): argument_spec["group_name"] = {"type": "str", "aliases": ["GroupName"]} argument_spec["spread_level"] = {"type": "str", "aliases": ["SpreadLevel"]} argument_spec["partition_count"] = {"type": "int", "aliases": ["PartitionCount"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], diff --git a/plugins/modules/ecr_repository.py b/plugins/modules/ecr_repository.py index 89747df0..c581b599 100644 --- a/plugins/modules/ecr_repository.py +++ b/plugins/modules/ecr_repository.py @@ -150,6 +150,7 @@ 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). @@ -233,7 +234,7 @@ def main(): "type": "dict", "aliases": ["RepositoryPolicyText"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["image_tag_mutability"] = { "type": "str", "choices": ["IMMUTABLE", "MUTABLE"], diff --git a/plugins/modules/ecs_capacity_provider.py b/plugins/modules/ecs_capacity_provider.py index cd4377aa..7397ce40 100644 --- a/plugins/modules/ecs_capacity_provider.py +++ b/plugins/modules/ecs_capacity_provider.py @@ -117,6 +117,7 @@ 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). @@ -224,7 +225,7 @@ def main(): "aliases": ["AutoScalingGroupProvider"], } argument_spec["name"] = {"type": "str", "aliases": ["Name"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -236,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], ] diff --git a/plugins/modules/ecs_cluster.py b/plugins/modules/ecs_cluster.py index a7ebd99a..6efbd555 100644 --- a/plugins/modules/ecs_cluster.py +++ b/plugins/modules/ecs_cluster.py @@ -195,6 +195,7 @@ 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). @@ -262,7 +263,7 @@ def main(): ), ) - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["cluster_name"] = {"type": "str", "aliases": ["ClusterName"]} argument_spec["cluster_settings"] = { "type": "list", diff --git a/plugins/modules/ecs_cluster_capacity_provider_associations.py b/plugins/modules/ecs_cluster_capacity_provider_associations.py index 342219c9..c33cd741 100644 --- a/plugins/modules/ecs_cluster_capacity_provider_associations.py +++ b/plugins/modules/ecs_cluster_capacity_provider_associations.py @@ -200,7 +200,7 @@ def main(): [ "state", "present", - ["capacity_providers", "cluster", "default_capacity_provider_strategy"], + ["capacity_providers", "default_capacity_provider_strategy", "cluster"], True, ], ["state", "absent", ["cluster"], True], diff --git a/plugins/modules/ecs_primary_task_set.py b/plugins/modules/ecs_primary_task_set.py index 75f4facd..fb48b56f 100644 --- a/plugins/modules/ecs_primary_task_set.py +++ b/plugins/modules/ecs_primary_task_set.py @@ -146,7 +146,7 @@ def main(): required_if = [ ["state", "list", ["cluster"], True], - ["state", "present", ["identifier", "cluster", "task_set_id", "service"], True], + ["state", "present", ["identifier", "task_set_id", "service", "cluster"], True], ["state", "absent", ["cluster", "service", "identifier"], True], ["state", "get", ["cluster", "service", "identifier"], True], ] diff --git a/plugins/modules/eks_addon.py b/plugins/modules/eks_addon.py index 16d4076c..a7553de6 100644 --- a/plugins/modules/eks_addon.py +++ b/plugins/modules/eks_addon.py @@ -103,6 +103,7 @@ 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). @@ -190,7 +191,7 @@ def main(): "type": "str", "aliases": ["ConfigurationValues"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -204,7 +205,7 @@ def main(): required_if = [ ["state", "list", ["cluster_name"], True], - ["state", "present", ["identifier", "addon_name", "cluster_name"], True], + ["state", "present", ["addon_name", "identifier", "cluster_name"], True], ["state", "absent", ["cluster_name", "addon_name", "identifier"], True], ["state", "get", ["cluster_name", "addon_name", "identifier"], True], ] diff --git a/plugins/modules/eks_cluster.py b/plugins/modules/eks_cluster.py index d43250ae..69893975 100644 --- a/plugins/modules/eks_cluster.py +++ b/plugins/modules/eks_cluster.py @@ -265,6 +265,7 @@ 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). @@ -443,7 +444,7 @@ def main(): } argument_spec["role_arn"] = {"type": "str", "aliases": ["RoleArn"]} argument_spec["version"] = {"type": "str", "aliases": ["Version"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -455,7 +456,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["name", "resources_vpc_config", "role_arn"], True], + ["state", "present", ["name", "role_arn", "resources_vpc_config"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/eks_fargate_profile.py b/plugins/modules/eks_fargate_profile.py index 6158b564..b17063b7 100644 --- a/plugins/modules/eks_fargate_profile.py +++ b/plugins/modules/eks_fargate_profile.py @@ -114,6 +114,7 @@ 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). @@ -212,7 +213,7 @@ def main(): }, "aliases": ["Selectors"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -230,11 +231,11 @@ def main(): "state", "present", [ - "cluster_name", "selectors", "fargate_profile_name", - "pod_execution_role_arn", "identifier", + "pod_execution_role_arn", + "cluster_name", ], True, ], diff --git a/plugins/modules/iam_instance_profile.py b/plugins/modules/iam_instance_profile.py index 5d916efa..5d149cc2 100644 --- a/plugins/modules/iam_instance_profile.py +++ b/plugins/modules/iam_instance_profile.py @@ -139,7 +139,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["roles", "instance_profile_name"], True], + ["state", "present", ["instance_profile_name", "roles"], True], ["state", "absent", ["instance_profile_name"], True], ["state", "get", ["instance_profile_name"], True], ] diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index e063b91b..ccb125ad 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -114,6 +114,7 @@ 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). @@ -210,7 +211,7 @@ def main(): "aliases": ["Policies"], } argument_spec["role_name"] = {"type": "str", "aliases": ["RoleName"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], diff --git a/plugins/modules/iam_server_certificate.py b/plugins/modules/iam_server_certificate.py index 7d378034..fc94bb1d 100644 --- a/plugins/modules/iam_server_certificate.py +++ b/plugins/modules/iam_server_certificate.py @@ -76,6 +76,7 @@ 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). @@ -154,7 +155,7 @@ def main(): } argument_spec["path"] = {"type": "str", "aliases": ["Path"]} argument_spec["private_key"] = {"type": "str", "aliases": ["PrivateKey"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], diff --git a/plugins/modules/kms_alias.py b/plugins/modules/kms_alias.py index 3cf7e5e2..08209c3d 100644 --- a/plugins/modules/kms_alias.py +++ b/plugins/modules/kms_alias.py @@ -132,7 +132,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["alias_name", "target_key_id"], True], + ["state", "present", ["target_key_id", "alias_name"], True], ["state", "absent", ["alias_name"], True], ["state", "get", ["alias_name"], True], ] diff --git a/plugins/modules/kms_replica_key.py b/plugins/modules/kms_replica_key.py index 12d4a040..7a456fbb 100644 --- a/plugins/modules/kms_replica_key.py +++ b/plugins/modules/kms_replica_key.py @@ -94,6 +94,7 @@ 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). @@ -169,7 +170,7 @@ def main(): "type": "int", "aliases": ["PendingWindowInDays"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["key_id"] = {"type": "str", "aliases": ["KeyId"]} argument_spec["state"] = { "type": "str", @@ -182,7 +183,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["key_id", "key_policy", "primary_key_arn"], True], + ["state", "present", ["key_id", "primary_key_arn", "key_policy"], True], ["state", "absent", ["key_id"], True], ["state", "get", ["key_id"], True], ] diff --git a/plugins/modules/lambda_event_source_mapping.py b/plugins/modules/lambda_event_source_mapping.py index 0b11ce86..d72609a2 100644 --- a/plugins/modules/lambda_event_source_mapping.py +++ b/plugins/modules/lambda_event_source_mapping.py @@ -533,7 +533,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["function_name", "id"], True], + ["state", "present", ["id", "function_name"], True], ["state", "absent", ["id"], True], ["state", "get", ["id"], True], ] diff --git a/plugins/modules/lambda_function.py b/plugins/modules/lambda_function.py index d1f642fc..4298d731 100644 --- a/plugins/modules/lambda_function.py +++ b/plugins/modules/lambda_function.py @@ -299,6 +299,7 @@ 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). @@ -484,7 +485,7 @@ def main(): "aliases": ["CodeSigningConfigArn"], } argument_spec["layers"] = {"type": "list", "elements": "str", "aliases": ["Layers"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["image_config"] = { "type": "dict", "options": { @@ -545,7 +546,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["code", "function_name", "role"], True], + ["state", "present", ["code", "role", "function_name"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] diff --git a/plugins/modules/logs_log_group.py b/plugins/modules/logs_log_group.py index 6b063824..084e9603 100644 --- a/plugins/modules/logs_log_group.py +++ b/plugins/modules/logs_log_group.py @@ -101,6 +101,7 @@ 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). @@ -202,7 +203,7 @@ def main(): ], "aliases": ["RetentionInDays"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index eb18ec4e..5ceb4fa1 100644 --- a/plugins/modules/logs_metric_filter.py +++ b/plugins/modules/logs_metric_filter.py @@ -97,8 +97,6 @@ - Metric name must be in ASCII format. type: str metric_namespace: - $comment: Namespaces can be up to 256 characters long; valid characters - include 0-9A-Za-z.-_/# aliases: - MetricNamespace description: @@ -235,11 +233,7 @@ def main(): "options": { "default_value": {"type": "int", "aliases": ["DefaultValue"]}, "metric_name": {"type": "str", "aliases": ["MetricName"]}, - "metric_namespace": { - "$comment": "Namespaces can be up to 256 characters long; valid characters include 0-9A-Za-z.-_/#", - "type": "str", - "aliases": ["MetricNamespace"], - }, + "metric_namespace": {"type": "str", "aliases": ["MetricNamespace"]}, "metric_value": {"type": "str", "aliases": ["MetricValue"]}, "unit": { "type": "str", @@ -302,11 +296,11 @@ def main(): "state", "present", [ - "log_group_name", "filter_pattern", "filter_name", - "identifier", + "log_group_name", "metric_transformations", + "identifier", ], True, ], diff --git a/plugins/modules/logs_query_definition.py b/plugins/modules/logs_query_definition.py index b905662d..735b2221 100644 --- a/plugins/modules/logs_query_definition.py +++ b/plugins/modules/logs_query_definition.py @@ -147,7 +147,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["name", "query_string", "query_definition_id"], True], + ["state", "present", ["query_definition_id", "query_string", "name"], True], ["state", "absent", ["query_definition_id"], True], ["state", "get", ["query_definition_id"], True], ] diff --git a/plugins/modules/logs_resource_policy.py b/plugins/modules/logs_resource_policy.py index 9dabc074..e73fd987 100644 --- a/plugins/modules/logs_resource_policy.py +++ b/plugins/modules/logs_resource_policy.py @@ -126,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], ] diff --git a/plugins/modules/memorydb_acl.py b/plugins/modules/memorydb_acl.py index f9f703e7..f0d1d7a8 100644 --- a/plugins/modules/memorydb_acl.py +++ b/plugins/modules/memorydb_acl.py @@ -53,12 +53,12 @@ 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: - $comment: List of users. aliases: - UserNames description: @@ -148,11 +148,10 @@ def main(): argument_spec["acl_name"] = {"type": "str", "aliases": ["ACLName"]} argument_spec["user_names"] = { "type": "list", - "$comment": "List of users.", "elements": "str", "aliases": ["UserNames"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], diff --git a/plugins/modules/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index fe5e6548..6bbd9f66 100644 --- a/plugins/modules/memorydb_cluster.py +++ b/plugins/modules/memorydb_cluster.py @@ -209,6 +209,7 @@ 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). @@ -364,7 +365,7 @@ def main(): "type": "bool", "aliases": ["AutoMinorVersionUpgrade"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -376,7 +377,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["node_type", "acl_name", "cluster_name"], True], + ["state", "present", ["acl_name", "cluster_name", "node_type"], True], ["state", "absent", ["cluster_name"], True], ["state", "get", ["cluster_name"], True], ] diff --git a/plugins/modules/memorydb_parameter_group.py b/plugins/modules/memorydb_parameter_group.py index 46c34ef3..deda2a61 100644 --- a/plugins/modules/memorydb_parameter_group.py +++ b/plugins/modules/memorydb_parameter_group.py @@ -75,6 +75,7 @@ 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). @@ -163,7 +164,7 @@ def main(): } argument_spec["family"] = {"type": "str", "aliases": ["Family"]} argument_spec["description"] = {"type": "str", "aliases": ["Description"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["parameters"] = {"type": "dict", "aliases": ["Parameters"]} argument_spec["state"] = { "type": "str", diff --git a/plugins/modules/memorydb_subnet_group.py b/plugins/modules/memorydb_subnet_group.py index fc805b2e..43bfccf2 100644 --- a/plugins/modules/memorydb_subnet_group.py +++ b/plugins/modules/memorydb_subnet_group.py @@ -70,6 +70,7 @@ 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). @@ -163,7 +164,7 @@ def main(): "elements": "str", "aliases": ["SubnetIds"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -175,7 +176,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], ] diff --git a/plugins/modules/memorydb_user.py b/plugins/modules/memorydb_user.py index ffdec4d9..535ae605 100644 --- a/plugins/modules/memorydb_user.py +++ b/plugins/modules/memorydb_user.py @@ -26,7 +26,6 @@ - Not Provived. suboptions: passwords: - $comment: List of passwords. aliases: - Passwords description: @@ -77,6 +76,7 @@ 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). @@ -160,16 +160,11 @@ def main(): "choices": ["iam", "password"], "aliases": ["Type"], }, - "passwords": { - "type": "list", - "$comment": "List of passwords.", - "elements": "str", - "aliases": ["Passwords"], - }, + "passwords": {"type": "list", "elements": "str", "aliases": ["Passwords"]}, }, "aliases": ["AuthenticationMode"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], diff --git a/plugins/modules/rds_db_cluster_parameter_group.py b/plugins/modules/rds_db_cluster_parameter_group.py index c86891a6..8d0f8b59 100644 --- a/plugins/modules/rds_db_cluster_parameter_group.py +++ b/plugins/modules/rds_db_cluster_parameter_group.py @@ -76,6 +76,7 @@ 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). @@ -150,7 +151,7 @@ def main(): "type": "str", "aliases": ["DBClusterParameterGroupName"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -165,7 +166,7 @@ def main(): [ "state", "present", - ["parameters", "db_cluster_parameter_group_name", "description", "family"], + ["db_cluster_parameter_group_name", "family", "parameters", "description"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], diff --git a/plugins/modules/rds_db_instance.py b/plugins/modules/rds_db_instance.py index 20720365..8d4a37e5 100644 --- a/plugins/modules/rds_db_instance.py +++ b/plugins/modules/rds_db_instance.py @@ -566,6 +566,7 @@ class of the DB instance. 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). @@ -896,7 +897,7 @@ def main(): "type": "int", "aliases": ["StorageThroughput"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["tde_credential_arn"] = { "type": "str", "aliases": ["TdeCredentialArn"], diff --git a/plugins/modules/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index 763b576b..1fbcc5a5 100644 --- a/plugins/modules/rds_db_proxy.py +++ b/plugins/modules/rds_db_proxy.py @@ -150,6 +150,7 @@ 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). @@ -273,7 +274,7 @@ def main(): } argument_spec["require_tls"] = {"type": "bool", "aliases": ["RequireTLS"]} argument_spec["role_arn"] = {"type": "str", "aliases": ["RoleArn"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["vpc_security_group_ids"] = { "type": "list", "elements": "str", @@ -298,7 +299,7 @@ def main(): [ "state", "present", - ["auth", "vpc_subnet_ids", "db_proxy_name", "role_arn", "engine_family"], + ["role_arn", "db_proxy_name", "vpc_subnet_ids", "engine_family", "auth"], True, ], ["state", "absent", ["db_proxy_name"], True], diff --git a/plugins/modules/rds_db_proxy_endpoint.py b/plugins/modules/rds_db_proxy_endpoint.py index 1bda3416..ea0ca4ad 100644 --- a/plugins/modules/rds_db_proxy_endpoint.py +++ b/plugins/modules/rds_db_proxy_endpoint.py @@ -64,6 +64,7 @@ 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). @@ -175,7 +176,7 @@ def main(): "choices": ["READ_ONLY", "READ_WRITE"], "aliases": ["TargetRole"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -190,7 +191,7 @@ def main(): [ "state", "present", - ["vpc_subnet_ids", "db_proxy_name", "db_proxy_endpoint_name"], + ["db_proxy_endpoint_name", "db_proxy_name", "vpc_subnet_ids"], True, ], ["state", "absent", ["db_proxy_endpoint_name"], True], diff --git a/plugins/modules/rds_db_subnet_group.py b/plugins/modules/rds_db_subnet_group.py index eaa3a3b2..84ebcb1d 100644 --- a/plugins/modules/rds_db_subnet_group.py +++ b/plugins/modules/rds_db_subnet_group.py @@ -67,6 +67,7 @@ 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). @@ -147,7 +148,7 @@ def main(): "elements": "str", "aliases": ["SubnetIds"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -162,7 +163,7 @@ def main(): [ "state", "present", - ["db_subnet_group_description", "subnet_ids", "db_subnet_group_name"], + ["subnet_ids", "db_subnet_group_name", "db_subnet_group_description"], True, ], ["state", "absent", ["db_subnet_group_name"], True], diff --git a/plugins/modules/rds_option_group.py b/plugins/modules/rds_option_group.py index a2874d5d..f369843e 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -134,6 +134,7 @@ 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). @@ -240,7 +241,7 @@ def main(): }, "aliases": ["OptionConfigurations"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -256,10 +257,10 @@ def main(): "state", "present", [ - "option_group_name", - "engine_name", "major_engine_version", + "option_group_name", "option_group_description", + "engine_name", ], True, ], diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index be3ece5f..209885d2 100644 --- a/plugins/modules/redshift_cluster.py +++ b/plugins/modules/redshift_cluster.py @@ -409,6 +409,7 @@ 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). @@ -547,7 +548,7 @@ def main(): "elements": "str", "aliases": ["IamRoles"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["vpc_security_group_ids"] = { "type": "list", "elements": "str", @@ -649,12 +650,12 @@ def main(): "state", "present", [ + "master_username", + "db_name", + "node_type", "cluster_identifier", "master_user_password", - "node_type", "cluster_type", - "master_username", - "db_name", ], True, ], diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index 62ea7f96..699a7507 100644 --- a/plugins/modules/redshift_endpoint_access.py +++ b/plugins/modules/redshift_endpoint_access.py @@ -163,10 +163,10 @@ def main(): "state", "present", [ - "subnet_group_name", "cluster_identifier", "endpoint_name", "vpc_security_group_ids", + "subnet_group_name", ], True, ], diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index dfe2cf3b..17888e18 100644 --- a/plugins/modules/redshift_endpoint_authorization.py +++ b/plugins/modules/redshift_endpoint_authorization.py @@ -151,7 +151,7 @@ def main(): required_if = [ ["state", "list", ["cluster_identifier"], True], - ["state", "present", ["identifier", "cluster_identifier", "account"], True], + ["state", "present", ["cluster_identifier", "identifier", "account"], True], ["state", "absent", ["cluster_identifier", "account", "identifier"], True], ["state", "get", ["cluster_identifier", "account", "identifier"], True], ] diff --git a/plugins/modules/redshift_event_subscription.py b/plugins/modules/redshift_event_subscription.py index cd815160..b51c1957 100644 --- a/plugins/modules/redshift_event_subscription.py +++ b/plugins/modules/redshift_event_subscription.py @@ -109,6 +109,7 @@ 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). @@ -209,7 +210,7 @@ def main(): "aliases": ["Severity"], } argument_spec["enabled"] = {"type": "bool", "aliases": ["Enabled"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], diff --git a/plugins/modules/route53_key_signing_key.py b/plugins/modules/route53_key_signing_key.py index 7c27f97a..59b7ae51 100644 --- a/plugins/modules/route53_key_signing_key.py +++ b/plugins/modules/route53_key_signing_key.py @@ -167,10 +167,10 @@ def main(): "present", [ "hosted_zone_id", + "identifier", "name", - "key_management_service_arn", "status", - "identifier", + "key_management_service_arn", ], True, ], diff --git a/plugins/modules/s3_bucket.py b/plugins/modules/s3_bucket.py index b4204bb6..44c6ad0f 100644 --- a/plugins/modules/s3_bucket.py +++ b/plugins/modules/s3_bucket.py @@ -1541,6 +1541,7 @@ 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). @@ -2577,7 +2578,7 @@ def main(): }, "aliases": ["ReplicationConfiguration"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["versioning_configuration"] = { "type": "dict", "options": { diff --git a/plugins/modules/s3objectlambda_access_point_policy.py b/plugins/modules/s3objectlambda_access_point_policy.py index b7ee5303..410acf32 100644 --- a/plugins/modules/s3objectlambda_access_point_policy.py +++ b/plugins/modules/s3objectlambda_access_point_policy.py @@ -130,7 +130,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["policy_document", "object_lambda_access_point"], True], + ["state", "present", ["object_lambda_access_point", "policy_document"], True], ["state", "absent", ["object_lambda_access_point"], True], ["state", "get", ["object_lambda_access_point"], True], ] diff --git a/plugins/modules/ssm_document.py b/plugins/modules/ssm_document.py index 57c3090b..d74ca8d0 100644 --- a/plugins/modules/ssm_document.py +++ b/plugins/modules/ssm_document.py @@ -149,6 +149,7 @@ 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). @@ -285,7 +286,7 @@ def main(): "aliases": ["DocumentFormat"], } argument_spec["target_type"] = {"type": "str", "aliases": ["TargetType"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["requires"] = { "type": "list", "elements": "dict", diff --git a/plugins/modules/wafv2_ip_set.py b/plugins/modules/wafv2_ip_set.py index 99b4dfdf..cf44cf56 100644 --- a/plugins/modules/wafv2_ip_set.py +++ b/plugins/modules/wafv2_ip_set.py @@ -102,6 +102,7 @@ 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). @@ -187,7 +188,7 @@ def main(): "elements": "str", "aliases": ["Addresses"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -204,7 +205,7 @@ def main(): [ "state", "present", - ["scope", "ip_address_version", "name", "addresses", "id", "identifier"], + ["ip_address_version", "identifier", "id", "name", "scope", "addresses"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], diff --git a/plugins/modules/wafv2_regex_pattern_set.py b/plugins/modules/wafv2_regex_pattern_set.py index c94a898e..67160998 100644 --- a/plugins/modules/wafv2_regex_pattern_set.py +++ b/plugins/modules/wafv2_regex_pattern_set.py @@ -90,6 +90,7 @@ 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). @@ -170,7 +171,7 @@ def main(): "choices": ["CLOUDFRONT", "REGIONAL"], "aliases": ["Scope"], } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -187,7 +188,7 @@ def main(): [ "state", "present", - ["regular_expression_list", "scope", "name", "id", "identifier"], + ["regular_expression_list", "identifier", "id", "name", "scope"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], diff --git a/plugins/modules/wafv2_web_acl_association.py b/plugins/modules/wafv2_web_acl_association.py index 303e5614..c589ccc6 100644 --- a/plugins/modules/wafv2_web_acl_association.py +++ b/plugins/modules/wafv2_web_acl_association.py @@ -136,7 +136,7 @@ def main(): required_if = [ ["state", "list", ["resource_arn"], True], - ["state", "present", ["identifier", "web_acl_arn", "resource_arn"], True], + ["state", "present", ["web_acl_arn", "identifier", "resource_arn"], True], ["state", "absent", ["resource_arn", "web_acl_arn", "identifier"], True], ["state", "get", ["resource_arn", "web_acl_arn", "identifier"], True], ] From 200ace504f8861d699310f169b991e441d9f736c Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Fri, 30 Jun 2023 17:17:07 +0200 Subject: [PATCH 04/32] Fix import Signed-off-by: Alina Buzachis --- plugins/module_utils/core.py | 3 - .../autoscaling_launch_configuration.py | 1 + plugins/modules/autoscaling_lifecycle_hook.py | 5 +- plugins/modules/autoscaling_warm_pool.py | 1 + plugins/modules/backup_backup_vault.py | 1 + plugins/modules/backup_framework.py | 1 + plugins/modules/backup_report_plan.py | 3 +- .../modules/cloudtrail_event_data_store.py | 1 + plugins/modules/cloudtrail_trail.py | 3 +- plugins/modules/cloudwatch_composite_alarm.py | 1 + plugins/modules/cloudwatch_metric_stream.py | 3 +- plugins/modules/dynamodb_global_table.py | 3 +- plugins/modules/ec2_placement_group.py | 1 + plugins/modules/ecr_repository.py | 1 + plugins/modules/ecs_capacity_provider.py | 1 + plugins/modules/ecs_cluster.py | 1 + ..._cluster_capacity_provider_associations.py | 3 +- plugins/modules/ecs_primary_task_set.py | 3 +- plugins/modules/eks_addon.py | 3 +- plugins/modules/eks_cluster.py | 1 + plugins/modules/eks_fargate_profile.py | 3 +- plugins/modules/iam_instance_profile.py | 1 + plugins/modules/iam_role.py | 3 +- plugins/modules/iam_server_certificate.py | 1 + plugins/modules/kms_alias.py | 1 + plugins/modules/kms_replica_key.py | 3 +- plugins/modules/lambda_code_signing_config.py | 1 + .../modules/lambda_event_source_mapping.py | 3 +- plugins/modules/lambda_function.py | 3 +- plugins/modules/logs_log_group.py | 1 + plugins/modules/logs_metric_filter.py | 5 +- plugins/modules/logs_query_definition.py | 3 +- plugins/modules/logs_resource_policy.py | 3 +- plugins/modules/memorydb_acl.py | 1 + plugins/modules/memorydb_cluster.py | 3 +- plugins/modules/memorydb_parameter_group.py | 1 + plugins/modules/memorydb_subnet_group.py | 3 +- plugins/modules/memorydb_user.py | 1 + .../modules/rds_db_cluster_parameter_group.py | 3 +- plugins/modules/rds_db_instance.py | 108 +++++++++++++++++- plugins/modules/rds_db_proxy.py | 3 +- plugins/modules/rds_db_proxy_endpoint.py | 3 +- plugins/modules/rds_db_subnet_group.py | 3 +- plugins/modules/rds_global_cluster.py | 1 + plugins/modules/rds_option_group.py | 3 +- plugins/modules/redshift_cluster.py | 7 +- plugins/modules/redshift_endpoint_access.py | 5 +- .../redshift_endpoint_authorization.py | 3 +- .../modules/redshift_event_subscription.py | 1 + plugins/modules/redshift_scheduled_action.py | 1 + plugins/modules/route53_dnssec.py | 1 + plugins/modules/route53_key_signing_key.py | 5 +- plugins/modules/s3_access_point.py | 3 +- plugins/modules/s3_bucket.py | 1 + .../modules/s3_multi_region_access_point.py | 3 +- .../s3_multi_region_access_point_policy.py | 3 +- .../modules/s3objectlambda_access_point.py | 3 +- .../s3objectlambda_access_point_policy.py | 3 +- plugins/modules/ssm_document.py | 3 +- plugins/modules/ssm_resource_data_sync.py | 1 + plugins/modules/wafv2_ip_set.py | 3 +- .../modules/wafv2_logging_configuration.py | 1 + plugins/modules/wafv2_regex_pattern_set.py | 3 +- plugins/modules/wafv2_web_acl_association.py | 1 + 64 files changed, 206 insertions(+), 49 deletions(-) diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index 2f5996b5..062794ea 100644 --- a/plugins/module_utils/core.py +++ b/plugins/module_utils/core.py @@ -263,9 +263,6 @@ def present( resource = None identifier: Dict = {} - if "PromotionTier" in params: - params.pop("PromotionTier") - if self.module.params.get("identifier"): identifier = self.module.params.get("identifier") else: diff --git a/plugins/modules/autoscaling_launch_configuration.py b/plugins/modules/autoscaling_launch_configuration.py index 6669fcd9..900e51d0 100644 --- a/plugins/modules/autoscaling_launch_configuration.py +++ b/plugins/modules/autoscaling_launch_configuration.py @@ -315,6 +315,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index 725635a1..9b5088aa 100644 --- a/plugins/modules/autoscaling_lifecycle_hook.py +++ b/plugins/modules/autoscaling_lifecycle_hook.py @@ -168,6 +168,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -221,10 +222,10 @@ def main(): "state", "present", [ - "lifecycle_transition", - "identifier", "lifecycle_hook_name", + "lifecycle_transition", "auto_scaling_group_name", + "identifier", ], True, ], diff --git a/plugins/modules/autoscaling_warm_pool.py b/plugins/modules/autoscaling_warm_pool.py index 4a85a5d2..e590e0c3 100644 --- a/plugins/modules/autoscaling_warm_pool.py +++ b/plugins/modules/autoscaling_warm_pool.py @@ -131,6 +131,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/backup_backup_vault.py b/plugins/modules/backup_backup_vault.py index 8332772c..e9b23e99 100644 --- a/plugins/modules/backup_backup_vault.py +++ b/plugins/modules/backup_backup_vault.py @@ -172,6 +172,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/backup_framework.py b/plugins/modules/backup_framework.py index 2152029a..73e7fa29 100644 --- a/plugins/modules/backup_framework.py +++ b/plugins/modules/backup_framework.py @@ -245,6 +245,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/backup_report_plan.py b/plugins/modules/backup_report_plan.py index 746d042d..2729226f 100644 --- a/plugins/modules/backup_report_plan.py +++ b/plugins/modules/backup_report_plan.py @@ -228,6 +228,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -297,7 +298,7 @@ def main(): [ "state", "present", - ["report_setting", "report_plan_arn", "report_delivery_channel"], + ["report_plan_arn", "report_setting", "report_delivery_channel"], True, ], ["state", "absent", ["report_plan_arn"], True], diff --git a/plugins/modules/cloudtrail_event_data_store.py b/plugins/modules/cloudtrail_event_data_store.py index 10bb133b..463ecc33 100644 --- a/plugins/modules/cloudtrail_event_data_store.py +++ b/plugins/modules/cloudtrail_event_data_store.py @@ -244,6 +244,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/cloudtrail_trail.py b/plugins/modules/cloudtrail_trail.py index e2d4a1f0..8a8264bc 100644 --- a/plugins/modules/cloudtrail_trail.py +++ b/plugins/modules/cloudtrail_trail.py @@ -380,6 +380,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -519,7 +520,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["is_logging", "trail_name", "s3_bucket_name"], True], + ["state", "present", ["is_logging", "s3_bucket_name", "trail_name"], True], ["state", "absent", ["trail_name"], True], ["state", "get", ["trail_name"], True], ] diff --git a/plugins/modules/cloudwatch_composite_alarm.py b/plugins/modules/cloudwatch_composite_alarm.py index c150ff33..e942379f 100644 --- a/plugins/modules/cloudwatch_composite_alarm.py +++ b/plugins/modules/cloudwatch_composite_alarm.py @@ -164,6 +164,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index 08d2897f..216d59d7 100644 --- a/plugins/modules/cloudwatch_metric_stream.py +++ b/plugins/modules/cloudwatch_metric_stream.py @@ -225,6 +225,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -306,7 +307,7 @@ def main(): [ "state", "present", - ["role_arn", "name", "firehose_arn", "output_format"], + ["firehose_arn", "name", "output_format", "role_arn"], True, ], ["state", "absent", ["name"], True], diff --git a/plugins/modules/dynamodb_global_table.py b/plugins/modules/dynamodb_global_table.py index 09a9ac71..81eac1a7 100644 --- a/plugins/modules/dynamodb_global_table.py +++ b/plugins/modules/dynamodb_global_table.py @@ -685,6 +685,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -1042,7 +1043,7 @@ def main(): [ "state", "present", - ["attribute_definitions", "table_name", "key_schema", "replicas"], + ["replicas", "table_name", "attribute_definitions", "key_schema"], True, ], ["state", "absent", ["table_name"], True], diff --git a/plugins/modules/ec2_placement_group.py b/plugins/modules/ec2_placement_group.py index 9dd25a0f..d5c6324a 100644 --- a/plugins/modules/ec2_placement_group.py +++ b/plugins/modules/ec2_placement_group.py @@ -132,6 +132,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/ecr_repository.py b/plugins/modules/ecr_repository.py index c581b599..823a5b89 100644 --- a/plugins/modules/ecr_repository.py +++ b/plugins/modules/ecr_repository.py @@ -207,6 +207,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/ecs_capacity_provider.py b/plugins/modules/ecs_capacity_provider.py index 7397ce40..7702151f 100644 --- a/plugins/modules/ecs_capacity_provider.py +++ b/plugins/modules/ecs_capacity_provider.py @@ -174,6 +174,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/ecs_cluster.py b/plugins/modules/ecs_cluster.py index 6efbd555..e87229d4 100644 --- a/plugins/modules/ecs_cluster.py +++ b/plugins/modules/ecs_cluster.py @@ -252,6 +252,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/ecs_cluster_capacity_provider_associations.py b/plugins/modules/ecs_cluster_capacity_provider_associations.py index c33cd741..ffde5df9 100644 --- a/plugins/modules/ecs_cluster_capacity_provider_associations.py +++ b/plugins/modules/ecs_cluster_capacity_provider_associations.py @@ -149,6 +149,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -200,7 +201,7 @@ def main(): [ "state", "present", - ["capacity_providers", "default_capacity_provider_strategy", "cluster"], + ["capacity_providers", "cluster", "default_capacity_provider_strategy"], True, ], ["state", "absent", ["cluster"], True], diff --git a/plugins/modules/ecs_primary_task_set.py b/plugins/modules/ecs_primary_task_set.py index fb48b56f..638fc344 100644 --- a/plugins/modules/ecs_primary_task_set.py +++ b/plugins/modules/ecs_primary_task_set.py @@ -120,6 +120,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -146,7 +147,7 @@ def main(): required_if = [ ["state", "list", ["cluster"], True], - ["state", "present", ["identifier", "task_set_id", "service", "cluster"], True], + ["state", "present", ["task_set_id", "service", "cluster", "identifier"], True], ["state", "absent", ["cluster", "service", "identifier"], True], ["state", "get", ["cluster", "service", "identifier"], True], ] diff --git a/plugins/modules/eks_addon.py b/plugins/modules/eks_addon.py index a7553de6..4e81baa4 100644 --- a/plugins/modules/eks_addon.py +++ b/plugins/modules/eks_addon.py @@ -160,6 +160,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -205,7 +206,7 @@ def main(): required_if = [ ["state", "list", ["cluster_name"], True], - ["state", "present", ["addon_name", "identifier", "cluster_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], ] diff --git a/plugins/modules/eks_cluster.py b/plugins/modules/eks_cluster.py index 69893975..645ab09c 100644 --- a/plugins/modules/eks_cluster.py +++ b/plugins/modules/eks_cluster.py @@ -330,6 +330,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/eks_fargate_profile.py b/plugins/modules/eks_fargate_profile.py index b17063b7..2b2b26a3 100644 --- a/plugins/modules/eks_fargate_profile.py +++ b/plugins/modules/eks_fargate_profile.py @@ -171,6 +171,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -232,10 +233,10 @@ def main(): "present", [ "selectors", - "fargate_profile_name", "identifier", "pod_execution_role_arn", "cluster_name", + "fargate_profile_name", ], True, ], diff --git a/plugins/modules/iam_instance_profile.py b/plugins/modules/iam_instance_profile.py index 5d149cc2..528992e8 100644 --- a/plugins/modules/iam_instance_profile.py +++ b/plugins/modules/iam_instance_profile.py @@ -112,6 +112,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index ccb125ad..29688d7b 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -171,6 +171,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -223,7 +224,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["role_name", "assume_role_policy_document"], True], + ["state", "present", ["assume_role_policy_document", "role_name"], True], ["state", "absent", ["role_name"], True], ["state", "get", ["role_name"], True], ] diff --git a/plugins/modules/iam_server_certificate.py b/plugins/modules/iam_server_certificate.py index fc94bb1d..18ce0a89 100644 --- a/plugins/modules/iam_server_certificate.py +++ b/plugins/modules/iam_server_certificate.py @@ -133,6 +133,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/kms_alias.py b/plugins/modules/kms_alias.py index 08209c3d..00b3025f 100644 --- a/plugins/modules/kms_alias.py +++ b/plugins/modules/kms_alias.py @@ -109,6 +109,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/kms_replica_key.py b/plugins/modules/kms_replica_key.py index 7a456fbb..eb9a0192 100644 --- a/plugins/modules/kms_replica_key.py +++ b/plugins/modules/kms_replica_key.py @@ -151,6 +151,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -183,7 +184,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["key_id", "primary_key_arn", "key_policy"], True], + ["state", "present", ["primary_key_arn", "key_policy", "key_id"], True], ["state", "absent", ["key_id"], True], ["state", "get", ["key_id"], True], ] diff --git a/plugins/modules/lambda_code_signing_config.py b/plugins/modules/lambda_code_signing_config.py index 05e174ec..cbbcf474 100644 --- a/plugins/modules/lambda_code_signing_config.py +++ b/plugins/modules/lambda_code_signing_config.py @@ -139,6 +139,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/lambda_event_source_mapping.py b/plugins/modules/lambda_event_source_mapping.py index d72609a2..66e91a8e 100644 --- a/plugins/modules/lambda_event_source_mapping.py +++ b/plugins/modules/lambda_event_source_mapping.py @@ -371,6 +371,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -533,7 +534,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["id", "function_name"], True], + ["state", "present", ["function_name", "id"], True], ["state", "absent", ["id"], True], ["state", "get", ["id"], True], ] diff --git a/plugins/modules/lambda_function.py b/plugins/modules/lambda_function.py index 4298d731..1fa6ff62 100644 --- a/plugins/modules/lambda_function.py +++ b/plugins/modules/lambda_function.py @@ -410,6 +410,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -546,7 +547,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["code", "role", "function_name"], True], + ["state", "present", ["code", "function_name", "role"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] diff --git a/plugins/modules/logs_log_group.py b/plugins/modules/logs_log_group.py index 084e9603..9ea4b34c 100644 --- a/plugins/modules/logs_log_group.py +++ b/plugins/modules/logs_log_group.py @@ -158,6 +158,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index 5ceb4fa1..7866d43e 100644 --- a/plugins/modules/logs_metric_filter.py +++ b/plugins/modules/logs_metric_filter.py @@ -213,6 +213,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -296,11 +297,11 @@ def main(): "state", "present", [ - "filter_pattern", + "identifier", "filter_name", + "filter_pattern", "log_group_name", "metric_transformations", - "identifier", ], True, ], diff --git a/plugins/modules/logs_query_definition.py b/plugins/modules/logs_query_definition.py index 735b2221..8d62d8d6 100644 --- a/plugins/modules/logs_query_definition.py +++ b/plugins/modules/logs_query_definition.py @@ -115,6 +115,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -147,7 +148,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["query_definition_id", "query_string", "name"], True], + ["state", "present", ["query_definition_id", "name", "query_string"], True], ["state", "absent", ["query_definition_id"], True], ["state", "get", ["query_definition_id"], True], ] diff --git a/plugins/modules/logs_resource_policy.py b/plugins/modules/logs_resource_policy.py index e73fd987..77a63531 100644 --- a/plugins/modules/logs_resource_policy.py +++ b/plugins/modules/logs_resource_policy.py @@ -103,6 +103,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -126,7 +127,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["policy_name", "policy_document"], True], + ["state", "present", ["policy_document", "policy_name"], True], ["state", "absent", ["policy_name"], True], ["state", "get", ["policy_name"], True], ] diff --git a/plugins/modules/memorydb_acl.py b/plugins/modules/memorydb_acl.py index f0d1d7a8..6ce23792 100644 --- a/plugins/modules/memorydb_acl.py +++ b/plugins/modules/memorydb_acl.py @@ -134,6 +134,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index 6bbd9f66..67abb0ab 100644 --- a/plugins/modules/memorydb_cluster.py +++ b/plugins/modules/memorydb_cluster.py @@ -297,6 +297,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -377,7 +378,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["acl_name", "cluster_name", "node_type"], True], + ["state", "present", ["acl_name", "node_type", "cluster_name"], True], ["state", "absent", ["cluster_name"], True], ["state", "get", ["cluster_name"], True], ] diff --git a/plugins/modules/memorydb_parameter_group.py b/plugins/modules/memorydb_parameter_group.py index deda2a61..13516f2e 100644 --- a/plugins/modules/memorydb_parameter_group.py +++ b/plugins/modules/memorydb_parameter_group.py @@ -147,6 +147,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/memorydb_subnet_group.py b/plugins/modules/memorydb_subnet_group.py index 43bfccf2..ff21d043 100644 --- a/plugins/modules/memorydb_subnet_group.py +++ b/plugins/modules/memorydb_subnet_group.py @@ -146,6 +146,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -176,7 +177,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["subnet_ids", "subnet_group_name"], True], + ["state", "present", ["subnet_group_name", "subnet_ids"], True], ["state", "absent", ["subnet_group_name"], True], ["state", "get", ["subnet_group_name"], True], ] diff --git a/plugins/modules/memorydb_user.py b/plugins/modules/memorydb_user.py index 535ae605..d17f95b9 100644 --- a/plugins/modules/memorydb_user.py +++ b/plugins/modules/memorydb_user.py @@ -139,6 +139,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/rds_db_cluster_parameter_group.py b/plugins/modules/rds_db_cluster_parameter_group.py index 8d0f8b59..4c9f69fa 100644 --- a/plugins/modules/rds_db_cluster_parameter_group.py +++ b/plugins/modules/rds_db_cluster_parameter_group.py @@ -133,6 +133,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -166,7 +167,7 @@ def main(): [ "state", "present", - ["db_cluster_parameter_group_name", "family", "parameters", "description"], + ["parameters", "description", "family", "db_cluster_parameter_group_name"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], diff --git a/plugins/modules/rds_db_instance.py b/plugins/modules/rds_db_instance.py index 8d4a37e5..b1344d31 100644 --- a/plugins/modules/rds_db_instance.py +++ b/plugins/modules/rds_db_instance.py @@ -90,7 +90,20 @@ - CertificateDetails description: - Returns the details of the DB instances server certificate. - suboptions: {} + suboptions: + ca_identifier: + aliases: + - CAIdentifier + description: + - The CA identifier of the CA certificate used for the DB instances + server certificate. + type: str + valid_till: + aliases: + - ValidTill + description: + - "The expiration date of the DB instance\u2019s server certificate." + type: str type: dict certificate_rotation_restart: aliases: @@ -158,6 +171,12 @@ - '* Cant be the identifier of an Aurora DB cluster snapshot.' - '* Cant be the identifier of an RDS for PostgreSQL Multi-AZ DB cluster snapshot.' type: str + db_instance_arn: + aliases: + - DBInstanceArn + description: + - The Amazon Resource Name (ARN) for the DB instance. + type: str db_instance_class: aliases: - DBInstanceClass @@ -215,6 +234,22 @@ - If you update this value, the new subnet group must be a subnet group in a new VPC. type: str + db_system_id: + aliases: + - DBSystemId + description: + - The Oracle system ID (Oracle SID) for a container database (CDB). The Oracle + SID is also the name of the CDB. This setting is valid for RDS Custom + only. + type: str + dbi_resource_id: + aliases: + - DbiResourceId + description: + - The AWS Region-unique, immutable identifier for the DB instance. + - This identifier is found in AWS CloudTrail log entries whenever the AWS + KMS key for the DB instance is accessed. + type: str delete_automated_backups: aliases: - DeleteAutomatedBackups @@ -277,7 +312,26 @@ - Endpoint description: - Specifies the connection endpoint. - suboptions: {} + suboptions: + address: + aliases: + - Address + description: + - Specifies the DNS address of the DB instance. + type: str + hosted_zone_id: + aliases: + - HostedZoneId + description: + - Specifies the ID that Amazon Route 53 assigns when you create a + hosted zone. + type: str + port: + aliases: + - Port + description: + - Specifies the port that the database engine is listening on. + type: str type: dict engine: aliases: @@ -345,6 +399,12 @@ description: - The AWS KMS key identifier that is used to encrypt the secret. type: str + secret_arn: + aliases: + - SecretArn + description: + - The Amazon Resource Name (ARN) of the secret. + type: str type: dict master_username: aliases: @@ -418,6 +478,12 @@ - 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 @@ -668,6 +734,7 @@ class of the DB instance. scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -715,7 +782,10 @@ def main(): } argument_spec["certificate_details"] = { "type": "dict", - "options": {}, + "options": { + "ca_identifier": {"type": "str", "aliases": ["CAIdentifier"]}, + "valid_till": {"type": "str", "aliases": ["ValidTill"]}, + }, "aliases": ["CertificateDetails"], } argument_spec["certificate_rotation_restart"] = { @@ -742,11 +812,13 @@ def main(): "type": "str", "aliases": ["DBClusterSnapshotIdentifier"], } + argument_spec["db_instance_arn"] = {"type": "str", "aliases": ["DBInstanceArn"]} argument_spec["db_instance_class"] = {"type": "str", "aliases": ["DBInstanceClass"]} argument_spec["db_instance_identifier"] = { "type": "str", "aliases": ["DBInstanceIdentifier"], } + argument_spec["dbi_resource_id"] = {"type": "str", "aliases": ["DbiResourceId"]} argument_spec["db_name"] = {"type": "str", "aliases": ["DBName"]} argument_spec["db_parameter_group_name"] = { "type": "str", @@ -765,6 +837,7 @@ def main(): "type": "str", "aliases": ["DBSubnetGroupName"], } + argument_spec["db_system_id"] = {"type": "str", "aliases": ["DBSystemId"]} argument_spec["delete_automated_backups"] = { "type": "bool", "aliases": ["DeleteAutomatedBackups"], @@ -791,7 +864,15 @@ def main(): "type": "bool", "aliases": ["EnablePerformanceInsights"], } - argument_spec["endpoint"] = {"type": "dict", "options": {}, "aliases": ["Endpoint"]} + argument_spec["endpoint"] = { + "type": "dict", + "options": { + "address": {"type": "str", "aliases": ["Address"]}, + "port": {"type": "str", "aliases": ["Port"]}, + "hosted_zone_id": {"type": "str", "aliases": ["HostedZoneId"]}, + }, + "aliases": ["Endpoint"], + } argument_spec["engine"] = {"type": "str", "aliases": ["Engine"]} argument_spec["engine_version"] = {"type": "str", "aliases": ["EngineVersion"]} argument_spec["manage_master_user_password"] = { @@ -808,7 +889,10 @@ def main(): } argument_spec["master_user_secret"] = { "type": "dict", - "options": {"kms_key_id": {"type": "str", "aliases": ["KmsKeyId"]}}, + "options": { + "secret_arn": {"type": "str", "aliases": ["SecretArn"]}, + "kms_key_id": {"type": "str", "aliases": ["KmsKeyId"]}, + }, "aliases": ["MasterUserSecret"], } argument_spec["max_allocated_storage"] = { @@ -839,6 +923,7 @@ def main(): "type": "int", "aliases": ["PerformanceInsightsRetentionPeriod"], } + argument_spec["port"] = {"type": "str", "aliases": ["Port"]} argument_spec["preferred_backup_window"] = { "type": "str", "aliases": ["PreferredBackupWindow"], @@ -973,6 +1058,7 @@ def main(): params["db_cluster_snapshot_identifier"] = module.params.get( "db_cluster_snapshot_identifier" ) + params["db_instance_arn"] = module.params.get("db_instance_arn") params["db_instance_class"] = module.params.get("db_instance_class") params["db_instance_identifier"] = module.params.get("db_instance_identifier") params["db_name"] = module.params.get("db_name") @@ -980,6 +1066,8 @@ def main(): params["db_security_groups"] = module.params.get("db_security_groups") params["db_snapshot_identifier"] = module.params.get("db_snapshot_identifier") params["db_subnet_group_name"] = module.params.get("db_subnet_group_name") + params["db_system_id"] = module.params.get("db_system_id") + params["dbi_resource_id"] = module.params.get("dbi_resource_id") params["delete_automated_backups"] = module.params.get("delete_automated_backups") params["deletion_protection"] = module.params.get("deletion_protection") params["domain"] = module.params.get("domain") @@ -1018,6 +1106,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" @@ -1088,6 +1177,15 @@ def main(): results = {"changed": False, "result": {}} + 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") + if state == "list": if "list" not in handlers: module.exit_json( diff --git a/plugins/modules/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index 1fbcc5a5..efce0925 100644 --- a/plugins/modules/rds_db_proxy.py +++ b/plugins/modules/rds_db_proxy.py @@ -221,6 +221,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -299,7 +300,7 @@ def main(): [ "state", "present", - ["role_arn", "db_proxy_name", "vpc_subnet_ids", "engine_family", "auth"], + ["db_proxy_name", "engine_family", "auth", "role_arn", "vpc_subnet_ids"], True, ], ["state", "absent", ["db_proxy_name"], True], diff --git a/plugins/modules/rds_db_proxy_endpoint.py b/plugins/modules/rds_db_proxy_endpoint.py index ea0ca4ad..acd65f86 100644 --- a/plugins/modules/rds_db_proxy_endpoint.py +++ b/plugins/modules/rds_db_proxy_endpoint.py @@ -145,6 +145,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -191,7 +192,7 @@ def main(): [ "state", "present", - ["db_proxy_endpoint_name", "db_proxy_name", "vpc_subnet_ids"], + ["vpc_subnet_ids", "db_proxy_endpoint_name", "db_proxy_name"], True, ], ["state", "absent", ["db_proxy_endpoint_name"], True], diff --git a/plugins/modules/rds_db_subnet_group.py b/plugins/modules/rds_db_subnet_group.py index 84ebcb1d..d3d0bad4 100644 --- a/plugins/modules/rds_db_subnet_group.py +++ b/plugins/modules/rds_db_subnet_group.py @@ -124,6 +124,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -163,7 +164,7 @@ def main(): [ "state", "present", - ["subnet_ids", "db_subnet_group_name", "db_subnet_group_description"], + ["subnet_ids", "db_subnet_group_description", "db_subnet_group_name"], True, ], ["state", "absent", ["db_subnet_group_name"], True], diff --git a/plugins/modules/rds_global_cluster.py b/plugins/modules/rds_global_cluster.py index e54b62b5..d2190392 100644 --- a/plugins/modules/rds_global_cluster.py +++ b/plugins/modules/rds_global_cluster.py @@ -149,6 +149,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/rds_option_group.py b/plugins/modules/rds_option_group.py index f369843e..5e6c07de 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -191,6 +191,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -257,10 +258,10 @@ def main(): "state", "present", [ + "engine_name", "major_engine_version", "option_group_name", "option_group_description", - "engine_name", ], True, ], diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index 209885d2..4baf024e 100644 --- a/plugins/modules/redshift_cluster.py +++ b/plugins/modules/redshift_cluster.py @@ -474,6 +474,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -651,11 +652,11 @@ def main(): "present", [ "master_username", - "db_name", - "node_type", - "cluster_identifier", "master_user_password", "cluster_type", + "node_type", + "db_name", + "cluster_identifier", ], True, ], diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index 699a7507..f8accd2a 100644 --- a/plugins/modules/redshift_endpoint_access.py +++ b/plugins/modules/redshift_endpoint_access.py @@ -126,6 +126,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -164,9 +165,9 @@ def main(): "present", [ "cluster_identifier", - "endpoint_name", - "vpc_security_group_ids", "subnet_group_name", + "vpc_security_group_ids", + "endpoint_name", ], True, ], diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index 17888e18..f422c52b 100644 --- a/plugins/modules/redshift_endpoint_authorization.py +++ b/plugins/modules/redshift_endpoint_authorization.py @@ -118,6 +118,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -151,7 +152,7 @@ def main(): required_if = [ ["state", "list", ["cluster_identifier"], True], - ["state", "present", ["cluster_identifier", "identifier", "account"], True], + ["state", "present", ["account", "cluster_identifier", "identifier"], True], ["state", "absent", ["cluster_identifier", "account", "identifier"], True], ["state", "get", ["cluster_identifier", "account", "identifier"], True], ] diff --git a/plugins/modules/redshift_event_subscription.py b/plugins/modules/redshift_event_subscription.py index b51c1957..e4c881a6 100644 --- a/plugins/modules/redshift_event_subscription.py +++ b/plugins/modules/redshift_event_subscription.py @@ -166,6 +166,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/redshift_scheduled_action.py b/plugins/modules/redshift_scheduled_action.py index 813af3a6..2d89fb11 100644 --- a/plugins/modules/redshift_scheduled_action.py +++ b/plugins/modules/redshift_scheduled_action.py @@ -214,6 +214,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/route53_dnssec.py b/plugins/modules/route53_dnssec.py index db281e32..4a5826fd 100644 --- a/plugins/modules/route53_dnssec.py +++ b/plugins/modules/route53_dnssec.py @@ -96,6 +96,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/route53_key_signing_key.py b/plugins/modules/route53_key_signing_key.py index 59b7ae51..b265bb82 100644 --- a/plugins/modules/route53_key_signing_key.py +++ b/plugins/modules/route53_key_signing_key.py @@ -128,6 +128,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -166,10 +167,10 @@ def main(): "state", "present", [ - "hosted_zone_id", + "status", "identifier", + "hosted_zone_id", "name", - "status", "key_management_service_arn", ], True, diff --git a/plugins/modules/s3_access_point.py b/plugins/modules/s3_access_point.py index a0f1d487..0b88a94d 100644 --- a/plugins/modules/s3_access_point.py +++ b/plugins/modules/s3_access_point.py @@ -194,6 +194,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -237,7 +238,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["name", "bucket"], True], + ["state", "present", ["bucket", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/s3_bucket.py b/plugins/modules/s3_bucket.py index 44c6ad0f..bcb4d935 100644 --- a/plugins/modules/s3_bucket.py +++ b/plugins/modules/s3_bucket.py @@ -1738,6 +1738,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/s3_multi_region_access_point.py b/plugins/modules/s3_multi_region_access_point.py index 288aefc2..d0c78e34 100644 --- a/plugins/modules/s3_multi_region_access_point.py +++ b/plugins/modules/s3_multi_region_access_point.py @@ -178,6 +178,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -222,7 +223,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], ] diff --git a/plugins/modules/s3_multi_region_access_point_policy.py b/plugins/modules/s3_multi_region_access_point_policy.py index f720a9f1..6b6d4eb7 100644 --- a/plugins/modules/s3_multi_region_access_point_policy.py +++ b/plugins/modules/s3_multi_region_access_point_policy.py @@ -103,6 +103,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -126,7 +127,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["mrap_name", "policy"], True], + ["state", "present", ["policy", "mrap_name"], True], ["state", "absent", ["mrap_name"], True], ["state", "get", ["mrap_name"], True], ] diff --git a/plugins/modules/s3objectlambda_access_point.py b/plugins/modules/s3objectlambda_access_point.py index 571b4046..9044649d 100644 --- a/plugins/modules/s3objectlambda_access_point.py +++ b/plugins/modules/s3objectlambda_access_point.py @@ -171,6 +171,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -244,7 +245,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], ] diff --git a/plugins/modules/s3objectlambda_access_point_policy.py b/plugins/modules/s3objectlambda_access_point_policy.py index 410acf32..e0030802 100644 --- a/plugins/modules/s3objectlambda_access_point_policy.py +++ b/plugins/modules/s3objectlambda_access_point_policy.py @@ -104,6 +104,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -130,7 +131,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["object_lambda_access_point", "policy_document"], True], + ["state", "present", ["policy_document", "object_lambda_access_point"], True], ["state", "absent", ["object_lambda_access_point"], True], ["state", "get", ["object_lambda_access_point"], True], ] diff --git a/plugins/modules/ssm_document.py b/plugins/modules/ssm_document.py index d74ca8d0..f97f6fc5 100644 --- a/plugins/modules/ssm_document.py +++ b/plugins/modules/ssm_document.py @@ -232,6 +232,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -313,7 +314,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["content", "name"], True], + ["state", "present", ["name", "content"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/ssm_resource_data_sync.py b/plugins/modules/ssm_resource_data_sync.py index f44a9e7d..6d29a01a 100644 --- a/plugins/modules/ssm_resource_data_sync.py +++ b/plugins/modules/ssm_resource_data_sync.py @@ -216,6 +216,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/wafv2_ip_set.py b/plugins/modules/wafv2_ip_set.py index cf44cf56..616fc7a0 100644 --- a/plugins/modules/wafv2_ip_set.py +++ b/plugins/modules/wafv2_ip_set.py @@ -159,6 +159,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -205,7 +206,7 @@ def main(): [ "state", "present", - ["ip_address_version", "identifier", "id", "name", "scope", "addresses"], + ["ip_address_version", "identifier", "scope", "id", "addresses", "name"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], diff --git a/plugins/modules/wafv2_logging_configuration.py b/plugins/modules/wafv2_logging_configuration.py index 1ebd1c6f..7307c76d 100644 --- a/plugins/modules/wafv2_logging_configuration.py +++ b/plugins/modules/wafv2_logging_configuration.py @@ -315,6 +315,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/wafv2_regex_pattern_set.py b/plugins/modules/wafv2_regex_pattern_set.py index 67160998..a6bfd950 100644 --- a/plugins/modules/wafv2_regex_pattern_set.py +++ b/plugins/modules/wafv2_regex_pattern_set.py @@ -147,6 +147,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -188,7 +189,7 @@ def main(): [ "state", "present", - ["regular_expression_list", "identifier", "id", "name", "scope"], + ["identifier", "scope", "id", "name", "regular_expression_list"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], diff --git a/plugins/modules/wafv2_web_acl_association.py b/plugins/modules/wafv2_web_acl_association.py index c589ccc6..7c369936 100644 --- a/plugins/modules/wafv2_web_acl_association.py +++ b/plugins/modules/wafv2_web_acl_association.py @@ -111,6 +111,7 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias +from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): From ba302127c0f837dd62eb8e68bb6ba8cc0d59f953 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Fri, 30 Jun 2023 18:14:27 +0200 Subject: [PATCH 05/32] Re-generate modules Signed-off-by: Alina Buzachis --- .../autoscaling_launch_configuration.py | 8 ++-- plugins/modules/autoscaling_lifecycle_hook.py | 10 ++--- plugins/modules/autoscaling_warm_pool.py | 6 +-- plugins/modules/backup_backup_vault.py | 6 +-- plugins/modules/backup_framework.py | 6 +-- plugins/modules/backup_report_plan.py | 8 ++-- .../modules/cloudtrail_event_data_store.py | 6 +-- plugins/modules/cloudtrail_trail.py | 8 ++-- plugins/modules/cloudwatch_composite_alarm.py | 6 +-- plugins/modules/cloudwatch_metric_stream.py | 8 ++-- plugins/modules/dynamodb_global_table.py | 8 ++-- plugins/modules/ec2_placement_group.py | 6 +-- plugins/modules/ecr_repository.py | 6 +-- plugins/modules/ecs_capacity_provider.py | 6 +-- plugins/modules/ecs_cluster.py | 6 +-- ..._cluster_capacity_provider_associations.py | 37 ++----------------- plugins/modules/ecs_primary_task_set.py | 8 ++-- plugins/modules/eks_addon.py | 8 ++-- plugins/modules/eks_cluster.py | 8 ++-- plugins/modules/eks_fargate_profile.py | 8 ++-- plugins/modules/iam_instance_profile.py | 8 ++-- plugins/modules/iam_role.py | 6 +-- plugins/modules/iam_server_certificate.py | 6 +-- plugins/modules/kms_alias.py | 8 ++-- plugins/modules/kms_replica_key.py | 8 ++-- plugins/modules/lambda_code_signing_config.py | 6 +-- .../modules/lambda_event_source_mapping.py | 6 +-- plugins/modules/lambda_function.py | 8 ++-- plugins/modules/logs_log_group.py | 6 +-- plugins/modules/logs_metric_filter.py | 10 ++--- plugins/modules/logs_query_definition.py | 8 ++-- plugins/modules/logs_resource_policy.py | 6 +-- plugins/modules/memorydb_acl.py | 6 +-- plugins/modules/memorydb_cluster.py | 8 ++-- plugins/modules/memorydb_parameter_group.py | 6 +-- plugins/modules/memorydb_subnet_group.py | 8 ++-- plugins/modules/memorydb_user.py | 6 +-- .../modules/rds_db_cluster_parameter_group.py | 8 ++-- plugins/modules/rds_db_instance.py | 6 +-- plugins/modules/rds_db_proxy.py | 8 ++-- plugins/modules/rds_db_proxy_endpoint.py | 8 ++-- plugins/modules/rds_db_subnet_group.py | 6 +-- plugins/modules/rds_global_cluster.py | 6 +-- plugins/modules/rds_option_group.py | 10 ++--- plugins/modules/redshift_cluster.py | 12 +++--- plugins/modules/redshift_endpoint_access.py | 8 ++-- .../redshift_endpoint_authorization.py | 8 ++-- .../modules/redshift_event_subscription.py | 6 +-- plugins/modules/redshift_scheduled_action.py | 6 +-- plugins/modules/route53_dnssec.py | 6 +-- plugins/modules/route53_key_signing_key.py | 12 +++--- plugins/modules/s3_access_point.py | 8 ++-- plugins/modules/s3_bucket.py | 6 +-- .../modules/s3_multi_region_access_point.py | 6 +-- .../s3_multi_region_access_point_policy.py | 8 ++-- .../modules/s3objectlambda_access_point.py | 6 +-- .../s3objectlambda_access_point_policy.py | 6 +-- plugins/modules/ssm_document.py | 6 +-- plugins/modules/ssm_resource_data_sync.py | 6 +-- plugins/modules/wafv2_ip_set.py | 8 ++-- .../modules/wafv2_logging_configuration.py | 6 +-- plugins/modules/wafv2_regex_pattern_set.py | 8 ++-- plugins/modules/wafv2_web_acl_association.py | 8 ++-- 63 files changed, 166 insertions(+), 319 deletions(-) diff --git a/plugins/modules/autoscaling_launch_configuration.py b/plugins/modules/autoscaling_launch_configuration.py index 900e51d0..8eae70f1 100644 --- a/plugins/modules/autoscaling_launch_configuration.py +++ b/plugins/modules/autoscaling_launch_configuration.py @@ -302,9 +302,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -421,7 +419,7 @@ def main(): [ "state", "present", - ["image_id", "launch_configuration_name", "instance_type"], + ["launch_configuration_name", "instance_type", "image_id"], True, ], ["state", "absent", ["launch_configuration_name"], True], @@ -429,7 +427,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index 9b5088aa..67582974 100644 --- a/plugins/modules/autoscaling_lifecycle_hook.py +++ b/plugins/modules/autoscaling_lifecycle_hook.py @@ -155,9 +155,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -222,10 +220,10 @@ def main(): "state", "present", [ - "lifecycle_hook_name", "lifecycle_transition", - "auto_scaling_group_name", "identifier", + "auto_scaling_group_name", + "lifecycle_hook_name", ], True, ], @@ -246,7 +244,7 @@ def main(): [("auto_scaling_group_name", "lifecycle_hook_name"), "identifier"] ] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/autoscaling_warm_pool.py b/plugins/modules/autoscaling_warm_pool.py index e590e0c3..9932bbc7 100644 --- a/plugins/modules/autoscaling_warm_pool.py +++ b/plugins/modules/autoscaling_warm_pool.py @@ -118,9 +118,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -176,7 +174,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/backup_backup_vault.py b/plugins/modules/backup_backup_vault.py index e9b23e99..3196e478 100644 --- a/plugins/modules/backup_backup_vault.py +++ b/plugins/modules/backup_backup_vault.py @@ -159,9 +159,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -233,7 +231,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/backup_framework.py b/plugins/modules/backup_framework.py index 73e7fa29..48bfe6f1 100644 --- a/plugins/modules/backup_framework.py +++ b/plugins/modules/backup_framework.py @@ -232,9 +232,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -332,7 +330,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/backup_report_plan.py b/plugins/modules/backup_report_plan.py index 2729226f..f014c5fa 100644 --- a/plugins/modules/backup_report_plan.py +++ b/plugins/modules/backup_report_plan.py @@ -215,9 +215,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -298,7 +296,7 @@ def main(): [ "state", "present", - ["report_plan_arn", "report_setting", "report_delivery_channel"], + ["report_delivery_channel", "report_setting", "report_plan_arn"], True, ], ["state", "absent", ["report_plan_arn"], True], @@ -306,7 +304,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/cloudtrail_event_data_store.py b/plugins/modules/cloudtrail_event_data_store.py index 463ecc33..76ba718f 100644 --- a/plugins/modules/cloudtrail_event_data_store.py +++ b/plugins/modules/cloudtrail_event_data_store.py @@ -231,9 +231,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -343,7 +341,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/cloudtrail_trail.py b/plugins/modules/cloudtrail_trail.py index 8a8264bc..f930c418 100644 --- a/plugins/modules/cloudtrail_trail.py +++ b/plugins/modules/cloudtrail_trail.py @@ -367,9 +367,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -520,13 +518,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["is_logging", "s3_bucket_name", "trail_name"], True], + ["state", "present", ["s3_bucket_name", "is_logging", "trail_name"], True], ["state", "absent", ["trail_name"], True], ["state", "get", ["trail_name"], True], ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/cloudwatch_composite_alarm.py b/plugins/modules/cloudwatch_composite_alarm.py index e942379f..c1260d42 100644 --- a/plugins/modules/cloudwatch_composite_alarm.py +++ b/plugins/modules/cloudwatch_composite_alarm.py @@ -151,9 +151,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -226,7 +224,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index 216d59d7..02b74755 100644 --- a/plugins/modules/cloudwatch_metric_stream.py +++ b/plugins/modules/cloudwatch_metric_stream.py @@ -212,9 +212,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -307,7 +305,7 @@ def main(): [ "state", "present", - ["firehose_arn", "name", "output_format", "role_arn"], + ["name", "role_arn", "output_format", "firehose_arn"], True, ], ["state", "absent", ["name"], True], @@ -315,7 +313,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/dynamodb_global_table.py b/plugins/modules/dynamodb_global_table.py index 81eac1a7..b127f294 100644 --- a/plugins/modules/dynamodb_global_table.py +++ b/plugins/modules/dynamodb_global_table.py @@ -672,9 +672,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -1043,7 +1041,7 @@ def main(): [ "state", "present", - ["replicas", "table_name", "attribute_definitions", "key_schema"], + ["table_name", "replicas", "key_schema", "attribute_definitions"], True, ], ["state", "absent", ["table_name"], True], @@ -1051,7 +1049,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ec2_placement_group.py b/plugins/modules/ec2_placement_group.py index d5c6324a..302301f6 100644 --- a/plugins/modules/ec2_placement_group.py +++ b/plugins/modules/ec2_placement_group.py @@ -119,9 +119,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -166,7 +164,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ecr_repository.py b/plugins/modules/ecr_repository.py index 823a5b89..c033893d 100644 --- a/plugins/modules/ecr_repository.py +++ b/plugins/modules/ecr_repository.py @@ -194,9 +194,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -275,7 +273,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ecs_capacity_provider.py b/plugins/modules/ecs_capacity_provider.py index 7702151f..4e0c20e5 100644 --- a/plugins/modules/ecs_capacity_provider.py +++ b/plugins/modules/ecs_capacity_provider.py @@ -161,9 +161,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -244,7 +242,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ecs_cluster.py b/plugins/modules/ecs_cluster.py index e87229d4..2843aed5 100644 --- a/plugins/modules/ecs_cluster.py +++ b/plugins/modules/ecs_cluster.py @@ -239,9 +239,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -352,7 +350,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ecs_cluster_capacity_provider_associations.py b/plugins/modules/ecs_cluster_capacity_provider_associations.py index ffde5df9..e3aa7b82 100644 --- a/plugins/modules/ecs_cluster_capacity_provider_associations.py +++ b/plugins/modules/ecs_cluster_capacity_provider_associations.py @@ -18,14 +18,6 @@ capacity_providers: aliases: - CapacityProviders - any_of: - - enum: - - FARGATE - - FARGATE_SPOT - type: string - - maxLength: 2048 - minLength: 1 - type: string description: - If using ec2 auto-scaling, the name of the associated capacity provider. - Otherwise FARGATE, C(FARGATE_SPOT). @@ -53,14 +45,6 @@ capacity_provider: aliases: - CapacityProvider - any_of: - - enum: - - FARGATE - - FARGATE_SPOT - type: string - - maxLength: 2048 - minLength: 1 - type: string description: - If using ec2 auto-scaling, the name of the associated capacity provider. - Otherwise FARGATE, C(FARGATE_SPOT). @@ -136,9 +120,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -164,10 +146,6 @@ def main(): argument_spec["capacity_providers"] = { "type": "list", "elements": "str", - "any_of": [ - {"type": "string", "enum": ["FARGATE", "FARGATE_SPOT"]}, - {"type": "string", "minLength": 1, "maxLength": 2048}, - ], "aliases": ["CapacityProviders"], } argument_spec["cluster"] = {"type": "str", "aliases": ["Cluster"]} @@ -177,14 +155,7 @@ def main(): "options": { "base": {"type": "int", "aliases": ["Base"]}, "weight": {"type": "int", "aliases": ["Weight"]}, - "capacity_provider": { - "type": "str", - "any_of": [ - {"type": "string", "enum": ["FARGATE", "FARGATE_SPOT"]}, - {"type": "string", "minLength": 1, "maxLength": 2048}, - ], - "aliases": ["CapacityProvider"], - }, + "capacity_provider": {"type": "str", "aliases": ["CapacityProvider"]}, }, "aliases": ["DefaultCapacityProviderStrategy"], } @@ -201,7 +172,7 @@ def main(): [ "state", "present", - ["capacity_providers", "cluster", "default_capacity_provider_strategy"], + ["default_capacity_provider_strategy", "capacity_providers", "cluster"], True, ], ["state", "absent", ["cluster"], True], @@ -209,7 +180,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ecs_primary_task_set.py b/plugins/modules/ecs_primary_task_set.py index 638fc344..b382a25c 100644 --- a/plugins/modules/ecs_primary_task_set.py +++ b/plugins/modules/ecs_primary_task_set.py @@ -107,9 +107,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -147,13 +145,13 @@ def main(): required_if = [ ["state", "list", ["cluster"], True], - ["state", "present", ["task_set_id", "service", "cluster", "identifier"], True], + ["state", "present", ["service", "task_set_id", "identifier", "cluster"], True], ["state", "absent", ["cluster", "service", "identifier"], True], ["state", "get", ["cluster", "service", "identifier"], True], ] mutually_exclusive = [[("cluster", "service"), "identifier"]] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/eks_addon.py b/plugins/modules/eks_addon.py index 4e81baa4..619c4b09 100644 --- a/plugins/modules/eks_addon.py +++ b/plugins/modules/eks_addon.py @@ -147,9 +147,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -206,13 +204,13 @@ def main(): required_if = [ ["state", "list", ["cluster_name"], True], - ["state", "present", ["addon_name", "cluster_name", "identifier"], True], + ["state", "present", ["addon_name", "identifier", "cluster_name"], True], ["state", "absent", ["cluster_name", "addon_name", "identifier"], True], ["state", "get", ["cluster_name", "addon_name", "identifier"], True], ] mutually_exclusive = [[("cluster_name", "addon_name"), "identifier"]] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/eks_cluster.py b/plugins/modules/eks_cluster.py index 645ab09c..d26f8998 100644 --- a/plugins/modules/eks_cluster.py +++ b/plugins/modules/eks_cluster.py @@ -317,9 +317,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -457,13 +455,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["name", "role_arn", "resources_vpc_config"], True], + ["state", "present", ["resources_vpc_config", "name", "role_arn"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/eks_fargate_profile.py b/plugins/modules/eks_fargate_profile.py index 2b2b26a3..b049eb27 100644 --- a/plugins/modules/eks_fargate_profile.py +++ b/plugins/modules/eks_fargate_profile.py @@ -158,9 +158,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -235,8 +233,8 @@ def main(): "selectors", "identifier", "pod_execution_role_arn", - "cluster_name", "fargate_profile_name", + "cluster_name", ], True, ], @@ -250,7 +248,7 @@ def main(): ] mutually_exclusive = [[("cluster_name", "fargate_profile_name"), "identifier"]] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/iam_instance_profile.py b/plugins/modules/iam_instance_profile.py index 528992e8..53bf316c 100644 --- a/plugins/modules/iam_instance_profile.py +++ b/plugins/modules/iam_instance_profile.py @@ -99,9 +99,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -140,13 +138,13 @@ 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], ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index 29688d7b..edfbe14e 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -158,9 +158,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -230,7 +228,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/iam_server_certificate.py b/plugins/modules/iam_server_certificate.py index 18ce0a89..41bcc8a5 100644 --- a/plugins/modules/iam_server_certificate.py +++ b/plugins/modules/iam_server_certificate.py @@ -120,9 +120,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -174,7 +172,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/kms_alias.py b/plugins/modules/kms_alias.py index 00b3025f..e5ddf0c5 100644 --- a/plugins/modules/kms_alias.py +++ b/plugins/modules/kms_alias.py @@ -96,9 +96,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -133,13 +131,13 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["target_key_id", "alias_name"], True], + ["state", "present", ["alias_name", "target_key_id"], True], ["state", "absent", ["alias_name"], True], ["state", "get", ["alias_name"], True], ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/kms_replica_key.py b/plugins/modules/kms_replica_key.py index eb9a0192..818ed86d 100644 --- a/plugins/modules/kms_replica_key.py +++ b/plugins/modules/kms_replica_key.py @@ -138,9 +138,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -184,13 +182,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["primary_key_arn", "key_policy", "key_id"], True], + ["state", "present", ["key_policy", "key_id", "primary_key_arn"], True], ["state", "absent", ["key_id"], True], ["state", "get", ["key_id"], True], ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/lambda_code_signing_config.py b/plugins/modules/lambda_code_signing_config.py index cbbcf474..1e85d4ff 100644 --- a/plugins/modules/lambda_code_signing_config.py +++ b/plugins/modules/lambda_code_signing_config.py @@ -126,9 +126,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -195,7 +193,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/lambda_event_source_mapping.py b/plugins/modules/lambda_event_source_mapping.py index 66e91a8e..54204de8 100644 --- a/plugins/modules/lambda_event_source_mapping.py +++ b/plugins/modules/lambda_event_source_mapping.py @@ -358,9 +358,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -540,7 +538,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/lambda_function.py b/plugins/modules/lambda_function.py index 1fa6ff62..ca66bd91 100644 --- a/plugins/modules/lambda_function.py +++ b/plugins/modules/lambda_function.py @@ -397,9 +397,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -547,13 +545,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["code", "function_name", "role"], True], + ["state", "present", ["function_name", "role", "code"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/logs_log_group.py b/plugins/modules/logs_log_group.py index 9ea4b34c..adfa20c8 100644 --- a/plugins/modules/logs_log_group.py +++ b/plugins/modules/logs_log_group.py @@ -145,9 +145,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -222,7 +220,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index 7866d43e..39cf3f2d 100644 --- a/plugins/modules/logs_metric_filter.py +++ b/plugins/modules/logs_metric_filter.py @@ -200,9 +200,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -297,11 +295,11 @@ def main(): "state", "present", [ - "identifier", - "filter_name", "filter_pattern", + "identifier", "log_group_name", "metric_transformations", + "filter_name", ], True, ], @@ -310,7 +308,7 @@ def main(): ] mutually_exclusive = [[("log_group_name", "filter_name"), "identifier"]] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/logs_query_definition.py b/plugins/modules/logs_query_definition.py index 8d62d8d6..7ff11227 100644 --- a/plugins/modules/logs_query_definition.py +++ b/plugins/modules/logs_query_definition.py @@ -102,9 +102,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -148,13 +146,13 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["query_definition_id", "name", "query_string"], True], + ["state", "present", ["query_string", "name", "query_definition_id"], True], ["state", "absent", ["query_definition_id"], True], ["state", "get", ["query_definition_id"], True], ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/logs_resource_policy.py b/plugins/modules/logs_resource_policy.py index 77a63531..a78c3961 100644 --- a/plugins/modules/logs_resource_policy.py +++ b/plugins/modules/logs_resource_policy.py @@ -90,9 +90,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -133,7 +131,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/memorydb_acl.py b/plugins/modules/memorydb_acl.py index 6ce23792..2754d6a7 100644 --- a/plugins/modules/memorydb_acl.py +++ b/plugins/modules/memorydb_acl.py @@ -121,9 +121,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -170,7 +168,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index 67abb0ab..e292fd0a 100644 --- a/plugins/modules/memorydb_cluster.py +++ b/plugins/modules/memorydb_cluster.py @@ -284,9 +284,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -378,13 +376,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["acl_name", "node_type", "cluster_name"], True], + ["state", "present", ["node_type", "cluster_name", "acl_name"], True], ["state", "absent", ["cluster_name"], True], ["state", "get", ["cluster_name"], True], ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/memorydb_parameter_group.py b/plugins/modules/memorydb_parameter_group.py index 13516f2e..59226867 100644 --- a/plugins/modules/memorydb_parameter_group.py +++ b/plugins/modules/memorydb_parameter_group.py @@ -134,9 +134,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -184,7 +182,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/memorydb_subnet_group.py b/plugins/modules/memorydb_subnet_group.py index ff21d043..0cb96587 100644 --- a/plugins/modules/memorydb_subnet_group.py +++ b/plugins/modules/memorydb_subnet_group.py @@ -133,9 +133,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -177,13 +175,13 @@ 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], ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/memorydb_user.py b/plugins/modules/memorydb_user.py index d17f95b9..efdb9b0f 100644 --- a/plugins/modules/memorydb_user.py +++ b/plugins/modules/memorydb_user.py @@ -126,9 +126,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -183,7 +181,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/rds_db_cluster_parameter_group.py b/plugins/modules/rds_db_cluster_parameter_group.py index 4c9f69fa..28de0f43 100644 --- a/plugins/modules/rds_db_cluster_parameter_group.py +++ b/plugins/modules/rds_db_cluster_parameter_group.py @@ -120,9 +120,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -167,7 +165,7 @@ def main(): [ "state", "present", - ["parameters", "description", "family", "db_cluster_parameter_group_name"], + ["parameters", "description", "db_cluster_parameter_group_name", "family"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], @@ -175,7 +173,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/rds_db_instance.py b/plugins/modules/rds_db_instance.py index b1344d31..5bd03f1a 100644 --- a/plugins/modules/rds_db_instance.py +++ b/plugins/modules/rds_db_instance.py @@ -721,9 +721,7 @@ class of the DB instance. """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -1022,7 +1020,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index efce0925..9426d94d 100644 --- a/plugins/modules/rds_db_proxy.py +++ b/plugins/modules/rds_db_proxy.py @@ -208,9 +208,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -300,7 +298,7 @@ def main(): [ "state", "present", - ["db_proxy_name", "engine_family", "auth", "role_arn", "vpc_subnet_ids"], + ["auth", "engine_family", "role_arn", "db_proxy_name", "vpc_subnet_ids"], True, ], ["state", "absent", ["db_proxy_name"], True], @@ -308,7 +306,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/rds_db_proxy_endpoint.py b/plugins/modules/rds_db_proxy_endpoint.py index acd65f86..d3a8c238 100644 --- a/plugins/modules/rds_db_proxy_endpoint.py +++ b/plugins/modules/rds_db_proxy_endpoint.py @@ -132,9 +132,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -192,7 +190,7 @@ def main(): [ "state", "present", - ["vpc_subnet_ids", "db_proxy_endpoint_name", "db_proxy_name"], + ["db_proxy_endpoint_name", "vpc_subnet_ids", "db_proxy_name"], True, ], ["state", "absent", ["db_proxy_endpoint_name"], True], @@ -200,7 +198,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/rds_db_subnet_group.py b/plugins/modules/rds_db_subnet_group.py index d3d0bad4..83026888 100644 --- a/plugins/modules/rds_db_subnet_group.py +++ b/plugins/modules/rds_db_subnet_group.py @@ -111,9 +111,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -172,7 +170,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/rds_global_cluster.py b/plugins/modules/rds_global_cluster.py index d2190392..00560f7e 100644 --- a/plugins/modules/rds_global_cluster.py +++ b/plugins/modules/rds_global_cluster.py @@ -136,9 +136,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -200,7 +198,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/rds_option_group.py b/plugins/modules/rds_option_group.py index 5e6c07de..e856ac1d 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -178,9 +178,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -258,10 +256,10 @@ def main(): "state", "present", [ - "engine_name", - "major_engine_version", "option_group_name", "option_group_description", + "major_engine_version", + "engine_name", ], True, ], @@ -270,7 +268,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index 4baf024e..b6e7afc3 100644 --- a/plugins/modules/redshift_cluster.py +++ b/plugins/modules/redshift_cluster.py @@ -461,9 +461,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -651,12 +649,12 @@ def main(): "state", "present", [ - "master_username", - "master_user_password", - "cluster_type", "node_type", + "cluster_type", + "master_username", "db_name", "cluster_identifier", + "master_user_password", ], True, ], @@ -665,7 +663,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index f8accd2a..1b4170e6 100644 --- a/plugins/modules/redshift_endpoint_access.py +++ b/plugins/modules/redshift_endpoint_access.py @@ -113,9 +113,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -165,9 +163,9 @@ def main(): "present", [ "cluster_identifier", - "subnet_group_name", "vpc_security_group_ids", "endpoint_name", + "subnet_group_name", ], True, ], @@ -176,7 +174,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index f422c52b..ed4376bd 100644 --- a/plugins/modules/redshift_endpoint_authorization.py +++ b/plugins/modules/redshift_endpoint_authorization.py @@ -105,9 +105,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -152,13 +150,13 @@ def main(): required_if = [ ["state", "list", ["cluster_identifier"], True], - ["state", "present", ["account", "cluster_identifier", "identifier"], True], + ["state", "present", ["cluster_identifier", "account", "identifier"], True], ["state", "absent", ["cluster_identifier", "account", "identifier"], True], ["state", "get", ["cluster_identifier", "account", "identifier"], True], ] mutually_exclusive = [[("cluster_identifier", "account"), "identifier"]] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/redshift_event_subscription.py b/plugins/modules/redshift_event_subscription.py index e4c881a6..6b739f42 100644 --- a/plugins/modules/redshift_event_subscription.py +++ b/plugins/modules/redshift_event_subscription.py @@ -153,9 +153,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -229,7 +227,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/redshift_scheduled_action.py b/plugins/modules/redshift_scheduled_action.py index 2d89fb11..297b4eed 100644 --- a/plugins/modules/redshift_scheduled_action.py +++ b/plugins/modules/redshift_scheduled_action.py @@ -201,9 +201,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -295,7 +293,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/route53_dnssec.py b/plugins/modules/route53_dnssec.py index 4a5826fd..ef32622d 100644 --- a/plugins/modules/route53_dnssec.py +++ b/plugins/modules/route53_dnssec.py @@ -83,9 +83,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -125,7 +123,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/route53_key_signing_key.py b/plugins/modules/route53_key_signing_key.py index b265bb82..56371f85 100644 --- a/plugins/modules/route53_key_signing_key.py +++ b/plugins/modules/route53_key_signing_key.py @@ -115,9 +115,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -167,11 +165,11 @@ def main(): "state", "present", [ - "status", - "identifier", "hosted_zone_id", - "name", + "identifier", "key_management_service_arn", + "name", + "status", ], True, ], @@ -180,7 +178,7 @@ def main(): ] mutually_exclusive = [[("hosted_zone_id", "name"), "identifier"]] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/s3_access_point.py b/plugins/modules/s3_access_point.py index 0b88a94d..e5448cc2 100644 --- a/plugins/modules/s3_access_point.py +++ b/plugins/modules/s3_access_point.py @@ -181,9 +181,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -238,13 +236,13 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["bucket", "name"], True], + ["state", "present", ["name", "bucket"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/s3_bucket.py b/plugins/modules/s3_bucket.py index bcb4d935..b42cc139 100644 --- a/plugins/modules/s3_bucket.py +++ b/plugins/modules/s3_bucket.py @@ -1725,9 +1725,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -2674,7 +2672,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/s3_multi_region_access_point.py b/plugins/modules/s3_multi_region_access_point.py index d0c78e34..485b86c1 100644 --- a/plugins/modules/s3_multi_region_access_point.py +++ b/plugins/modules/s3_multi_region_access_point.py @@ -165,9 +165,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -229,7 +227,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/s3_multi_region_access_point_policy.py b/plugins/modules/s3_multi_region_access_point_policy.py index 6b6d4eb7..f18213a3 100644 --- a/plugins/modules/s3_multi_region_access_point_policy.py +++ b/plugins/modules/s3_multi_region_access_point_policy.py @@ -90,9 +90,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -127,13 +125,13 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["policy", "mrap_name"], True], + ["state", "present", ["mrap_name", "policy"], True], ["state", "absent", ["mrap_name"], True], ["state", "get", ["mrap_name"], True], ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/s3objectlambda_access_point.py b/plugins/modules/s3objectlambda_access_point.py index 9044649d..3b8ee7cb 100644 --- a/plugins/modules/s3objectlambda_access_point.py +++ b/plugins/modules/s3objectlambda_access_point.py @@ -158,9 +158,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -251,7 +249,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/s3objectlambda_access_point_policy.py b/plugins/modules/s3objectlambda_access_point_policy.py index e0030802..45dffdc0 100644 --- a/plugins/modules/s3objectlambda_access_point_policy.py +++ b/plugins/modules/s3objectlambda_access_point_policy.py @@ -91,9 +91,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -137,7 +135,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ssm_document.py b/plugins/modules/ssm_document.py index f97f6fc5..898467f9 100644 --- a/plugins/modules/ssm_document.py +++ b/plugins/modules/ssm_document.py @@ -219,9 +219,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -320,7 +318,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ssm_resource_data_sync.py b/plugins/modules/ssm_resource_data_sync.py index 6d29a01a..d46bbd5e 100644 --- a/plugins/modules/ssm_resource_data_sync.py +++ b/plugins/modules/ssm_resource_data_sync.py @@ -203,9 +203,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -293,7 +291,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/wafv2_ip_set.py b/plugins/modules/wafv2_ip_set.py index 616fc7a0..c2734fe2 100644 --- a/plugins/modules/wafv2_ip_set.py +++ b/plugins/modules/wafv2_ip_set.py @@ -146,9 +146,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -206,7 +204,7 @@ def main(): [ "state", "present", - ["ip_address_version", "identifier", "scope", "id", "addresses", "name"], + ["scope", "id", "identifier", "ip_address_version", "name", "addresses"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], @@ -214,7 +212,7 @@ def main(): ] mutually_exclusive = [[("name", "id", "scope"), "identifier"]] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/wafv2_logging_configuration.py b/plugins/modules/wafv2_logging_configuration.py index 7307c76d..63cf928f 100644 --- a/plugins/modules/wafv2_logging_configuration.py +++ b/plugins/modules/wafv2_logging_configuration.py @@ -302,9 +302,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -455,7 +453,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/wafv2_regex_pattern_set.py b/plugins/modules/wafv2_regex_pattern_set.py index a6bfd950..270efd63 100644 --- a/plugins/modules/wafv2_regex_pattern_set.py +++ b/plugins/modules/wafv2_regex_pattern_set.py @@ -134,9 +134,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -189,7 +187,7 @@ def main(): [ "state", "present", - ["identifier", "scope", "id", "name", "regular_expression_list"], + ["scope", "id", "identifier", "name", "regular_expression_list"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], @@ -197,7 +195,7 @@ def main(): ] mutually_exclusive = [[("name", "id", "scope"), "identifier"]] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/wafv2_web_acl_association.py b/plugins/modules/wafv2_web_acl_association.py index 7c369936..e465c609 100644 --- a/plugins/modules/wafv2_web_acl_association.py +++ b/plugins/modules/wafv2_web_acl_association.py @@ -98,9 +98,7 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - AnsibleAmazonCloudModule, -) +from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -137,13 +135,13 @@ def main(): required_if = [ ["state", "list", ["resource_arn"], True], - ["state", "present", ["web_acl_arn", "identifier", "resource_arn"], True], + ["state", "present", ["identifier", "resource_arn", "web_acl_arn"], True], ["state", "absent", ["resource_arn", "web_acl_arn", "identifier"], True], ["state", "get", ["resource_arn", "web_acl_arn", "identifier"], True], ] mutually_exclusive = [[("resource_arn", "web_acl_arn"), "identifier"]] - module = AnsibleAmazonCloudModule( + module = AnsibleAWSModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, From 9343a24fc2dcec11d770ea4637ec4434e767742e Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Fri, 30 Jun 2023 18:49:14 +0200 Subject: [PATCH 06/32] Re-generate Signed-off-by: Alina Buzachis --- .../autoscaling_launch_configuration.py | 8 ++++--- plugins/modules/autoscaling_lifecycle_hook.py | 10 ++++---- plugins/modules/autoscaling_warm_pool.py | 6 +++-- plugins/modules/backup_backup_vault.py | 6 +++-- plugins/modules/backup_framework.py | 8 ++++--- plugins/modules/backup_report_plan.py | 6 +++-- .../modules/cloudtrail_event_data_store.py | 6 +++-- plugins/modules/cloudtrail_trail.py | 6 +++-- plugins/modules/cloudwatch_composite_alarm.py | 8 ++++--- plugins/modules/cloudwatch_metric_stream.py | 8 ++++--- plugins/modules/dynamodb_global_table.py | 8 ++++--- plugins/modules/ec2_placement_group.py | 6 +++-- plugins/modules/ecr_repository.py | 6 +++-- plugins/modules/ecs_capacity_provider.py | 8 ++++--- plugins/modules/ecs_cluster.py | 6 +++-- ..._cluster_capacity_provider_associations.py | 8 ++++--- plugins/modules/ecs_primary_task_set.py | 8 ++++--- plugins/modules/eks_addon.py | 8 ++++--- plugins/modules/eks_cluster.py | 8 ++++--- plugins/modules/eks_fargate_profile.py | 12 ++++++---- plugins/modules/iam_instance_profile.py | 6 +++-- plugins/modules/iam_role.py | 8 ++++--- plugins/modules/iam_server_certificate.py | 6 +++-- plugins/modules/kms_alias.py | 6 +++-- plugins/modules/kms_replica_key.py | 8 ++++--- plugins/modules/lambda_code_signing_config.py | 6 +++-- .../modules/lambda_event_source_mapping.py | 8 ++++--- plugins/modules/lambda_function.py | 8 ++++--- plugins/modules/logs_log_group.py | 6 +++-- plugins/modules/logs_metric_filter.py | 10 ++++---- plugins/modules/logs_query_definition.py | 8 ++++--- plugins/modules/logs_resource_policy.py | 8 ++++--- plugins/modules/memorydb_acl.py | 6 +++-- plugins/modules/memorydb_cluster.py | 8 ++++--- plugins/modules/memorydb_parameter_group.py | 8 ++++--- plugins/modules/memorydb_subnet_group.py | 8 ++++--- plugins/modules/memorydb_user.py | 6 +++-- .../modules/rds_db_cluster_parameter_group.py | 8 ++++--- plugins/modules/rds_db_instance.py | 24 ++++++++++--------- plugins/modules/rds_db_proxy.py | 8 ++++--- plugins/modules/rds_db_proxy_endpoint.py | 8 ++++--- plugins/modules/rds_db_subnet_group.py | 8 ++++--- plugins/modules/rds_global_cluster.py | 6 +++-- plugins/modules/rds_option_group.py | 10 ++++---- plugins/modules/redshift_cluster.py | 14 ++++++----- plugins/modules/redshift_endpoint_access.py | 8 ++++--- .../redshift_endpoint_authorization.py | 8 ++++--- .../modules/redshift_event_subscription.py | 6 +++-- plugins/modules/redshift_scheduled_action.py | 6 +++-- plugins/modules/route53_dnssec.py | 6 +++-- plugins/modules/route53_key_signing_key.py | 10 ++++---- plugins/modules/s3_access_point.py | 8 ++++--- plugins/modules/s3_bucket.py | 6 +++-- .../modules/s3_multi_region_access_point.py | 6 +++-- .../s3_multi_region_access_point_policy.py | 6 +++-- .../modules/s3objectlambda_access_point.py | 8 ++++--- .../s3objectlambda_access_point_policy.py | 8 ++++--- plugins/modules/ssm_document.py | 8 ++++--- plugins/modules/ssm_resource_data_sync.py | 6 +++-- plugins/modules/wafv2_ip_set.py | 8 ++++--- .../modules/wafv2_logging_configuration.py | 6 +++-- plugins/modules/wafv2_regex_pattern_set.py | 8 ++++--- plugins/modules/wafv2_web_acl_association.py | 8 ++++--- 63 files changed, 308 insertions(+), 182 deletions(-) diff --git a/plugins/modules/autoscaling_launch_configuration.py b/plugins/modules/autoscaling_launch_configuration.py index 8eae70f1..94341544 100644 --- a/plugins/modules/autoscaling_launch_configuration.py +++ b/plugins/modules/autoscaling_launch_configuration.py @@ -302,7 +302,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -419,7 +421,7 @@ def main(): [ "state", "present", - ["launch_configuration_name", "instance_type", "image_id"], + ["instance_type", "image_id", "launch_configuration_name"], True, ], ["state", "absent", ["launch_configuration_name"], True], @@ -427,7 +429,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index 67582974..973111b3 100644 --- a/plugins/modules/autoscaling_lifecycle_hook.py +++ b/plugins/modules/autoscaling_lifecycle_hook.py @@ -155,7 +155,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -220,10 +222,10 @@ def main(): "state", "present", [ - "lifecycle_transition", "identifier", - "auto_scaling_group_name", + "lifecycle_transition", "lifecycle_hook_name", + "auto_scaling_group_name", ], True, ], @@ -244,7 +246,7 @@ def main(): [("auto_scaling_group_name", "lifecycle_hook_name"), "identifier"] ] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/autoscaling_warm_pool.py b/plugins/modules/autoscaling_warm_pool.py index 9932bbc7..e590e0c3 100644 --- a/plugins/modules/autoscaling_warm_pool.py +++ b/plugins/modules/autoscaling_warm_pool.py @@ -118,7 +118,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -174,7 +176,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/backup_backup_vault.py b/plugins/modules/backup_backup_vault.py index 3196e478..e9b23e99 100644 --- a/plugins/modules/backup_backup_vault.py +++ b/plugins/modules/backup_backup_vault.py @@ -159,7 +159,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -231,7 +233,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/backup_framework.py b/plugins/modules/backup_framework.py index 48bfe6f1..7874791b 100644 --- a/plugins/modules/backup_framework.py +++ b/plugins/modules/backup_framework.py @@ -232,7 +232,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -324,13 +326,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["framework_arn", "framework_controls"], True], + ["state", "present", ["framework_controls", "framework_arn"], True], ["state", "absent", ["framework_arn"], True], ["state", "get", ["framework_arn"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/backup_report_plan.py b/plugins/modules/backup_report_plan.py index f014c5fa..2363e7a8 100644 --- a/plugins/modules/backup_report_plan.py +++ b/plugins/modules/backup_report_plan.py @@ -215,7 +215,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -304,7 +306,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/cloudtrail_event_data_store.py b/plugins/modules/cloudtrail_event_data_store.py index 76ba718f..463ecc33 100644 --- a/plugins/modules/cloudtrail_event_data_store.py +++ b/plugins/modules/cloudtrail_event_data_store.py @@ -231,7 +231,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -341,7 +343,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/cloudtrail_trail.py b/plugins/modules/cloudtrail_trail.py index f930c418..517eabe6 100644 --- a/plugins/modules/cloudtrail_trail.py +++ b/plugins/modules/cloudtrail_trail.py @@ -367,7 +367,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -524,7 +526,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/cloudwatch_composite_alarm.py b/plugins/modules/cloudwatch_composite_alarm.py index c1260d42..82c2e711 100644 --- a/plugins/modules/cloudwatch_composite_alarm.py +++ b/plugins/modules/cloudwatch_composite_alarm.py @@ -151,7 +151,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -218,13 +220,13 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["alarm_name", "alarm_rule"], True], + ["state", "present", ["alarm_rule", "alarm_name"], True], ["state", "absent", ["alarm_name"], True], ["state", "get", ["alarm_name"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index 02b74755..91a8b4ad 100644 --- a/plugins/modules/cloudwatch_metric_stream.py +++ b/plugins/modules/cloudwatch_metric_stream.py @@ -212,7 +212,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -305,7 +307,7 @@ def main(): [ "state", "present", - ["name", "role_arn", "output_format", "firehose_arn"], + ["name", "role_arn", "firehose_arn", "output_format"], True, ], ["state", "absent", ["name"], True], @@ -313,7 +315,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/dynamodb_global_table.py b/plugins/modules/dynamodb_global_table.py index b127f294..a3a3bf3b 100644 --- a/plugins/modules/dynamodb_global_table.py +++ b/plugins/modules/dynamodb_global_table.py @@ -672,7 +672,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -1041,7 +1043,7 @@ def main(): [ "state", "present", - ["table_name", "replicas", "key_schema", "attribute_definitions"], + ["attribute_definitions", "key_schema", "table_name", "replicas"], True, ], ["state", "absent", ["table_name"], True], @@ -1049,7 +1051,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ec2_placement_group.py b/plugins/modules/ec2_placement_group.py index 302301f6..d5c6324a 100644 --- a/plugins/modules/ec2_placement_group.py +++ b/plugins/modules/ec2_placement_group.py @@ -119,7 +119,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -164,7 +166,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ecr_repository.py b/plugins/modules/ecr_repository.py index c033893d..823a5b89 100644 --- a/plugins/modules/ecr_repository.py +++ b/plugins/modules/ecr_repository.py @@ -194,7 +194,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -273,7 +275,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ecs_capacity_provider.py b/plugins/modules/ecs_capacity_provider.py index 4e0c20e5..db5a439f 100644 --- a/plugins/modules/ecs_capacity_provider.py +++ b/plugins/modules/ecs_capacity_provider.py @@ -161,7 +161,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -236,13 +238,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["name", "auto_scaling_group_provider"], True], + ["state", "present", ["auto_scaling_group_provider", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ecs_cluster.py b/plugins/modules/ecs_cluster.py index 2843aed5..e87229d4 100644 --- a/plugins/modules/ecs_cluster.py +++ b/plugins/modules/ecs_cluster.py @@ -239,7 +239,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -350,7 +352,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ecs_cluster_capacity_provider_associations.py b/plugins/modules/ecs_cluster_capacity_provider_associations.py index e3aa7b82..e578fba1 100644 --- a/plugins/modules/ecs_cluster_capacity_provider_associations.py +++ b/plugins/modules/ecs_cluster_capacity_provider_associations.py @@ -120,7 +120,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -172,7 +174,7 @@ def main(): [ "state", "present", - ["default_capacity_provider_strategy", "capacity_providers", "cluster"], + ["default_capacity_provider_strategy", "cluster", "capacity_providers"], True, ], ["state", "absent", ["cluster"], True], @@ -180,7 +182,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ecs_primary_task_set.py b/plugins/modules/ecs_primary_task_set.py index b382a25c..90e9119b 100644 --- a/plugins/modules/ecs_primary_task_set.py +++ b/plugins/modules/ecs_primary_task_set.py @@ -107,7 +107,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -145,13 +147,13 @@ def main(): required_if = [ ["state", "list", ["cluster"], True], - ["state", "present", ["service", "task_set_id", "identifier", "cluster"], True], + ["state", "present", ["service", "cluster", "identifier", "task_set_id"], True], ["state", "absent", ["cluster", "service", "identifier"], True], ["state", "get", ["cluster", "service", "identifier"], True], ] mutually_exclusive = [[("cluster", "service"), "identifier"]] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/eks_addon.py b/plugins/modules/eks_addon.py index 619c4b09..a4cd373c 100644 --- a/plugins/modules/eks_addon.py +++ b/plugins/modules/eks_addon.py @@ -147,7 +147,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -204,13 +206,13 @@ def main(): required_if = [ ["state", "list", ["cluster_name"], True], - ["state", "present", ["addon_name", "identifier", "cluster_name"], True], + ["state", "present", ["identifier", "cluster_name", "addon_name"], True], ["state", "absent", ["cluster_name", "addon_name", "identifier"], True], ["state", "get", ["cluster_name", "addon_name", "identifier"], True], ] mutually_exclusive = [[("cluster_name", "addon_name"), "identifier"]] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/eks_cluster.py b/plugins/modules/eks_cluster.py index d26f8998..645ab09c 100644 --- a/plugins/modules/eks_cluster.py +++ b/plugins/modules/eks_cluster.py @@ -317,7 +317,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -455,13 +457,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["resources_vpc_config", "name", "role_arn"], True], + ["state", "present", ["name", "role_arn", "resources_vpc_config"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/eks_fargate_profile.py b/plugins/modules/eks_fargate_profile.py index b049eb27..e751def3 100644 --- a/plugins/modules/eks_fargate_profile.py +++ b/plugins/modules/eks_fargate_profile.py @@ -158,7 +158,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -230,11 +232,11 @@ def main(): "state", "present", [ - "selectors", - "identifier", + "cluster_name", "pod_execution_role_arn", "fargate_profile_name", - "cluster_name", + "selectors", + "identifier", ], True, ], @@ -248,7 +250,7 @@ def main(): ] mutually_exclusive = [[("cluster_name", "fargate_profile_name"), "identifier"]] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/iam_instance_profile.py b/plugins/modules/iam_instance_profile.py index 53bf316c..ac7fd10b 100644 --- a/plugins/modules/iam_instance_profile.py +++ b/plugins/modules/iam_instance_profile.py @@ -99,7 +99,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -144,7 +146,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index edfbe14e..5ab7a4e0 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -158,7 +158,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -222,13 +224,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["assume_role_policy_document", "role_name"], True], + ["state", "present", ["role_name", "assume_role_policy_document"], True], ["state", "absent", ["role_name"], True], ["state", "get", ["role_name"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/iam_server_certificate.py b/plugins/modules/iam_server_certificate.py index 41bcc8a5..18ce0a89 100644 --- a/plugins/modules/iam_server_certificate.py +++ b/plugins/modules/iam_server_certificate.py @@ -120,7 +120,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -172,7 +174,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/kms_alias.py b/plugins/modules/kms_alias.py index e5ddf0c5..907721ad 100644 --- a/plugins/modules/kms_alias.py +++ b/plugins/modules/kms_alias.py @@ -96,7 +96,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -137,7 +139,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/kms_replica_key.py b/plugins/modules/kms_replica_key.py index 818ed86d..eb9a0192 100644 --- a/plugins/modules/kms_replica_key.py +++ b/plugins/modules/kms_replica_key.py @@ -138,7 +138,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -182,13 +184,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["key_policy", "key_id", "primary_key_arn"], True], + ["state", "present", ["primary_key_arn", "key_policy", "key_id"], True], ["state", "absent", ["key_id"], True], ["state", "get", ["key_id"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/lambda_code_signing_config.py b/plugins/modules/lambda_code_signing_config.py index 1e85d4ff..cbbcf474 100644 --- a/plugins/modules/lambda_code_signing_config.py +++ b/plugins/modules/lambda_code_signing_config.py @@ -126,7 +126,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -193,7 +195,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/lambda_event_source_mapping.py b/plugins/modules/lambda_event_source_mapping.py index 54204de8..949d6ca3 100644 --- a/plugins/modules/lambda_event_source_mapping.py +++ b/plugins/modules/lambda_event_source_mapping.py @@ -358,7 +358,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -532,13 +534,13 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["function_name", "id"], True], + ["state", "present", ["id", "function_name"], True], ["state", "absent", ["id"], True], ["state", "get", ["id"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/lambda_function.py b/plugins/modules/lambda_function.py index ca66bd91..f432924a 100644 --- a/plugins/modules/lambda_function.py +++ b/plugins/modules/lambda_function.py @@ -397,7 +397,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -545,13 +547,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["function_name", "role", "code"], True], + ["state", "present", ["code", "role", "function_name"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/logs_log_group.py b/plugins/modules/logs_log_group.py index adfa20c8..9ea4b34c 100644 --- a/plugins/modules/logs_log_group.py +++ b/plugins/modules/logs_log_group.py @@ -145,7 +145,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -220,7 +222,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index 39cf3f2d..24e0d830 100644 --- a/plugins/modules/logs_metric_filter.py +++ b/plugins/modules/logs_metric_filter.py @@ -200,7 +200,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -295,11 +297,11 @@ def main(): "state", "present", [ + "metric_transformations", "filter_pattern", + "filter_name", "identifier", "log_group_name", - "metric_transformations", - "filter_name", ], True, ], @@ -308,7 +310,7 @@ def main(): ] mutually_exclusive = [[("log_group_name", "filter_name"), "identifier"]] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/logs_query_definition.py b/plugins/modules/logs_query_definition.py index 7ff11227..a84a0e6a 100644 --- a/plugins/modules/logs_query_definition.py +++ b/plugins/modules/logs_query_definition.py @@ -102,7 +102,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -146,13 +148,13 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["query_string", "name", "query_definition_id"], True], + ["state", "present", ["name", "query_definition_id", "query_string"], True], ["state", "absent", ["query_definition_id"], True], ["state", "get", ["query_definition_id"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/logs_resource_policy.py b/plugins/modules/logs_resource_policy.py index a78c3961..ae9561b2 100644 --- a/plugins/modules/logs_resource_policy.py +++ b/plugins/modules/logs_resource_policy.py @@ -90,7 +90,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -125,13 +127,13 @@ 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], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/memorydb_acl.py b/plugins/modules/memorydb_acl.py index 2754d6a7..6ce23792 100644 --- a/plugins/modules/memorydb_acl.py +++ b/plugins/modules/memorydb_acl.py @@ -121,7 +121,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -168,7 +170,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index e292fd0a..6e025f80 100644 --- a/plugins/modules/memorydb_cluster.py +++ b/plugins/modules/memorydb_cluster.py @@ -284,7 +284,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -376,13 +378,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["node_type", "cluster_name", "acl_name"], True], + ["state", "present", ["acl_name", "cluster_name", "node_type"], True], ["state", "absent", ["cluster_name"], True], ["state", "get", ["cluster_name"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/memorydb_parameter_group.py b/plugins/modules/memorydb_parameter_group.py index 59226867..4a6380e2 100644 --- a/plugins/modules/memorydb_parameter_group.py +++ b/plugins/modules/memorydb_parameter_group.py @@ -134,7 +134,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -176,13 +178,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["parameter_group_name", "family"], True], + ["state", "present", ["family", "parameter_group_name"], True], ["state", "absent", ["parameter_group_name"], True], ["state", "get", ["parameter_group_name"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/memorydb_subnet_group.py b/plugins/modules/memorydb_subnet_group.py index 0cb96587..ff21d043 100644 --- a/plugins/modules/memorydb_subnet_group.py +++ b/plugins/modules/memorydb_subnet_group.py @@ -133,7 +133,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -175,13 +177,13 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["subnet_ids", "subnet_group_name"], True], + ["state", "present", ["subnet_group_name", "subnet_ids"], True], ["state", "absent", ["subnet_group_name"], True], ["state", "get", ["subnet_group_name"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/memorydb_user.py b/plugins/modules/memorydb_user.py index efdb9b0f..d17f95b9 100644 --- a/plugins/modules/memorydb_user.py +++ b/plugins/modules/memorydb_user.py @@ -126,7 +126,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -181,7 +183,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/rds_db_cluster_parameter_group.py b/plugins/modules/rds_db_cluster_parameter_group.py index 28de0f43..805d53c4 100644 --- a/plugins/modules/rds_db_cluster_parameter_group.py +++ b/plugins/modules/rds_db_cluster_parameter_group.py @@ -120,7 +120,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -165,7 +167,7 @@ def main(): [ "state", "present", - ["parameters", "description", "db_cluster_parameter_group_name", "family"], + ["db_cluster_parameter_group_name", "family", "description", "parameters"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], @@ -173,7 +175,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/rds_db_instance.py b/plugins/modules/rds_db_instance.py index 5bd03f1a..37e3114b 100644 --- a/plugins/modules/rds_db_instance.py +++ b/plugins/modules/rds_db_instance.py @@ -721,7 +721,9 @@ class of the DB instance. """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -1020,7 +1022,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, @@ -1140,6 +1142,15 @@ 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 = scrub_none_parameters(params) @@ -1175,15 +1186,6 @@ def main(): results = {"changed": False, "result": {}} - 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") - if state == "list": if "list" not in handlers: module.exit_json( diff --git a/plugins/modules/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index 9426d94d..3c43508a 100644 --- a/plugins/modules/rds_db_proxy.py +++ b/plugins/modules/rds_db_proxy.py @@ -208,7 +208,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -298,7 +300,7 @@ def main(): [ "state", "present", - ["auth", "engine_family", "role_arn", "db_proxy_name", "vpc_subnet_ids"], + ["vpc_subnet_ids", "role_arn", "auth", "db_proxy_name", "engine_family"], True, ], ["state", "absent", ["db_proxy_name"], True], @@ -306,7 +308,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/rds_db_proxy_endpoint.py b/plugins/modules/rds_db_proxy_endpoint.py index d3a8c238..4d69998f 100644 --- a/plugins/modules/rds_db_proxy_endpoint.py +++ b/plugins/modules/rds_db_proxy_endpoint.py @@ -132,7 +132,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -190,7 +192,7 @@ def main(): [ "state", "present", - ["db_proxy_endpoint_name", "vpc_subnet_ids", "db_proxy_name"], + ["db_proxy_name", "vpc_subnet_ids", "db_proxy_endpoint_name"], True, ], ["state", "absent", ["db_proxy_endpoint_name"], True], @@ -198,7 +200,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/rds_db_subnet_group.py b/plugins/modules/rds_db_subnet_group.py index 83026888..de0b2728 100644 --- a/plugins/modules/rds_db_subnet_group.py +++ b/plugins/modules/rds_db_subnet_group.py @@ -111,7 +111,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -162,7 +164,7 @@ def main(): [ "state", "present", - ["subnet_ids", "db_subnet_group_description", "db_subnet_group_name"], + ["db_subnet_group_name", "subnet_ids", "db_subnet_group_description"], True, ], ["state", "absent", ["db_subnet_group_name"], True], @@ -170,7 +172,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/rds_global_cluster.py b/plugins/modules/rds_global_cluster.py index 00560f7e..d2190392 100644 --- a/plugins/modules/rds_global_cluster.py +++ b/plugins/modules/rds_global_cluster.py @@ -136,7 +136,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -198,7 +200,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/rds_option_group.py b/plugins/modules/rds_option_group.py index e856ac1d..ffdaf1f7 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -178,7 +178,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -256,10 +258,10 @@ def main(): "state", "present", [ - "option_group_name", - "option_group_description", "major_engine_version", "engine_name", + "option_group_name", + "option_group_description", ], True, ], @@ -268,7 +270,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index b6e7afc3..c52b7061 100644 --- a/plugins/modules/redshift_cluster.py +++ b/plugins/modules/redshift_cluster.py @@ -461,7 +461,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -649,12 +651,12 @@ def main(): "state", "present", [ - "node_type", - "cluster_type", - "master_username", - "db_name", "cluster_identifier", "master_user_password", + "master_username", + "cluster_type", + "db_name", + "node_type", ], True, ], @@ -663,7 +665,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index 1b4170e6..5ca97d55 100644 --- a/plugins/modules/redshift_endpoint_access.py +++ b/plugins/modules/redshift_endpoint_access.py @@ -113,7 +113,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -162,10 +164,10 @@ def main(): "state", "present", [ - "cluster_identifier", "vpc_security_group_ids", "endpoint_name", "subnet_group_name", + "cluster_identifier", ], True, ], @@ -174,7 +176,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index ed4376bd..68346ed7 100644 --- a/plugins/modules/redshift_endpoint_authorization.py +++ b/plugins/modules/redshift_endpoint_authorization.py @@ -105,7 +105,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -150,13 +152,13 @@ def main(): required_if = [ ["state", "list", ["cluster_identifier"], True], - ["state", "present", ["cluster_identifier", "account", "identifier"], True], + ["state", "present", ["identifier", "account", "cluster_identifier"], True], ["state", "absent", ["cluster_identifier", "account", "identifier"], True], ["state", "get", ["cluster_identifier", "account", "identifier"], True], ] mutually_exclusive = [[("cluster_identifier", "account"), "identifier"]] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/redshift_event_subscription.py b/plugins/modules/redshift_event_subscription.py index 6b739f42..e4c881a6 100644 --- a/plugins/modules/redshift_event_subscription.py +++ b/plugins/modules/redshift_event_subscription.py @@ -153,7 +153,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -227,7 +229,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/redshift_scheduled_action.py b/plugins/modules/redshift_scheduled_action.py index 297b4eed..2d89fb11 100644 --- a/plugins/modules/redshift_scheduled_action.py +++ b/plugins/modules/redshift_scheduled_action.py @@ -201,7 +201,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -293,7 +295,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/route53_dnssec.py b/plugins/modules/route53_dnssec.py index ef32622d..4a5826fd 100644 --- a/plugins/modules/route53_dnssec.py +++ b/plugins/modules/route53_dnssec.py @@ -83,7 +83,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -123,7 +125,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/route53_key_signing_key.py b/plugins/modules/route53_key_signing_key.py index 56371f85..7c1dd225 100644 --- a/plugins/modules/route53_key_signing_key.py +++ b/plugins/modules/route53_key_signing_key.py @@ -115,7 +115,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -165,10 +167,10 @@ def main(): "state", "present", [ - "hosted_zone_id", - "identifier", "key_management_service_arn", "name", + "hosted_zone_id", + "identifier", "status", ], True, @@ -178,7 +180,7 @@ def main(): ] mutually_exclusive = [[("hosted_zone_id", "name"), "identifier"]] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/s3_access_point.py b/plugins/modules/s3_access_point.py index e5448cc2..0b88a94d 100644 --- a/plugins/modules/s3_access_point.py +++ b/plugins/modules/s3_access_point.py @@ -181,7 +181,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -236,13 +238,13 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["name", "bucket"], True], + ["state", "present", ["bucket", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/s3_bucket.py b/plugins/modules/s3_bucket.py index b42cc139..bcb4d935 100644 --- a/plugins/modules/s3_bucket.py +++ b/plugins/modules/s3_bucket.py @@ -1725,7 +1725,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -2672,7 +2674,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/s3_multi_region_access_point.py b/plugins/modules/s3_multi_region_access_point.py index 485b86c1..d0c78e34 100644 --- a/plugins/modules/s3_multi_region_access_point.py +++ b/plugins/modules/s3_multi_region_access_point.py @@ -165,7 +165,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -227,7 +229,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/s3_multi_region_access_point_policy.py b/plugins/modules/s3_multi_region_access_point_policy.py index f18213a3..d2d88b72 100644 --- a/plugins/modules/s3_multi_region_access_point_policy.py +++ b/plugins/modules/s3_multi_region_access_point_policy.py @@ -90,7 +90,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -131,7 +133,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/s3objectlambda_access_point.py b/plugins/modules/s3objectlambda_access_point.py index 3b8ee7cb..248f9e0a 100644 --- a/plugins/modules/s3objectlambda_access_point.py +++ b/plugins/modules/s3objectlambda_access_point.py @@ -158,7 +158,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -243,13 +245,13 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["object_lambda_configuration", "name"], True], + ["state", "present", ["name", "object_lambda_configuration"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/s3objectlambda_access_point_policy.py b/plugins/modules/s3objectlambda_access_point_policy.py index 45dffdc0..7433333f 100644 --- a/plugins/modules/s3objectlambda_access_point_policy.py +++ b/plugins/modules/s3objectlambda_access_point_policy.py @@ -91,7 +91,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -129,13 +131,13 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["policy_document", "object_lambda_access_point"], True], + ["state", "present", ["object_lambda_access_point", "policy_document"], True], ["state", "absent", ["object_lambda_access_point"], True], ["state", "get", ["object_lambda_access_point"], True], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ssm_document.py b/plugins/modules/ssm_document.py index 898467f9..5f0686a6 100644 --- a/plugins/modules/ssm_document.py +++ b/plugins/modules/ssm_document.py @@ -219,7 +219,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -312,13 +314,13 @@ 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], ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/ssm_resource_data_sync.py b/plugins/modules/ssm_resource_data_sync.py index d46bbd5e..6d29a01a 100644 --- a/plugins/modules/ssm_resource_data_sync.py +++ b/plugins/modules/ssm_resource_data_sync.py @@ -203,7 +203,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -291,7 +293,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/wafv2_ip_set.py b/plugins/modules/wafv2_ip_set.py index c2734fe2..fa5ee659 100644 --- a/plugins/modules/wafv2_ip_set.py +++ b/plugins/modules/wafv2_ip_set.py @@ -146,7 +146,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -204,7 +206,7 @@ def main(): [ "state", "present", - ["scope", "id", "identifier", "ip_address_version", "name", "addresses"], + ["addresses", "name", "ip_address_version", "scope", "id", "identifier"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], @@ -212,7 +214,7 @@ def main(): ] mutually_exclusive = [[("name", "id", "scope"), "identifier"]] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/wafv2_logging_configuration.py b/plugins/modules/wafv2_logging_configuration.py index 63cf928f..7307c76d 100644 --- a/plugins/modules/wafv2_logging_configuration.py +++ b/plugins/modules/wafv2_logging_configuration.py @@ -302,7 +302,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -453,7 +455,7 @@ def main(): ] mutually_exclusive = [] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/wafv2_regex_pattern_set.py b/plugins/modules/wafv2_regex_pattern_set.py index 270efd63..df79fc90 100644 --- a/plugins/modules/wafv2_regex_pattern_set.py +++ b/plugins/modules/wafv2_regex_pattern_set.py @@ -134,7 +134,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -187,7 +189,7 @@ def main(): [ "state", "present", - ["scope", "id", "identifier", "name", "regular_expression_list"], + ["name", "scope", "regular_expression_list", "id", "identifier"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], @@ -195,7 +197,7 @@ def main(): ] mutually_exclusive = [[("name", "id", "scope"), "identifier"]] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, diff --git a/plugins/modules/wafv2_web_acl_association.py b/plugins/modules/wafv2_web_acl_association.py index e465c609..22fb7163 100644 --- a/plugins/modules/wafv2_web_acl_association.py +++ b/plugins/modules/wafv2_web_acl_association.py @@ -98,7 +98,9 @@ """ -from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + AnsibleAmazonCloudModule, +) from ansible_collections.amazon.cloud.plugins.module_utils.core import ( CloudControlResource, ) @@ -135,13 +137,13 @@ def main(): required_if = [ ["state", "list", ["resource_arn"], True], - ["state", "present", ["identifier", "resource_arn", "web_acl_arn"], True], + ["state", "present", ["identifier", "web_acl_arn", "resource_arn"], True], ["state", "absent", ["resource_arn", "web_acl_arn", "identifier"], True], ["state", "get", ["resource_arn", "web_acl_arn", "identifier"], True], ] mutually_exclusive = [[("resource_arn", "web_acl_arn"), "identifier"]] - module = AnsibleAWSModule( + module = AnsibleAmazonCloudModule( argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, From fd8a0589a9dd77290118475e190e78e7f7380df9 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Thu, 6 Jul 2023 20:07:14 +0200 Subject: [PATCH 07/32] Fix map_key_to_alias Signed-off-by: Alina Buzachis --- plugins/module_utils/utils.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plugins/module_utils/utils.py b/plugins/module_utils/utils.py index eddf4fee..09882f66 100644 --- a/plugins/module_utils/utils.py +++ b/plugins/module_utils/utils.py @@ -216,8 +216,23 @@ def map_key_to_alias(data, mapping): 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 From 73e2104da37c847a62fdd2d7241d916966186e38 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Tue, 18 Jul 2023 10:27:24 +0200 Subject: [PATCH 08/32] Last Changes commit Signed-off-by: Alina Buzachis --- plugins/module_utils/core.py | 9 +++++++- plugins/module_utils/utils.py | 35 ++++++++++++++++++++++++++++-- plugins/modules/iam_role.py | 8 ++++++- plugins/modules/rds_db_instance.py | 16 +++++++------- 4 files changed, 56 insertions(+), 12 deletions(-) diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index 062794ea..a25cc5fc 100644 --- a/plugins/module_utils/core.py +++ b/plugins/module_utils/core.py @@ -75,7 +75,10 @@ except ImportError: BOTO3_IMP_ERR = traceback.format_exc() HAS_BOTO3 = False - +import logging +logging.basicConfig(filename = '/tmp/file.log', + level = logging.DEBUG, + format = '%(asctime)s:%(levelname)s:%(name)s:%(message)s') class CloudControlResource(object): def __init__(self, module): @@ -299,12 +302,16 @@ def create_resource(self, type_name: str, params: Dict) -> bool: response = self.client.create_resource( TypeName=type_name, DesiredState=params ) + logging.debug("RESP") + logging.debug(response) except ( botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError, ) as e: self.module.fail_json_aws(e, msg="Failed to create resource") + logging.debug("RESPAFTER") + logging.debug(response) self.wait_until_resource_request_success( response["ProgressEvent"]["RequestToken"] ) diff --git a/plugins/module_utils/utils.py b/plugins/module_utils/utils.py index 09882f66..510e7d60 100644 --- a/plugins/module_utils/utils.py +++ b/plugins/module_utils/utils.py @@ -128,6 +128,10 @@ def _normalize_response(resource_description): else: return _normalize_response(resource_descriptions) +import logging +logging.basicConfig(filename = '/tmp/file.log', + level = logging.DEBUG, + format = '%(asctime)s:%(levelname)s:%(name)s:%(message)s') def ansible_dict_to_boto3_tag_list( tags_dict, tag_name_key_name="Key", tag_value_key_name="Value" @@ -281,6 +285,10 @@ def find_tag_by_key(key, tags): def tag_merge(t1, t2): + logging.debug("t2") + logging.debug(t2) + logging.debug("t1") + logging.debug(t1) for tag in t2: existing = find_tag_by_key(tag["Key"], t1) if existing: @@ -295,7 +303,25 @@ def op(operation, path, value): return {"op": operation, "path": path, "value": value} +def merge_dicts(list1, list2): + merged_list = list1.copy() + + for dict2 in list2: + matching_dicts = [dict1 for dict1 in merged_list if all(item in dict1.items() for item in dict2.items())] + if matching_dicts: + for k, v in dict2.items(): + matching_dicts[0][k] = v + else: + merged_list.append(dict2) + + return merged_list + + def make_op(path, old, new, strategy): + logging.debug("old") + logging.debug(old) + logging.debug("new") + logging.debug(new) _new_cpy = copy.deepcopy(new) if isinstance(old, dict): @@ -303,9 +329,14 @@ def make_op(path, old, new, strategy): _new_cpy = dict(old, **new) elif isinstance(old, list): if strategy == "merge": - _old_cpy = copy.deepcopy(old) - _new_cpy = tag_merge(_old_cpy, new) + if path == 'Tags': + _old_cpy = copy.deepcopy(old) + _new_cpy = tag_merge(_old_cpy, new) + else: + _new_cpy = merge_dicts(old, new) + logging.debug('op("replace", path, _new_cpy)') + logging.debug(op("replace", path, _new_cpy)) return op("replace", path, _new_cpy) diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index 5ab7a4e0..5c6df9ca 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -173,7 +173,10 @@ from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake - +import logging +logging.basicConfig(filename = '/tmp/file.log', + level = logging.DEBUG, + format = '%(asctime)s:%(levelname)s:%(name)s:%(message)s') def main(): argument_spec = dict( state=dict( @@ -264,6 +267,9 @@ def main(): # Use the alis from argument_spec as key and avoid snake_to_camel conversions params_to_set = map_key_to_alias(_params_to_set, argument_spec) + logging.debug("params_to_set") + logging.debug(params_to_set) + # Ignore createOnlyProperties that can be set only during resource creation create_only_params = ["Path", "RoleName"] diff --git a/plugins/modules/rds_db_instance.py b/plugins/modules/rds_db_instance.py index 37e3114b..d9273c99 100644 --- a/plugins/modules/rds_db_instance.py +++ b/plugins/modules/rds_db_instance.py @@ -1142,14 +1142,14 @@ 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") + # 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 = scrub_none_parameters(params) From dcd949d803c40cd9b5227facef45c019fa3efeb2 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 9 Aug 2023 16:06:23 +0200 Subject: [PATCH 09/32] Yet another round of fixes Signed-off-by: Alina Buzachis --- meta/runtime.yml | 2 +- plugins/module_utils/core.py | 20 +-- plugins/module_utils/utils.py | 28 ++- .../autoscaling_launch_configuration.py | 44 ++--- plugins/modules/autoscaling_lifecycle_hook.py | 15 +- plugins/modules/autoscaling_warm_pool.py | 6 +- plugins/modules/backup_backup_vault.py | 6 +- plugins/modules/backup_framework.py | 14 +- plugins/modules/backup_report_plan.py | 17 +- .../modules/cloudtrail_event_data_store.py | 15 +- plugins/modules/cloudtrail_trail.py | 8 +- plugins/modules/cloudwatch_composite_alarm.py | 6 +- plugins/modules/cloudwatch_metric_stream.py | 8 +- plugins/modules/dynamodb_global_table.py | 12 +- plugins/modules/ec2_placement_group.py | 18 +- plugins/modules/ecr_repository.py | 12 +- plugins/modules/ecs_capacity_provider.py | 11 +- plugins/modules/ecs_cluster.py | 6 +- ..._cluster_capacity_provider_associations.py | 8 +- plugins/modules/ecs_primary_task_set.py | 10 +- plugins/modules/eks_addon.py | 10 +- plugins/modules/eks_cluster.py | 92 +++++----- plugins/modules/eks_fargate_profile.py | 117 ++++++++++-- plugins/modules/iam_instance_profile.py | 6 +- plugins/modules/iam_role.py | 16 +- plugins/modules/iam_server_certificate.py | 48 ++++- plugins/modules/kms_alias.py | 6 +- plugins/modules/kms_replica_key.py | 16 +- plugins/modules/lambda_code_signing_config.py | 17 +- .../modules/lambda_event_source_mapping.py | 26 +-- plugins/modules/lambda_function.py | 27 ++- plugins/modules/logs_log_group.py | 37 +++- plugins/modules/logs_metric_filter.py | 12 +- plugins/modules/logs_query_definition.py | 17 +- plugins/modules/logs_resource_policy.py | 6 +- plugins/modules/memorydb_acl.py | 6 +- plugins/modules/memorydb_cluster.py | 43 ++--- plugins/modules/memorydb_parameter_group.py | 12 +- plugins/modules/memorydb_subnet_group.py | 8 +- plugins/modules/memorydb_user.py | 6 +- .../modules/rds_db_cluster_parameter_group.py | 12 +- plugins/modules/rds_db_instance.py | 168 +++--------------- plugins/modules/rds_db_proxy.py | 12 +- plugins/modules/rds_db_proxy_endpoint.py | 10 +- plugins/modules/rds_db_subnet_group.py | 8 +- plugins/modules/rds_global_cluster.py | 12 +- plugins/modules/rds_option_group.py | 16 +- plugins/modules/redshift_cluster.py | 44 ++--- plugins/modules/redshift_endpoint_access.py | 16 +- .../redshift_endpoint_authorization.py | 8 +- .../modules/redshift_event_subscription.py | 6 +- plugins/modules/redshift_scheduled_action.py | 6 +- plugins/modules/route53_dnssec.py | 6 +- plugins/modules/route53_key_signing_key.py | 18 +- plugins/modules/s3_access_point.py | 11 +- plugins/modules/s3_bucket.py | 36 +++- .../modules/s3_multi_region_access_point.py | 10 +- .../s3_multi_region_access_point_policy.py | 8 +- .../modules/s3objectlambda_access_point.py | 8 +- .../s3objectlambda_access_point_policy.py | 6 +- plugins/modules/ssm_document.py | 6 +- plugins/modules/ssm_resource_data_sync.py | 28 ++- plugins/modules/wafv2_ip_set.py | 18 +- .../modules/wafv2_logging_configuration.py | 6 +- plugins/modules/wafv2_regex_pattern_set.py | 18 +- plugins/modules/wafv2_web_acl_association.py | 10 +- tests/sanity/ignore-2.12.txt | 1 + tests/sanity/ignore-2.13.txt | 1 + tests/sanity/ignore-2.14.txt | 1 + tests/sanity/ignore-2.15.txt | 167 +++++++++++++++++ 70 files changed, 820 insertions(+), 651 deletions(-) diff --git a/meta/runtime.yml b/meta/runtime.yml index 75105ec2..e3a9c6b2 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -1,4 +1,4 @@ -requires_ansible: '>=2.12.0' +requires_ansible: '>=2.13.0' action_groups: aws: - backup_backup_vault diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index a25cc5fc..1527c889 100644 --- a/plugins/module_utils/core.py +++ b/plugins/module_utils/core.py @@ -75,10 +75,7 @@ except ImportError: BOTO3_IMP_ERR = traceback.format_exc() HAS_BOTO3 = False -import logging -logging.basicConfig(filename = '/tmp/file.log', - level = logging.DEBUG, - format = '%(asctime)s:%(levelname)s:%(name)s:%(message)s') + class CloudControlResource(object): def __init__(self, module): @@ -156,8 +153,9 @@ async def list_resources( if identifiers: additional_properties: Dict = {} for id in identifiers: - additional_properties[id] = self.module.params.get( - camel_to_snake(id) + _id = id.split("/")[-1] + additional_properties[_id] = self.module.params.get( + camel_to_snake(_id) ) params["ResourceModel"] = json.dumps(additional_properties) @@ -278,8 +276,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 together {*_primary_identifier, } to create a new resource. The identifier parameter can only be used to manipulate an existing resource.""" ) results["changed"] |= self.create_resource(type_name, params) @@ -302,16 +301,12 @@ def create_resource(self, type_name: str, params: Dict) -> bool: response = self.client.create_resource( TypeName=type_name, DesiredState=params ) - logging.debug("RESP") - logging.debug(response) except ( botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError, ) as e: self.module.fail_json_aws(e, msg="Failed to create resource") - logging.debug("RESPAFTER") - logging.debug(response) self.wait_until_resource_request_success( response["ProgressEvent"]["RequestToken"] ) @@ -529,7 +524,8 @@ def update_resource( def get_identifier(self, primary_identifier: list) -> Dict: identifier: Dict = {} for id in primary_identifier: - identifier[id] = self.module.params.get(camel_to_snake(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 510e7d60..c89cc418 100644 --- a/plugins/module_utils/utils.py +++ b/plugins/module_utils/utils.py @@ -106,7 +106,11 @@ 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} + return { + k: v + for k, v in a_dict.items() + if not any(k in item for item in list_of_keys_to_remove) + } def normalize_response(response: Iterable): @@ -128,10 +132,6 @@ def _normalize_response(resource_description): else: return _normalize_response(resource_descriptions) -import logging -logging.basicConfig(filename = '/tmp/file.log', - level = logging.DEBUG, - format = '%(asctime)s:%(levelname)s:%(name)s:%(message)s') def ansible_dict_to_boto3_tag_list( tags_dict, tag_name_key_name="Key", tag_value_key_name="Value" @@ -285,10 +285,6 @@ def find_tag_by_key(key, tags): def tag_merge(t1, t2): - logging.debug("t2") - logging.debug(t2) - logging.debug("t1") - logging.debug(t1) for tag in t2: existing = find_tag_by_key(tag["Key"], t1) if existing: @@ -307,7 +303,11 @@ def merge_dicts(list1, list2): merged_list = list1.copy() for dict2 in list2: - matching_dicts = [dict1 for dict1 in merged_list if all(item in dict1.items() for item in dict2.items())] + matching_dicts = [ + dict1 + for dict1 in merged_list + if all(item in dict1.items() for item in dict2.items()) + ] if matching_dicts: for k, v in dict2.items(): matching_dicts[0][k] = v @@ -318,10 +318,6 @@ def merge_dicts(list1, list2): def make_op(path, old, new, strategy): - logging.debug("old") - logging.debug(old) - logging.debug("new") - logging.debug(new) _new_cpy = copy.deepcopy(new) if isinstance(old, dict): @@ -329,14 +325,12 @@ def make_op(path, old, new, strategy): _new_cpy = dict(old, **new) elif isinstance(old, list): if strategy == "merge": - if path == 'Tags': + if path == "Tags": _old_cpy = copy.deepcopy(old) _new_cpy = tag_merge(_old_cpy, new) else: _new_cpy = merge_dicts(old, new) - logging.debug('op("replace", path, _new_cpy)') - logging.debug(op("replace", path, _new_cpy)) return op("replace", path, _new_cpy) diff --git a/plugins/modules/autoscaling_launch_configuration.py b/plugins/modules/autoscaling_launch_configuration.py index 94341544..f05c8406 100644 --- a/plugins/modules/autoscaling_launch_configuration.py +++ b/plugins/modules/autoscaling_launch_configuration.py @@ -421,7 +421,7 @@ def main(): [ "state", "present", - ["instance_type", "image_id", "launch_configuration_name"], + ["image_id", "instance_type", "launch_configuration_name"], True, ], ["state", "absent", ["launch_configuration_name"], True], @@ -472,37 +472,37 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = [ - "AssociatePublicIpAddress", - "BlockDeviceMappings", - "ClassicLinkVPCId", - "ClassicLinkVPCSecurityGroups", - "EbsOptimized", - "IamInstanceProfile", - "ImageId", - "InstanceId", - "InstanceMonitoring", - "InstanceType", - "KernelId", - "KeyName", - "LaunchConfigurationName", - "MetadataOptions", - "PlacementTenancy", - "RamDiskId", - "SecurityGroups", - "SpotPrice", - "UserData", + "/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 = ["LaunchConfigurationName"] + identifier = ["/properties/LaunchConfigurationName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index 973111b3..5f103d25 100644 --- a/plugins/modules/autoscaling_lifecycle_hook.py +++ b/plugins/modules/autoscaling_lifecycle_hook.py @@ -222,10 +222,10 @@ def main(): "state", "present", [ + "auto_scaling_group_name", + "lifecycle_hook_name", "identifier", "lifecycle_transition", - "lifecycle_hook_name", - "auto_scaling_group_name", ], True, ], @@ -275,17 +275,20 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["AutoScalingGroupName", "LifecycleHookName"] + 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 = ["AutoScalingGroupName", "LifecycleHookName"] + identifier = ["/properties/AutoScalingGroupName", "/properties/LifecycleHookName"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None @@ -294,7 +297,7 @@ def main(): "lifecycle_hook_name" ): module.fail_json( - f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + "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 e590e0c3..82887129 100644 --- a/plugins/modules/autoscaling_warm_pool.py +++ b/plugins/modules/autoscaling_warm_pool.py @@ -203,17 +203,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["AutoScalingGroupName"] + 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 = ["AutoScalingGroupName"] + identifier = ["/properties/AutoScalingGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/backup_backup_vault.py b/plugins/modules/backup_backup_vault.py index e9b23e99..ee5749af 100644 --- a/plugins/modules/backup_backup_vault.py +++ b/plugins/modules/backup_backup_vault.py @@ -260,17 +260,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["BackupVaultName", "EncryptionKeyArn"] + 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 = ["BackupVaultName"] + identifier = ["/properties/BackupVaultName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/backup_framework.py b/plugins/modules/backup_framework.py index 7874791b..6346e92f 100644 --- a/plugins/modules/backup_framework.py +++ b/plugins/modules/backup_framework.py @@ -22,12 +22,6 @@ operation to make the resource available so that another operation may be performed on it. type: bool - framework_arn: - aliases: - - FrameworkArn - description: - - An Amazon Resource Name (ARN) that uniquely identifies Framework as a resource. - type: str framework_controls: aliases: - FrameworkControls @@ -262,7 +256,6 @@ def main(): "type": "str", "aliases": ["FrameworkDescription"], } - argument_spec["framework_arn"] = {"type": "str", "aliases": ["FrameworkArn"]} argument_spec["framework_controls"] = { "type": "list", "elements": "dict", @@ -344,7 +337,6 @@ def main(): 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") @@ -358,17 +350,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["FrameworkName"] + create_only_params = ["/properties/FrameworkName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["FrameworkArn"] + identifier = ["/properties/FrameworkArn"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/backup_report_plan.py b/plugins/modules/backup_report_plan.py index 2363e7a8..aff9c32e 100644 --- a/plugins/modules/backup_report_plan.py +++ b/plugins/modules/backup_report_plan.py @@ -58,13 +58,6 @@ - If not specified, there is no prefix. type: str type: dict - report_plan_arn: - aliases: - - ReportPlanArn - 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: aliases: - ReportPlanDescription @@ -241,7 +234,6 @@ def main(): ) argument_spec["report_plan_name"] = {"type": "str", "aliases": ["ReportPlanName"]} - argument_spec["report_plan_arn"] = {"type": "str", "aliases": ["ReportPlanArn"]} argument_spec["report_plan_description"] = { "type": "str", "aliases": ["ReportPlanDescription"], @@ -298,7 +290,7 @@ def main(): [ "state", "present", - ["report_delivery_channel", "report_setting", "report_plan_arn"], + ["report_delivery_channel", "report_plan_arn", "report_setting"], True, ], ["state", "absent", ["report_plan_arn"], True], @@ -319,7 +311,6 @@ def main(): 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") @@ -333,17 +324,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["ReportPlanName"] + create_only_params = ["/properties/ReportPlanName"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["ReportPlanArn"] + identifier = ["/properties/ReportPlanArn"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/cloudtrail_event_data_store.py b/plugins/modules/cloudtrail_event_data_store.py index 463ecc33..98e4077a 100644 --- a/plugins/modules/cloudtrail_event_data_store.py +++ b/plugins/modules/cloudtrail_event_data_store.py @@ -103,12 +103,6 @@ as Log data events for only two S3 buckets. type: str type: list - event_data_store_arn: - aliases: - - EventDataStoreArn - description: - - The ARN of the event data store. - type: str force: default: false description: @@ -302,10 +296,6 @@ def main(): }, "aliases": ["AdvancedEventSelectors"], } - argument_spec["event_data_store_arn"] = { - "type": "str", - "aliases": ["EventDataStoreArn"], - } argument_spec["multi_region_enabled"] = { "type": "bool", "aliases": ["MultiRegionEnabled"], @@ -356,7 +346,6 @@ def main(): params = {} params["advanced_event_selectors"] = module.params.get("advanced_event_selectors") - params["event_data_store_arn"] = module.params.get("event_data_store_arn") params["ingestion_enabled"] = module.params.get("ingestion_enabled") params["kms_key_id"] = module.params.get("kms_key_id") params["multi_region_enabled"] = module.params.get("multi_region_enabled") @@ -375,7 +364,7 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 @@ -385,7 +374,7 @@ def main(): handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["EventDataStoreArn"] + identifier = ["/properties/EventDataStoreArn"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/cloudtrail_trail.py b/plugins/modules/cloudtrail_trail.py index 517eabe6..e7e3b5bb 100644 --- a/plugins/modules/cloudtrail_trail.py +++ b/plugins/modules/cloudtrail_trail.py @@ -520,7 +520,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], ] @@ -568,17 +568,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["TrailName"] + 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 = ["TrailName"] + identifier = ["/properties/TrailName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/cloudwatch_composite_alarm.py b/plugins/modules/cloudwatch_composite_alarm.py index 82c2e711..e8c3ff0f 100644 --- a/plugins/modules/cloudwatch_composite_alarm.py +++ b/plugins/modules/cloudwatch_composite_alarm.py @@ -260,17 +260,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["AlarmName"] + 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 = ["AlarmName"] + identifier = ["/properties/AlarmName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index 91a8b4ad..d7d88854 100644 --- a/plugins/modules/cloudwatch_metric_stream.py +++ b/plugins/modules/cloudwatch_metric_stream.py @@ -307,7 +307,7 @@ def main(): [ "state", "present", - ["name", "role_arn", "firehose_arn", "output_format"], + ["firehose_arn", "output_format", "role_arn", "name"], True, ], ["state", "absent", ["name"], True], @@ -346,17 +346,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 a3a3bf3b..00253430 100644 --- a/plugins/modules/dynamodb_global_table.py +++ b/plugins/modules/dynamodb_global_table.py @@ -1043,7 +1043,7 @@ def main(): [ "state", "present", - ["attribute_definitions", "key_schema", "table_name", "replicas"], + ["table_name", "replicas", "key_schema", "attribute_definitions"], True, ], ["state", "absent", ["table_name"], True], @@ -1086,17 +1086,21 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["LocalSecondaryIndexes", "TableName", "KeySchema"] + 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 = ["TableName"] + identifier = ["/properties/TableName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ec2_placement_group.py b/plugins/modules/ec2_placement_group.py index d5c6324a..14918bb2 100644 --- a/plugins/modules/ec2_placement_group.py +++ b/plugins/modules/ec2_placement_group.py @@ -25,12 +25,6 @@ operation to make the resource available so that another operation may be performed on it. type: bool - group_name: - aliases: - - GroupName - description: - - The Group Name of Placement Group. - type: str partition_count: aliases: - PartitionCount @@ -145,7 +139,6 @@ def main(): ) argument_spec["strategy"] = {"type": "str", "aliases": ["Strategy"]} - argument_spec["group_name"] = {"type": "str", "aliases": ["GroupName"]} argument_spec["spread_level"] = {"type": "str", "aliases": ["SpreadLevel"]} argument_spec["partition_count"] = {"type": "int", "aliases": ["PartitionCount"]} argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} @@ -178,7 +171,6 @@ def main(): 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") @@ -191,17 +183,21 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["Strategy", "SpreadLevel", "PartitionCount"] + create_only_params = [ + "/properties/Strategy", + "/properties/SpreadLevel", + "/properties/PartitionCount", + ] # Necessary to handle when module does not support all the states handlers = ["create", "read", "delete", "list"] state = module.params.get("state") - identifier = ["GroupName"] + identifier = ["/properties/GroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ecr_repository.py b/plugins/modules/ecr_repository.py index 823a5b89..8a770454 100644 --- a/plugins/modules/ecr_repository.py +++ b/plugins/modules/ecr_repository.py @@ -304,22 +304,22 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = [ - "RepositoryName", - "EncryptionConfiguration", - "EncryptionType", - "KmsKey", + "/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 = ["RepositoryName"] + identifier = ["/properties/RepositoryName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ecs_capacity_provider.py b/plugins/modules/ecs_capacity_provider.py index db5a439f..4d48e3d2 100644 --- a/plugins/modules/ecs_capacity_provider.py +++ b/plugins/modules/ecs_capacity_provider.py @@ -238,7 +238,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], ] @@ -269,17 +269,20 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["AutoScalingGroupArn", "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 e87229d4..6cba2559 100644 --- a/plugins/modules/ecs_cluster.py +++ b/plugins/modules/ecs_cluster.py @@ -381,17 +381,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["ClusterName"] + 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 = ["ClusterName"] + 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 e578fba1..b7208abd 100644 --- a/plugins/modules/ecs_cluster_capacity_provider_associations.py +++ b/plugins/modules/ecs_cluster_capacity_provider_associations.py @@ -174,7 +174,7 @@ def main(): [ "state", "present", - ["default_capacity_provider_strategy", "cluster", "capacity_providers"], + ["cluster", "capacity_providers", "default_capacity_provider_strategy"], True, ], ["state", "absent", ["cluster"], True], @@ -207,17 +207,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 90e9119b..551a7f13 100644 --- a/plugins/modules/ecs_primary_task_set.py +++ b/plugins/modules/ecs_primary_task_set.py @@ -147,7 +147,7 @@ def main(): required_if = [ ["state", "list", ["cluster"], True], - ["state", "present", ["service", "cluster", "identifier", "task_set_id"], True], + ["state", "present", ["cluster", "task_set_id", "identifier", "service"], True], ["state", "absent", ["cluster", "service", "identifier"], True], ["state", "get", ["cluster", "service", "identifier"], True], ] @@ -177,24 +177,24 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + "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 a4cd373c..ba89e74b 100644 --- a/plugins/modules/eks_addon.py +++ b/plugins/modules/eks_addon.py @@ -206,7 +206,7 @@ def main(): required_if = [ ["state", "list", ["cluster_name"], True], - ["state", "present", ["identifier", "cluster_name", "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], ] @@ -241,24 +241,24 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["ClusterName", "AddonName"] + 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 = ["ClusterName", "AddonName"] + 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 all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + "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 645ab09c..2f0c3437 100644 --- a/plugins/modules/eks_cluster.py +++ b/plugins/modules/eks_cluster.py @@ -54,35 +54,6 @@ operation to make the resource available so that another operation may be performed on it. type: bool - kubernetes_network_config: - aliases: - - KubernetesNetworkConfig - description: - - The Kubernetes network configuration for the cluster. - suboptions: - ip_family: - aliases: - - IpFamily - 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: - aliases: - - ServiceIpv4Cidr - 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 @@ -297,6 +268,36 @@ """ EXAMPLES = r""" +- name: Set the cluster name + set_fact: + eks_cluster_name: '{{ _resource_prefix }}-cluster' + +- name: Create EKS cluster + amazon.cloud.eks_cluster: + name: '{{ eks_cluster_name }}' + resources_vpc_config: + security_group_ids: "{{ _result_create_security_groups.results | map(attribute='group_id') }}" + subnet_ids: "{{ _result_create_subnets.results | map(attribute='subnet.id') }}" + endpoint_public_access: true + endpoint_private_access: false + public_access_cidrs: + - 0.0.0.0/0 + role_arn: '{{ _result_create_iam_role.arn }}' + tags: + Name: '{{ _resource_prefix }}-eks-cluster' + wait_timeout: 900 + register: _result_create_cluster + +- name: Describe EKS cluster + amazon.cloud.eks_cluster: + name: '{{ eks_cluster_name }}' + state: describe + register: _result_get_cluster + +- name: List EKS clusters + amazon.cloud.eks_cluster: + state: list + register: _result_list_clusters """ RETURN = r""" @@ -355,18 +356,6 @@ def main(): }, "aliases": ["EncryptionConfig"], } - argument_spec["kubernetes_network_config"] = { - "type": "dict", - "options": { - "service_ipv4_cidr": {"type": "str", "aliases": ["ServiceIpv4Cidr"]}, - "ip_family": { - "type": "str", - "choices": ["ipv4", "ipv6"], - "aliases": ["IpFamily"], - }, - }, - "aliases": ["KubernetesNetworkConfig"], - } argument_spec["logging"] = { "type": "dict", "options": { @@ -457,7 +446,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["name", "role_arn", "resources_vpc_config"], True], + ["state", "present", ["resources_vpc_config", "role_arn", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] @@ -476,7 +465,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") @@ -492,25 +480,25 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = [ - "OutpostConfig", - "EncryptionConfig", - "KubernetesNetworkConfig", - "Name", - "RoleArn", - "SubnetIds", - "SecurityGroupIds", + "/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 e751def3..7d1e0261 100644 --- a/plugins/modules/eks_fargate_profile.py +++ b/plugins/modules/eks_fargate_profile.py @@ -138,6 +138,103 @@ """ EXAMPLES = r""" +- name: Set the cluster name + set_fact: + eks_cluster_name: '{{ _resource_prefix }}-cluster' + +- name: Define EKS facts + set_fact: + eks_fargate_profile_name_a: '{{ _resource_prefix }}-fp-a' + eks_fargate_profile_name_b: '{{ _resource_prefix }}-fp-b' + eks_subnets: + - zone: a + cidr: 10.0.1.0/24 + type: private + tag: internal-elb + - zone: b + cidr: 10.0.2.0/24 + type: public + tag: elb + eks_security_groups: + - name: '{{ eks_cluster_name }}-control-plane-sg' + description: EKS Control Plane Security Group + rules: + - group_name: '{{ eks_cluster_name }}-workers-sg' + group_desc: EKS Worker Security Group + ports: 443 + proto: tcp + rules_egress: + - group_name: '{{ eks_cluster_name }}-workers-sg' + group_desc: EKS Worker Security Group + from_port: 1025 + to_port: 65535 + proto: tcp + - name: '{{ eks_cluster_name }}-workers-sg' + description: EKS Worker Security Group + rules: + - group_name: '{{ eks_cluster_name }}-workers-sg' + proto: tcp + from_port: 1 + to_port: 65535 + - group_name: '{{ eks_cluster_name }}-control-plane-sg' + ports: 10250 + proto: tcp + +- name: Define selector + set_fact: + selectors: + - labels: + - key: test + value: test + namespace: fp-default + +- name: Define the tags + set_fact: + tags: + Foo: foo + bar: Bar + +- name: Create Fargate Profile a with wait + amazon.cloud.eks_fargate_profile: + 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 }}' + subnets: "{{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }}" + selectors: '{{ selectors }}' + wait: true + tags: '{{ tags }}' + register: _result_create_fp + +- name: List Fargate Profiles + amazon.cloud.eks_fargate_profile: + state: list + cluster_name: '{{ eks_cluster_name }}' + register: _result_list_fp + +- name: Update tags in Fargate Profile a with wait (check mode) + amazon.cloud.eks_fargate_profile: + 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 }}' + subnets: "{{_result_create_subnets.results|selectattr('subnet.tags.Name', 'contains', 'private') | map(attribute='subnet.id') }}" + selectors: '{{ selectors }}' + wait: true + tags: + env: test + test: foo + check_mode: true + register: _result_update_tags_fp + +- name: Delete Fargate Profile a + amazon.cloud.eks_fargate_profile: + fargate_profile_name: '{{ eks_fargate_profile_name_a }}' + cluster_name: '{{ eks_cluster_name }}' + state: absent + wait: true + wait_timeout: 900 + register: _result_delete_fp """ RETURN = r""" @@ -232,11 +329,11 @@ def main(): "state", "present", [ - "cluster_name", "pod_execution_role_arn", + "identifier", "fargate_profile_name", + "cluster_name", "selectors", - "identifier", ], True, ], @@ -277,23 +374,23 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = [ - "ClusterName", - "FargateProfileName", - "PodExecutionRoleArn", - "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 = ["ClusterName", "FargateProfileName"] + identifier = ["/properties/ClusterName", "/properties/FargateProfileName"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None @@ -302,7 +399,7 @@ def main(): "fargate_profile_name" ): module.fail_json( - f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + "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 ac7fd10b..9678fb05 100644 --- a/plugins/modules/iam_instance_profile.py +++ b/plugins/modules/iam_instance_profile.py @@ -169,17 +169,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["InstanceProfileName", "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 = ["InstanceProfileName"] + identifier = ["/properties/InstanceProfileName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index 5c6df9ca..d977a4a7 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -173,10 +173,7 @@ from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake -import logging -logging.basicConfig(filename = '/tmp/file.log', - level = logging.DEBUG, - format = '%(asctime)s:%(levelname)s:%(name)s:%(message)s') + def main(): argument_spec = dict( state=dict( @@ -227,7 +224,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["role_name", "assume_role_policy_document"], True], + ["state", "present", ["assume_role_policy_document", "role_name"], True], ["state", "absent", ["role_name"], True], ["state", "get", ["role_name"], True], ] @@ -264,20 +261,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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) - logging.debug("params_to_set") - logging.debug(params_to_set) - # Ignore createOnlyProperties that can be set only during resource creation - create_only_params = ["Path", "RoleName"] + 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 = ["RoleName"] + identifier = ["/properties/RoleName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/iam_server_certificate.py b/plugins/modules/iam_server_certificate.py index 18ce0a89..337ec900 100644 --- a/plugins/modules/iam_server_certificate.py +++ b/plugins/modules/iam_server_certificate.py @@ -100,6 +100,42 @@ """ EXAMPLES = r""" +- name: Load the certificate data + set_fact: + cert_a_data: '{{ lookup("file", path_cert_a) }}' + cert_b_data: '{{ lookup("file", path_cert_b) }}' + chain_cert_data: '{{ lookup("file", path_intermediate_cert) }}' + +- name: Create Certificate + amazon.cloud.iam_server_certificate: + server_certificate_name: '{{ cert_name }}' + state: present + certificate_body: '{{ cert_a_data }}' + private_key: '{{ lookup("file", path_cert_key) }}' + wait: true + register: create_cert + +- name: Delete certificate + amazon.cloud.iam_server_certificate: + server_certificate_name: '{{ cert_name }}' + state: absent + register: delete_cert + +- name: Create Certificate with Chain and path + amazon.cloud.iam_server_certificate: + server_certificate_name: '{{ cert_name }}' + state: present + certificate_body: '{{ cert_a_data }}' + private_key: '{{ lookup("file", path_cert_key) }}' + certificate_chain: '{{ chain_cert_data }}' + path: /example/ + register: create_cert + +- name: Gather information about a certificate + amazon.cloud.iam_server_certificate: + server_certificate_name: '{{ cert_name }}' + state: get + register: create_info """ RETURN = r""" @@ -200,22 +236,22 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = [ - "ServerCertificateName", - "PrivateKey", - "CertificateBody", - "CertificateChain", + "/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 = ["ServerCertificateName"] + identifier = ["/properties/ServerCertificateName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/kms_alias.py b/plugins/modules/kms_alias.py index 907721ad..08a82561 100644 --- a/plugins/modules/kms_alias.py +++ b/plugins/modules/kms_alias.py @@ -161,17 +161,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["AliasName"] + 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 = ["AliasName"] + identifier = ["/properties/AliasName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/kms_replica_key.py b/plugins/modules/kms_replica_key.py index eb9a0192..009800d6 100644 --- a/plugins/modules/kms_replica_key.py +++ b/plugins/modules/kms_replica_key.py @@ -39,12 +39,6 @@ operation to make the resource available so that another operation may be performed on it. type: bool - key_id: - aliases: - - KeyId - description: - - Not Provived. - type: str key_policy: aliases: - KeyPolicy @@ -172,7 +166,6 @@ def main(): "aliases": ["PendingWindowInDays"], } argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} - argument_spec["key_id"] = {"type": "str", "aliases": ["KeyId"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -184,7 +177,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["primary_key_arn", "key_policy", "key_id"], True], + ["state", "present", ["key_policy", "primary_key_arn", "key_id"], True], ["state", "absent", ["key_id"], True], ["state", "get", ["key_id"], True], ] @@ -204,7 +197,6 @@ def main(): 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") @@ -217,17 +209,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["PrimaryKeyArn"] + create_only_params = ["/properties/PrimaryKeyArn"] # Necessary to handle when module does not support all the states handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["KeyId"] + identifier = ["/properties/KeyId"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/lambda_code_signing_config.py b/plugins/modules/lambda_code_signing_config.py index cbbcf474..38c6edde 100644 --- a/plugins/modules/lambda_code_signing_config.py +++ b/plugins/modules/lambda_code_signing_config.py @@ -30,12 +30,6 @@ elements: str type: list type: dict - code_signing_config_arn: - aliases: - - CodeSigningConfigArn - description: - - A unique Arn for CodeSigningConfig resource. - type: str code_signing_policies: aliases: - CodeSigningPolicies @@ -175,10 +169,6 @@ def main(): }, "aliases": ["CodeSigningPolicies"], } - argument_spec["code_signing_config_arn"] = { - "type": "str", - "aliases": ["CodeSigningConfigArn"], - } argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -189,7 +179,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["allowed_publishers", "code_signing_config_arn"], True], + ["state", "present", ["code_signing_config_arn", "allowed_publishers"], True], ["state", "absent", ["code_signing_config_arn"], True], ["state", "get", ["code_signing_config_arn"], True], ] @@ -208,7 +198,6 @@ def main(): 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") @@ -219,7 +208,7 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 @@ -229,7 +218,7 @@ def main(): handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["CodeSigningConfigArn"] + identifier = ["/properties/CodeSigningConfigArn"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/lambda_event_source_mapping.py b/plugins/modules/lambda_event_source_mapping.py index 949d6ca3..68f72463 100644 --- a/plugins/modules/lambda_event_source_mapping.py +++ b/plugins/modules/lambda_event_source_mapping.py @@ -153,12 +153,6 @@ - (Streams) A list of response types supported by the function. elements: str type: list - id: - aliases: - - Id - description: - - Event Source Mapping Identifier UUID. - type: str maximum_batching_window_in_seconds: aliases: - MaximumBatchingWindowInSeconds @@ -383,7 +377,6 @@ def main(): ), ) - argument_spec["id"] = {"type": "str", "aliases": ["Id"]} argument_spec["batch_size"] = {"type": "int", "aliases": ["BatchSize"]} argument_spec["bisect_batch_on_function_error"] = { "type": "bool", @@ -534,7 +527,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["id", "function_name"], True], + ["state", "present", ["function_name", "id"], True], ["state", "absent", ["id"], True], ["state", "get", ["id"], True], ] @@ -568,7 +561,6 @@ def main(): 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" ) @@ -602,24 +594,24 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = [ - "EventSourceArn", - "StartingPosition", - "StartingPositionTimestamp", - "SelfManagedEventSource", - "AmazonManagedKafkaEventSourceConfig", - "SelfManagedKafkaEventSourceConfig", + "/properties/EventSourceArn", + "/properties/StartingPosition", + "/properties/StartingPositionTimestamp", + "/properties/SelfManagedEventSource", + "/properties/AmazonManagedKafkaEventSourceConfig", + "/properties/SelfManagedKafkaEventSourceConfig", ] # Necessary to handle when module does not support all the states handlers = ["create", "delete", "list", "read", "update"] state = module.params.get("state") - identifier = ["Id"] + identifier = ["/properties/Id"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/lambda_function.py b/plugins/modules/lambda_function.py index f432924a..aa5e964a 100644 --- a/plugins/modules/lambda_function.py +++ b/plugins/modules/lambda_function.py @@ -278,7 +278,16 @@ - 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: @@ -464,7 +473,13 @@ def main(): } argument_spec["snap_start"] = { "type": "dict", - "options": {}, + "options": { + "apply_on": { + "type": "str", + "choices": ["None", "PublishedVersions"], + "aliases": ["ApplyOn"], + } + }, "aliases": ["SnapStart"], } argument_spec["file_system_configs"] = { @@ -547,7 +562,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["code", "role", "function_name"], True], + ["state", "present", ["function_name", "code", "role"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] @@ -599,17 +614,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["FunctionName"] + 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 = ["FunctionName"] + identifier = ["/properties/FunctionName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/logs_log_group.py b/plugins/modules/logs_log_group.py index 9ea4b34c..8eb05a7d 100644 --- a/plugins/modules/logs_log_group.py +++ b/plugins/modules/logs_log_group.py @@ -125,6 +125,37 @@ """ EXAMPLES = r""" +- name: Create log group + amazon.cloud.logs_log_group: + state: present + log_group_name: '{{ log_group_name }}' + retention_in_days: 7 + tags: + testkey: testvalue + wait: true + register: output + +- name: Describe log group + amazon.cloud.logs_log_group: + state: describe + log_group_name: '{{ log_group_name }}' + register: output + +- name: Update log group + amazon.cloud.logs_log_group: + state: present + log_group_name: '{{ log_group_name }}' + tags: + anotherkey: anothervalue + purge_tags: false + wait: true + register: output + +- name: Delete log group + amazon.cloud.logs_log_group: + state: absent + log_group_name: '{{ log_group_name }}' + register: output """ RETURN = r""" @@ -247,17 +278,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["LogGroupName"] + 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 = ["LogGroupName"] + identifier = ["/properties/LogGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index 24e0d830..225046b9 100644 --- a/plugins/modules/logs_metric_filter.py +++ b/plugins/modules/logs_metric_filter.py @@ -298,10 +298,10 @@ def main(): "present", [ "metric_transformations", - "filter_pattern", - "filter_name", "identifier", "log_group_name", + "filter_name", + "filter_pattern", ], True, ], @@ -335,17 +335,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["FilterName", "LogGroupName"] + 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 = ["LogGroupName", "FilterName"] + identifier = ["/properties/LogGroupName", "/properties/FilterName"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None @@ -354,7 +354,7 @@ def main(): "filter_name" ): module.fail_json( - f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + "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 index a84a0e6a..8bbee483 100644 --- a/plugins/modules/logs_query_definition.py +++ b/plugins/modules/logs_query_definition.py @@ -35,12 +35,6 @@ description: - A name for the saved query definition. type: str - query_definition_id: - aliases: - - QueryDefinitionId - description: - - Unique identifier of a query definition. - type: str query_string: aliases: - QueryString @@ -134,10 +128,6 @@ def main(): "elements": "str", "aliases": ["LogGroupNames"], } - argument_spec["query_definition_id"] = { - "type": "str", - "aliases": ["QueryDefinitionId"], - } argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -148,7 +138,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["name", "query_definition_id", "query_string"], True], + ["state", "present", ["query_definition_id", "query_string", "name"], True], ["state", "absent", ["query_definition_id"], True], ["state", "get", ["query_definition_id"], True], ] @@ -168,7 +158,6 @@ def main(): 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 @@ -178,7 +167,7 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 @@ -188,7 +177,7 @@ def main(): handlers = ["create", "read", "update", "delete", "list"] state = module.params.get("state") - identifier = ["QueryDefinitionId"] + identifier = ["/properties/QueryDefinitionId"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/logs_resource_policy.py b/plugins/modules/logs_resource_policy.py index ae9561b2..25f1b63c 100644 --- a/plugins/modules/logs_resource_policy.py +++ b/plugins/modules/logs_resource_policy.py @@ -155,17 +155,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["PolicyName"] + 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 = ["PolicyName"] + identifier = ["/properties/PolicyName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_acl.py b/plugins/modules/memorydb_acl.py index 6ce23792..86055ec9 100644 --- a/plugins/modules/memorydb_acl.py +++ b/plugins/modules/memorydb_acl.py @@ -193,17 +193,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["ACLName"] + 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 = ["ACLName"] + identifier = ["/properties/ACLName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index 6e025f80..395e76e5 100644 --- a/plugins/modules/memorydb_cluster.py +++ b/plugins/modules/memorydb_cluster.py @@ -29,13 +29,6 @@ - To enable AutoMinorVersionUpgrade on a cluster you must set AutoMinorVersionUpgrade to true when you create a cluster. type: bool - cluster_endpoint: - aliases: - - ClusterEndpoint - description: - - The cluster endpoint. - suboptions: {} - type: dict cluster_name: aliases: - ClusterName @@ -124,6 +117,12 @@ 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: @@ -331,6 +330,7 @@ def main(): "type": "str", "aliases": ["ParameterGroupName"], } + argument_spec["port"] = {"type": "int", "aliases": ["Port"]} argument_spec["snapshot_retention_limit"] = { "type": "int", "aliases": ["SnapshotRetentionLimit"], @@ -357,11 +357,6 @@ def main(): "aliases": ["FinalSnapshotName"], } argument_spec["engine_version"] = {"type": "str", "aliases": ["EngineVersion"]} - argument_spec["cluster_endpoint"] = { - "type": "dict", - "options": {}, - "aliases": ["ClusterEndpoint"], - } argument_spec["auto_minor_version_upgrade"] = { "type": "bool", "aliases": ["AutoMinorVersionUpgrade"], @@ -378,7 +373,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], ] @@ -400,7 +395,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") @@ -412,6 +406,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") @@ -430,26 +425,26 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = [ - "ClusterName", - "TLSEnabled", - "DataTiering", - "KmsKeyId", - "Port", - "SubnetGroupName", - "SnapshotArns", - "SnapshotName", + "/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 = ["ClusterName"] + identifier = ["/properties/ClusterName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_parameter_group.py b/plugins/modules/memorydb_parameter_group.py index 4a6380e2..6bb14d4c 100644 --- a/plugins/modules/memorydb_parameter_group.py +++ b/plugins/modules/memorydb_parameter_group.py @@ -178,7 +178,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["family", "parameter_group_name"], True], + ["state", "present", ["parameter_group_name", "family"], True], ["state", "absent", ["parameter_group_name"], True], ["state", "get", ["parameter_group_name"], True], ] @@ -209,17 +209,21 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["ParameterGroupName", "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 = ["ParameterGroupName"] + identifier = ["/properties/ParameterGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_subnet_group.py b/plugins/modules/memorydb_subnet_group.py index ff21d043..0e03c088 100644 --- a/plugins/modules/memorydb_subnet_group.py +++ b/plugins/modules/memorydb_subnet_group.py @@ -177,7 +177,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], ] @@ -207,17 +207,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["SubnetGroupName"] + 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 = ["SubnetGroupName"] + identifier = ["/properties/SubnetGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/memorydb_user.py b/plugins/modules/memorydb_user.py index d17f95b9..db8cea7e 100644 --- a/plugins/modules/memorydb_user.py +++ b/plugins/modules/memorydb_user.py @@ -207,17 +207,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["UserName"] + 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 = ["UserName"] + 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 805d53c4..34ae0993 100644 --- a/plugins/modules/rds_db_cluster_parameter_group.py +++ b/plugins/modules/rds_db_cluster_parameter_group.py @@ -167,7 +167,7 @@ def main(): [ "state", "present", - ["db_cluster_parameter_group_name", "family", "description", "parameters"], + ["family", "parameters", "description", "db_cluster_parameter_group_name"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], @@ -202,17 +202,21 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["DBClusterParameterGroupName", "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 = ["DBClusterParameterGroupName"] + identifier = ["/properties/DBClusterParameterGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_db_instance.py b/plugins/modules/rds_db_instance.py index d9273c99..36d9f19d 100644 --- a/plugins/modules/rds_db_instance.py +++ b/plugins/modules/rds_db_instance.py @@ -85,26 +85,6 @@ description: - The identifier of the CA certificate for this DB instance. type: str - certificate_details: - aliases: - - CertificateDetails - description: - - Returns the details of the DB instances server certificate. - suboptions: - ca_identifier: - aliases: - - CAIdentifier - description: - - The CA identifier of the CA certificate used for the DB instances - server certificate. - type: str - valid_till: - aliases: - - ValidTill - description: - - "The expiration date of the DB instance\u2019s server certificate." - type: str - type: dict certificate_rotation_restart: aliases: - CertificateRotationRestart @@ -171,12 +151,6 @@ - '* Cant be the identifier of an Aurora DB cluster snapshot.' - '* Cant be the identifier of an RDS for PostgreSQL Multi-AZ DB cluster snapshot.' type: str - db_instance_arn: - aliases: - - DBInstanceArn - description: - - The Amazon Resource Name (ARN) for the DB instance. - type: str db_instance_class: aliases: - DBInstanceClass @@ -234,22 +208,6 @@ - If you update this value, the new subnet group must be a subnet group in a new VPC. type: str - db_system_id: - aliases: - - DBSystemId - description: - - The Oracle system ID (Oracle SID) for a container database (CDB). The Oracle - SID is also the name of the CDB. This setting is valid for RDS Custom - only. - type: str - dbi_resource_id: - aliases: - - DbiResourceId - description: - - The AWS Region-unique, immutable identifier for the DB instance. - - This identifier is found in AWS CloudTrail log entries whenever the AWS - KMS key for the DB instance is accessed. - type: str delete_automated_backups: aliases: - DeleteAutomatedBackups @@ -307,32 +265,6 @@ - A value that indicates whether to enable Performance Insights for the DB instance. type: bool - endpoint: - aliases: - - Endpoint - description: - - Specifies the connection endpoint. - suboptions: - address: - aliases: - - Address - description: - - Specifies the DNS address of the DB instance. - type: str - hosted_zone_id: - aliases: - - HostedZoneId - description: - - Specifies the ID that Amazon Route 53 assigns when you create a - hosted zone. - type: str - port: - aliases: - - Port - description: - - Specifies the port that the database engine is listening on. - type: str - type: dict engine: aliases: - Engine @@ -386,26 +318,6 @@ description: - The password for the master user. type: str - master_user_secret: - aliases: - - MasterUserSecret - description: - - Contains the secret managed by RDS in AWS Secrets Manager for the master - user password. - suboptions: - kms_key_id: - aliases: - - KmsKeyId - description: - - The AWS KMS key identifier that is used to encrypt the secret. - type: str - secret_arn: - aliases: - - SecretArn - description: - - The Amazon Resource Name (ARN) of the secret. - type: str - type: dict master_username: aliases: - MasterUsername @@ -780,14 +692,6 @@ def main(): "type": "str", "aliases": ["CACertificateIdentifier"], } - argument_spec["certificate_details"] = { - "type": "dict", - "options": { - "ca_identifier": {"type": "str", "aliases": ["CAIdentifier"]}, - "valid_till": {"type": "str", "aliases": ["ValidTill"]}, - }, - "aliases": ["CertificateDetails"], - } argument_spec["certificate_rotation_restart"] = { "type": "bool", "aliases": ["CertificateRotationRestart"], @@ -812,13 +716,11 @@ def main(): "type": "str", "aliases": ["DBClusterSnapshotIdentifier"], } - argument_spec["db_instance_arn"] = {"type": "str", "aliases": ["DBInstanceArn"]} argument_spec["db_instance_class"] = {"type": "str", "aliases": ["DBInstanceClass"]} argument_spec["db_instance_identifier"] = { "type": "str", "aliases": ["DBInstanceIdentifier"], } - argument_spec["dbi_resource_id"] = {"type": "str", "aliases": ["DbiResourceId"]} argument_spec["db_name"] = {"type": "str", "aliases": ["DBName"]} argument_spec["db_parameter_group_name"] = { "type": "str", @@ -837,7 +739,6 @@ def main(): "type": "str", "aliases": ["DBSubnetGroupName"], } - argument_spec["db_system_id"] = {"type": "str", "aliases": ["DBSystemId"]} argument_spec["delete_automated_backups"] = { "type": "bool", "aliases": ["DeleteAutomatedBackups"], @@ -864,15 +765,6 @@ def main(): "type": "bool", "aliases": ["EnablePerformanceInsights"], } - argument_spec["endpoint"] = { - "type": "dict", - "options": { - "address": {"type": "str", "aliases": ["Address"]}, - "port": {"type": "str", "aliases": ["Port"]}, - "hosted_zone_id": {"type": "str", "aliases": ["HostedZoneId"]}, - }, - "aliases": ["Endpoint"], - } argument_spec["engine"] = {"type": "str", "aliases": ["Engine"]} argument_spec["engine_version"] = {"type": "str", "aliases": ["EngineVersion"]} argument_spec["manage_master_user_password"] = { @@ -887,14 +779,6 @@ def main(): "type": "str", "aliases": ["MasterUserPassword"], } - argument_spec["master_user_secret"] = { - "type": "dict", - "options": { - "secret_arn": {"type": "str", "aliases": ["SecretArn"]}, - "kms_key_id": {"type": "str", "aliases": ["KmsKeyId"]}, - }, - "aliases": ["MasterUserSecret"], - } argument_spec["max_allocated_storage"] = { "type": "int", "aliases": ["MaxAllocatedStorage"], @@ -1045,7 +929,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" ) @@ -1058,7 +941,6 @@ def main(): params["db_cluster_snapshot_identifier"] = module.params.get( "db_cluster_snapshot_identifier" ) - params["db_instance_arn"] = module.params.get("db_instance_arn") params["db_instance_class"] = module.params.get("db_instance_class") params["db_instance_identifier"] = module.params.get("db_instance_identifier") params["db_name"] = module.params.get("db_name") @@ -1066,8 +948,6 @@ def main(): params["db_security_groups"] = module.params.get("db_security_groups") params["db_snapshot_identifier"] = module.params.get("db_snapshot_identifier") params["db_subnet_group_name"] = module.params.get("db_subnet_group_name") - params["db_system_id"] = module.params.get("db_system_id") - params["dbi_resource_id"] = module.params.get("dbi_resource_id") params["delete_automated_backups"] = module.params.get("delete_automated_backups") params["deletion_protection"] = module.params.get("deletion_protection") params["domain"] = module.params.get("domain") @@ -1081,7 +961,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") @@ -1091,7 +970,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") @@ -1142,14 +1020,14 @@ 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") + 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 = scrub_none_parameters(params) @@ -1158,31 +1036,31 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = [ - "CharacterSetName", - "CustomIAMInstanceProfile", - "DBClusterIdentifier", - "DBInstanceIdentifier", - "DBName", - "DBSubnetGroupName", - "KmsKeyId", - "MasterUsername", - "NcharCharacterSetName", - "Port", - "SourceRegion", - "StorageEncrypted", - "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 = ["DBInstanceIdentifier"] + identifier = ["/properties/DBInstanceIdentifier"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index 3c43508a..fe707776 100644 --- a/plugins/modules/rds_db_proxy.py +++ b/plugins/modules/rds_db_proxy.py @@ -300,7 +300,7 @@ def main(): [ "state", "present", - ["vpc_subnet_ids", "role_arn", "auth", "db_proxy_name", "engine_family"], + ["engine_family", "role_arn", "auth", "db_proxy_name", "vpc_subnet_ids"], True, ], ["state", "absent", ["db_proxy_name"], True], @@ -338,17 +338,21 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["DBProxyName", "EngineFamily", "VpcSubnetIds"] + 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 = ["DBProxyName"] + 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 4d69998f..d4f5a900 100644 --- a/plugins/modules/rds_db_proxy_endpoint.py +++ b/plugins/modules/rds_db_proxy_endpoint.py @@ -226,17 +226,21 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["DBProxyName", "DBProxyEndpointName", "VpcSubnetIds"] + 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 = ["DBProxyEndpointName"] + 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 de0b2728..e8ec7065 100644 --- a/plugins/modules/rds_db_subnet_group.py +++ b/plugins/modules/rds_db_subnet_group.py @@ -164,7 +164,7 @@ def main(): [ "state", "present", - ["db_subnet_group_name", "subnet_ids", "db_subnet_group_description"], + ["subnet_ids", "db_subnet_group_description", "db_subnet_group_name"], True, ], ["state", "absent", ["db_subnet_group_name"], True], @@ -198,17 +198,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["DBSubnetGroupName"] + 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 = ["DBSubnetGroupName"] + identifier = ["/properties/DBSubnetGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_global_cluster.py b/plugins/modules/rds_global_cluster.py index d2190392..83d5f929 100644 --- a/plugins/modules/rds_global_cluster.py +++ b/plugins/modules/rds_global_cluster.py @@ -228,22 +228,22 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = [ - "GlobalClusterIdentifier", - "SourceDBClusterIdentifier", - "StorageEncrypted", - "Engine", + "/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 = ["GlobalClusterIdentifier"] + identifier = ["/properties/GlobalClusterIdentifier"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/rds_option_group.py b/plugins/modules/rds_option_group.py index ffdaf1f7..87795ea1 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -258,10 +258,10 @@ def main(): "state", "present", [ + "option_group_description", + "option_group_name", "major_engine_version", "engine_name", - "option_group_name", - "option_group_description", ], True, ], @@ -296,22 +296,22 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = [ - "EngineName", - "MajorEngineVersion", - "OptionGroupDescription", - "OptionGroupName", + "/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 = ["OptionGroupName"] + identifier = ["/properties/OptionGroupName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index c52b7061..6dcbb2de 100644 --- a/plugins/modules/redshift_cluster.py +++ b/plugins/modules/redshift_cluster.py @@ -173,13 +173,6 @@ description: - If true, the data in the cluster is encrypted at rest. type: bool - endpoint: - aliases: - - Endpoint - description: - - Not Provived. - suboptions: {} - type: dict enhanced_vpc_routing: aliases: - EnhancedVpcRouting @@ -312,6 +305,13 @@ 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 @@ -531,6 +531,7 @@ def main(): } 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"], @@ -572,7 +573,6 @@ def main(): }, "aliases": ["LoggingProperties"], } - argument_spec["endpoint"] = {"type": "dict", "options": {}, "aliases": ["Endpoint"]} argument_spec["destination_region"] = { "type": "str", "aliases": ["DestinationRegion"], @@ -651,12 +651,12 @@ def main(): "state", "present", [ + "node_type", "cluster_identifier", - "master_user_password", - "master_username", - "cluster_type", "db_name", - "node_type", + "cluster_type", + "master_username", + "master_user_password", ], True, ], @@ -712,7 +712,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" @@ -732,6 +731,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" ) @@ -758,25 +758,25 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = [ - "ClusterIdentifier", - "OwnerAccount", - "SnapshotIdentifier", - "DBName", - "SnapshotClusterIdentifier", - "ClusterSubnetGroupName", - "MasterUsername", + "/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 = ["ClusterIdentifier"] + identifier = ["/properties/ClusterIdentifier"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index 5ca97d55..96902327 100644 --- a/plugins/modules/redshift_endpoint_access.py +++ b/plugins/modules/redshift_endpoint_access.py @@ -164,10 +164,10 @@ def main(): "state", "present", [ - "vpc_security_group_ids", "endpoint_name", - "subnet_group_name", "cluster_identifier", + "subnet_group_name", + "vpc_security_group_ids", ], True, ], @@ -201,22 +201,22 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = [ - "EndpointName", - "ClusterIdentifier", - "ResourceOwner", - "SubnetGroupName", + "/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 = ["EndpointName"] + identifier = ["/properties/EndpointName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index 68346ed7..fa533b2a 100644 --- a/plugins/modules/redshift_endpoint_authorization.py +++ b/plugins/modules/redshift_endpoint_authorization.py @@ -182,17 +182,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["ClusterIdentifier", "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 = ["ClusterIdentifier", "Account"] + identifier = ["/properties/ClusterIdentifier", "/properties/Account"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None @@ -201,7 +201,7 @@ def main(): "account" ): module.fail_json( - f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + "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 e4c881a6..7af6fd29 100644 --- a/plugins/modules/redshift_event_subscription.py +++ b/plugins/modules/redshift_event_subscription.py @@ -257,17 +257,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["SubscriptionName"] + 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 = ["SubscriptionName"] + identifier = ["/properties/SubscriptionName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/redshift_scheduled_action.py b/plugins/modules/redshift_scheduled_action.py index 2d89fb11..af05e948 100644 --- a/plugins/modules/redshift_scheduled_action.py +++ b/plugins/modules/redshift_scheduled_action.py @@ -325,17 +325,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["ScheduledActionName"] + 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 = ["ScheduledActionName"] + identifier = ["/properties/ScheduledActionName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/route53_dnssec.py b/plugins/modules/route53_dnssec.py index 4a5826fd..daf88a4b 100644 --- a/plugins/modules/route53_dnssec.py +++ b/plugins/modules/route53_dnssec.py @@ -146,17 +146,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["HostedZoneId"] + 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 = ["HostedZoneId"] + 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 7c1dd225..f86bfe8b 100644 --- a/plugins/modules/route53_key_signing_key.py +++ b/plugins/modules/route53_key_signing_key.py @@ -167,11 +167,11 @@ def main(): "state", "present", [ - "key_management_service_arn", - "name", - "hosted_zone_id", "identifier", "status", + "hosted_zone_id", + "name", + "key_management_service_arn", ], True, ], @@ -207,24 +207,28 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["HostedZoneId", "Name", "KeyManagementServiceArn"] + 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 = ["HostedZoneId", "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 all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + "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 0b88a94d..2ee70bd3 100644 --- a/plugins/modules/s3_access_point.py +++ b/plugins/modules/s3_access_point.py @@ -272,17 +272,22 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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", "BucketAccountId", "VpcConfiguration"] + create_only_params = [ + "/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 bcb4d935..ca83c01e 100644 --- a/plugins/modules/s3_bucket.py +++ b/plugins/modules/s3_bucket.py @@ -1705,6 +1705,36 @@ """ EXAMPLES = r""" +- name: Create S3 bucket + amazon.cloud.s3_bucket: + bucket_name: '{{ bucket_name }}' + state: present + register: output + +- name: Describe S3 bucket + amazon.cloud.s3_bucket: + state: describe + bucket_name: '{{ output.result.identifier }}' + register: _result + +- name: List S3 buckets + amazon.cloud.s3_bucket: + state: list + register: _result + +- name: Update S3 bucket public access block configuration and tags (diff=true) + amazon.cloud.s3_bucket: + bucket_name: '{{ output.result.identifier }}' + state: present + public_access_block_configuration: + block_public_acls: false + block_public_policy: false + ignore_public_acls: false + restrict_public_buckets: false + tags: + mykey: myval + diff: true + register: _result """ RETURN = r""" @@ -2720,17 +2750,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["BucketName", "ObjectLockEnabled"] + 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 = ["BucketName"] + 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 d0c78e34..eeddc714 100644 --- a/plugins/modules/s3_multi_region_access_point.py +++ b/plugins/modules/s3_multi_region_access_point.py @@ -254,17 +254,21 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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", "PublicAccessBlockConfiguration", "Regions"] + create_only_params = [ + "/properties/Name", + "/properties/PublicAccessBlockConfiguration", + "/properties/Regions", + ] # Necessary to handle when module does not support all the states 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 d2d88b72..72b922f7 100644 --- a/plugins/modules/s3_multi_region_access_point_policy.py +++ b/plugins/modules/s3_multi_region_access_point_policy.py @@ -127,7 +127,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["mrap_name", "policy"], True], + ["state", "present", ["policy", "mrap_name"], True], ["state", "absent", ["mrap_name"], True], ["state", "get", ["mrap_name"], True], ] @@ -155,17 +155,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["MrapName"] + 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 = ["MrapName"] + identifier = ["/properties/MrapName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/s3objectlambda_access_point.py b/plugins/modules/s3objectlambda_access_point.py index 248f9e0a..9886ae01 100644 --- a/plugins/modules/s3objectlambda_access_point.py +++ b/plugins/modules/s3objectlambda_access_point.py @@ -245,7 +245,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], ] @@ -275,17 +275,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 7433333f..89a06f97 100644 --- a/plugins/modules/s3objectlambda_access_point_policy.py +++ b/plugins/modules/s3objectlambda_access_point_policy.py @@ -161,17 +161,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["ObjectLambdaAccessPoint"] + 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 = ["ObjectLambdaAccessPoint"] + identifier = ["/properties/ObjectLambdaAccessPoint"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/ssm_document.py b/plugins/modules/ssm_document.py index 5f0686a6..12fea6c6 100644 --- a/plugins/modules/ssm_document.py +++ b/plugins/modules/ssm_document.py @@ -350,17 +350,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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", "DocumentType"] + 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 index 6d29a01a..193edde0 100644 --- a/plugins/modules/ssm_resource_data_sync.py +++ b/plugins/modules/ssm_resource_data_sync.py @@ -106,12 +106,6 @@ description: - Not Provived. type: str - sync_name: - aliases: - - SyncName - description: - - Not Provived. - type: str sync_source: aliases: - SyncSource @@ -274,7 +268,6 @@ def main(): argument_spec["bucket_name"] = {"type": "str", "aliases": ["BucketName"]} argument_spec["bucket_region"] = {"type": "str", "aliases": ["BucketRegion"]} argument_spec["sync_format"] = {"type": "str", "aliases": ["SyncFormat"]} - argument_spec["sync_name"] = {"type": "str", "aliases": ["SyncName"]} argument_spec["sync_type"] = {"type": "str", "aliases": ["SyncType"]} argument_spec["bucket_prefix"] = {"type": "str", "aliases": ["BucketPrefix"]} argument_spec["state"] = { @@ -311,7 +304,6 @@ def main(): 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") @@ -322,26 +314,26 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = [ - "KMSKeyArn", - "SyncFormat", - "BucketPrefix", - "SyncName", - "BucketRegion", - "BucketName", - "S3Destination", - "SyncType", + "/properties/KMSKeyArn", + "/properties/SyncFormat", + "/properties/BucketPrefix", + "/properties/SyncName", + "/properties/BucketRegion", + "/properties/BucketName", + "/properties/S3Destination", + "/properties/SyncType", ] # Necessary to handle when module does not support all the states handlers = ["create", "delete", "update", "list", "read"] state = module.params.get("state") - identifier = ["SyncName"] + identifier = ["/properties/SyncName"] results = {"changed": False, "result": {}} diff --git a/plugins/modules/wafv2_ip_set.py b/plugins/modules/wafv2_ip_set.py index fa5ee659..3e013228 100644 --- a/plugins/modules/wafv2_ip_set.py +++ b/plugins/modules/wafv2_ip_set.py @@ -39,12 +39,6 @@ operation to make the resource available so that another operation may be performed on it. type: bool - id: - aliases: - - Id - description: - - Id of the IPSet. - type: str identifier: description: - For compound primary identifiers, to specify the primary identifier as a @@ -173,7 +167,6 @@ def main(): argument_spec["description"] = {"type": "str", "aliases": ["Description"]} argument_spec["name"] = {"type": "str", "aliases": ["Name"]} - argument_spec["id"] = {"type": "str", "aliases": ["Id"]} argument_spec["scope"] = { "type": "str", "choices": ["CLOUDFRONT", "REGIONAL"], @@ -206,7 +199,7 @@ def main(): [ "state", "present", - ["addresses", "name", "ip_address_version", "scope", "id", "identifier"], + ["identifier", "id", "addresses", "name", "scope", "ip_address_version"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], @@ -228,7 +221,6 @@ def main(): 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") @@ -242,17 +234,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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", "Scope"] + create_only_params = ["/properties/Name", "/properties/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"] + identifier = ["/properties/Name", "/properties/Id", "/properties/Scope"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None @@ -263,7 +255,7 @@ def main(): or not module.params.get("scope") ): module.fail_json( - f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + "You must specify all the ('name', 'id', 'scope') identifiers." ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/wafv2_logging_configuration.py b/plugins/modules/wafv2_logging_configuration.py index 7307c76d..214583a5 100644 --- a/plugins/modules/wafv2_logging_configuration.py +++ b/plugins/modules/wafv2_logging_configuration.py @@ -479,17 +479,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["ResourceArn"] + 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 = ["ResourceArn"] + 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 index df79fc90..38866d38 100644 --- a/plugins/modules/wafv2_regex_pattern_set.py +++ b/plugins/modules/wafv2_regex_pattern_set.py @@ -30,12 +30,6 @@ operation to make the resource available so that another operation may be performed on it. type: bool - id: - aliases: - - Id - description: - - Id of the RegexPatternSet. - type: str identifier: description: - For compound primary identifiers, to specify the primary identifier as a @@ -161,7 +155,6 @@ def main(): argument_spec["description"] = {"type": "str", "aliases": ["Description"]} argument_spec["name"] = {"type": "str", "aliases": ["Name"]} - argument_spec["id"] = {"type": "str", "aliases": ["Id"]} argument_spec["regular_expression_list"] = { "type": "list", "elements": "str", @@ -189,7 +182,7 @@ def main(): [ "state", "present", - ["name", "scope", "regular_expression_list", "id", "identifier"], + ["identifier", "id", "regular_expression_list", "name", "scope"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], @@ -210,7 +203,6 @@ def main(): 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") @@ -224,17 +216,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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", "Scope"] + create_only_params = ["/properties/Name", "/properties/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"] + identifier = ["/properties/Name", "/properties/Id", "/properties/Scope"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None @@ -245,7 +237,7 @@ def main(): or not module.params.get("scope") ): module.fail_json( - f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + "You must specify all the ('name', 'id', 'scope') identifiers." ) results = {"changed": False, "result": {}} diff --git a/plugins/modules/wafv2_web_acl_association.py b/plugins/modules/wafv2_web_acl_association.py index 22fb7163..dbaf3438 100644 --- a/plugins/modules/wafv2_web_acl_association.py +++ b/plugins/modules/wafv2_web_acl_association.py @@ -137,7 +137,7 @@ def main(): required_if = [ ["state", "list", ["resource_arn"], True], - ["state", "present", ["identifier", "web_acl_arn", "resource_arn"], True], + ["state", "present", ["identifier", "resource_arn", "web_acl_arn"], True], ["state", "absent", ["resource_arn", "web_acl_arn", "identifier"], True], ["state", "get", ["resource_arn", "web_acl_arn", "identifier"], True], ] @@ -166,17 +166,17 @@ def main(): if module.params.get("tags") is not None: _params_to_set["tags"] = ansible_dict_to_boto3_tag_list(module.params["tags"]) - # Use the alis from argument_spec as key and avoid snake_to_camel conversions + # 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 = ["ResourceArn", "WebACLArn"] + 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 = ["ResourceArn", "WebACLArn"] + identifier = ["/properties/ResourceArn", "/properties/WebACLArn"] if ( state in ("present", "absent", "get", "describe") and module.params.get("identifier") is None @@ -185,7 +185,7 @@ def main(): "web_acl_arn" ): module.fail_json( - f"You must specify all the {*[camel_to_snake(id, alias=False) for id in identifier], } identifiers." + "You must specify all the ('resource_arn', 'web_acl_arn') identifiers." ) results = {"changed": False, "result": {}} diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 0d450e7e..103dcf38 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -91,3 +91,4 @@ 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 0d450e7e..103dcf38 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -91,3 +91,4 @@ 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.14.txt b/tests/sanity/ignore-2.14.txt index 0d450e7e..103dcf38 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -91,3 +91,4 @@ 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.15.txt b/tests/sanity/ignore-2.15.txt index ff9c0297..d6080865 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -8,3 +8,170 @@ 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 +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 +tools/update_constants.py shebang!skipplugins/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 +tools/update_constants.py shebang!skip From ebd1c5e5a581a1097de2dec809eb2028bc023aa5 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 9 Aug 2023 16:59:42 +0200 Subject: [PATCH 10/32] Add changelog fragment Signed-off-by: Alina Buzachis --- README.md | 2 +- changelogs/fragments/20230809-collection_regeneration.yml | 6 ++++++ meta/runtime.yml | 5 ----- 3 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 changelogs/fragments/20230809-collection_regeneration.yml 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..510f910e --- /dev/null +++ b/changelogs/fragments/20230809-collection_regeneration.yml @@ -0,0 +1,6 @@ +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." \ No newline at end of file diff --git a/meta/runtime.yml b/meta/runtime.yml index e3a9c6b2..64306fd7 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -67,11 +67,6 @@ action_groups: - 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 plugin_routing: modules: rdsdb_proxy: From f2910775723f790d3da1f56715d34436641f1478 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 9 Aug 2023 17:39:08 +0200 Subject: [PATCH 11/32] Yet another update Signed-off-by: Alina Buzachis --- .../modules/autoscaling_launch_configuration.py | 2 +- plugins/modules/backup_framework.py | 8 ++++++++ plugins/modules/backup_report_plan.py | 11 ++++++++++- plugins/modules/cloudtrail_event_data_store.py | 11 +++++++++++ plugins/modules/cloudtrail_trail.py | 2 +- plugins/modules/cloudwatch_metric_stream.py | 2 +- plugins/modules/dynamodb_global_table.py | 12 +++++++++--- plugins/modules/ec2_placement_group.py | 8 ++++++++ plugins/modules/ecs_capacity_provider.py | 2 +- .../ecs_cluster_capacity_provider_associations.py | 2 +- plugins/modules/ecs_primary_task_set.py | 2 +- plugins/modules/eks_addon.py | 2 +- plugins/modules/eks_cluster.py | 2 +- plugins/modules/eks_fargate_profile.py | 4 ++-- plugins/modules/iam_role.py | 2 +- plugins/modules/kms_alias.py | 2 +- plugins/modules/kms_replica_key.py | 10 +++++++++- plugins/modules/lambda_code_signing_config.py | 13 ++++++++++++- plugins/modules/lambda_event_source_mapping.py | 8 ++++++++ plugins/modules/lambda_function.py | 14 ++++++++++++-- plugins/modules/logs_metric_filter.py | 6 +++--- plugins/modules/logs_query_definition.py | 11 +++++++++++ plugins/modules/logs_resource_policy.py | 2 +- plugins/modules/memorydb_cluster.py | 2 +- plugins/modules/memorydb_parameter_group.py | 2 +- plugins/modules/rds_db_cluster_parameter_group.py | 2 +- plugins/modules/rds_db_proxy.py | 2 +- plugins/modules/rds_db_proxy_endpoint.py | 2 +- plugins/modules/rds_db_subnet_group.py | 2 +- plugins/modules/rds_option_group.py | 6 +++--- plugins/modules/redshift_cluster.py | 8 ++++---- plugins/modules/redshift_endpoint_access.py | 4 ++-- plugins/modules/redshift_endpoint_authorization.py | 2 +- plugins/modules/route53_key_signing_key.py | 4 ++-- plugins/modules/ssm_resource_data_sync.py | 8 ++++++++ plugins/modules/wafv2_ip_set.py | 10 +++++++++- plugins/modules/wafv2_logging_configuration.py | 2 +- plugins/modules/wafv2_regex_pattern_set.py | 10 +++++++++- 38 files changed, 159 insertions(+), 45 deletions(-) diff --git a/plugins/modules/autoscaling_launch_configuration.py b/plugins/modules/autoscaling_launch_configuration.py index f05c8406..4aaf8f13 100644 --- a/plugins/modules/autoscaling_launch_configuration.py +++ b/plugins/modules/autoscaling_launch_configuration.py @@ -421,7 +421,7 @@ def main(): [ "state", "present", - ["image_id", "instance_type", "launch_configuration_name"], + ["instance_type", "image_id", "launch_configuration_name"], True, ], ["state", "absent", ["launch_configuration_name"], True], diff --git a/plugins/modules/backup_framework.py b/plugins/modules/backup_framework.py index 6346e92f..0b90cc36 100644 --- a/plugins/modules/backup_framework.py +++ b/plugins/modules/backup_framework.py @@ -22,6 +22,12 @@ operation to make the resource available so that another operation may be performed on it. type: bool + framework_arn: + aliases: + - FrameworkArn + description: + - An Amazon Resource Name (ARN) that uniquely identifies Framework as a resource. + type: str framework_controls: aliases: - FrameworkControls @@ -256,6 +262,7 @@ def main(): "type": "str", "aliases": ["FrameworkDescription"], } + argument_spec["framework_arn"] = {"type": "str", "aliases": ["FrameworkArn"]} argument_spec["framework_controls"] = { "type": "list", "elements": "dict", @@ -337,6 +344,7 @@ def main(): 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") diff --git a/plugins/modules/backup_report_plan.py b/plugins/modules/backup_report_plan.py index aff9c32e..178dcca8 100644 --- a/plugins/modules/backup_report_plan.py +++ b/plugins/modules/backup_report_plan.py @@ -58,6 +58,13 @@ - If not specified, there is no prefix. type: str type: dict + report_plan_arn: + aliases: + - ReportPlanArn + 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: aliases: - ReportPlanDescription @@ -234,6 +241,7 @@ def main(): ) argument_spec["report_plan_name"] = {"type": "str", "aliases": ["ReportPlanName"]} + argument_spec["report_plan_arn"] = {"type": "str", "aliases": ["ReportPlanArn"]} argument_spec["report_plan_description"] = { "type": "str", "aliases": ["ReportPlanDescription"], @@ -290,7 +298,7 @@ def main(): [ "state", "present", - ["report_delivery_channel", "report_plan_arn", "report_setting"], + ["report_delivery_channel", "report_setting", "report_plan_arn"], True, ], ["state", "absent", ["report_plan_arn"], True], @@ -311,6 +319,7 @@ def main(): 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") diff --git a/plugins/modules/cloudtrail_event_data_store.py b/plugins/modules/cloudtrail_event_data_store.py index 98e4077a..eeb26cfe 100644 --- a/plugins/modules/cloudtrail_event_data_store.py +++ b/plugins/modules/cloudtrail_event_data_store.py @@ -103,6 +103,12 @@ as Log data events for only two S3 buckets. type: str type: list + event_data_store_arn: + aliases: + - EventDataStoreArn + description: + - The ARN of the event data store. + type: str force: default: false description: @@ -296,6 +302,10 @@ def main(): }, "aliases": ["AdvancedEventSelectors"], } + argument_spec["event_data_store_arn"] = { + "type": "str", + "aliases": ["EventDataStoreArn"], + } argument_spec["multi_region_enabled"] = { "type": "bool", "aliases": ["MultiRegionEnabled"], @@ -346,6 +356,7 @@ def main(): params = {} params["advanced_event_selectors"] = module.params.get("advanced_event_selectors") + params["event_data_store_arn"] = module.params.get("event_data_store_arn") params["ingestion_enabled"] = module.params.get("ingestion_enabled") params["kms_key_id"] = module.params.get("kms_key_id") params["multi_region_enabled"] = module.params.get("multi_region_enabled") diff --git a/plugins/modules/cloudtrail_trail.py b/plugins/modules/cloudtrail_trail.py index e7e3b5bb..9547abb3 100644 --- a/plugins/modules/cloudtrail_trail.py +++ b/plugins/modules/cloudtrail_trail.py @@ -520,7 +520,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["is_logging", "s3_bucket_name", "trail_name"], True], + ["state", "present", ["is_logging", "trail_name", "s3_bucket_name"], True], ["state", "absent", ["trail_name"], True], ["state", "get", ["trail_name"], True], ] diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index d7d88854..4feb10f5 100644 --- a/plugins/modules/cloudwatch_metric_stream.py +++ b/plugins/modules/cloudwatch_metric_stream.py @@ -307,7 +307,7 @@ def main(): [ "state", "present", - ["firehose_arn", "output_format", "role_arn", "name"], + ["role_arn", "firehose_arn", "output_format", "name"], True, ], ["state", "absent", ["name"], True], diff --git a/plugins/modules/dynamodb_global_table.py b/plugins/modules/dynamodb_global_table.py index 00253430..08f5b14c 100644 --- a/plugins/modules/dynamodb_global_table.py +++ b/plugins/modules/dynamodb_global_table.py @@ -367,7 +367,13 @@ - KinesisStreamSpecification description: - Not Provived. - suboptions: {} + suboptions: + stream_arn: + aliases: + - StreamArn + description: + - Not Provived. + type: str type: dict point_in_time_recovery_specification: aliases: @@ -1002,7 +1008,7 @@ def main(): }, "kinesis_stream_specification": { "type": "dict", - "options": {}, + "options": {"stream_arn": {"type": "str", "aliases": ["StreamArn"]}}, "aliases": ["KinesisStreamSpecification"], }, }, @@ -1043,7 +1049,7 @@ def main(): [ "state", "present", - ["table_name", "replicas", "key_schema", "attribute_definitions"], + ["attribute_definitions", "replicas", "key_schema", "table_name"], True, ], ["state", "absent", ["table_name"], True], diff --git a/plugins/modules/ec2_placement_group.py b/plugins/modules/ec2_placement_group.py index 14918bb2..0a95cfc5 100644 --- a/plugins/modules/ec2_placement_group.py +++ b/plugins/modules/ec2_placement_group.py @@ -25,6 +25,12 @@ operation to make the resource available so that another operation may be performed on it. type: bool + group_name: + aliases: + - GroupName + description: + - The Group Name of Placement Group. + type: str partition_count: aliases: - PartitionCount @@ -139,6 +145,7 @@ def main(): ) argument_spec["strategy"] = {"type": "str", "aliases": ["Strategy"]} + argument_spec["group_name"] = {"type": "str", "aliases": ["GroupName"]} argument_spec["spread_level"] = {"type": "str", "aliases": ["SpreadLevel"]} argument_spec["partition_count"] = {"type": "int", "aliases": ["PartitionCount"]} argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} @@ -171,6 +178,7 @@ def main(): 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") diff --git a/plugins/modules/ecs_capacity_provider.py b/plugins/modules/ecs_capacity_provider.py index 4d48e3d2..c12af8f3 100644 --- a/plugins/modules/ecs_capacity_provider.py +++ b/plugins/modules/ecs_capacity_provider.py @@ -238,7 +238,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["name", "auto_scaling_group_provider"], True], + ["state", "present", ["auto_scaling_group_provider", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/ecs_cluster_capacity_provider_associations.py b/plugins/modules/ecs_cluster_capacity_provider_associations.py index b7208abd..2e7f85d6 100644 --- a/plugins/modules/ecs_cluster_capacity_provider_associations.py +++ b/plugins/modules/ecs_cluster_capacity_provider_associations.py @@ -174,7 +174,7 @@ def main(): [ "state", "present", - ["cluster", "capacity_providers", "default_capacity_provider_strategy"], + ["cluster", "default_capacity_provider_strategy", "capacity_providers"], True, ], ["state", "absent", ["cluster"], True], diff --git a/plugins/modules/ecs_primary_task_set.py b/plugins/modules/ecs_primary_task_set.py index 551a7f13..81465213 100644 --- a/plugins/modules/ecs_primary_task_set.py +++ b/plugins/modules/ecs_primary_task_set.py @@ -147,7 +147,7 @@ def main(): required_if = [ ["state", "list", ["cluster"], True], - ["state", "present", ["cluster", "task_set_id", "identifier", "service"], True], + ["state", "present", ["cluster", "task_set_id", "service", "identifier"], True], ["state", "absent", ["cluster", "service", "identifier"], True], ["state", "get", ["cluster", "service", "identifier"], True], ] diff --git a/plugins/modules/eks_addon.py b/plugins/modules/eks_addon.py index ba89e74b..c67ebbcb 100644 --- a/plugins/modules/eks_addon.py +++ b/plugins/modules/eks_addon.py @@ -206,7 +206,7 @@ def main(): required_if = [ ["state", "list", ["cluster_name"], True], - ["state", "present", ["addon_name", "cluster_name", "identifier"], True], + ["state", "present", ["identifier", "cluster_name", "addon_name"], True], ["state", "absent", ["cluster_name", "addon_name", "identifier"], True], ["state", "get", ["cluster_name", "addon_name", "identifier"], True], ] diff --git a/plugins/modules/eks_cluster.py b/plugins/modules/eks_cluster.py index 2f0c3437..c43dba1b 100644 --- a/plugins/modules/eks_cluster.py +++ b/plugins/modules/eks_cluster.py @@ -446,7 +446,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", "resources_vpc_config", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/eks_fargate_profile.py b/plugins/modules/eks_fargate_profile.py index 7d1e0261..346376f5 100644 --- a/plugins/modules/eks_fargate_profile.py +++ b/plugins/modules/eks_fargate_profile.py @@ -329,11 +329,11 @@ def main(): "state", "present", [ - "pod_execution_role_arn", - "identifier", "fargate_profile_name", "cluster_name", + "pod_execution_role_arn", "selectors", + "identifier", ], True, ], diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index d977a4a7..a258c33a 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -224,7 +224,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["assume_role_policy_document", "role_name"], True], + ["state", "present", ["role_name", "assume_role_policy_document"], True], ["state", "absent", ["role_name"], True], ["state", "get", ["role_name"], True], ] diff --git a/plugins/modules/kms_alias.py b/plugins/modules/kms_alias.py index 08a82561..aec66a8c 100644 --- a/plugins/modules/kms_alias.py +++ b/plugins/modules/kms_alias.py @@ -133,7 +133,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["alias_name", "target_key_id"], True], + ["state", "present", ["target_key_id", "alias_name"], True], ["state", "absent", ["alias_name"], True], ["state", "get", ["alias_name"], True], ] diff --git a/plugins/modules/kms_replica_key.py b/plugins/modules/kms_replica_key.py index 009800d6..f15ea3b3 100644 --- a/plugins/modules/kms_replica_key.py +++ b/plugins/modules/kms_replica_key.py @@ -39,6 +39,12 @@ operation to make the resource available so that another operation may be performed on it. type: bool + key_id: + aliases: + - KeyId + description: + - Not Provived. + type: str key_policy: aliases: - KeyPolicy @@ -166,6 +172,7 @@ def main(): "aliases": ["PendingWindowInDays"], } argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} + argument_spec["key_id"] = {"type": "str", "aliases": ["KeyId"]} argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -177,7 +184,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["key_policy", "primary_key_arn", "key_id"], True], + ["state", "present", ["key_id", "primary_key_arn", "key_policy"], True], ["state", "absent", ["key_id"], True], ["state", "get", ["key_id"], True], ] @@ -197,6 +204,7 @@ def main(): 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") diff --git a/plugins/modules/lambda_code_signing_config.py b/plugins/modules/lambda_code_signing_config.py index 38c6edde..ddc4fdb3 100644 --- a/plugins/modules/lambda_code_signing_config.py +++ b/plugins/modules/lambda_code_signing_config.py @@ -30,6 +30,12 @@ elements: str type: list type: dict + code_signing_config_arn: + aliases: + - CodeSigningConfigArn + description: + - A unique Arn for CodeSigningConfig resource. + type: str code_signing_policies: aliases: - CodeSigningPolicies @@ -169,6 +175,10 @@ def main(): }, "aliases": ["CodeSigningPolicies"], } + argument_spec["code_signing_config_arn"] = { + "type": "str", + "aliases": ["CodeSigningConfigArn"], + } argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -179,7 +189,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["code_signing_config_arn", "allowed_publishers"], True], + ["state", "present", ["allowed_publishers", "code_signing_config_arn"], True], ["state", "absent", ["code_signing_config_arn"], True], ["state", "get", ["code_signing_config_arn"], True], ] @@ -198,6 +208,7 @@ def main(): 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") diff --git a/plugins/modules/lambda_event_source_mapping.py b/plugins/modules/lambda_event_source_mapping.py index 68f72463..20798281 100644 --- a/plugins/modules/lambda_event_source_mapping.py +++ b/plugins/modules/lambda_event_source_mapping.py @@ -153,6 +153,12 @@ - (Streams) A list of response types supported by the function. elements: str type: list + id: + aliases: + - Id + description: + - Event Source Mapping Identifier UUID. + type: str maximum_batching_window_in_seconds: aliases: - MaximumBatchingWindowInSeconds @@ -377,6 +383,7 @@ def main(): ), ) + argument_spec["id"] = {"type": "str", "aliases": ["Id"]} argument_spec["batch_size"] = {"type": "int", "aliases": ["BatchSize"]} argument_spec["bisect_batch_on_function_error"] = { "type": "bool", @@ -561,6 +568,7 @@ def main(): 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" ) diff --git a/plugins/modules/lambda_function.py b/plugins/modules/lambda_function.py index aa5e964a..f3a5de31 100644 --- a/plugins/modules/lambda_function.py +++ b/plugins/modules/lambda_function.py @@ -132,6 +132,13 @@ 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 @@ -485,7 +492,10 @@ def main(): argument_spec["file_system_configs"] = { "type": "list", "elements": "dict", - "options": {"local_mount_path": {"type": "str", "aliases": ["LocalMountPath"]}}, + "options": { + "arn": {"type": "str", "aliases": ["Arn"]}, + "local_mount_path": {"type": "str", "aliases": ["LocalMountPath"]}, + }, "aliases": ["FileSystemConfigs"], } argument_spec["function_name"] = {"type": "str", "aliases": ["FunctionName"]} @@ -562,7 +572,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["function_name", "code", "role"], True], + ["state", "present", ["role", "code", "function_name"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index 225046b9..02c9f3da 100644 --- a/plugins/modules/logs_metric_filter.py +++ b/plugins/modules/logs_metric_filter.py @@ -297,11 +297,11 @@ def main(): "state", "present", [ - "metric_transformations", + "filter_pattern", + "filter_name", "identifier", + "metric_transformations", "log_group_name", - "filter_name", - "filter_pattern", ], True, ], diff --git a/plugins/modules/logs_query_definition.py b/plugins/modules/logs_query_definition.py index 8bbee483..84786417 100644 --- a/plugins/modules/logs_query_definition.py +++ b/plugins/modules/logs_query_definition.py @@ -35,6 +35,12 @@ description: - A name for the saved query definition. type: str + query_definition_id: + aliases: + - QueryDefinitionId + description: + - Unique identifier of a query definition. + type: str query_string: aliases: - QueryString @@ -128,6 +134,10 @@ def main(): "elements": "str", "aliases": ["LogGroupNames"], } + argument_spec["query_definition_id"] = { + "type": "str", + "aliases": ["QueryDefinitionId"], + } argument_spec["state"] = { "type": "str", "choices": ["present", "absent", "list", "describe", "get"], @@ -158,6 +168,7 @@ def main(): 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 diff --git a/plugins/modules/logs_resource_policy.py b/plugins/modules/logs_resource_policy.py index 25f1b63c..5017e482 100644 --- a/plugins/modules/logs_resource_policy.py +++ b/plugins/modules/logs_resource_policy.py @@ -127,7 +127,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["policy_name", "policy_document"], True], + ["state", "present", ["policy_document", "policy_name"], True], ["state", "absent", ["policy_name"], True], ["state", "get", ["policy_name"], True], ] diff --git a/plugins/modules/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index 395e76e5..1b3fb057 100644 --- a/plugins/modules/memorydb_cluster.py +++ b/plugins/modules/memorydb_cluster.py @@ -373,7 +373,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["cluster_name", "acl_name", "node_type"], True], + ["state", "present", ["acl_name", "cluster_name", "node_type"], True], ["state", "absent", ["cluster_name"], True], ["state", "get", ["cluster_name"], True], ] diff --git a/plugins/modules/memorydb_parameter_group.py b/plugins/modules/memorydb_parameter_group.py index 6bb14d4c..e0104ced 100644 --- a/plugins/modules/memorydb_parameter_group.py +++ b/plugins/modules/memorydb_parameter_group.py @@ -178,7 +178,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["parameter_group_name", "family"], True], + ["state", "present", ["family", "parameter_group_name"], True], ["state", "absent", ["parameter_group_name"], True], ["state", "get", ["parameter_group_name"], True], ] diff --git a/plugins/modules/rds_db_cluster_parameter_group.py b/plugins/modules/rds_db_cluster_parameter_group.py index 34ae0993..28283067 100644 --- a/plugins/modules/rds_db_cluster_parameter_group.py +++ b/plugins/modules/rds_db_cluster_parameter_group.py @@ -167,7 +167,7 @@ def main(): [ "state", "present", - ["family", "parameters", "description", "db_cluster_parameter_group_name"], + ["description", "family", "parameters", "db_cluster_parameter_group_name"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], diff --git a/plugins/modules/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index fe707776..6b6ef5dc 100644 --- a/plugins/modules/rds_db_proxy.py +++ b/plugins/modules/rds_db_proxy.py @@ -300,7 +300,7 @@ def main(): [ "state", "present", - ["engine_family", "role_arn", "auth", "db_proxy_name", "vpc_subnet_ids"], + ["role_arn", "engine_family", "db_proxy_name", "auth", "vpc_subnet_ids"], True, ], ["state", "absent", ["db_proxy_name"], True], diff --git a/plugins/modules/rds_db_proxy_endpoint.py b/plugins/modules/rds_db_proxy_endpoint.py index d4f5a900..56286e6e 100644 --- a/plugins/modules/rds_db_proxy_endpoint.py +++ b/plugins/modules/rds_db_proxy_endpoint.py @@ -192,7 +192,7 @@ def main(): [ "state", "present", - ["db_proxy_name", "vpc_subnet_ids", "db_proxy_endpoint_name"], + ["db_proxy_endpoint_name", "db_proxy_name", "vpc_subnet_ids"], True, ], ["state", "absent", ["db_proxy_endpoint_name"], True], diff --git a/plugins/modules/rds_db_subnet_group.py b/plugins/modules/rds_db_subnet_group.py index e8ec7065..03a13025 100644 --- a/plugins/modules/rds_db_subnet_group.py +++ b/plugins/modules/rds_db_subnet_group.py @@ -164,7 +164,7 @@ def main(): [ "state", "present", - ["subnet_ids", "db_subnet_group_description", "db_subnet_group_name"], + ["db_subnet_group_name", "subnet_ids", "db_subnet_group_description"], True, ], ["state", "absent", ["db_subnet_group_name"], True], diff --git a/plugins/modules/rds_option_group.py b/plugins/modules/rds_option_group.py index 87795ea1..11f0a395 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -258,10 +258,10 @@ def main(): "state", "present", [ - "option_group_description", - "option_group_name", - "major_engine_version", "engine_name", + "major_engine_version", + "option_group_name", + "option_group_description", ], True, ], diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index 6dcbb2de..6e69c5c6 100644 --- a/plugins/modules/redshift_cluster.py +++ b/plugins/modules/redshift_cluster.py @@ -651,12 +651,12 @@ def main(): "state", "present", [ - "node_type", - "cluster_identifier", "db_name", - "cluster_type", - "master_username", "master_user_password", + "cluster_identifier", + "master_username", + "node_type", + "cluster_type", ], True, ], diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index 96902327..4f7eb926 100644 --- a/plugins/modules/redshift_endpoint_access.py +++ b/plugins/modules/redshift_endpoint_access.py @@ -164,10 +164,10 @@ def main(): "state", "present", [ - "endpoint_name", - "cluster_identifier", "subnet_group_name", "vpc_security_group_ids", + "cluster_identifier", + "endpoint_name", ], True, ], diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index fa533b2a..f8ea1360 100644 --- a/plugins/modules/redshift_endpoint_authorization.py +++ b/plugins/modules/redshift_endpoint_authorization.py @@ -152,7 +152,7 @@ def main(): required_if = [ ["state", "list", ["cluster_identifier"], True], - ["state", "present", ["identifier", "account", "cluster_identifier"], True], + ["state", "present", ["identifier", "cluster_identifier", "account"], True], ["state", "absent", ["cluster_identifier", "account", "identifier"], True], ["state", "get", ["cluster_identifier", "account", "identifier"], True], ] diff --git a/plugins/modules/route53_key_signing_key.py b/plugins/modules/route53_key_signing_key.py index f86bfe8b..1b81cff8 100644 --- a/plugins/modules/route53_key_signing_key.py +++ b/plugins/modules/route53_key_signing_key.py @@ -167,11 +167,11 @@ def main(): "state", "present", [ - "identifier", + "key_management_service_arn", "status", + "identifier", "hosted_zone_id", "name", - "key_management_service_arn", ], True, ], diff --git a/plugins/modules/ssm_resource_data_sync.py b/plugins/modules/ssm_resource_data_sync.py index 193edde0..28920e7f 100644 --- a/plugins/modules/ssm_resource_data_sync.py +++ b/plugins/modules/ssm_resource_data_sync.py @@ -106,6 +106,12 @@ description: - Not Provived. type: str + sync_name: + aliases: + - SyncName + description: + - Not Provived. + type: str sync_source: aliases: - SyncSource @@ -268,6 +274,7 @@ def main(): argument_spec["bucket_name"] = {"type": "str", "aliases": ["BucketName"]} argument_spec["bucket_region"] = {"type": "str", "aliases": ["BucketRegion"]} argument_spec["sync_format"] = {"type": "str", "aliases": ["SyncFormat"]} + argument_spec["sync_name"] = {"type": "str", "aliases": ["SyncName"]} argument_spec["sync_type"] = {"type": "str", "aliases": ["SyncType"]} argument_spec["bucket_prefix"] = {"type": "str", "aliases": ["BucketPrefix"]} argument_spec["state"] = { @@ -304,6 +311,7 @@ def main(): 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") diff --git a/plugins/modules/wafv2_ip_set.py b/plugins/modules/wafv2_ip_set.py index 3e013228..16bd77bf 100644 --- a/plugins/modules/wafv2_ip_set.py +++ b/plugins/modules/wafv2_ip_set.py @@ -39,6 +39,12 @@ operation to make the resource available so that another operation may be performed on it. type: bool + id: + aliases: + - Id + description: + - Id of the IPSet. + type: str identifier: description: - For compound primary identifiers, to specify the primary identifier as a @@ -167,6 +173,7 @@ def main(): argument_spec["description"] = {"type": "str", "aliases": ["Description"]} argument_spec["name"] = {"type": "str", "aliases": ["Name"]} + argument_spec["id"] = {"type": "str", "aliases": ["Id"]} argument_spec["scope"] = { "type": "str", "choices": ["CLOUDFRONT", "REGIONAL"], @@ -199,7 +206,7 @@ def main(): [ "state", "present", - ["identifier", "id", "addresses", "name", "scope", "ip_address_version"], + ["id", "addresses", "scope", "identifier", "name", "ip_address_version"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], @@ -221,6 +228,7 @@ def main(): 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") diff --git a/plugins/modules/wafv2_logging_configuration.py b/plugins/modules/wafv2_logging_configuration.py index 214583a5..adad0afc 100644 --- a/plugins/modules/wafv2_logging_configuration.py +++ b/plugins/modules/wafv2_logging_configuration.py @@ -449,7 +449,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["log_destination_configs", "resource_arn"], True], + ["state", "present", ["resource_arn", "log_destination_configs"], True], ["state", "absent", ["resource_arn"], True], ["state", "get", ["resource_arn"], True], ] diff --git a/plugins/modules/wafv2_regex_pattern_set.py b/plugins/modules/wafv2_regex_pattern_set.py index 38866d38..0c717add 100644 --- a/plugins/modules/wafv2_regex_pattern_set.py +++ b/plugins/modules/wafv2_regex_pattern_set.py @@ -30,6 +30,12 @@ operation to make the resource available so that another operation may be performed on it. type: bool + id: + aliases: + - Id + description: + - Id of the RegexPatternSet. + type: str identifier: description: - For compound primary identifiers, to specify the primary identifier as a @@ -155,6 +161,7 @@ def main(): argument_spec["description"] = {"type": "str", "aliases": ["Description"]} argument_spec["name"] = {"type": "str", "aliases": ["Name"]} + argument_spec["id"] = {"type": "str", "aliases": ["Id"]} argument_spec["regular_expression_list"] = { "type": "list", "elements": "str", @@ -182,7 +189,7 @@ def main(): [ "state", "present", - ["identifier", "id", "regular_expression_list", "name", "scope"], + ["id", "regular_expression_list", "scope", "identifier", "name"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], @@ -203,6 +210,7 @@ def main(): 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") From 560b2b74933bddece4ac3f52d3a9ccf80d13f04a Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 9 Aug 2023 18:05:09 +0200 Subject: [PATCH 12/32] Re-generate collection Signed-off-by: Alina Buzachis --- plugins/modules/autoscaling_launch_configuration.py | 3 +-- plugins/modules/autoscaling_lifecycle_hook.py | 7 +++---- plugins/modules/autoscaling_warm_pool.py | 1 - plugins/modules/backup_backup_vault.py | 1 - plugins/modules/backup_framework.py | 1 - plugins/modules/backup_report_plan.py | 3 +-- plugins/modules/cloudtrail_event_data_store.py | 1 - plugins/modules/cloudtrail_trail.py | 3 +-- plugins/modules/cloudwatch_composite_alarm.py | 3 +-- plugins/modules/cloudwatch_metric_stream.py | 3 +-- plugins/modules/dynamodb_global_table.py | 3 +-- plugins/modules/ec2_placement_group.py | 1 - plugins/modules/ecr_repository.py | 1 - plugins/modules/ecs_capacity_provider.py | 1 - plugins/modules/ecs_cluster.py | 1 - .../modules/ecs_cluster_capacity_provider_associations.py | 3 +-- plugins/modules/ecs_primary_task_set.py | 3 +-- plugins/modules/eks_addon.py | 3 +-- plugins/modules/eks_cluster.py | 3 +-- plugins/modules/eks_fargate_profile.py | 3 +-- plugins/modules/iam_instance_profile.py | 1 - plugins/modules/iam_role.py | 1 - plugins/modules/iam_server_certificate.py | 1 - plugins/modules/kms_alias.py | 3 +-- plugins/modules/kms_replica_key.py | 3 +-- plugins/modules/lambda_code_signing_config.py | 1 - plugins/modules/lambda_event_source_mapping.py | 3 +-- plugins/modules/lambda_function.py | 3 +-- plugins/modules/logs_log_group.py | 1 - plugins/modules/logs_metric_filter.py | 3 +-- plugins/modules/logs_query_definition.py | 3 +-- plugins/modules/logs_resource_policy.py | 1 - plugins/modules/memorydb_acl.py | 1 - plugins/modules/memorydb_cluster.py | 3 +-- plugins/modules/memorydb_parameter_group.py | 3 +-- plugins/modules/memorydb_subnet_group.py | 3 +-- plugins/modules/memorydb_user.py | 1 - plugins/modules/rds_db_cluster_parameter_group.py | 3 +-- plugins/modules/rds_db_instance.py | 1 - plugins/modules/rds_db_proxy.py | 3 +-- plugins/modules/rds_db_proxy_endpoint.py | 3 +-- plugins/modules/rds_db_subnet_group.py | 3 +-- plugins/modules/rds_global_cluster.py | 1 - plugins/modules/rds_option_group.py | 5 ++--- plugins/modules/redshift_cluster.py | 5 ++--- plugins/modules/redshift_endpoint_access.py | 3 +-- plugins/modules/redshift_endpoint_authorization.py | 3 +-- plugins/modules/redshift_event_subscription.py | 1 - plugins/modules/redshift_scheduled_action.py | 1 - plugins/modules/route53_dnssec.py | 1 - plugins/modules/route53_key_signing_key.py | 7 +++---- plugins/modules/s3_access_point.py | 3 +-- plugins/modules/s3_bucket.py | 1 - plugins/modules/s3_multi_region_access_point.py | 1 - plugins/modules/s3_multi_region_access_point_policy.py | 3 +-- plugins/modules/s3objectlambda_access_point.py | 3 +-- plugins/modules/s3objectlambda_access_point_policy.py | 3 +-- plugins/modules/ssm_document.py | 1 - plugins/modules/ssm_resource_data_sync.py | 1 - plugins/modules/wafv2_ip_set.py | 3 +-- plugins/modules/wafv2_logging_configuration.py | 1 - plugins/modules/wafv2_regex_pattern_set.py | 3 +-- plugins/modules/wafv2_web_acl_association.py | 3 +-- 63 files changed, 43 insertions(+), 106 deletions(-) diff --git a/plugins/modules/autoscaling_launch_configuration.py b/plugins/modules/autoscaling_launch_configuration.py index 4aaf8f13..71a0592b 100644 --- a/plugins/modules/autoscaling_launch_configuration.py +++ b/plugins/modules/autoscaling_launch_configuration.py @@ -315,7 +315,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -421,7 +420,7 @@ def main(): [ "state", "present", - ["instance_type", "image_id", "launch_configuration_name"], + ["image_id", "instance_type", "launch_configuration_name"], True, ], ["state", "absent", ["launch_configuration_name"], True], diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index 5f103d25..3c048de0 100644 --- a/plugins/modules/autoscaling_lifecycle_hook.py +++ b/plugins/modules/autoscaling_lifecycle_hook.py @@ -168,7 +168,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -222,10 +221,10 @@ def main(): "state", "present", [ - "auto_scaling_group_name", - "lifecycle_hook_name", - "identifier", "lifecycle_transition", + "identifier", + "lifecycle_hook_name", + "auto_scaling_group_name", ], True, ], diff --git a/plugins/modules/autoscaling_warm_pool.py b/plugins/modules/autoscaling_warm_pool.py index 82887129..86fa142d 100644 --- a/plugins/modules/autoscaling_warm_pool.py +++ b/plugins/modules/autoscaling_warm_pool.py @@ -131,7 +131,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/backup_backup_vault.py b/plugins/modules/backup_backup_vault.py index ee5749af..94d0aa3d 100644 --- a/plugins/modules/backup_backup_vault.py +++ b/plugins/modules/backup_backup_vault.py @@ -172,7 +172,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/backup_framework.py b/plugins/modules/backup_framework.py index 0b90cc36..5466f772 100644 --- a/plugins/modules/backup_framework.py +++ b/plugins/modules/backup_framework.py @@ -245,7 +245,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/backup_report_plan.py b/plugins/modules/backup_report_plan.py index 178dcca8..7a2b3971 100644 --- a/plugins/modules/backup_report_plan.py +++ b/plugins/modules/backup_report_plan.py @@ -228,7 +228,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -298,7 +297,7 @@ def main(): [ "state", "present", - ["report_delivery_channel", "report_setting", "report_plan_arn"], + ["report_delivery_channel", "report_plan_arn", "report_setting"], True, ], ["state", "absent", ["report_plan_arn"], True], diff --git a/plugins/modules/cloudtrail_event_data_store.py b/plugins/modules/cloudtrail_event_data_store.py index eeb26cfe..037feeec 100644 --- a/plugins/modules/cloudtrail_event_data_store.py +++ b/plugins/modules/cloudtrail_event_data_store.py @@ -244,7 +244,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/cloudtrail_trail.py b/plugins/modules/cloudtrail_trail.py index 9547abb3..ffba51da 100644 --- a/plugins/modules/cloudtrail_trail.py +++ b/plugins/modules/cloudtrail_trail.py @@ -380,7 +380,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -520,7 +519,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["is_logging", "trail_name", "s3_bucket_name"], True], + ["state", "present", ["trail_name", "is_logging", "s3_bucket_name"], True], ["state", "absent", ["trail_name"], True], ["state", "get", ["trail_name"], True], ] diff --git a/plugins/modules/cloudwatch_composite_alarm.py b/plugins/modules/cloudwatch_composite_alarm.py index e8c3ff0f..dcacb5dd 100644 --- a/plugins/modules/cloudwatch_composite_alarm.py +++ b/plugins/modules/cloudwatch_composite_alarm.py @@ -164,7 +164,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -220,7 +219,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["alarm_rule", "alarm_name"], True], + ["state", "present", ["alarm_name", "alarm_rule"], True], ["state", "absent", ["alarm_name"], True], ["state", "get", ["alarm_name"], True], ] diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index 4feb10f5..0eee8ba8 100644 --- a/plugins/modules/cloudwatch_metric_stream.py +++ b/plugins/modules/cloudwatch_metric_stream.py @@ -225,7 +225,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -307,7 +306,7 @@ def main(): [ "state", "present", - ["role_arn", "firehose_arn", "output_format", "name"], + ["name", "role_arn", "output_format", "firehose_arn"], True, ], ["state", "absent", ["name"], True], diff --git a/plugins/modules/dynamodb_global_table.py b/plugins/modules/dynamodb_global_table.py index 08f5b14c..599bc438 100644 --- a/plugins/modules/dynamodb_global_table.py +++ b/plugins/modules/dynamodb_global_table.py @@ -691,7 +691,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -1049,7 +1048,7 @@ def main(): [ "state", "present", - ["attribute_definitions", "replicas", "key_schema", "table_name"], + ["replicas", "key_schema", "table_name", "attribute_definitions"], True, ], ["state", "absent", ["table_name"], True], diff --git a/plugins/modules/ec2_placement_group.py b/plugins/modules/ec2_placement_group.py index 0a95cfc5..d4edc652 100644 --- a/plugins/modules/ec2_placement_group.py +++ b/plugins/modules/ec2_placement_group.py @@ -132,7 +132,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/ecr_repository.py b/plugins/modules/ecr_repository.py index 8a770454..06645247 100644 --- a/plugins/modules/ecr_repository.py +++ b/plugins/modules/ecr_repository.py @@ -207,7 +207,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/ecs_capacity_provider.py b/plugins/modules/ecs_capacity_provider.py index c12af8f3..7f2a44f3 100644 --- a/plugins/modules/ecs_capacity_provider.py +++ b/plugins/modules/ecs_capacity_provider.py @@ -174,7 +174,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/ecs_cluster.py b/plugins/modules/ecs_cluster.py index 6cba2559..0cb5a097 100644 --- a/plugins/modules/ecs_cluster.py +++ b/plugins/modules/ecs_cluster.py @@ -252,7 +252,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/ecs_cluster_capacity_provider_associations.py b/plugins/modules/ecs_cluster_capacity_provider_associations.py index 2e7f85d6..49da41f2 100644 --- a/plugins/modules/ecs_cluster_capacity_provider_associations.py +++ b/plugins/modules/ecs_cluster_capacity_provider_associations.py @@ -133,7 +133,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -174,7 +173,7 @@ def main(): [ "state", "present", - ["cluster", "default_capacity_provider_strategy", "capacity_providers"], + ["default_capacity_provider_strategy", "cluster", "capacity_providers"], True, ], ["state", "absent", ["cluster"], True], diff --git a/plugins/modules/ecs_primary_task_set.py b/plugins/modules/ecs_primary_task_set.py index 81465213..b1ce1623 100644 --- a/plugins/modules/ecs_primary_task_set.py +++ b/plugins/modules/ecs_primary_task_set.py @@ -120,7 +120,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -147,7 +146,7 @@ def main(): required_if = [ ["state", "list", ["cluster"], True], - ["state", "present", ["cluster", "task_set_id", "service", "identifier"], True], + ["state", "present", ["task_set_id", "service", "cluster", "identifier"], True], ["state", "absent", ["cluster", "service", "identifier"], True], ["state", "get", ["cluster", "service", "identifier"], True], ] diff --git a/plugins/modules/eks_addon.py b/plugins/modules/eks_addon.py index c67ebbcb..2ccf1891 100644 --- a/plugins/modules/eks_addon.py +++ b/plugins/modules/eks_addon.py @@ -160,7 +160,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -206,7 +205,7 @@ def main(): required_if = [ ["state", "list", ["cluster_name"], True], - ["state", "present", ["identifier", "cluster_name", "addon_name"], True], + ["state", "present", ["cluster_name", "addon_name", "identifier"], True], ["state", "absent", ["cluster_name", "addon_name", "identifier"], True], ["state", "get", ["cluster_name", "addon_name", "identifier"], True], ] diff --git a/plugins/modules/eks_cluster.py b/plugins/modules/eks_cluster.py index c43dba1b..d0af3619 100644 --- a/plugins/modules/eks_cluster.py +++ b/plugins/modules/eks_cluster.py @@ -331,7 +331,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -446,7 +445,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["role_arn", "resources_vpc_config", "name"], True], + ["state", "present", ["resources_vpc_config", "name", "role_arn"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/eks_fargate_profile.py b/plugins/modules/eks_fargate_profile.py index 346376f5..45c6e1e0 100644 --- a/plugins/modules/eks_fargate_profile.py +++ b/plugins/modules/eks_fargate_profile.py @@ -268,7 +268,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -329,9 +328,9 @@ def main(): "state", "present", [ + "pod_execution_role_arn", "fargate_profile_name", "cluster_name", - "pod_execution_role_arn", "selectors", "identifier", ], diff --git a/plugins/modules/iam_instance_profile.py b/plugins/modules/iam_instance_profile.py index 9678fb05..09005cb0 100644 --- a/plugins/modules/iam_instance_profile.py +++ b/plugins/modules/iam_instance_profile.py @@ -112,7 +112,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index a258c33a..7eb63898 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -171,7 +171,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/iam_server_certificate.py b/plugins/modules/iam_server_certificate.py index 337ec900..88cae07d 100644 --- a/plugins/modules/iam_server_certificate.py +++ b/plugins/modules/iam_server_certificate.py @@ -169,7 +169,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/kms_alias.py b/plugins/modules/kms_alias.py index aec66a8c..42da74c2 100644 --- a/plugins/modules/kms_alias.py +++ b/plugins/modules/kms_alias.py @@ -109,7 +109,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -133,7 +132,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["target_key_id", "alias_name"], True], + ["state", "present", ["alias_name", "target_key_id"], True], ["state", "absent", ["alias_name"], True], ["state", "get", ["alias_name"], True], ] diff --git a/plugins/modules/kms_replica_key.py b/plugins/modules/kms_replica_key.py index f15ea3b3..3f846d49 100644 --- a/plugins/modules/kms_replica_key.py +++ b/plugins/modules/kms_replica_key.py @@ -151,7 +151,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -184,7 +183,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["key_id", "primary_key_arn", "key_policy"], True], + ["state", "present", ["key_id", "key_policy", "primary_key_arn"], True], ["state", "absent", ["key_id"], True], ["state", "get", ["key_id"], True], ] diff --git a/plugins/modules/lambda_code_signing_config.py b/plugins/modules/lambda_code_signing_config.py index ddc4fdb3..d6f72b4a 100644 --- a/plugins/modules/lambda_code_signing_config.py +++ b/plugins/modules/lambda_code_signing_config.py @@ -139,7 +139,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/lambda_event_source_mapping.py b/plugins/modules/lambda_event_source_mapping.py index 20798281..3f494e0b 100644 --- a/plugins/modules/lambda_event_source_mapping.py +++ b/plugins/modules/lambda_event_source_mapping.py @@ -371,7 +371,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -534,7 +533,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["function_name", "id"], True], + ["state", "present", ["id", "function_name"], True], ["state", "absent", ["id"], True], ["state", "get", ["id"], True], ] diff --git a/plugins/modules/lambda_function.py b/plugins/modules/lambda_function.py index f3a5de31..e45d7704 100644 --- a/plugins/modules/lambda_function.py +++ b/plugins/modules/lambda_function.py @@ -426,7 +426,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -572,7 +571,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["role", "code", "function_name"], True], + ["state", "present", ["role", "function_name", "code"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] diff --git a/plugins/modules/logs_log_group.py b/plugins/modules/logs_log_group.py index 8eb05a7d..f2b07ec0 100644 --- a/plugins/modules/logs_log_group.py +++ b/plugins/modules/logs_log_group.py @@ -189,7 +189,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index 02c9f3da..a070be12 100644 --- a/plugins/modules/logs_metric_filter.py +++ b/plugins/modules/logs_metric_filter.py @@ -213,7 +213,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -299,9 +298,9 @@ def main(): [ "filter_pattern", "filter_name", - "identifier", "metric_transformations", "log_group_name", + "identifier", ], True, ], diff --git a/plugins/modules/logs_query_definition.py b/plugins/modules/logs_query_definition.py index 84786417..15d0255e 100644 --- a/plugins/modules/logs_query_definition.py +++ b/plugins/modules/logs_query_definition.py @@ -115,7 +115,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -148,7 +147,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["query_definition_id", "query_string", "name"], True], + ["state", "present", ["query_definition_id", "name", "query_string"], True], ["state", "absent", ["query_definition_id"], True], ["state", "get", ["query_definition_id"], True], ] diff --git a/plugins/modules/logs_resource_policy.py b/plugins/modules/logs_resource_policy.py index 5017e482..94f6ee4a 100644 --- a/plugins/modules/logs_resource_policy.py +++ b/plugins/modules/logs_resource_policy.py @@ -103,7 +103,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/memorydb_acl.py b/plugins/modules/memorydb_acl.py index 86055ec9..1f480aea 100644 --- a/plugins/modules/memorydb_acl.py +++ b/plugins/modules/memorydb_acl.py @@ -134,7 +134,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index 1b3fb057..0687d22f 100644 --- a/plugins/modules/memorydb_cluster.py +++ b/plugins/modules/memorydb_cluster.py @@ -296,7 +296,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -373,7 +372,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", "node_type", "acl_name"], True], ["state", "absent", ["cluster_name"], True], ["state", "get", ["cluster_name"], True], ] diff --git a/plugins/modules/memorydb_parameter_group.py b/plugins/modules/memorydb_parameter_group.py index e0104ced..0643d4f8 100644 --- a/plugins/modules/memorydb_parameter_group.py +++ b/plugins/modules/memorydb_parameter_group.py @@ -147,7 +147,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -178,7 +177,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["family", "parameter_group_name"], True], + ["state", "present", ["parameter_group_name", "family"], True], ["state", "absent", ["parameter_group_name"], True], ["state", "get", ["parameter_group_name"], True], ] diff --git a/plugins/modules/memorydb_subnet_group.py b/plugins/modules/memorydb_subnet_group.py index 0e03c088..75d35246 100644 --- a/plugins/modules/memorydb_subnet_group.py +++ b/plugins/modules/memorydb_subnet_group.py @@ -146,7 +146,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -177,7 +176,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["subnet_ids", "subnet_group_name"], True], + ["state", "present", ["subnet_group_name", "subnet_ids"], True], ["state", "absent", ["subnet_group_name"], True], ["state", "get", ["subnet_group_name"], True], ] diff --git a/plugins/modules/memorydb_user.py b/plugins/modules/memorydb_user.py index db8cea7e..9d06535c 100644 --- a/plugins/modules/memorydb_user.py +++ b/plugins/modules/memorydb_user.py @@ -139,7 +139,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/rds_db_cluster_parameter_group.py b/plugins/modules/rds_db_cluster_parameter_group.py index 28283067..c9f143c4 100644 --- a/plugins/modules/rds_db_cluster_parameter_group.py +++ b/plugins/modules/rds_db_cluster_parameter_group.py @@ -133,7 +133,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -167,7 +166,7 @@ def main(): [ "state", "present", - ["description", "family", "parameters", "db_cluster_parameter_group_name"], + ["parameters", "family", "db_cluster_parameter_group_name", "description"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], diff --git a/plugins/modules/rds_db_instance.py b/plugins/modules/rds_db_instance.py index 36d9f19d..1366dfe3 100644 --- a/plugins/modules/rds_db_instance.py +++ b/plugins/modules/rds_db_instance.py @@ -646,7 +646,6 @@ class of the DB instance. scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index 6b6ef5dc..cc23a8f2 100644 --- a/plugins/modules/rds_db_proxy.py +++ b/plugins/modules/rds_db_proxy.py @@ -221,7 +221,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -300,7 +299,7 @@ def main(): [ "state", "present", - ["role_arn", "engine_family", "db_proxy_name", "auth", "vpc_subnet_ids"], + ["auth", "role_arn", "engine_family", "vpc_subnet_ids", "db_proxy_name"], True, ], ["state", "absent", ["db_proxy_name"], True], diff --git a/plugins/modules/rds_db_proxy_endpoint.py b/plugins/modules/rds_db_proxy_endpoint.py index 56286e6e..5754d2da 100644 --- a/plugins/modules/rds_db_proxy_endpoint.py +++ b/plugins/modules/rds_db_proxy_endpoint.py @@ -145,7 +145,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -192,7 +191,7 @@ def main(): [ "state", "present", - ["db_proxy_endpoint_name", "db_proxy_name", "vpc_subnet_ids"], + ["vpc_subnet_ids", "db_proxy_endpoint_name", "db_proxy_name"], True, ], ["state", "absent", ["db_proxy_endpoint_name"], True], diff --git a/plugins/modules/rds_db_subnet_group.py b/plugins/modules/rds_db_subnet_group.py index 03a13025..d9555a05 100644 --- a/plugins/modules/rds_db_subnet_group.py +++ b/plugins/modules/rds_db_subnet_group.py @@ -124,7 +124,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -164,7 +163,7 @@ def main(): [ "state", "present", - ["db_subnet_group_name", "subnet_ids", "db_subnet_group_description"], + ["db_subnet_group_name", "db_subnet_group_description", "subnet_ids"], True, ], ["state", "absent", ["db_subnet_group_name"], True], diff --git a/plugins/modules/rds_global_cluster.py b/plugins/modules/rds_global_cluster.py index 83d5f929..77e03ac7 100644 --- a/plugins/modules/rds_global_cluster.py +++ b/plugins/modules/rds_global_cluster.py @@ -149,7 +149,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/rds_option_group.py b/plugins/modules/rds_option_group.py index 11f0a395..6aec7425 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -191,7 +191,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -258,10 +257,10 @@ def main(): "state", "present", [ - "engine_name", + "option_group_description", "major_engine_version", + "engine_name", "option_group_name", - "option_group_description", ], True, ], diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index 6e69c5c6..d47610e0 100644 --- a/plugins/modules/redshift_cluster.py +++ b/plugins/modules/redshift_cluster.py @@ -474,7 +474,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -651,11 +650,11 @@ def main(): "state", "present", [ + "master_username", "db_name", + "node_type", "master_user_password", "cluster_identifier", - "master_username", - "node_type", "cluster_type", ], True, diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index 4f7eb926..35033b87 100644 --- a/plugins/modules/redshift_endpoint_access.py +++ b/plugins/modules/redshift_endpoint_access.py @@ -126,7 +126,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -166,8 +165,8 @@ def main(): [ "subnet_group_name", "vpc_security_group_ids", - "cluster_identifier", "endpoint_name", + "cluster_identifier", ], True, ], diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index f8ea1360..898886e7 100644 --- a/plugins/modules/redshift_endpoint_authorization.py +++ b/plugins/modules/redshift_endpoint_authorization.py @@ -118,7 +118,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -152,7 +151,7 @@ def main(): required_if = [ ["state", "list", ["cluster_identifier"], True], - ["state", "present", ["identifier", "cluster_identifier", "account"], True], + ["state", "present", ["identifier", "account", "cluster_identifier"], True], ["state", "absent", ["cluster_identifier", "account", "identifier"], True], ["state", "get", ["cluster_identifier", "account", "identifier"], True], ] diff --git a/plugins/modules/redshift_event_subscription.py b/plugins/modules/redshift_event_subscription.py index 7af6fd29..8b7e5985 100644 --- a/plugins/modules/redshift_event_subscription.py +++ b/plugins/modules/redshift_event_subscription.py @@ -166,7 +166,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/redshift_scheduled_action.py b/plugins/modules/redshift_scheduled_action.py index af05e948..acd529eb 100644 --- a/plugins/modules/redshift_scheduled_action.py +++ b/plugins/modules/redshift_scheduled_action.py @@ -214,7 +214,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/route53_dnssec.py b/plugins/modules/route53_dnssec.py index daf88a4b..6d600506 100644 --- a/plugins/modules/route53_dnssec.py +++ b/plugins/modules/route53_dnssec.py @@ -96,7 +96,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/route53_key_signing_key.py b/plugins/modules/route53_key_signing_key.py index 1b81cff8..cf776cbe 100644 --- a/plugins/modules/route53_key_signing_key.py +++ b/plugins/modules/route53_key_signing_key.py @@ -128,7 +128,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -167,11 +166,11 @@ def main(): "state", "present", [ - "key_management_service_arn", + "name", "status", - "identifier", + "key_management_service_arn", "hosted_zone_id", - "name", + "identifier", ], True, ], diff --git a/plugins/modules/s3_access_point.py b/plugins/modules/s3_access_point.py index 2ee70bd3..c3b929d2 100644 --- a/plugins/modules/s3_access_point.py +++ b/plugins/modules/s3_access_point.py @@ -194,7 +194,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -238,7 +237,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["bucket", "name"], True], + ["state", "present", ["name", "bucket"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/s3_bucket.py b/plugins/modules/s3_bucket.py index ca83c01e..4fa9d46a 100644 --- a/plugins/modules/s3_bucket.py +++ b/plugins/modules/s3_bucket.py @@ -1768,7 +1768,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/s3_multi_region_access_point.py b/plugins/modules/s3_multi_region_access_point.py index eeddc714..2a31c536 100644 --- a/plugins/modules/s3_multi_region_access_point.py +++ b/plugins/modules/s3_multi_region_access_point.py @@ -178,7 +178,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/s3_multi_region_access_point_policy.py b/plugins/modules/s3_multi_region_access_point_policy.py index 72b922f7..3ff03691 100644 --- a/plugins/modules/s3_multi_region_access_point_policy.py +++ b/plugins/modules/s3_multi_region_access_point_policy.py @@ -103,7 +103,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -127,7 +126,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["policy", "mrap_name"], True], + ["state", "present", ["mrap_name", "policy"], True], ["state", "absent", ["mrap_name"], True], ["state", "get", ["mrap_name"], True], ] diff --git a/plugins/modules/s3objectlambda_access_point.py b/plugins/modules/s3objectlambda_access_point.py index 9886ae01..5bf255e0 100644 --- a/plugins/modules/s3objectlambda_access_point.py +++ b/plugins/modules/s3objectlambda_access_point.py @@ -171,7 +171,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -245,7 +244,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["object_lambda_configuration", "name"], True], + ["state", "present", ["name", "object_lambda_configuration"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/s3objectlambda_access_point_policy.py b/plugins/modules/s3objectlambda_access_point_policy.py index 89a06f97..136621bb 100644 --- a/plugins/modules/s3objectlambda_access_point_policy.py +++ b/plugins/modules/s3objectlambda_access_point_policy.py @@ -104,7 +104,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -131,7 +130,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["object_lambda_access_point", "policy_document"], True], + ["state", "present", ["policy_document", "object_lambda_access_point"], True], ["state", "absent", ["object_lambda_access_point"], True], ["state", "get", ["object_lambda_access_point"], True], ] diff --git a/plugins/modules/ssm_document.py b/plugins/modules/ssm_document.py index 12fea6c6..40b11e8c 100644 --- a/plugins/modules/ssm_document.py +++ b/plugins/modules/ssm_document.py @@ -232,7 +232,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/ssm_resource_data_sync.py b/plugins/modules/ssm_resource_data_sync.py index 28920e7f..581e4df2 100644 --- a/plugins/modules/ssm_resource_data_sync.py +++ b/plugins/modules/ssm_resource_data_sync.py @@ -216,7 +216,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/wafv2_ip_set.py b/plugins/modules/wafv2_ip_set.py index 16bd77bf..bfdc7348 100644 --- a/plugins/modules/wafv2_ip_set.py +++ b/plugins/modules/wafv2_ip_set.py @@ -159,7 +159,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -206,7 +205,7 @@ def main(): [ "state", "present", - ["id", "addresses", "scope", "identifier", "name", "ip_address_version"], + ["ip_address_version", "id", "scope", "name", "addresses", "identifier"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], diff --git a/plugins/modules/wafv2_logging_configuration.py b/plugins/modules/wafv2_logging_configuration.py index adad0afc..b085e09f 100644 --- a/plugins/modules/wafv2_logging_configuration.py +++ b/plugins/modules/wafv2_logging_configuration.py @@ -315,7 +315,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): diff --git a/plugins/modules/wafv2_regex_pattern_set.py b/plugins/modules/wafv2_regex_pattern_set.py index 0c717add..a5446b86 100644 --- a/plugins/modules/wafv2_regex_pattern_set.py +++ b/plugins/modules/wafv2_regex_pattern_set.py @@ -147,7 +147,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -189,7 +188,7 @@ def main(): [ "state", "present", - ["id", "regular_expression_list", "scope", "identifier", "name"], + ["regular_expression_list", "id", "scope", "name", "identifier"], True, ], ["state", "absent", ["name", "id", "scope", "identifier"], True], diff --git a/plugins/modules/wafv2_web_acl_association.py b/plugins/modules/wafv2_web_acl_association.py index dbaf3438..ba5c9f3e 100644 --- a/plugins/modules/wafv2_web_acl_association.py +++ b/plugins/modules/wafv2_web_acl_association.py @@ -111,7 +111,6 @@ scrub_none_parameters, ) from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias -from ansible_collections.amazon.cloud.plugins.module_utils.core import camel_to_snake def main(): @@ -137,7 +136,7 @@ def main(): required_if = [ ["state", "list", ["resource_arn"], True], - ["state", "present", ["identifier", "resource_arn", "web_acl_arn"], True], + ["state", "present", ["web_acl_arn", "resource_arn", "identifier"], True], ["state", "absent", ["resource_arn", "web_acl_arn", "identifier"], True], ["state", "get", ["resource_arn", "web_acl_arn", "identifier"], True], ] From f8331c83e8e48806fdcd67b3a2a9981c457565c7 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 9 Aug 2023 18:11:39 +0200 Subject: [PATCH 13/32] Fix sanity Signed-off-by: Alina Buzachis --- plugins/module_utils/core.py | 6 +- tests/sanity/ignore-2.12.txt | 1 - tests/sanity/ignore-2.13.txt | 1 + tests/sanity/ignore-2.14.txt | 1 + tests/sanity/ignore-2.15.txt | 104 ++++------------------------------- tests/sanity/ignore-2.16.txt | 1 + 6 files changed, 19 insertions(+), 95 deletions(-) diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index 1527c889..4dfbdde0 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, @@ -62,9 +64,11 @@ 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, -) # pylint: disable=unused-import +) BOTO3_IMP_ERR = None diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 103dcf38..0d450e7e 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -91,4 +91,3 @@ 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..fd87ac8e 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -91,4 +91,5 @@ 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..fd87ac8e 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -91,4 +91,5 @@ 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 d6080865..fd87ac8e 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -1,13 +1,3 @@ -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 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 @@ -91,87 +81,15 @@ 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 -tools/update_constants.py shebang!skipplugins/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 +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..74cd5234 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -91,4 +91,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 From f6100e5179ccc902441779c59a73a385b2910292 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 9 Aug 2023 20:13:15 +0200 Subject: [PATCH 14/32] Remove broken modules Signed-off-by: Alina Buzachis --- .../20230809-collection_regeneration.yml | 15 +- config/modules.yaml | 81 --- meta/runtime.yml | 11 - .../autoscaling_launch_configuration.py | 2 +- plugins/modules/autoscaling_lifecycle_hook.py | 6 +- plugins/modules/backup_framework.py | 400 ----------- plugins/modules/backup_report_plan.py | 375 ---------- .../modules/cloudtrail_event_data_store.py | 417 ----------- plugins/modules/cloudtrail_trail.py | 2 +- plugins/modules/cloudwatch_composite_alarm.py | 2 +- plugins/modules/cloudwatch_metric_stream.py | 2 +- plugins/modules/dynamodb_global_table.py | 2 +- plugins/modules/ec2_placement_group.py | 237 ------- ..._cluster_capacity_provider_associations.py | 2 +- plugins/modules/ecs_primary_task_set.py | 2 +- plugins/modules/eks_addon.py | 2 +- plugins/modules/eks_cluster.py | 2 +- plugins/modules/eks_fargate_profile.py | 4 +- plugins/modules/iam_instance_profile.py | 2 +- plugins/modules/kms_replica_key.py | 259 ------- plugins/modules/lambda_code_signing_config.py | 261 ------- .../modules/lambda_event_source_mapping.py | 651 ------------------ plugins/modules/lambda_function.py | 2 +- plugins/modules/logs_metric_filter.py | 6 +- plugins/modules/logs_query_definition.py | 220 ------ plugins/modules/memorydb_cluster.py | 2 +- plugins/modules/memorydb_parameter_group.py | 2 +- .../modules/rds_db_cluster_parameter_group.py | 2 +- plugins/modules/rds_db_proxy.py | 2 +- plugins/modules/rds_db_proxy_endpoint.py | 2 +- plugins/modules/rds_db_subnet_group.py | 2 +- plugins/modules/rds_option_group.py | 4 +- plugins/modules/redshift_cluster.py | 4 +- plugins/modules/redshift_endpoint_access.py | 4 +- .../redshift_endpoint_authorization.py | 2 +- plugins/modules/route53_key_signing_key.py | 6 +- .../s3_multi_region_access_point_policy.py | 2 +- .../modules/s3objectlambda_access_point.py | 2 +- plugins/modules/ssm_document.py | 2 +- plugins/modules/ssm_resource_data_sync.py | 373 ---------- plugins/modules/wafv2_ip_set.py | 296 -------- .../modules/wafv2_logging_configuration.py | 2 +- plugins/modules/wafv2_regex_pattern_set.py | 278 -------- plugins/modules/wafv2_web_acl_association.py | 2 +- tests/sanity/ignore-2.10.txt | 105 --- tests/sanity/ignore-2.11.txt | 105 --- tests/sanity/ignore-2.12.txt | 17 - tests/sanity/ignore-2.13.txt | 17 - tests/sanity/ignore-2.14.txt | 17 - tests/sanity/ignore-2.15.txt | 17 - tests/sanity/ignore-2.16.txt | 17 - tests/sanity/ignore-2.9.txt | 92 +-- 52 files changed, 55 insertions(+), 4286 deletions(-) delete mode 100644 plugins/modules/backup_framework.py delete mode 100644 plugins/modules/backup_report_plan.py delete mode 100644 plugins/modules/cloudtrail_event_data_store.py delete mode 100644 plugins/modules/ec2_placement_group.py delete mode 100644 plugins/modules/kms_replica_key.py delete mode 100644 plugins/modules/lambda_code_signing_config.py delete mode 100644 plugins/modules/lambda_event_source_mapping.py delete mode 100644 plugins/modules/logs_query_definition.py delete mode 100644 plugins/modules/ssm_resource_data_sync.py delete mode 100644 plugins/modules/wafv2_ip_set.py delete mode 100644 plugins/modules/wafv2_regex_pattern_set.py diff --git a/changelogs/fragments/20230809-collection_regeneration.yml b/changelogs/fragments/20230809-collection_regeneration.yml index 510f910e..8f96c1c8 100644 --- a/changelogs/fragments/20230809-collection_regeneration.yml +++ b/changelogs/fragments/20230809-collection_regeneration.yml @@ -3,4 +3,17 @@ bugfixes: 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." \ No newline at end of file + - "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 29ce44f7..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. diff --git a/meta/runtime.yml b/meta/runtime.yml index 64306fd7..d6c510bb 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -2,15 +2,10 @@ 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,7 +45,6 @@ action_groups: - ecs_primary_task_set - iam_instance_profile - logs_metric_filter - - ec2_placement_group - autoscaling_launch_configuration - autoscaling_lifecycle_hook - autoscaling_warm_pool diff --git a/plugins/modules/autoscaling_launch_configuration.py b/plugins/modules/autoscaling_launch_configuration.py index 71a0592b..41ac3088 100644 --- a/plugins/modules/autoscaling_launch_configuration.py +++ b/plugins/modules/autoscaling_launch_configuration.py @@ -420,7 +420,7 @@ def main(): [ "state", "present", - ["image_id", "instance_type", "launch_configuration_name"], + ["instance_type", "image_id", "launch_configuration_name"], True, ], ["state", "absent", ["launch_configuration_name"], True], diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index 3c048de0..92cc1cf0 100644 --- a/plugins/modules/autoscaling_lifecycle_hook.py +++ b/plugins/modules/autoscaling_lifecycle_hook.py @@ -221,10 +221,10 @@ def main(): "state", "present", [ - "lifecycle_transition", - "identifier", - "lifecycle_hook_name", "auto_scaling_group_name", + "lifecycle_hook_name", + "identifier", + "lifecycle_transition", ], True, ], diff --git a/plugins/modules/backup_framework.py b/plugins/modules/backup_framework.py deleted file mode 100644 index 5466f772..00000000 --- a/plugins/modules/backup_framework.py +++ /dev/null @@ -1,400 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -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: - aliases: - - FrameworkArn - description: - - An Amazon Resource Name (ARN) that uniquely identifies Framework as a resource. - type: str - framework_controls: - aliases: - - FrameworkControls - 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: - aliases: - - ControlInputParameters - description: - - A list of I(parameter_name) and I(parameter_value) pairs. - elements: dict - suboptions: - parameter_name: - aliases: - - ParameterName - description: - - Not Provived. - type: str - parameter_value: - aliases: - - ParameterValue - description: - - Not Provived. - type: str - type: list - control_name: - aliases: - - ControlName - description: - - The name of a control. - - This name is between 1 and 256 characters. - type: str - control_scope: - aliases: - - ControlScope - 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: - aliases: - - ComplianceResourceIds - description: - - The ID of the only AWS resource that you want your control - scope to contain. - elements: str - type: list - compliance_resource_types: - aliases: - - ComplianceResourceTypes - description: - - Describes whether the control scope includes one or more - types of resources, such as EFS or RDS. - elements: str - type: list - tags: - aliases: - - Tags - description: - - A key-value pair to associate with a resource. - elements: dict - suboptions: - key: - aliases: - - 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: - aliases: - - 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: - aliases: - - FrameworkDescription - description: - - An optional description of the framework with a maximum 1,024 characters. - type: str - framework_name: - aliases: - - FrameworkName - 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: - aliases: - - FrameworkTags - description: - - A key-value pair to associate with a resource. - elements: dict - suboptions: - key: - aliases: - - 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: - aliases: - - 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: - - 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 - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["framework_name"] = {"type": "str", "aliases": ["FrameworkName"]} - argument_spec["framework_description"] = { - "type": "str", - "aliases": ["FrameworkDescription"], - } - argument_spec["framework_arn"] = {"type": "str", "aliases": ["FrameworkArn"]} - argument_spec["framework_controls"] = { - "type": "list", - "elements": "dict", - "options": { - "control_name": {"type": "str", "aliases": ["ControlName"]}, - "control_input_parameters": { - "type": "list", - "elements": "dict", - "options": { - "parameter_name": {"type": "str", "aliases": ["ParameterName"]}, - "parameter_value": {"type": "str", "aliases": ["ParameterValue"]}, - }, - "aliases": ["ControlInputParameters"], - }, - "control_scope": { - "type": "dict", - "options": { - "compliance_resource_ids": { - "type": "list", - "elements": "str", - "aliases": ["ComplianceResourceIds"], - }, - "compliance_resource_types": { - "type": "list", - "elements": "str", - "aliases": ["ComplianceResourceTypes"], - }, - "tags": { - "type": "list", - "elements": "dict", - "options": { - "key": {"type": "str", "aliases": ["Key"]}, - "value": {"type": "str", "aliases": ["Value"]}, - }, - "aliases": ["Tags"], - }, - }, - "aliases": ["ControlScope"], - }, - }, - "aliases": ["FrameworkControls"], - } - argument_spec["framework_tags"] = { - "type": "list", - "elements": "dict", - "options": { - "key": {"type": "str", "aliases": ["Key"]}, - "value": {"type": "str", "aliases": ["Value"]}, - }, - "aliases": ["FrameworkTags"], - } - 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": ["Tags", "resource_tags"]} - argument_spec["purge_tags"] = {"type": "bool", "default": True} - - required_if = [ - ["state", "present", ["framework_controls", "framework_arn"], 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 = 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"]) - - # 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 = ["/properties/FrameworkName"] - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["/properties/FrameworkArn"] - - 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 7a2b3971..00000000 --- a/plugins/modules/backup_report_plan.py +++ /dev/null @@ -1,375 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -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: - aliases: - - ReportDeliveryChannel - 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: - aliases: - - 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: - aliases: - - S3BucketName - description: - - The unique name of the S3 bucket that receives your reports. - type: str - s3_key_prefix: - aliases: - - S3KeyPrefix - 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: - aliases: - - ReportPlanArn - 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: - aliases: - - ReportPlanDescription - description: - - An optional description of the report plan with a maximum of 1,024 characters. - type: str - report_plan_name: - aliases: - - ReportPlanName - 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: - aliases: - - ReportPlanTags - description: - - A key-value pair to associate with a resource. - elements: dict - suboptions: - key: - aliases: - - 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: - aliases: - - 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: - aliases: - - ReportSetting - description: - - Identifies the report template for the report. - - Reports are built using a report template. - suboptions: - accounts: - aliases: - - Accounts - description: - - The list of AWS accounts that a report covers. - elements: str - type: list - framework_arns: - aliases: - - FrameworkArns - description: - - The Amazon Resource Names (ARNs) of the frameworks a report covers. - elements: str - type: list - organization_units: - aliases: - - OrganizationUnits - description: - - The list of AWS organization units that a report covers. - elements: str - type: list - regions: - aliases: - - Regions - description: - - The list of AWS regions that a report covers. - elements: str - type: list - report_template: - aliases: - - ReportTemplate - 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: - - 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 - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["report_plan_name"] = {"type": "str", "aliases": ["ReportPlanName"]} - argument_spec["report_plan_arn"] = {"type": "str", "aliases": ["ReportPlanArn"]} - argument_spec["report_plan_description"] = { - "type": "str", - "aliases": ["ReportPlanDescription"], - } - argument_spec["report_plan_tags"] = { - "type": "list", - "elements": "dict", - "options": { - "key": {"type": "str", "aliases": ["Key"]}, - "value": {"type": "str", "aliases": ["Value"]}, - }, - "aliases": ["ReportPlanTags"], - } - argument_spec["report_delivery_channel"] = { - "type": "dict", - "options": { - "formats": {"type": "list", "elements": "str", "aliases": ["Formats"]}, - "s3_bucket_name": {"type": "str", "aliases": ["S3BucketName"]}, - "s3_key_prefix": {"type": "str", "aliases": ["S3KeyPrefix"]}, - }, - "aliases": ["ReportDeliveryChannel"], - } - argument_spec["report_setting"] = { - "type": "dict", - "options": { - "report_template": {"type": "str", "aliases": ["ReportTemplate"]}, - "framework_arns": { - "type": "list", - "elements": "str", - "aliases": ["FrameworkArns"], - }, - "accounts": {"type": "list", "elements": "str", "aliases": ["Accounts"]}, - "organization_units": { - "type": "list", - "elements": "str", - "aliases": ["OrganizationUnits"], - }, - "regions": {"type": "list", "elements": "str", "aliases": ["Regions"]}, - }, - "aliases": ["ReportSetting"], - } - 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": ["Tags", "resource_tags"]} - argument_spec["purge_tags"] = {"type": "bool", "default": True} - - required_if = [ - [ - "state", - "present", - ["report_delivery_channel", "report_plan_arn", "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 = 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"]) - - # 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 = ["/properties/ReportPlanName"] - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["/properties/ReportPlanArn"] - - 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 037feeec..00000000 --- a/plugins/modules/cloudtrail_event_data_store.py +++ /dev/null @@ -1,417 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -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: - 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 - event_data_store_arn: - aliases: - - EventDataStoreArn - 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 - ingestion_enabled: - aliases: - - IngestionEnabled - description: - - Indicates whether the event data store is ingesting events. - type: bool - kms_key_id: - aliases: - - KmsKeyId - 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: - aliases: - - MultiRegionEnabled - 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: - aliases: - - Name - description: - - The name of the event data store. - type: str - organization_enabled: - aliases: - - OrganizationEnabled - 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: - aliases: - - RetentionPeriod - 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: - - 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 - termination_protection_enabled: - aliases: - - TerminationProtectionEnabled - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -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", "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_data_store_arn"] = { - "type": "str", - "aliases": ["EventDataStoreArn"], - } - argument_spec["multi_region_enabled"] = { - "type": "bool", - "aliases": ["MultiRegionEnabled"], - } - argument_spec["name"] = {"type": "str", "aliases": ["Name"]} - argument_spec["organization_enabled"] = { - "type": "bool", - "aliases": ["OrganizationEnabled"], - } - argument_spec["retention_period"] = {"type": "int", "aliases": ["RetentionPeriod"]} - argument_spec["termination_protection_enabled"] = { - "type": "bool", - "aliases": ["TerminationProtectionEnabled"], - } - argument_spec["kms_key_id"] = {"type": "str", "aliases": ["KmsKeyId"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} - argument_spec["ingestion_enabled"] = { - "type": "bool", - "aliases": ["IngestionEnabled"], - } - 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["ingestion_enabled"] = module.params.get("ingestion_enabled") - 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 = 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"]) - - # 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 = {} - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["/properties/EventDataStoreArn"] - - 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 ffba51da..079987a7 100644 --- a/plugins/modules/cloudtrail_trail.py +++ b/plugins/modules/cloudtrail_trail.py @@ -519,7 +519,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["trail_name", "is_logging", "s3_bucket_name"], True], + ["state", "present", ["is_logging", "s3_bucket_name", "trail_name"], True], ["state", "absent", ["trail_name"], True], ["state", "get", ["trail_name"], True], ] diff --git a/plugins/modules/cloudwatch_composite_alarm.py b/plugins/modules/cloudwatch_composite_alarm.py index dcacb5dd..06633172 100644 --- a/plugins/modules/cloudwatch_composite_alarm.py +++ b/plugins/modules/cloudwatch_composite_alarm.py @@ -219,7 +219,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["alarm_name", "alarm_rule"], True], + ["state", "present", ["alarm_rule", "alarm_name"], True], ["state", "absent", ["alarm_name"], True], ["state", "get", ["alarm_name"], True], ] diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index 0eee8ba8..af7c2a84 100644 --- a/plugins/modules/cloudwatch_metric_stream.py +++ b/plugins/modules/cloudwatch_metric_stream.py @@ -306,7 +306,7 @@ def main(): [ "state", "present", - ["name", "role_arn", "output_format", "firehose_arn"], + ["output_format", "firehose_arn", "name", "role_arn"], True, ], ["state", "absent", ["name"], True], diff --git a/plugins/modules/dynamodb_global_table.py b/plugins/modules/dynamodb_global_table.py index 599bc438..26e33563 100644 --- a/plugins/modules/dynamodb_global_table.py +++ b/plugins/modules/dynamodb_global_table.py @@ -1048,7 +1048,7 @@ def main(): [ "state", "present", - ["replicas", "key_schema", "table_name", "attribute_definitions"], + ["replicas", "attribute_definitions", "key_schema", "table_name"], True, ], ["state", "absent", ["table_name"], True], diff --git a/plugins/modules/ec2_placement_group.py b/plugins/modules/ec2_placement_group.py deleted file mode 100644 index d4edc652..00000000 --- a/plugins/modules/ec2_placement_group.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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -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: - aliases: - - GroupName - description: - - The Group Name of Placement Group. - type: str - partition_count: - aliases: - - PartitionCount - 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: - aliases: - - SpreadLevel - 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: - aliases: - - Strategy - description: - - The placement strategy. - 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 - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["strategy"] = {"type": "str", "aliases": ["Strategy"]} - argument_spec["group_name"] = {"type": "str", "aliases": ["GroupName"]} - argument_spec["spread_level"] = {"type": "str", "aliases": ["SpreadLevel"]} - argument_spec["partition_count"] = {"type": "int", "aliases": ["PartitionCount"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "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 = 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"]) - - # 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 = [ - "/properties/Strategy", - "/properties/SpreadLevel", - "/properties/PartitionCount", - ] - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "delete", "list"] - - state = module.params.get("state") - identifier = ["/properties/GroupName"] - - 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/ecs_cluster_capacity_provider_associations.py b/plugins/modules/ecs_cluster_capacity_provider_associations.py index 49da41f2..c71fb4ea 100644 --- a/plugins/modules/ecs_cluster_capacity_provider_associations.py +++ b/plugins/modules/ecs_cluster_capacity_provider_associations.py @@ -173,7 +173,7 @@ def main(): [ "state", "present", - ["default_capacity_provider_strategy", "cluster", "capacity_providers"], + ["default_capacity_provider_strategy", "capacity_providers", "cluster"], True, ], ["state", "absent", ["cluster"], True], diff --git a/plugins/modules/ecs_primary_task_set.py b/plugins/modules/ecs_primary_task_set.py index b1ce1623..12bd9ca1 100644 --- a/plugins/modules/ecs_primary_task_set.py +++ b/plugins/modules/ecs_primary_task_set.py @@ -146,7 +146,7 @@ def main(): required_if = [ ["state", "list", ["cluster"], True], - ["state", "present", ["task_set_id", "service", "cluster", "identifier"], True], + ["state", "present", ["identifier", "task_set_id", "service", "cluster"], True], ["state", "absent", ["cluster", "service", "identifier"], True], ["state", "get", ["cluster", "service", "identifier"], True], ] diff --git a/plugins/modules/eks_addon.py b/plugins/modules/eks_addon.py index 2ccf1891..d401a487 100644 --- a/plugins/modules/eks_addon.py +++ b/plugins/modules/eks_addon.py @@ -205,7 +205,7 @@ def main(): required_if = [ ["state", "list", ["cluster_name"], True], - ["state", "present", ["cluster_name", "addon_name", "identifier"], True], + ["state", "present", ["identifier", "addon_name", "cluster_name"], True], ["state", "absent", ["cluster_name", "addon_name", "identifier"], True], ["state", "get", ["cluster_name", "addon_name", "identifier"], True], ] diff --git a/plugins/modules/eks_cluster.py b/plugins/modules/eks_cluster.py index d0af3619..debc53b3 100644 --- a/plugins/modules/eks_cluster.py +++ b/plugins/modules/eks_cluster.py @@ -445,7 +445,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["resources_vpc_config", "name", "role_arn"], True], + ["state", "present", ["name", "role_arn", "resources_vpc_config"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/eks_fargate_profile.py b/plugins/modules/eks_fargate_profile.py index 45c6e1e0..616bd38c 100644 --- a/plugins/modules/eks_fargate_profile.py +++ b/plugins/modules/eks_fargate_profile.py @@ -329,10 +329,10 @@ def main(): "present", [ "pod_execution_role_arn", + "identifier", "fargate_profile_name", - "cluster_name", "selectors", - "identifier", + "cluster_name", ], True, ], diff --git a/plugins/modules/iam_instance_profile.py b/plugins/modules/iam_instance_profile.py index 09005cb0..36e08315 100644 --- a/plugins/modules/iam_instance_profile.py +++ b/plugins/modules/iam_instance_profile.py @@ -139,7 +139,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["roles", "instance_profile_name"], True], + ["state", "present", ["instance_profile_name", "roles"], True], ["state", "absent", ["instance_profile_name"], True], ["state", "get", ["instance_profile_name"], True], ] diff --git a/plugins/modules/kms_replica_key.py b/plugins/modules/kms_replica_key.py deleted file mode 100644 index 3f846d49..00000000 --- a/plugins/modules/kms_replica_key.py +++ /dev/null @@ -1,259 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -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: - aliases: - - 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: - aliases: - - 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: - aliases: - - KeyId - description: - - Not Provived. - type: str - key_policy: - aliases: - - KeyPolicy - 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: - aliases: - - PendingWindowInDays - 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: - aliases: - - PrimaryKeyArn - 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: - - 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 - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["primary_key_arn"] = {"type": "str", "aliases": ["PrimaryKeyArn"]} - argument_spec["description"] = {"type": "str", "aliases": ["Description"]} - argument_spec["enabled"] = {"type": "bool", "aliases": ["Enabled"]} - argument_spec["key_policy"] = {"type": "dict", "aliases": ["KeyPolicy"]} - argument_spec["pending_window_in_days"] = { - "type": "int", - "aliases": ["PendingWindowInDays"], - } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} - argument_spec["key_id"] = {"type": "str", "aliases": ["KeyId"]} - 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", ["key_id", "key_policy", "primary_key_arn"], 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 = 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"]) - - # 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 = ["/properties/PrimaryKeyArn"] - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["/properties/KeyId"] - - 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 d6f72b4a..00000000 --- a/plugins/modules/lambda_code_signing_config.py +++ /dev/null @@ -1,261 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -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: - aliases: - - AllowedPublishers - 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: - aliases: - - SigningProfileVersionArns - description: - - List of Signing profile version Arns. - elements: str - type: list - type: dict - code_signing_config_arn: - aliases: - - CodeSigningConfigArn - description: - - A unique Arn for CodeSigningConfig resource. - type: str - code_signing_policies: - aliases: - - CodeSigningPolicies - 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: - aliases: - - UntrustedArtifactOnDeployment - 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: - aliases: - - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["description"] = {"type": "str", "aliases": ["Description"]} - argument_spec["allowed_publishers"] = { - "type": "dict", - "options": { - "signing_profile_version_arns": { - "type": "list", - "elements": "str", - "aliases": ["SigningProfileVersionArns"], - } - }, - "aliases": ["AllowedPublishers"], - } - argument_spec["code_signing_policies"] = { - "type": "dict", - "options": { - "untrusted_artifact_on_deployment": { - "type": "str", - "default": "Warn", - "choices": ["Enforce", "Warn"], - "aliases": ["UntrustedArtifactOnDeployment"], - } - }, - "aliases": ["CodeSigningPolicies"], - } - argument_spec["code_signing_config_arn"] = { - "type": "str", - "aliases": ["CodeSigningConfigArn"], - } - 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", ["allowed_publishers", "code_signing_config_arn"], 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 = 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"]) - - # 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 = {} - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["/properties/CodeSigningConfigArn"] - - 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 3f494e0b..00000000 --- a/plugins/modules/lambda_event_source_mapping.py +++ /dev/null @@ -1,651 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -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: - aliases: - - AmazonManagedKafkaEventSourceConfig - description: - - Specific configuration settings for an MSK event source.Specific configuration - settings for an MSK event source. - suboptions: - consumer_group_id: - aliases: - - ConsumerGroupId - 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: - aliases: - - BatchSize - description: - - The maximum number of items to retrieve in a single batch. - type: int - bisect_batch_on_function_error: - aliases: - - BisectBatchOnFunctionError - description: - - (Streams) If the function returns an error, split the batch in two and retry. - type: bool - destination_config: - aliases: - - DestinationConfig - 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: - aliases: - - OnFailure - description: - - The destination configuration for failed invocations.A destination - for events that failed processing. - suboptions: - destination: - aliases: - - Destination - description: - - The Amazon Resource Name (ARN) of the destination resource. - type: str - type: dict - type: dict - document_db_event_source_config: - aliases: - - DocumentDBEventSourceConfig - description: - - Document db event source config.Document db event source config. - suboptions: - collection_name: - aliases: - - CollectionName - description: - - The collection name to connect to. - type: str - database_name: - aliases: - - DatabaseName - description: - - The database name to connect to. - type: str - full_document: - aliases: - - FullDocument - choices: - - Default - - UpdateLookup - description: - - Include full document in change stream response. - - The default option will only send the changes made to documents - to Lambda. - - If you want the complete document sent to Lambda, set this to UpdateLookup. - type: str - type: dict - enabled: - aliases: - - Enabled - description: - - Disables the event source mapping to pause polling and invocation. - type: bool - event_source_arn: - aliases: - - EventSourceArn - description: - - The Amazon Resource Name (ARN) of the event source. - type: str - filter_criteria: - aliases: - - FilterCriteria - description: - - The filter criteria to control event filtering.The filter criteria to control - event filtering. - suboptions: - filters: - aliases: - - Filters - description: - - The filter object that defines parameters for ESM filtering. - elements: dict - suboptions: - pattern: - aliases: - - 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: - aliases: - - FunctionName - description: - - The name of the Lambda function. - type: str - function_response_types: - aliases: - - FunctionResponseTypes - choices: - - ReportBatchItemFailures - description: - - (Streams) A list of response types supported by the function. - elements: str - type: list - id: - aliases: - - Id - description: - - Event Source Mapping Identifier UUID. - type: str - maximum_batching_window_in_seconds: - aliases: - - MaximumBatchingWindowInSeconds - description: - - (Streams) The maximum amount of time to gather records before invoking the - function, in seconds. - type: int - maximum_record_age_in_seconds: - aliases: - - MaximumRecordAgeInSeconds - description: - - (Streams) The maximum age of a record that Lambda sends to a function for - processing. - type: int - maximum_retry_attempts: - aliases: - - MaximumRetryAttempts - description: - - (Streams) The maximum number of times to retry when the function returns - an error. - type: int - parallelization_factor: - aliases: - - ParallelizationFactor - description: - - (Streams) The number of batches to process from each shard concurrently. - type: int - queues: - aliases: - - Queues - description: - - (ActiveMQ) A list of ActiveMQ queues. - elements: str - type: list - scaling_config: - aliases: - - ScalingConfig - description: - - The scaling configuration for the event source.The scaling configuration - for the event source. - suboptions: - maximum_concurrency: - aliases: - - MaximumConcurrency - 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: - aliases: - - SelfManagedEventSource - description: - - Self-managed event source endpoints.The configuration used by AWS Lambda - to access a self-managed event source. - suboptions: - endpoints: - aliases: - - 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: - aliases: - - KafkaBootstrapServers - description: - - The URL of a Kafka server. - elements: str - type: list - type: dict - type: dict - self_managed_kafka_event_source_config: - aliases: - - SelfManagedKafkaEventSourceConfig - 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: - aliases: - - ConsumerGroupId - description: - - The identifier for the Kafka Consumer Group to join. - type: str - type: dict - source_access_configurations: - aliases: - - SourceAccessConfigurations - description: - - The configuration used by AWS Lambda to access event source. - elements: dict - suboptions: - type: - aliases: - - 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: - aliases: - - URI - description: - - The URI for the source access configuration resource. - type: str - type: list - starting_position: - aliases: - - StartingPosition - 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: - aliases: - - StartingPositionTimestamp - 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: - aliases: - - Topics - description: - - (Kafka) A list of Kafka topics. - elements: str - type: list - tumbling_window_in_seconds: - aliases: - - TumblingWindowInSeconds - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["id"] = {"type": "str", "aliases": ["Id"]} - argument_spec["batch_size"] = {"type": "int", "aliases": ["BatchSize"]} - argument_spec["bisect_batch_on_function_error"] = { - "type": "bool", - "aliases": ["BisectBatchOnFunctionError"], - } - argument_spec["destination_config"] = { - "type": "dict", - "options": { - "on_failure": { - "type": "dict", - "options": {"destination": {"type": "str", "aliases": ["Destination"]}}, - "aliases": ["OnFailure"], - } - }, - "aliases": ["DestinationConfig"], - } - argument_spec["enabled"] = {"type": "bool", "aliases": ["Enabled"]} - argument_spec["event_source_arn"] = {"type": "str", "aliases": ["EventSourceArn"]} - argument_spec["filter_criteria"] = { - "type": "dict", - "options": { - "filters": { - "type": "list", - "elements": "dict", - "options": {"pattern": {"type": "str", "aliases": ["Pattern"]}}, - "aliases": ["Filters"], - } - }, - "aliases": ["FilterCriteria"], - } - argument_spec["function_name"] = {"type": "str", "aliases": ["FunctionName"]} - argument_spec["maximum_batching_window_in_seconds"] = { - "type": "int", - "aliases": ["MaximumBatchingWindowInSeconds"], - } - argument_spec["maximum_record_age_in_seconds"] = { - "type": "int", - "aliases": ["MaximumRecordAgeInSeconds"], - } - argument_spec["maximum_retry_attempts"] = { - "type": "int", - "aliases": ["MaximumRetryAttempts"], - } - argument_spec["parallelization_factor"] = { - "type": "int", - "aliases": ["ParallelizationFactor"], - } - argument_spec["starting_position"] = { - "type": "str", - "aliases": ["StartingPosition"], - } - argument_spec["starting_position_timestamp"] = { - "type": "int", - "aliases": ["StartingPositionTimestamp"], - } - argument_spec["topics"] = {"type": "list", "elements": "str", "aliases": ["Topics"]} - argument_spec["queues"] = {"type": "list", "elements": "str", "aliases": ["Queues"]} - 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", - ], - "aliases": ["Type"], - }, - "uri": {"type": "str", "aliases": ["URI"]}, - }, - "aliases": ["SourceAccessConfigurations"], - } - argument_spec["tumbling_window_in_seconds"] = { - "type": "int", - "aliases": ["TumblingWindowInSeconds"], - } - argument_spec["function_response_types"] = { - "type": "list", - "elements": "str", - "choices": ["ReportBatchItemFailures"], - "aliases": ["FunctionResponseTypes"], - } - argument_spec["self_managed_event_source"] = { - "type": "dict", - "options": { - "endpoints": { - "type": "dict", - "options": { - "kafka_bootstrap_servers": { - "type": "list", - "elements": "str", - "aliases": ["KafkaBootstrapServers"], - } - }, - "aliases": ["Endpoints"], - } - }, - "aliases": ["SelfManagedEventSource"], - } - argument_spec["amazon_managed_kafka_event_source_config"] = { - "type": "dict", - "options": { - "consumer_group_id": {"type": "str", "aliases": ["ConsumerGroupId"]} - }, - "aliases": ["AmazonManagedKafkaEventSourceConfig"], - } - argument_spec["self_managed_kafka_event_source_config"] = { - "type": "dict", - "options": { - "consumer_group_id": {"type": "str", "aliases": ["ConsumerGroupId"]} - }, - "aliases": ["SelfManagedKafkaEventSourceConfig"], - } - argument_spec["scaling_config"] = { - "type": "dict", - "options": { - "maximum_concurrency": {"type": "int", "aliases": ["MaximumConcurrency"]} - }, - "aliases": ["ScalingConfig"], - } - argument_spec["document_db_event_source_config"] = { - "type": "dict", - "options": { - "database_name": {"type": "str", "aliases": ["DatabaseName"]}, - "collection_name": {"type": "str", "aliases": ["CollectionName"]}, - "full_document": { - "type": "str", - "choices": ["Default", "UpdateLookup"], - "aliases": ["FullDocument"], - }, - }, - "aliases": ["DocumentDBEventSourceConfig"], - } - 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["document_db_event_source_config"] = module.params.get( - "document_db_event_source_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 = 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"]) - - # 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 = [ - "/properties/EventSourceArn", - "/properties/StartingPosition", - "/properties/StartingPositionTimestamp", - "/properties/SelfManagedEventSource", - "/properties/AmazonManagedKafkaEventSourceConfig", - "/properties/SelfManagedKafkaEventSourceConfig", - ] - - # Necessary to handle when module does not support all the states - handlers = ["create", "delete", "list", "read", "update"] - - state = module.params.get("state") - identifier = ["/properties/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 e45d7704..6b9e9b92 100644 --- a/plugins/modules/lambda_function.py +++ b/plugins/modules/lambda_function.py @@ -571,7 +571,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["role", "function_name", "code"], True], + ["state", "present", ["role", "code", "function_name"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index a070be12..03cca111 100644 --- a/plugins/modules/logs_metric_filter.py +++ b/plugins/modules/logs_metric_filter.py @@ -296,11 +296,11 @@ def main(): "state", "present", [ - "filter_pattern", + "identifier", "filter_name", - "metric_transformations", "log_group_name", - "identifier", + "metric_transformations", + "filter_pattern", ], True, ], diff --git a/plugins/modules/logs_query_definition.py b/plugins/modules/logs_query_definition.py deleted file mode 100644 index 15d0255e..00000000 --- a/plugins/modules/logs_query_definition.py +++ /dev/null @@ -1,220 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -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: - aliases: - - LogGroupNames - description: - - I(log_group) name. - elements: str - type: list - name: - aliases: - - Name - description: - - A name for the saved query definition. - type: str - query_definition_id: - aliases: - - QueryDefinitionId - description: - - Unique identifier of a query definition. - type: str - query_string: - aliases: - - QueryString - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["name"] = {"type": "str", "aliases": ["Name"]} - argument_spec["query_string"] = {"type": "str", "aliases": ["QueryString"]} - argument_spec["log_group_names"] = { - "type": "list", - "elements": "str", - "aliases": ["LogGroupNames"], - } - argument_spec["query_definition_id"] = { - "type": "str", - "aliases": ["QueryDefinitionId"], - } - 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", "name", "query_string"], 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 = 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"]) - - # 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 = {} - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["/properties/QueryDefinitionId"] - - 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/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index 0687d22f..7ae2dcfd 100644 --- a/plugins/modules/memorydb_cluster.py +++ b/plugins/modules/memorydb_cluster.py @@ -372,7 +372,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["cluster_name", "node_type", "acl_name"], True], + ["state", "present", ["node_type", "acl_name", "cluster_name"], True], ["state", "absent", ["cluster_name"], True], ["state", "get", ["cluster_name"], True], ] diff --git a/plugins/modules/memorydb_parameter_group.py b/plugins/modules/memorydb_parameter_group.py index 0643d4f8..2c154fc1 100644 --- a/plugins/modules/memorydb_parameter_group.py +++ b/plugins/modules/memorydb_parameter_group.py @@ -177,7 +177,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["parameter_group_name", "family"], True], + ["state", "present", ["family", "parameter_group_name"], True], ["state", "absent", ["parameter_group_name"], True], ["state", "get", ["parameter_group_name"], True], ] diff --git a/plugins/modules/rds_db_cluster_parameter_group.py b/plugins/modules/rds_db_cluster_parameter_group.py index c9f143c4..6a2b5369 100644 --- a/plugins/modules/rds_db_cluster_parameter_group.py +++ b/plugins/modules/rds_db_cluster_parameter_group.py @@ -166,7 +166,7 @@ def main(): [ "state", "present", - ["parameters", "family", "db_cluster_parameter_group_name", "description"], + ["description", "db_cluster_parameter_group_name", "parameters", "family"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], diff --git a/plugins/modules/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index cc23a8f2..be789cda 100644 --- a/plugins/modules/rds_db_proxy.py +++ b/plugins/modules/rds_db_proxy.py @@ -299,7 +299,7 @@ def main(): [ "state", "present", - ["auth", "role_arn", "engine_family", "vpc_subnet_ids", "db_proxy_name"], + ["role_arn", "engine_family", "db_proxy_name", "vpc_subnet_ids", "auth"], True, ], ["state", "absent", ["db_proxy_name"], True], diff --git a/plugins/modules/rds_db_proxy_endpoint.py b/plugins/modules/rds_db_proxy_endpoint.py index 5754d2da..573b355e 100644 --- a/plugins/modules/rds_db_proxy_endpoint.py +++ b/plugins/modules/rds_db_proxy_endpoint.py @@ -191,7 +191,7 @@ def main(): [ "state", "present", - ["vpc_subnet_ids", "db_proxy_endpoint_name", "db_proxy_name"], + ["db_proxy_endpoint_name", "db_proxy_name", "vpc_subnet_ids"], True, ], ["state", "absent", ["db_proxy_endpoint_name"], True], diff --git a/plugins/modules/rds_db_subnet_group.py b/plugins/modules/rds_db_subnet_group.py index d9555a05..58863b20 100644 --- a/plugins/modules/rds_db_subnet_group.py +++ b/plugins/modules/rds_db_subnet_group.py @@ -163,7 +163,7 @@ def main(): [ "state", "present", - ["db_subnet_group_name", "db_subnet_group_description", "subnet_ids"], + ["db_subnet_group_description", "db_subnet_group_name", "subnet_ids"], True, ], ["state", "absent", ["db_subnet_group_name"], True], diff --git a/plugins/modules/rds_option_group.py b/plugins/modules/rds_option_group.py index 6aec7425..98fb3f77 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -257,10 +257,10 @@ def main(): "state", "present", [ - "option_group_description", "major_engine_version", - "engine_name", "option_group_name", + "option_group_description", + "engine_name", ], True, ], diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index d47610e0..8f8d86c8 100644 --- a/plugins/modules/redshift_cluster.py +++ b/plugins/modules/redshift_cluster.py @@ -650,11 +650,11 @@ def main(): "state", "present", [ - "master_username", "db_name", "node_type", - "master_user_password", "cluster_identifier", + "master_username", + "master_user_password", "cluster_type", ], True, diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index 35033b87..570efaf1 100644 --- a/plugins/modules/redshift_endpoint_access.py +++ b/plugins/modules/redshift_endpoint_access.py @@ -163,10 +163,10 @@ def main(): "state", "present", [ + "cluster_identifier", + "endpoint_name", "subnet_group_name", "vpc_security_group_ids", - "endpoint_name", - "cluster_identifier", ], True, ], diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index 898886e7..62825806 100644 --- a/plugins/modules/redshift_endpoint_authorization.py +++ b/plugins/modules/redshift_endpoint_authorization.py @@ -151,7 +151,7 @@ def main(): required_if = [ ["state", "list", ["cluster_identifier"], True], - ["state", "present", ["identifier", "account", "cluster_identifier"], True], + ["state", "present", ["cluster_identifier", "identifier", "account"], True], ["state", "absent", ["cluster_identifier", "account", "identifier"], True], ["state", "get", ["cluster_identifier", "account", "identifier"], True], ] diff --git a/plugins/modules/route53_key_signing_key.py b/plugins/modules/route53_key_signing_key.py index cf776cbe..5f17e8df 100644 --- a/plugins/modules/route53_key_signing_key.py +++ b/plugins/modules/route53_key_signing_key.py @@ -166,11 +166,11 @@ def main(): "state", "present", [ - "name", - "status", "key_management_service_arn", - "hosted_zone_id", + "status", "identifier", + "hosted_zone_id", + "name", ], True, ], diff --git a/plugins/modules/s3_multi_region_access_point_policy.py b/plugins/modules/s3_multi_region_access_point_policy.py index 3ff03691..85001fd2 100644 --- a/plugins/modules/s3_multi_region_access_point_policy.py +++ b/plugins/modules/s3_multi_region_access_point_policy.py @@ -126,7 +126,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["mrap_name", "policy"], True], + ["state", "present", ["policy", "mrap_name"], True], ["state", "absent", ["mrap_name"], True], ["state", "get", ["mrap_name"], True], ] diff --git a/plugins/modules/s3objectlambda_access_point.py b/plugins/modules/s3objectlambda_access_point.py index 5bf255e0..0f250b93 100644 --- a/plugins/modules/s3objectlambda_access_point.py +++ b/plugins/modules/s3objectlambda_access_point.py @@ -244,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], ] diff --git a/plugins/modules/ssm_document.py b/plugins/modules/ssm_document.py index 40b11e8c..91775d67 100644 --- a/plugins/modules/ssm_document.py +++ b/plugins/modules/ssm_document.py @@ -313,7 +313,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["content", "name"], True], + ["state", "present", ["name", "content"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/ssm_resource_data_sync.py b/plugins/modules/ssm_resource_data_sync.py deleted file mode 100644 index 581e4df2..00000000 --- a/plugins/modules/ssm_resource_data_sync.py +++ /dev/null @@ -1,373 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -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: - aliases: - - BucketName - description: - - Not Provived. - type: str - bucket_prefix: - aliases: - - BucketPrefix - description: - - Not Provived. - type: str - bucket_region: - aliases: - - BucketRegion - 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: - aliases: - - KMSKeyArn - description: - - Not Provived. - type: str - s3_destination: - aliases: - - S3Destination - description: - - Not Provived. - suboptions: - bucket_name: - aliases: - - BucketName - description: - - Not Provived. - type: str - bucket_prefix: - aliases: - - BucketPrefix - description: - - Not Provived. - type: str - bucket_region: - aliases: - - BucketRegion - description: - - Not Provived. - type: str - kms_key_arn: - aliases: - - KMSKeyArn - description: - - Not Provived. - type: str - sync_format: - aliases: - - SyncFormat - 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: - aliases: - - SyncFormat - description: - - Not Provived. - type: str - sync_name: - aliases: - - SyncName - description: - - Not Provived. - type: str - sync_source: - aliases: - - SyncSource - description: - - Not Provived. - suboptions: - aws_organizations_source: - aliases: - - AwsOrganizationsSource - description: - - Not Provived. - suboptions: - organization_source_type: - aliases: - - OrganizationSourceType - description: - - Not Provived. - type: str - organizational_units: - aliases: - - OrganizationalUnits - description: - - Not Provived. - elements: str - type: list - type: dict - include_future_regions: - aliases: - - IncludeFutureRegions - description: - - Not Provived. - type: bool - source_regions: - aliases: - - SourceRegions - description: - - Not Provived. - elements: str - type: list - source_type: - aliases: - - SourceType - description: - - Not Provived. - type: str - type: dict - sync_type: - aliases: - - SyncType - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -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", "aliases": ["KMSKeyArn"]}, - "bucket_prefix": {"type": "str", "aliases": ["BucketPrefix"]}, - "bucket_name": {"type": "str", "aliases": ["BucketName"]}, - "bucket_region": {"type": "str", "aliases": ["BucketRegion"]}, - "sync_format": {"type": "str", "aliases": ["SyncFormat"]}, - }, - "aliases": ["S3Destination"], - } - argument_spec["kms_key_arn"] = {"type": "str", "aliases": ["KMSKeyArn"]} - argument_spec["sync_source"] = { - "type": "dict", - "options": { - "include_future_regions": { - "type": "bool", - "aliases": ["IncludeFutureRegions"], - }, - "source_regions": { - "type": "list", - "elements": "str", - "aliases": ["SourceRegions"], - }, - "source_type": {"type": "str", "aliases": ["SourceType"]}, - "aws_organizations_source": { - "type": "dict", - "options": { - "organizational_units": { - "type": "list", - "elements": "str", - "aliases": ["OrganizationalUnits"], - }, - "organization_source_type": { - "type": "str", - "aliases": ["OrganizationSourceType"], - }, - }, - "aliases": ["AwsOrganizationsSource"], - }, - }, - "aliases": ["SyncSource"], - } - argument_spec["bucket_name"] = {"type": "str", "aliases": ["BucketName"]} - argument_spec["bucket_region"] = {"type": "str", "aliases": ["BucketRegion"]} - argument_spec["sync_format"] = {"type": "str", "aliases": ["SyncFormat"]} - argument_spec["sync_name"] = {"type": "str", "aliases": ["SyncName"]} - argument_spec["sync_type"] = {"type": "str", "aliases": ["SyncType"]} - argument_spec["bucket_prefix"] = {"type": "str", "aliases": ["BucketPrefix"]} - 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 = 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"]) - - # 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 = [ - "/properties/KMSKeyArn", - "/properties/SyncFormat", - "/properties/BucketPrefix", - "/properties/SyncName", - "/properties/BucketRegion", - "/properties/BucketName", - "/properties/S3Destination", - "/properties/SyncType", - ] - - # Necessary to handle when module does not support all the states - handlers = ["create", "delete", "update", "list", "read"] - - state = module.params.get("state") - identifier = ["/properties/SyncName"] - - 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 bfdc7348..00000000 --- a/plugins/modules/wafv2_ip_set.py +++ /dev/null @@ -1,296 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -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: - aliases: - - Addresses - description: - - IP address. - elements: str - type: list - description: - aliases: - - 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: - aliases: - - 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: - aliases: - - IPAddressVersion - 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: - aliases: - - Name - description: - - Name of the IPSet. - type: str - purge_tags: - default: true - description: - - Remove tags not listed in I(tags). - type: bool - scope: - aliases: - - 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: - - 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 - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["description"] = {"type": "str", "aliases": ["Description"]} - argument_spec["name"] = {"type": "str", "aliases": ["Name"]} - argument_spec["id"] = {"type": "str", "aliases": ["Id"]} - argument_spec["scope"] = { - "type": "str", - "choices": ["CLOUDFRONT", "REGIONAL"], - "aliases": ["Scope"], - } - argument_spec["ip_address_version"] = { - "type": "str", - "choices": ["IPV4", "IPV6"], - "aliases": ["IPAddressVersion"], - } - argument_spec["addresses"] = { - "type": "list", - "elements": "str", - "aliases": ["Addresses"], - } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "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", - ["ip_address_version", "id", "scope", "name", "addresses", "identifier"], - 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 = 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"]) - - # 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 = ["/properties/Name", "/properties/Scope"] - - # Necessary to handle when module does not support all the states - handlers = ["create", "delete", "read", "update", "list"] - - state = module.params.get("state") - identifier = ["/properties/Name", "/properties/Id", "/properties/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( - "You must specify all the ('name', 'id', 'scope') 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 b085e09f..87667fd7 100644 --- a/plugins/modules/wafv2_logging_configuration.py +++ b/plugins/modules/wafv2_logging_configuration.py @@ -448,7 +448,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["resource_arn", "log_destination_configs"], True], + ["state", "present", ["log_destination_configs", "resource_arn"], True], ["state", "absent", ["resource_arn"], True], ["state", "get", ["resource_arn"], True], ] diff --git a/plugins/modules/wafv2_regex_pattern_set.py b/plugins/modules/wafv2_regex_pattern_set.py deleted file mode 100644 index a5446b86..00000000 --- a/plugins/modules/wafv2_regex_pattern_set.py +++ /dev/null @@ -1,278 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -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: - aliases: - - 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: - aliases: - - 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: - aliases: - - 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: - aliases: - - RegularExpressionList - description: - - Not Provived. - elements: str - type: list - scope: - aliases: - - 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: - - 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 - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["description"] = {"type": "str", "aliases": ["Description"]} - argument_spec["name"] = {"type": "str", "aliases": ["Name"]} - argument_spec["id"] = {"type": "str", "aliases": ["Id"]} - argument_spec["regular_expression_list"] = { - "type": "list", - "elements": "str", - "aliases": ["RegularExpressionList"], - } - argument_spec["scope"] = { - "type": "str", - "choices": ["CLOUDFRONT", "REGIONAL"], - "aliases": ["Scope"], - } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "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", "id", "scope", "name", "identifier"], - 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 = 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"]) - - # 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 = ["/properties/Name", "/properties/Scope"] - - # Necessary to handle when module does not support all the states - handlers = ["create", "delete", "read", "update", "list"] - - state = module.params.get("state") - identifier = ["/properties/Name", "/properties/Id", "/properties/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( - "You must specify all the ('name', 'id', 'scope') 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 ba5c9f3e..7d679a6c 100644 --- a/plugins/modules/wafv2_web_acl_association.py +++ b/plugins/modules/wafv2_web_acl_association.py @@ -136,7 +136,7 @@ def main(): required_if = [ ["state", "list", ["resource_arn"], True], - ["state", "present", ["web_acl_arn", "resource_arn", "identifier"], True], + ["state", "present", ["identifier", "web_acl_arn", "resource_arn"], True], ["state", "absent", ["resource_arn", "web_acl_arn", "identifier"], True], ["state", "get", ["resource_arn", "web_acl_arn", "identifier"], True], ] diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 148fff3a..501d6b15 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -24,26 +24,6 @@ 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 @@ -63,24 +43,6 @@ 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 @@ -100,15 +62,6 @@ 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 @@ -250,16 +203,6 @@ 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 @@ -326,15 +269,6 @@ 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 @@ -408,25 +342,6 @@ 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 @@ -436,15 +351,6 @@ 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 @@ -520,15 +426,6 @@ 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 @@ -609,6 +506,4 @@ 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 diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 3744d9e6..61bf59fd 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -24,26 +24,6 @@ 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 @@ -63,24 +43,6 @@ 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 @@ -100,15 +62,6 @@ 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 @@ -250,16 +203,6 @@ 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 @@ -325,15 +268,6 @@ 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 @@ -407,25 +341,6 @@ 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 @@ -435,15 +350,6 @@ 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 @@ -519,15 +425,6 @@ 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 @@ -608,6 +505,4 @@ 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 diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 0d450e7e..a5facba4 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.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,6 +73,4 @@ 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 diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index fd87ac8e..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,8 +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 fd87ac8e..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,8 +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 fd87ac8e..732b8179 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.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,8 +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.16.txt b/tests/sanity/ignore-2.16.txt index 74cd5234..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 diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 84441c7c..24d8e87f 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -22,23 +22,7 @@ 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 +lugins/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 @@ -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,4 @@ 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 From 2256a8a8e376fb07f65de02934101c68b75e203e Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 9 Aug 2023 20:59:39 +0200 Subject: [PATCH 15/32] Add new rds modules Signed-off-by: Alina Buzachis --- config/modules.yaml | 29 + meta/runtime.yml | 5 + plugins/modules/autoscaling_lifecycle_hook.py | 4 +- plugins/modules/cloudtrail_trail.py | 2 +- plugins/modules/cloudwatch_metric_stream.py | 2 +- plugins/modules/dynamodb_global_table.py | 2 +- plugins/modules/ecs_capacity_provider.py | 2 +- plugins/modules/ecs_primary_task_set.py | 2 +- plugins/modules/eks_addon.py | 2 +- plugins/modules/eks_cluster.py | 2 +- plugins/modules/eks_fargate_profile.py | 4 +- plugins/modules/iam_role.py | 2 +- plugins/modules/kms_alias.py | 2 +- plugins/modules/lambda_function.py | 2 +- plugins/modules/logs_metric_filter.py | 4 +- plugins/modules/logs_resource_policy.py | 2 +- plugins/modules/memorydb_acl.py | 17 - plugins/modules/memorydb_cluster.py | 23 +- plugins/modules/memorydb_parameter_group.py | 15 - plugins/modules/memorydb_subnet_group.py | 19 - .../modules/rds_custom_db_engine_version.py | 328 ++++++ plugins/modules/rds_db_cluster.py | 995 ++++++++++++++++++ .../modules/rds_db_cluster_parameter_group.py | 2 +- plugins/modules/rds_db_parameter_group.py | 242 +++++ plugins/modules/rds_db_proxy.py | 2 +- plugins/modules/rds_db_proxy_endpoint.py | 2 +- plugins/modules/rds_event_subscription.py | 274 +++++ plugins/modules/rds_option_group.py | 4 +- plugins/modules/redshift_cluster.py | 8 +- plugins/modules/redshift_endpoint_access.py | 4 +- .../redshift_endpoint_authorization.py | 2 +- plugins/modules/route53_key_signing_key.py | 4 +- .../s3_multi_region_access_point_policy.py | 2 +- .../modules/s3objectlambda_access_point.py | 2 +- .../s3objectlambda_access_point_policy.py | 2 +- plugins/modules/wafv2_web_acl_association.py | 2 +- tests/sanity/ignore-2.10.txt | 46 + tests/sanity/ignore-2.11.txt | 46 + tests/sanity/ignore-2.12.txt | 11 + tests/sanity/ignore-2.13.txt | 12 +- tests/sanity/ignore-2.14.txt | 12 +- tests/sanity/ignore-2.15.txt | 22 +- tests/sanity/ignore-2.16.txt | 6 + tests/sanity/ignore-2.9.txt | 44 +- 44 files changed, 2097 insertions(+), 119 deletions(-) create mode 100644 plugins/modules/rds_custom_db_engine_version.py create mode 100644 plugins/modules/rds_db_cluster.py create mode 100644 plugins/modules/rds_db_parameter_group.py create mode 100644 plugins/modules/rds_event_subscription.py diff --git a/config/modules.yaml b/config/modules.yaml index 4da4f34f..7e606ec8 100644 --- a/config/modules.yaml +++ b/config/modules.yaml @@ -409,3 +409,32 @@ - Creates a MemoryDB user. For more information, see U(https://docs.aws.amazon.com/memorydb/latest/devguide/clusters.acls.html) resource: AWS::MemoryDB::User +# 0.5.0 +- rds_custom_db_engine_version: + documentation: + short_description: Creates and manages a custom DB engine version (CEV) + description: + - Creates and manages a custom DB engine version (CEV). For more information, see + U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-customdbengineversion.html) + resource: AWS::RDS::CustomDBEngineVersion +- rds_db_cluster: + documentation: + short_description: Creates and manages an Amazon Aurora DB cluster or Multi-AZ DB cluster + description: + - Creates and manages an Amazon Aurora DB cluster or Multi-AZ DB cluster. For more information, see + U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html) + resource: AWS::RDS::DBCluster +- rds_db_parameter_group: + documentation: + short_description: Creates and manages a custom parameter group for an RDS database family + description: + - Creates and manages a custom parameter group for an RDS database family. For more information, see + U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbparametergroup.html) + resource: AWS::RDS::DBParameterGroup +- rds_event_subscription: + documentation: + short_description: Allows you to receive notifications for Amazon Relational Database Service events through the Amazon Simple Notification Service (Amazon SNS) + description: + - Allows you to receive notifications for Amazon Relational Database Service events through the Amazon Simple Notification Service (Amazon SNS). For more information, see + U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-eventsubscription.html) + resource: AWS::RDS::EventSubscription diff --git a/meta/runtime.yml b/meta/runtime.yml index d6c510bb..1bf3754a 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -53,6 +53,11 @@ action_groups: - memorydb_parameter_group - memorydb_subnet_group - memorydb_user + - rds_custom_db_engine_version + - rds_db_cluster + - rds_db_parameter_group + - rds_event_subscription + - rds_db_proxy_target_group - rdsdb_proxy - s3_object_lambda_access_point - s3_object_lambda_access_point_policy diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index 92cc1cf0..3afd1b57 100644 --- a/plugins/modules/autoscaling_lifecycle_hook.py +++ b/plugins/modules/autoscaling_lifecycle_hook.py @@ -221,10 +221,10 @@ def main(): "state", "present", [ - "auto_scaling_group_name", - "lifecycle_hook_name", "identifier", + "auto_scaling_group_name", "lifecycle_transition", + "lifecycle_hook_name", ], True, ], diff --git a/plugins/modules/cloudtrail_trail.py b/plugins/modules/cloudtrail_trail.py index 079987a7..a7ab0c43 100644 --- a/plugins/modules/cloudtrail_trail.py +++ b/plugins/modules/cloudtrail_trail.py @@ -519,7 +519,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["is_logging", "s3_bucket_name", "trail_name"], True], + ["state", "present", ["s3_bucket_name", "trail_name", "is_logging"], True], ["state", "absent", ["trail_name"], True], ["state", "get", ["trail_name"], True], ] diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index af7c2a84..d30f2f96 100644 --- a/plugins/modules/cloudwatch_metric_stream.py +++ b/plugins/modules/cloudwatch_metric_stream.py @@ -306,7 +306,7 @@ def main(): [ "state", "present", - ["output_format", "firehose_arn", "name", "role_arn"], + ["firehose_arn", "output_format", "name", "role_arn"], True, ], ["state", "absent", ["name"], True], diff --git a/plugins/modules/dynamodb_global_table.py b/plugins/modules/dynamodb_global_table.py index 26e33563..087824e9 100644 --- a/plugins/modules/dynamodb_global_table.py +++ b/plugins/modules/dynamodb_global_table.py @@ -1048,7 +1048,7 @@ def main(): [ "state", "present", - ["replicas", "attribute_definitions", "key_schema", "table_name"], + ["table_name", "attribute_definitions", "replicas", "key_schema"], True, ], ["state", "absent", ["table_name"], True], diff --git a/plugins/modules/ecs_capacity_provider.py b/plugins/modules/ecs_capacity_provider.py index 7f2a44f3..70b19858 100644 --- a/plugins/modules/ecs_capacity_provider.py +++ b/plugins/modules/ecs_capacity_provider.py @@ -237,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], ] diff --git a/plugins/modules/ecs_primary_task_set.py b/plugins/modules/ecs_primary_task_set.py index 12bd9ca1..eba815b2 100644 --- a/plugins/modules/ecs_primary_task_set.py +++ b/plugins/modules/ecs_primary_task_set.py @@ -146,7 +146,7 @@ def main(): required_if = [ ["state", "list", ["cluster"], True], - ["state", "present", ["identifier", "task_set_id", "service", "cluster"], True], + ["state", "present", ["task_set_id", "identifier", "cluster", "service"], True], ["state", "absent", ["cluster", "service", "identifier"], True], ["state", "get", ["cluster", "service", "identifier"], True], ] diff --git a/plugins/modules/eks_addon.py b/plugins/modules/eks_addon.py index d401a487..722a7e68 100644 --- a/plugins/modules/eks_addon.py +++ b/plugins/modules/eks_addon.py @@ -205,7 +205,7 @@ def main(): required_if = [ ["state", "list", ["cluster_name"], True], - ["state", "present", ["identifier", "addon_name", "cluster_name"], True], + ["state", "present", ["addon_name", "identifier", "cluster_name"], True], ["state", "absent", ["cluster_name", "addon_name", "identifier"], True], ["state", "get", ["cluster_name", "addon_name", "identifier"], True], ] diff --git a/plugins/modules/eks_cluster.py b/plugins/modules/eks_cluster.py index debc53b3..d0af3619 100644 --- a/plugins/modules/eks_cluster.py +++ b/plugins/modules/eks_cluster.py @@ -445,7 +445,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["name", "role_arn", "resources_vpc_config"], True], + ["state", "present", ["resources_vpc_config", "name", "role_arn"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/eks_fargate_profile.py b/plugins/modules/eks_fargate_profile.py index 616bd38c..df7ef920 100644 --- a/plugins/modules/eks_fargate_profile.py +++ b/plugins/modules/eks_fargate_profile.py @@ -328,10 +328,10 @@ def main(): "state", "present", [ - "pod_execution_role_arn", - "identifier", "fargate_profile_name", + "pod_execution_role_arn", "selectors", + "identifier", "cluster_name", ], True, diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index 7eb63898..9c0f49b9 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -223,7 +223,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["role_name", "assume_role_policy_document"], True], + ["state", "present", ["assume_role_policy_document", "role_name"], True], ["state", "absent", ["role_name"], True], ["state", "get", ["role_name"], True], ] diff --git a/plugins/modules/kms_alias.py b/plugins/modules/kms_alias.py index 42da74c2..c4983d97 100644 --- a/plugins/modules/kms_alias.py +++ b/plugins/modules/kms_alias.py @@ -132,7 +132,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["alias_name", "target_key_id"], True], + ["state", "present", ["target_key_id", "alias_name"], True], ["state", "absent", ["alias_name"], True], ["state", "get", ["alias_name"], True], ] diff --git a/plugins/modules/lambda_function.py b/plugins/modules/lambda_function.py index 6b9e9b92..e45d7704 100644 --- a/plugins/modules/lambda_function.py +++ b/plugins/modules/lambda_function.py @@ -571,7 +571,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["role", "code", "function_name"], True], + ["state", "present", ["role", "function_name", "code"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index 03cca111..78e540f8 100644 --- a/plugins/modules/logs_metric_filter.py +++ b/plugins/modules/logs_metric_filter.py @@ -296,11 +296,11 @@ def main(): "state", "present", [ - "identifier", - "filter_name", "log_group_name", + "filter_name", "metric_transformations", "filter_pattern", + "identifier", ], True, ], diff --git a/plugins/modules/logs_resource_policy.py b/plugins/modules/logs_resource_policy.py index 94f6ee4a..2f8cb60d 100644 --- a/plugins/modules/logs_resource_policy.py +++ b/plugins/modules/logs_resource_policy.py @@ -126,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], ] diff --git a/plugins/modules/memorydb_acl.py b/plugins/modules/memorydb_acl.py index 1f480aea..69630beb 100644 --- a/plugins/modules/memorydb_acl.py +++ b/plugins/modules/memorydb_acl.py @@ -84,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""" diff --git a/plugins/modules/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index 7ae2dcfd..211f8a6c 100644 --- a/plugins/modules/memorydb_cluster.py +++ b/plugins/modules/memorydb_cluster.py @@ -242,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""" @@ -372,7 +351,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["node_type", "acl_name", "cluster_name"], True], + ["state", "present", ["acl_name", "node_type", "cluster_name"], True], ["state", "absent", ["cluster_name"], True], ["state", "get", ["cluster_name"], True], ] diff --git a/plugins/modules/memorydb_parameter_group.py b/plugins/modules/memorydb_parameter_group.py index 2c154fc1..c903969b 100644 --- a/plugins/modules/memorydb_parameter_group.py +++ b/plugins/modules/memorydb_parameter_group.py @@ -99,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""" diff --git a/plugins/modules/memorydb_subnet_group.py b/plugins/modules/memorydb_subnet_group.py index 75d35246..41df9721 100644 --- a/plugins/modules/memorydb_subnet_group.py +++ b/plugins/modules/memorydb_subnet_group.py @@ -94,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""" diff --git a/plugins/modules/rds_custom_db_engine_version.py b/plugins/modules/rds_custom_db_engine_version.py new file mode 100644 index 00000000..61df33e9 --- /dev/null +++ b/plugins/modules/rds_custom_db_engine_version.py @@ -0,0 +1,328 @@ +#!/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 ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder + + +DOCUMENTATION = r""" +module: rds_custom_db_engine_version +short_description: Creates and manages a custom DB engine version (CEV) +description: +- Creates and manages a custom DB engine version (CEV). For more information, see + U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-customdbengineversion.html) +options: + database_installation_files_s3_bucket_name: + aliases: + - DatabaseInstallationFilesS3BucketName + description: + - The name of an Amazon S3 bucket that contains database installation files + for your CEV. For example, a valid bucket name is my-custom-installation-files. + type: str + database_installation_files_s3_prefix: + aliases: + - DatabaseInstallationFilesS3Prefix + description: + - The Amazon S3 directory that contains the database installation files for + your CEV. For example, a valid bucket name is 123456789012/cev1. + - If this setting isnt specified, no prefix is assumed. + type: str + description: + aliases: + - Description + description: + - An optional description of your CEV. + type: str + engine: + aliases: + - Engine + description: + - The database engine to use for your custom engine version (CEV). The only + supported value is custom-oracle-ee. + type: str + engine_version: + aliases: + - EngineVersion + description: + - The name of your CEV. The name format is 19.customized_string . + - For example, a valid name is 19.my_cev1. + - This setting is required for RDS Custom for Oracle, but optional for Amazon + RDS. The combination of Engine and EngineVersion is unique per customer + per Region. + 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 + 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 + kms_key_id: + aliases: + - KMSKeyId + description: + - The AWS KMS key identifier for an encrypted CEV. A symmetric KMS key is + required for RDS Custom, but optional for Amazon RDS. + type: str + manifest: + aliases: + - Manifest + description: + - The CEV manifest, which is a JSON document that describes the installation + .zip files stored in Amazon S3. Specify the name/value pairs in a file + or a quoted string. + - RDS Custom applies the patches in the order in which they are listed. + 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 + status: + aliases: + - Status + choices: + - available + - inactive + - inactive-except-restore + default: available + description: + - The availability status to be assigned to the CEV. + 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 + 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 ( + ansible_dict_to_boto3_tag_list, +) +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + scrub_none_parameters, +) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias + + +def main(): + argument_spec = dict( + state=dict( + type="str", + choices=["present", "absent", "list", "describe", "get"], + default="present", + ), + ) + + argument_spec["database_installation_files_s3_bucket_name"] = { + "type": "str", + "aliases": ["DatabaseInstallationFilesS3BucketName"], + } + argument_spec["database_installation_files_s3_prefix"] = { + "type": "str", + "aliases": ["DatabaseInstallationFilesS3Prefix"], + } + argument_spec["description"] = {"type": "str", "aliases": ["Description"]} + argument_spec["engine"] = {"type": "str", "aliases": ["Engine"]} + argument_spec["engine_version"] = {"type": "str", "aliases": ["EngineVersion"]} + argument_spec["kms_key_id"] = {"type": "str", "aliases": ["KMSKeyId"]} + argument_spec["manifest"] = {"type": "str", "aliases": ["Manifest"]} + argument_spec["status"] = { + "type": "str", + "default": "available", + "choices": ["available", "inactive", "inactive-except-restore"], + "aliases": ["Status"], + } + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "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", ["engine"], True], + [ + "state", + "present", + [ + "engine_version", + "database_installation_files_s3_bucket_name", + "identifier", + "engine", + ], + True, + ], + ["state", "absent", ["engine", "engine_version", "identifier"], True], + ["state", "get", ["engine", "engine_version", "identifier"], True], + ] + mutually_exclusive = [[("engine", "engine_version"), "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::RDS::CustomDBEngineVersion" + + params = {} + + params["database_installation_files_s3_bucket_name"] = module.params.get( + "database_installation_files_s3_bucket_name" + ) + params["database_installation_files_s3_prefix"] = module.params.get( + "database_installation_files_s3_prefix" + ) + params["description"] = module.params.get("description") + params["engine"] = module.params.get("engine") + params["engine_version"] = module.params.get("engine_version") + params["identifier"] = module.params.get("identifier") + params["kms_key_id"] = module.params.get("kms_key_id") + params["manifest"] = module.params.get("manifest") + params["status"] = module.params.get("status") + params["tags"] = module.params.get("tags") + + # The DesiredState we pass to AWS must be a JSONArray of non-null values + _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"]) + + # 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 = [ + "/properties/Engine", + "/properties/EngineVersion", + "/properties/DatabaseInstallationFilesS3BucketName", + "/properties/DatabaseInstallationFilesS3Prefix", + "/properties/KMSKeyId", + "/properties/Manifest", + ] + + # Necessary to handle when module does not support all the states + handlers = ["create", "read", "update", "delete", "list"] + + state = module.params.get("state") + identifier = ["/properties/Engine", "/properties/EngineVersion"] + if ( + state in ("present", "absent", "get", "describe") + and module.params.get("identifier") is None + ): + if not module.params.get("engine") or not module.params.get("engine_version"): + module.fail_json( + "You must specify all the ('engine', 'engine_version') 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/rds_db_cluster.py b/plugins/modules/rds_db_cluster.py new file mode 100644 index 00000000..52b30c36 --- /dev/null +++ b/plugins/modules/rds_db_cluster.py @@ -0,0 +1,995 @@ +#!/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 ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder + + +DOCUMENTATION = r""" +module: rds_db_cluster +short_description: Creates and manages an Amazon Aurora DB cluster or Multi-AZ DB + cluster +description: +- Creates and manages an Amazon Aurora DB cluster or Multi-AZ DB cluster. For more + information, see U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html) +options: + allocated_storage: + aliases: + - AllocatedStorage + description: + - The amount of storage in gibibytes (GiB) to allocate to each DB instance + in the Multi-AZ DB cluster. + type: int + associated_roles: + aliases: + - AssociatedRoles + description: + - Describes an AWS Identity and Access Management (IAM) role that is associated + with a DB cluster. + elements: dict + suboptions: + feature_name: + aliases: + - FeatureName + description: + - The name of the feature associated with the AWS Identity and Access + Management (IAM) role. + - For the list of supported feature names, see DBEngineVersion in + the Amazon RDS API Reference. + type: str + role_arn: + aliases: + - RoleArn + description: + - The Amazon Resource Name (ARN) of the IAM role that is associated + with the DB cluster. + 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 cluster during the maintenance window. + - By default, minor engine upgrades are applied automatically. + type: bool + availability_zones: + aliases: + - AvailabilityZones + description: + - A list of Availability Zones (AZs) where instances in the DB cluster can + be created. + - For information on AWS Regions and Availability Zones, see Choosing the + Regions and Availability Zones in the Amazon Aurora User Guide. + elements: str + type: list + backtrack_window: + aliases: + - BacktrackWindow + default: 0 + description: + - The target backtrack window, in seconds. + - To disable backtracking, set this value to 0. + type: int + backup_retention_period: + aliases: + - BackupRetentionPeriod + default: 1 + description: + - The number of days for which automated backups are retained. + type: int + copy_tags_to_snapshot: + aliases: + - CopyTagsToSnapshot + description: + - A value that indicates whether to copy all tags from the DB cluster to snapshots + of the DB cluster. + - The default is not to copy them. + type: bool + database_name: + aliases: + - DatabaseName + description: + - The name of your database. + - If you dont provide a name, then Amazon RDS wont create a database in this + DB cluster. + - For naming constraints, see Naming Constraints in the Amazon RDS User Guide. + type: str + db_cluster_identifier: + aliases: + - DBClusterIdentifier + description: + - The DB cluster identifier. + - This parameter is stored as a lowercase string. + type: str + db_cluster_instance_class: + aliases: + - DBClusterInstanceClass + description: + - The compute and memory capacity of each DB instance in the Multi-AZ DB cluster, + for example db.m6g.xlarge. + type: str + db_cluster_parameter_group_name: + aliases: + - DBClusterParameterGroupName + default: default.aurora5.6 + description: + - The name of the DB cluster parameter group to associate with this DB cluster. + type: str + db_instance_parameter_group_name: + aliases: + - DBInstanceParameterGroupName + description: + - The name of the DB parameter group to apply to all instances of the DB cluster. + type: str + db_subnet_group_name: + aliases: + - DBSubnetGroupName + description: + - A DB subnet group that you want to associate with this DB cluster. + type: str + db_system_id: + aliases: + - DBSystemId + description: + - Reserved for future use. + type: str + deletion_protection: + aliases: + - DeletionProtection + description: + - A value that indicates whether the DB cluster 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 cluster in. + 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. + - The values in the list depend on the DB engine being used. + - For more information, see Publishing Database Logs to Amazon CloudWatch + Logs in the Amazon Aurora User Guide. + elements: str + type: list + enable_http_endpoint: + aliases: + - EnableHttpEndpoint + description: + - A value that indicates whether to enable the HTTP endpoint for an Aurora + Serverless DB cluster. + - By default, the HTTP endpoint is disabled. + type: bool + 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 + engine: + aliases: + - Engine + description: + - The name of the database engine to be used for this DB cluster. + - 'Valid Values: aurora (for MySQL 5.6-compatible Aurora), aurora-mysql (for + MySQL 5.7-compatible Aurora), and aurora-postgresql.' + type: str + engine_mode: + aliases: + - EngineMode + description: + - The DB engine mode of the DB cluster, either provisioned, serverless, parallelquery, + global, or multimaster. + type: str + engine_version: + aliases: + - EngineVersion + description: + - The version number of the database engine to use. + 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 + global_cluster_identifier: + aliases: + - GlobalClusterIdentifier + description: + - If you are configuring an Aurora global database cluster and want your Aurora + DB cluster to be a secondary member in the global database cluster, specify + the global cluster ID of the global database cluster. + - To define the primary database cluster of the global cluster, use the AWS::RDS::GlobalCluster + resource. + - If you arent configuring a global database cluster, dont specify this property. + type: str + iops: + aliases: + - Iops + description: + - The amount of Provisioned IOPS (input/output operations per second) to be + initially allocated for each DB instance in the Multi-AZ DB cluster. + type: int + kms_key_id: + aliases: + - KmsKeyId + description: + - The Amazon Resource Name (ARN) of the AWS Key Management Service master + key that is used to encrypt the database instances in the DB cluster, + such as arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. + - If you enable the StorageEncrypted property but dont specify this property, + the default master key is used. + - If you specify this property, you must set the StorageEncrypted property + to true. + 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 master password for the DB instance. + type: str + master_username: + aliases: + - MasterUsername + description: + - The name of the master user for the DB cluster. + - You must specify MasterUsername, unless you specify SnapshotIdentifier. + - In that case, dont specify MasterUsername. + type: str + monitoring_interval: + aliases: + - MonitoringInterval + default: 0 + description: + - The interval, in seconds, between points when Enhanced Monitoring metrics + are collected for the DB cluster. + - To turn off collecting Enhanced Monitoring metrics, specify 0. + - The default is 0. + type: int + monitoring_role_arn: + aliases: + - MonitoringRoleArn + description: + - The Amazon Resource Name (ARN) for the IAM role that permits RDS to send + Enhanced Monitoring metrics to Amazon CloudWatch Logs. + type: str + network_type: + aliases: + - NetworkType + description: + - The network type of the DB cluster. + type: str + performance_insights_enabled: + aliases: + - PerformanceInsightsEnabled + description: + - A value that indicates whether to turn on Performance Insights for the DB + cluster. + type: bool + performance_insights_kms_key_id: + aliases: + - PerformanceInsightsKmsKeyId + description: + - The Amazon Web Services KMS key identifier for encryption of Performance + Insights data. + type: str + performance_insights_retention_period: + aliases: + - PerformanceInsightsRetentionPeriod + description: + - The amount of time, in days, to retain Performance Insights data. + type: int + port: + aliases: + - Port + description: + - The port number on which the instances in the DB cluster accept connections. + - 'Default: 3306 if engine is set as aurora or 5432 if set to aurora-postgresql.' + type: int + 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. + - The default is a 30-minute window selected at random from an 8-hour block + of time for each AWS Region. + - To see the time blocks available, see Adjusting the Preferred DB Cluster + Maintenance Window in the Amazon Aurora User Guide. + type: str + preferred_maintenance_window: + aliases: + - PreferredMaintenanceWindow + description: + - The weekly time range during which system maintenance can occur, in Universal + Coordinated Time (UTC). The default is a 30-minute window selected at + random from an 8-hour block of time for each AWS Region, occurring on + a random day of the week. + - To see the time blocks available, see Adjusting the Preferred DB Cluster + Maintenance Window in the Amazon Aurora User Guide. + type: str + publicly_accessible: + aliases: + - PubliclyAccessible + description: + - A value that indicates whether the DB cluster is publicly accessible. + type: bool + purge_tags: + default: true + description: + - Remove tags not listed in I(tags). + type: bool + replication_source_identifier: + aliases: + - ReplicationSourceIdentifier + description: + - The Amazon Resource Name (ARN) of the source DB instance or DB cluster if + this DB cluster is created as a Read Replica. + type: str + restore_to_time: + aliases: + - RestoreToTime + description: + - The date and time to restore the DB cluster to. + - Value must be a time in Universal Coordinated Time (UTC) format. + - 'An example: 2015-03-07C(T23):45:00Z.' + type: str + restore_type: + aliases: + - RestoreType + default: full-copy + description: + - The type of restore to be performed. + - You can specify one of the following values:. + - full-copy - The new DB cluster is restored as a full copy of the source + DB cluster. + - copy-on-write - The new DB cluster is restored as a clone of the source + DB cluster. + type: str + scaling_configuration: + aliases: + - ScalingConfiguration + description: + - The I(scaling_configuration) property type specifies the scaling configuration + of an Aurora Serverless DB cluster.The I(scaling_configuration) property + type specifies the scaling configuration of an Aurora Serverless DB cluster. + suboptions: + auto_pause: + aliases: + - AutoPause + description: + - A value that indicates whether to allow or disallow automatic pause + for an Aurora DB cluster in serverless DB engine mode. + - A DB cluster can be paused only when its idle (it has no connections). + type: bool + max_capacity: + aliases: + - MaxCapacity + description: + - The maximum capacity for an Aurora DB cluster in serverless DB engine + mode. + - For Aurora MySQL, valid capacity values are 1, 2, 4, 8, 16, 32, + 64, 128, and 256. + - For Aurora PostgreSQL, valid capacity values are 2, 4, 8, 16, 32, + 64, 192, and 384. + - The maximum capacity must be greater than or equal to the minimum + capacity. + type: int + min_capacity: + aliases: + - MinCapacity + description: + - The minimum capacity for an Aurora DB cluster in serverless DB engine + mode. + - For Aurora MySQL, valid capacity values are 1, 2, 4, 8, 16, 32, + 64, 128, and 256. + - For Aurora PostgreSQL, valid capacity values are 2, 4, 8, 16, 32, + 64, 192, and 384. + - The minimum capacity must be less than or equal to the maximum capacity. + type: int + seconds_before_timeout: + aliases: + - SecondsBeforeTimeout + description: + - The amount of time, in seconds, that Aurora Serverless v1 tries + to find a scaling point to perform seamless scaling before enforcing + the timeout action. + - The default is 300. + type: int + seconds_until_auto_pause: + aliases: + - SecondsUntilAutoPause + description: + - The time, in seconds, before an Aurora DB cluster in serverless + mode is paused. + type: int + timeout_action: + aliases: + - TimeoutAction + description: + - The action to take when the timeout is reached, either ForceApplyCapacityChange + or RollbackCapacityChange. + - ForceApplyCapacityChange sets the capacity to the specified value + as soon as possible. + - RollbackCapacityChange, the default, ignores the capacity change + if a scaling point isnt found in the timeout period. + - For more information, see Autoscaling for Aurora Serverless v1 in + the Amazon Aurora User Guide. + type: str + type: dict + serverless_v2_scaling_configuration: + aliases: + - ServerlessV2ScalingConfiguration + description: + - Contains the scaling configuration of an Aurora Serverless v2 DB cluster.Contains + the scaling configuration of an Aurora Serverless v2 DB cluster. + suboptions: + max_capacity: + aliases: + - MaxCapacity + description: + - The maximum number of Aurora capacity units (ACUs) for a DB instance + in an Aurora Serverless v2 cluster. + - You can specify ACU values in half-step increments, such as 40, + 40.5, 41, and so on. + - The largest value that you can use is 128. + type: int + min_capacity: + aliases: + - MinCapacity + description: + - The minimum number of Aurora capacity units (ACUs) for a DB instance + in an Aurora Serverless v2 cluster. + - You can specify ACU values in half-step increments, such as 8, 8.5, + 9, and so on. + - The smallest value that you can use is 0.5. + type: int + type: dict + snapshot_identifier: + aliases: + - SnapshotIdentifier + description: + - The identifier for the DB snapshot or DB cluster snapshot to restore from. + - You can use either the name or the Amazon Resource Name (ARN) to specify + a DB cluster snapshot. + - However, you can use only the ARN to specify a DB snapshot. + - After you restore a DB cluster with a SnapshotIdentifier property, you must + specify the same SnapshotIdentifier property for any future updates to + the DB cluster. + - When you specify this property for an update, the DB cluster is not restored + from the snapshot again, and the data in the database is not changed. + - However, if you dont specify the SnapshotIdentifier property, an empty DB + cluster is created, and the original DB cluster is deleted. + - If you specify a property that is different from the previous snapshot restore + property, the DB cluster is restored from the specified SnapshotIdentifier + property, and the original DB cluster is deleted. + type: str + source_db_cluster_identifier: + aliases: + - SourceDBClusterIdentifier + description: + - The identifier of the source DB cluster from which to restore. + type: str + source_region: + aliases: + - SourceRegion + description: + - The AWS Region which contains the source DB cluster when replicating a DB + cluster. + - For example, us-east-1. + 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 + storage_encrypted: + aliases: + - StorageEncrypted + description: + - Indicates whether the DB instance is encrypted. + - If you specify the DBClusterIdentifier, SnapshotIdentifier, or SourceDBInstanceIdentifier + property, dont specify this property. + - The value is inherited from the cluster, snapshot, or source DB instance. + type: bool + storage_type: + aliases: + - StorageType + description: + - Specifies the storage type to be associated with the DB 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 + use_latest_restorable_time: + aliases: + - UseLatestRestorableTime + description: + - A value that indicates whether to restore the DB cluster to the latest restorable + backup time. + - By default, the DB cluster is not restored to the latest restorable backup + time. + type: bool + vpc_security_group_ids: + aliases: + - VpcSecurityGroupIds + description: + - A list of EC2 VPC security groups to associate with this DB cluster. + elements: str + type: list + 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 ( + ansible_dict_to_boto3_tag_list, +) +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + scrub_none_parameters, +) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias + + +def main(): + argument_spec = dict( + state=dict( + type="str", + choices=["present", "absent", "list", "describe", "get"], + default="present", + ), + ) + + argument_spec["allocated_storage"] = { + "type": "int", + "aliases": ["AllocatedStorage"], + } + argument_spec["associated_roles"] = { + "type": "list", + "elements": "dict", + "options": { + "feature_name": {"type": "str", "aliases": ["FeatureName"]}, + "role_arn": {"type": "str", "aliases": ["RoleArn"]}, + }, + "aliases": ["AssociatedRoles"], + } + argument_spec["availability_zones"] = { + "type": "list", + "elements": "str", + "aliases": ["AvailabilityZones"], + } + argument_spec["auto_minor_version_upgrade"] = { + "type": "bool", + "aliases": ["AutoMinorVersionUpgrade"], + } + argument_spec["backtrack_window"] = { + "default": 0, + "type": "int", + "aliases": ["BacktrackWindow"], + } + argument_spec["backup_retention_period"] = { + "default": 1, + "type": "int", + "aliases": ["BackupRetentionPeriod"], + } + argument_spec["copy_tags_to_snapshot"] = { + "type": "bool", + "aliases": ["CopyTagsToSnapshot"], + } + argument_spec["database_name"] = {"type": "str", "aliases": ["DatabaseName"]} + argument_spec["db_cluster_instance_class"] = { + "type": "str", + "aliases": ["DBClusterInstanceClass"], + } + argument_spec["db_instance_parameter_group_name"] = { + "type": "str", + "aliases": ["DBInstanceParameterGroupName"], + } + argument_spec["db_system_id"] = {"type": "str", "aliases": ["DBSystemId"]} + argument_spec["global_cluster_identifier"] = { + "type": "str", + "aliases": ["GlobalClusterIdentifier"], + } + argument_spec["db_cluster_identifier"] = { + "type": "str", + "aliases": ["DBClusterIdentifier"], + } + argument_spec["db_cluster_parameter_group_name"] = { + "type": "str", + "default": "default.aurora5.6", + "aliases": ["DBClusterParameterGroupName"], + } + argument_spec["db_subnet_group_name"] = { + "type": "str", + "aliases": ["DBSubnetGroupName"], + } + 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_http_endpoint"] = { + "type": "bool", + "aliases": ["EnableHttpEndpoint"], + } + argument_spec["enable_iam_database_authentication"] = { + "type": "bool", + "aliases": ["EnableIAMDatabaseAuthentication"], + } + argument_spec["engine"] = {"type": "str", "aliases": ["Engine"]} + argument_spec["engine_mode"] = {"type": "str", "aliases": ["EngineMode"]} + 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["master_username"] = {"type": "str", "aliases": ["MasterUsername"]} + argument_spec["master_user_password"] = { + "type": "str", + "aliases": ["MasterUserPassword"], + } + argument_spec["monitoring_interval"] = { + "type": "int", + "default": 0, + "aliases": ["MonitoringInterval"], + } + argument_spec["monitoring_role_arn"] = { + "type": "str", + "aliases": ["MonitoringRoleArn"], + } + argument_spec["network_type"] = {"type": "str", "aliases": ["NetworkType"]} + argument_spec["performance_insights_enabled"] = { + "type": "bool", + "aliases": ["PerformanceInsightsEnabled"], + } + 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": "int", "aliases": ["Port"]} + argument_spec["preferred_backup_window"] = { + "type": "str", + "aliases": ["PreferredBackupWindow"], + } + argument_spec["preferred_maintenance_window"] = { + "type": "str", + "aliases": ["PreferredMaintenanceWindow"], + } + argument_spec["publicly_accessible"] = { + "type": "bool", + "aliases": ["PubliclyAccessible"], + } + argument_spec["replication_source_identifier"] = { + "type": "str", + "aliases": ["ReplicationSourceIdentifier"], + } + argument_spec["restore_to_time"] = {"type": "str", "aliases": ["RestoreToTime"]} + argument_spec["restore_type"] = { + "type": "str", + "default": "full-copy", + "aliases": ["RestoreType"], + } + argument_spec["serverless_v2_scaling_configuration"] = { + "type": "dict", + "options": { + "min_capacity": {"type": "int", "aliases": ["MinCapacity"]}, + "max_capacity": {"type": "int", "aliases": ["MaxCapacity"]}, + }, + "aliases": ["ServerlessV2ScalingConfiguration"], + } + argument_spec["scaling_configuration"] = { + "type": "dict", + "options": { + "auto_pause": {"type": "bool", "aliases": ["AutoPause"]}, + "max_capacity": {"type": "int", "aliases": ["MaxCapacity"]}, + "min_capacity": {"type": "int", "aliases": ["MinCapacity"]}, + "seconds_before_timeout": { + "type": "int", + "aliases": ["SecondsBeforeTimeout"], + }, + "seconds_until_auto_pause": { + "type": "int", + "aliases": ["SecondsUntilAutoPause"], + }, + "timeout_action": {"type": "str", "aliases": ["TimeoutAction"]}, + }, + "aliases": ["ScalingConfiguration"], + } + argument_spec["snapshot_identifier"] = { + "type": "str", + "aliases": ["SnapshotIdentifier"], + } + argument_spec["source_db_cluster_identifier"] = { + "type": "str", + "aliases": ["SourceDBClusterIdentifier"], + } + 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["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} + argument_spec["use_latest_restorable_time"] = { + "type": "bool", + "aliases": ["UseLatestRestorableTime"], + } + argument_spec["vpc_security_group_ids"] = { + "type": "list", + "elements": "str", + "aliases": ["VpcSecurityGroupIds"], + } + 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", ["db_cluster_identifier"], True], + ["state", "absent", ["db_cluster_identifier"], True], + ["state", "get", ["db_cluster_identifier"], 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::RDS::DBCluster" + + params = {} + + params["allocated_storage"] = module.params.get("allocated_storage") + params["associated_roles"] = module.params.get("associated_roles") + params["auto_minor_version_upgrade"] = module.params.get( + "auto_minor_version_upgrade" + ) + params["availability_zones"] = module.params.get("availability_zones") + params["backtrack_window"] = module.params.get("backtrack_window") + params["backup_retention_period"] = module.params.get("backup_retention_period") + params["copy_tags_to_snapshot"] = module.params.get("copy_tags_to_snapshot") + params["database_name"] = module.params.get("database_name") + params["db_cluster_identifier"] = module.params.get("db_cluster_identifier") + params["db_cluster_instance_class"] = module.params.get("db_cluster_instance_class") + params["db_cluster_parameter_group_name"] = module.params.get( + "db_cluster_parameter_group_name" + ) + params["db_instance_parameter_group_name"] = module.params.get( + "db_instance_parameter_group_name" + ) + params["db_subnet_group_name"] = module.params.get("db_subnet_group_name") + params["db_system_id"] = module.params.get("db_system_id") + params["deletion_protection"] = module.params.get("deletion_protection") + params["domain"] = module.params.get("domain") + params["domain_iam_role_name"] = module.params.get("domain_iam_role_name") + params["enable_cloudwatch_logs_exports"] = module.params.get( + "enable_cloudwatch_logs_exports" + ) + params["enable_http_endpoint"] = module.params.get("enable_http_endpoint") + params["enable_iam_database_authentication"] = module.params.get( + "enable_iam_database_authentication" + ) + params["engine"] = module.params.get("engine") + params["engine_mode"] = module.params.get("engine_mode") + params["engine_version"] = module.params.get("engine_version") + params["global_cluster_identifier"] = module.params.get("global_cluster_identifier") + params["iops"] = module.params.get("iops") + params["kms_key_id"] = module.params.get("kms_key_id") + params["manage_master_user_password"] = module.params.get( + "manage_master_user_password" + ) + params["master_user_password"] = module.params.get("master_user_password") + params["master_username"] = module.params.get("master_username") + params["monitoring_interval"] = module.params.get("monitoring_interval") + params["monitoring_role_arn"] = module.params.get("monitoring_role_arn") + params["network_type"] = module.params.get("network_type") + params["performance_insights_enabled"] = module.params.get( + "performance_insights_enabled" + ) + params["performance_insights_kms_key_id"] = module.params.get( + "performance_insights_kms_key_id" + ) + 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" + ) + params["publicly_accessible"] = module.params.get("publicly_accessible") + params["replication_source_identifier"] = module.params.get( + "replication_source_identifier" + ) + params["restore_to_time"] = module.params.get("restore_to_time") + params["restore_type"] = module.params.get("restore_type") + params["scaling_configuration"] = module.params.get("scaling_configuration") + params["serverless_v2_scaling_configuration"] = module.params.get( + "serverless_v2_scaling_configuration" + ) + params["snapshot_identifier"] = module.params.get("snapshot_identifier") + params["source_db_cluster_identifier"] = module.params.get( + "source_db_cluster_identifier" + ) + params["source_region"] = module.params.get("source_region") + params["storage_encrypted"] = module.params.get("storage_encrypted") + params["storage_type"] = module.params.get("storage_type") + params["tags"] = module.params.get("tags") + params["use_latest_restorable_time"] = module.params.get( + "use_latest_restorable_time" + ) + 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 = 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"]) + + # 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 = [ + "/properties/AvailabilityZones", + "/properties/DBClusterIdentifier", + "/properties/DBSubnetGroupName", + "/properties/DBSystemId", + "/properties/DatabaseName", + "/properties/EngineMode", + "/properties/KmsKeyId", + "/properties/PubliclyAccessible", + "/properties/RestoreToTime", + "/properties/RestoreType", + "/properties/SnapshotIdentifier", + "/properties/SourceDBClusterIdentifier", + "/properties/SourceRegion", + "/properties/StorageEncrypted", + "/properties/UseLatestRestorableTime", + ] + + # Necessary to handle when module does not support all the states + handlers = ["create", "read", "update", "delete", "list"] + + state = module.params.get("state") + identifier = ["/properties/DBClusterIdentifier"] + + 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/rds_db_cluster_parameter_group.py b/plugins/modules/rds_db_cluster_parameter_group.py index 6a2b5369..926588d6 100644 --- a/plugins/modules/rds_db_cluster_parameter_group.py +++ b/plugins/modules/rds_db_cluster_parameter_group.py @@ -166,7 +166,7 @@ def main(): [ "state", "present", - ["description", "db_cluster_parameter_group_name", "parameters", "family"], + ["family", "parameters", "description", "db_cluster_parameter_group_name"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], diff --git a/plugins/modules/rds_db_parameter_group.py b/plugins/modules/rds_db_parameter_group.py new file mode 100644 index 00000000..fdd88709 --- /dev/null +++ b/plugins/modules/rds_db_parameter_group.py @@ -0,0 +1,242 @@ +#!/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 ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder + + +DOCUMENTATION = r""" +module: rds_db_parameter_group +short_description: Creates and manages a custom parameter group for an RDS database + family +description: +- Creates and manages a custom parameter group for an RDS database family. For more + information, see U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbparametergroup.html) +options: + db_parameter_group_name: + aliases: + - DBParameterGroupName + description: + - Specifies the name of the DB parameter group. + type: str + description: + aliases: + - Description + description: + - Provides the customer-specified description for this DB parameter group. + type: str + family: + aliases: + - Family + description: + - The DB parameter group family name. + 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 + parameters: + aliases: + - Parameters + description: + - An array of parameter names and values for the parameter update. + type: dict + 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: + - 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 + 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 ( + ansible_dict_to_boto3_tag_list, +) +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + scrub_none_parameters, +) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias + + +def main(): + argument_spec = dict( + state=dict( + type="str", + choices=["present", "absent", "list", "describe", "get"], + default="present", + ), + ) + + argument_spec["db_parameter_group_name"] = { + "type": "str", + "aliases": ["DBParameterGroupName"], + } + argument_spec["description"] = {"type": "str", "aliases": ["Description"]} + argument_spec["family"] = {"type": "str", "aliases": ["Family"]} + argument_spec["parameters"] = {"type": "dict", "aliases": ["Parameters"]} + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "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", + ["family", "db_parameter_group_name", "description"], + True, + ], + ["state", "absent", ["db_parameter_group_name"], True], + ["state", "get", ["db_parameter_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::RDS::DBParameterGroup" + + params = {} + + params["db_parameter_group_name"] = module.params.get("db_parameter_group_name") + params["description"] = module.params.get("description") + params["family"] = module.params.get("family") + params["parameters"] = module.params.get("parameters") + params["tags"] = module.params.get("tags") + + # The DesiredState we pass to AWS must be a JSONArray of non-null values + _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"]) + + # 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 = [ + "/properties/DBParameterGroupName", + "/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 = ["/properties/DBParameterGroupName"] + + 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/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index be789cda..4312b537 100644 --- a/plugins/modules/rds_db_proxy.py +++ b/plugins/modules/rds_db_proxy.py @@ -299,7 +299,7 @@ def main(): [ "state", "present", - ["role_arn", "engine_family", "db_proxy_name", "vpc_subnet_ids", "auth"], + ["vpc_subnet_ids", "role_arn", "auth", "db_proxy_name", "engine_family"], True, ], ["state", "absent", ["db_proxy_name"], True], diff --git a/plugins/modules/rds_db_proxy_endpoint.py b/plugins/modules/rds_db_proxy_endpoint.py index 573b355e..5754d2da 100644 --- a/plugins/modules/rds_db_proxy_endpoint.py +++ b/plugins/modules/rds_db_proxy_endpoint.py @@ -191,7 +191,7 @@ def main(): [ "state", "present", - ["db_proxy_endpoint_name", "db_proxy_name", "vpc_subnet_ids"], + ["vpc_subnet_ids", "db_proxy_endpoint_name", "db_proxy_name"], True, ], ["state", "absent", ["db_proxy_endpoint_name"], True], diff --git a/plugins/modules/rds_event_subscription.py b/plugins/modules/rds_event_subscription.py new file mode 100644 index 00000000..f981990d --- /dev/null +++ b/plugins/modules/rds_event_subscription.py @@ -0,0 +1,274 @@ +#!/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 ansible.content_builder. +# See: https://github.com/ansible-community/ansible.content_builder + + +DOCUMENTATION = r""" +module: rds_event_subscription +short_description: Allows you to receive notifications for Amazon Relational Database + Service events through the Amazon Simple Notification Service (Amazon SNS) +description: +- Allows you to receive notifications for Amazon Relational Database Service events + through the Amazon Simple Notification Service (Amazon SNS). For more information, + see U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-eventsubscription.html) +options: + enabled: + aliases: + - Enabled + default: true + description: + - A Boolean value; set to true to activate the subscription, set to false + to create the subscription but not active it. + type: bool + event_categories: + aliases: + - EventCategories + description: + - A list of event categories for a SourceType that you want to subscribe to. + - You can see a list of the categories for a given SourceType in the Events + topic in the Amazon RDS User Guide or by using the DescribeEventCategories + action. + elements: str + type: list + 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 + sns_topic_arn: + aliases: + - SnsTopicArn + description: + - The Amazon Resource Name (ARN) of the SNS topic created for event notification. + - The ARN is created by Amazon SNS when you create a topic and subscribe to + it. + type: str + source_ids: + aliases: + - SourceIds + description: + - The list of identifiers of the event sources for which events will be returned. + - If not specified, then all sources are included in the response. + - An identifier must begin with a letter and must contain only ASCII letters, + digits, and hyphens; it cannot end with a hyphen or contain two consecutive + hyphens. + elements: str + type: list + source_type: + aliases: + - SourceType + description: + - The type of source that will be generating the events. + - For example, if you want to be notified of events generated by a DB instance, + you would set this parameter to db-instance. if this value is not specified, + all events are returned. + 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 + subscription_name: + aliases: + - SubscriptionName + description: + - The name of the subscription. + 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 + 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 ( + ansible_dict_to_boto3_tag_list, +) +from ansible_collections.amazon.cloud.plugins.module_utils.core import ( + scrub_none_parameters, +) +from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias + + +def main(): + argument_spec = dict( + state=dict( + type="str", + choices=["present", "absent", "list", "describe", "get"], + default="present", + ), + ) + + argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} + argument_spec["subscription_name"] = { + "type": "str", + "aliases": ["SubscriptionName"], + } + argument_spec["enabled"] = {"type": "bool", "default": True, "aliases": ["Enabled"]} + argument_spec["event_categories"] = { + "type": "list", + "elements": "str", + "aliases": ["EventCategories"], + } + argument_spec["sns_topic_arn"] = {"type": "str", "aliases": ["SnsTopicArn"]} + argument_spec["source_ids"] = { + "type": "list", + "elements": "str", + "aliases": ["SourceIds"], + } + argument_spec["source_type"] = {"type": "str", "aliases": ["SourceType"]} + 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", ["sns_topic_arn", "subscription_name"], True], + ["state", "absent", ["subscription_name"], True], + ["state", "get", ["subscription_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::RDS::EventSubscription" + + params = {} + + params["enabled"] = module.params.get("enabled") + params["event_categories"] = module.params.get("event_categories") + params["sns_topic_arn"] = module.params.get("sns_topic_arn") + params["source_ids"] = module.params.get("source_ids") + params["source_type"] = module.params.get("source_type") + params["subscription_name"] = module.params.get("subscription_name") + params["tags"] = module.params.get("tags") + + # The DesiredState we pass to AWS must be a JSONArray of non-null values + _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"]) + + # 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 = ["/properties/SubscriptionName", "/properties/SnsTopicArn"] + + # Necessary to handle when module does not support all the states + handlers = ["create", "read", "update", "delete", "list"] + + state = module.params.get("state") + identifier = ["/properties/SubscriptionName"] + + 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/rds_option_group.py b/plugins/modules/rds_option_group.py index 98fb3f77..cc0691f9 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -257,10 +257,10 @@ def main(): "state", "present", [ - "major_engine_version", - "option_group_name", "option_group_description", "engine_name", + "option_group_name", + "major_engine_version", ], True, ], diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index 8f8d86c8..0484efa9 100644 --- a/plugins/modules/redshift_cluster.py +++ b/plugins/modules/redshift_cluster.py @@ -650,12 +650,12 @@ def main(): "state", "present", [ - "db_name", - "node_type", - "cluster_identifier", - "master_username", "master_user_password", "cluster_type", + "cluster_identifier", + "node_type", + "db_name", + "master_username", ], True, ], diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index 570efaf1..ff5b3b9c 100644 --- a/plugins/modules/redshift_endpoint_access.py +++ b/plugins/modules/redshift_endpoint_access.py @@ -163,10 +163,10 @@ def main(): "state", "present", [ + "vpc_security_group_ids", + "subnet_group_name", "cluster_identifier", "endpoint_name", - "subnet_group_name", - "vpc_security_group_ids", ], True, ], diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index 62825806..8f26dc6f 100644 --- a/plugins/modules/redshift_endpoint_authorization.py +++ b/plugins/modules/redshift_endpoint_authorization.py @@ -151,7 +151,7 @@ def main(): required_if = [ ["state", "list", ["cluster_identifier"], True], - ["state", "present", ["cluster_identifier", "identifier", "account"], True], + ["state", "present", ["account", "cluster_identifier", "identifier"], True], ["state", "absent", ["cluster_identifier", "account", "identifier"], True], ["state", "get", ["cluster_identifier", "account", "identifier"], True], ] diff --git a/plugins/modules/route53_key_signing_key.py b/plugins/modules/route53_key_signing_key.py index 5f17e8df..2fde8611 100644 --- a/plugins/modules/route53_key_signing_key.py +++ b/plugins/modules/route53_key_signing_key.py @@ -166,11 +166,11 @@ def main(): "state", "present", [ - "key_management_service_arn", "status", - "identifier", "hosted_zone_id", "name", + "key_management_service_arn", + "identifier", ], True, ], diff --git a/plugins/modules/s3_multi_region_access_point_policy.py b/plugins/modules/s3_multi_region_access_point_policy.py index 85001fd2..3ff03691 100644 --- a/plugins/modules/s3_multi_region_access_point_policy.py +++ b/plugins/modules/s3_multi_region_access_point_policy.py @@ -126,7 +126,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["policy", "mrap_name"], True], + ["state", "present", ["mrap_name", "policy"], True], ["state", "absent", ["mrap_name"], True], ["state", "get", ["mrap_name"], True], ] diff --git a/plugins/modules/s3objectlambda_access_point.py b/plugins/modules/s3objectlambda_access_point.py index 0f250b93..5bf255e0 100644 --- a/plugins/modules/s3objectlambda_access_point.py +++ b/plugins/modules/s3objectlambda_access_point.py @@ -244,7 +244,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["object_lambda_configuration", "name"], True], + ["state", "present", ["name", "object_lambda_configuration"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/s3objectlambda_access_point_policy.py b/plugins/modules/s3objectlambda_access_point_policy.py index 136621bb..ec3091d7 100644 --- a/plugins/modules/s3objectlambda_access_point_policy.py +++ b/plugins/modules/s3objectlambda_access_point_policy.py @@ -130,7 +130,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["policy_document", "object_lambda_access_point"], True], + ["state", "present", ["object_lambda_access_point", "policy_document"], True], ["state", "absent", ["object_lambda_access_point"], True], ["state", "get", ["object_lambda_access_point"], True], ] diff --git a/plugins/modules/wafv2_web_acl_association.py b/plugins/modules/wafv2_web_acl_association.py index 7d679a6c..04705061 100644 --- a/plugins/modules/wafv2_web_acl_association.py +++ b/plugins/modules/wafv2_web_acl_association.py @@ -136,7 +136,7 @@ def main(): required_if = [ ["state", "list", ["resource_arn"], True], - ["state", "present", ["identifier", "web_acl_arn", "resource_arn"], True], + ["state", "present", ["identifier", "resource_arn", "web_acl_arn"], True], ["state", "absent", ["resource_arn", "web_acl_arn", "identifier"], True], ["state", "get", ["resource_arn", "web_acl_arn", "identifier"], True], ] diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 501d6b15..1e20bc22 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -499,6 +499,51 @@ 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/rds_custom_db_engine_version.py compile-2.7!skip +plugins/modules/rds_custom_db_engine_version.py compile-3.5!skip +plugins/modules/rds_custom_db_engine_version.py import-2.7!skip +plugins/modules/rds_custom_db_engine_version.py import-3.5!skip +plugins/modules/rds_custom_db_engine_version.py future-import-boilerplate!skip +plugins/modules/rds_custom_db_engine_version.py metaclass-boilerplate!skip +plugins/modules/rds_custom_db_engine_version.py compile-2.6!skip +plugins/modules/rds_custom_db_engine_version.py import-2.6!skip +plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_cluster.py compile-2.7!skip +plugins/modules/rds_db_cluster.py compile-3.5!skip +plugins/modules/rds_db_cluster.py import-2.7!skip +plugins/modules/rds_db_cluster.py import-3.5!skip +plugins/modules/rds_db_cluster.py future-import-boilerplate!skip +plugins/modules/rds_db_cluster.py metaclass-boilerplate!skip +plugins/modules/rds_db_cluster.py compile-2.6!skip +plugins/modules/rds_db_cluster.py import-2.6!skip +plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_parameter_group.py compile-2.7!skip +plugins/modules/rds_db_parameter_group.py compile-3.5!skip +plugins/modules/rds_db_parameter_group.py import-2.7!skip +plugins/modules/rds_db_parameter_group.py import-3.5!skip +plugins/modules/rds_db_parameter_group.py future-import-boilerplate!skip +plugins/modules/rds_db_parameter_group.py metaclass-boilerplate!skip +plugins/modules/rds_db_parameter_group.py compile-2.6!skip +plugins/modules/rds_db_parameter_group.py import-2.6!skip +plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_event_subscription.py compile-2.7!skip +plugins/modules/rds_event_subscription.py compile-3.5!skip +plugins/modules/rds_event_subscription.py import-2.7!skip +plugins/modules/rds_event_subscription.py import-3.5!skip +plugins/modules/rds_event_subscription.py future-import-boilerplate!skip +plugins/modules/rds_event_subscription.py metaclass-boilerplate!skip +plugins/modules/rds_event_subscription.py compile-2.6!skip +plugins/modules/rds_event_subscription.py import-2.6!skip +plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_proxy_target_group.py compile-2.7!skip +plugins/modules/rds_db_proxy_target_group.py compile-3.5!skip +plugins/modules/rds_db_proxy_target_group.py import-2.7!skip +plugins/modules/rds_db_proxy_target_group.py import-3.5!skip +plugins/modules/rds_db_proxy_target_group.py future-import-boilerplate!skip +plugins/modules/rds_db_proxy_target_group.py metaclass-boilerplate!skip +plugins/modules/rds_db_proxy_target_group.py compile-2.6!skip +plugins/modules/rds_db_proxy_target_group.py import-2.6!skip +plugins/modules/rds_db_proxy_target_group.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 @@ -507,3 +552,4 @@ plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusiv 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_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 index 61bf59fd..a8f0aeb0 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -498,6 +498,51 @@ 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/rds_custom_db_engine_version.py compile-2.7!skip +plugins/modules/rds_custom_db_engine_version.py compile-3.5!skip +plugins/modules/rds_custom_db_engine_version.py import-2.7!skip +plugins/modules/rds_custom_db_engine_version.py import-3.5!skip +plugins/modules/rds_custom_db_engine_version.py future-import-boilerplate!skip +plugins/modules/rds_custom_db_engine_version.py metaclass-boilerplate!skip +plugins/modules/rds_custom_db_engine_version.py compile-2.6!skip +plugins/modules/rds_custom_db_engine_version.py import-2.6!skip +plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_cluster.py compile-2.7!skip +plugins/modules/rds_db_cluster.py compile-3.5!skip +plugins/modules/rds_db_cluster.py import-2.7!skip +plugins/modules/rds_db_cluster.py import-3.5!skip +plugins/modules/rds_db_cluster.py future-import-boilerplate!skip +plugins/modules/rds_db_cluster.py metaclass-boilerplate!skip +plugins/modules/rds_db_cluster.py compile-2.6!skip +plugins/modules/rds_db_cluster.py import-2.6!skip +plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_parameter_group.py compile-2.7!skip +plugins/modules/rds_db_parameter_group.py compile-3.5!skip +plugins/modules/rds_db_parameter_group.py import-2.7!skip +plugins/modules/rds_db_parameter_group.py import-3.5!skip +plugins/modules/rds_db_parameter_group.py future-import-boilerplate!skip +plugins/modules/rds_db_parameter_group.py metaclass-boilerplate!skip +plugins/modules/rds_db_parameter_group.py compile-2.6!skip +plugins/modules/rds_db_parameter_group.py import-2.6!skip +plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_event_subscription.py compile-2.7!skip +plugins/modules/rds_event_subscription.py compile-3.5!skip +plugins/modules/rds_event_subscription.py import-2.7!skip +plugins/modules/rds_event_subscription.py import-3.5!skip +plugins/modules/rds_event_subscription.py future-import-boilerplate!skip +plugins/modules/rds_event_subscription.py metaclass-boilerplate!skip +plugins/modules/rds_event_subscription.py compile-2.6!skip +plugins/modules/rds_event_subscription.py import-2.6!skip +plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_proxy_target_group.py compile-2.7!skip +plugins/modules/rds_db_proxy_target_group.py compile-3.5!skip +plugins/modules/rds_db_proxy_target_group.py import-2.7!skip +plugins/modules/rds_db_proxy_target_group.py import-3.5!skip +plugins/modules/rds_db_proxy_target_group.py future-import-boilerplate!skip +plugins/modules/rds_db_proxy_target_group.py metaclass-boilerplate!skip +plugins/modules/rds_db_proxy_target_group.py compile-2.6!skip +plugins/modules/rds_db_proxy_target_group.py import-2.6!skip +plugins/modules/rds_db_proxy_target_group.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 @@ -506,3 +551,4 @@ plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusiv 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_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 index a5facba4..fb4629ba 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -66,6 +66,11 @@ 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/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_proxy_target_group.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 @@ -74,3 +79,9 @@ plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusiv 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_web_acl_association.py validate-modules:mutually_exclusive-type +plugins/modules/rds_custom_db_engine_version.py validate-modules:mutually_exclusive-type +plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_cluster.py validate-modules:no-log-needed +plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index 732b8179..45975dc3 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -66,6 +66,11 @@ 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/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_proxy_target_group.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 @@ -74,5 +79,10 @@ plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusiv 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_web_acl_association.py validate-modules:mutually_exclusive-type -plugins/modules/memorydb_user.py validate-modules:no-log-needed +plugins/modules/rds_custom_db_engine_version.py validate-modules:mutually_exclusive-type +plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_cluster.py validate-modules:no-log-needed +plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice tools/update_constants.py shebang!skip diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 732b8179..45975dc3 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -66,6 +66,11 @@ 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/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_proxy_target_group.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 @@ -74,5 +79,10 @@ plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusiv 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_web_acl_association.py validate-modules:mutually_exclusive-type -plugins/modules/memorydb_user.py validate-modules:no-log-needed +plugins/modules/rds_custom_db_engine_version.py validate-modules:mutually_exclusive-type +plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_cluster.py validate-modules:no-log-needed +plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice tools/update_constants.py shebang!skip diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 732b8179..8165138c 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -1,3 +1,11 @@ +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_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/eks_cluster.py validate-modules:no-log-needed @@ -66,13 +74,11 @@ 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/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_web_acl_association.py validate-modules:mutually_exclusive-type plugins/modules/memorydb_user.py validate-modules:no-log-needed +plugins/modules/rds_custom_db_engine_version.py validate-modules:mutually_exclusive-type +plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_cluster.py validate-modules:no-log-needed +plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice tools/update_constants.py shebang!skip diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index e3496db4..8165138c 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -75,4 +75,10 @@ plugins/modules/memorydb_parameter_group.py validate-modules:parameter-state-inv 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 +plugins/modules/rds_custom_db_engine_version.py validate-modules:mutually_exclusive-type +plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_cluster.py validate-modules:no-log-needed +plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice +plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice tools/update_constants.py shebang!skip diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index 24d8e87f..6ef02315 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -22,7 +22,7 @@ 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 -lugins/modules/eks_cluster.py compile-2.7!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 plugins/modules/eks_cluster.py import-3.5!skip @@ -430,6 +430,46 @@ 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/rds_custom_db_engine_version.py compile-2.7!skip +plugins/modules/rds_custom_db_engine_version.py compile-3.5!skip +plugins/modules/rds_custom_db_engine_version.py import-2.7!skip +plugins/modules/rds_custom_db_engine_version.py import-3.5!skip +plugins/modules/rds_custom_db_engine_version.py future-import-boilerplate!skip +plugins/modules/rds_custom_db_engine_version.py metaclass-boilerplate!skip +plugins/modules/rds_custom_db_engine_version.py compile-2.6!skip +plugins/modules/rds_custom_db_engine_version.py import-2.6!skip +plugins/modules/rds_db_cluster.py compile-2.7!skip +plugins/modules/rds_db_cluster.py compile-3.5!skip +plugins/modules/rds_db_cluster.py import-2.7!skip +plugins/modules/rds_db_cluster.py import-3.5!skip +plugins/modules/rds_db_cluster.py future-import-boilerplate!skip +plugins/modules/rds_db_cluster.py metaclass-boilerplate!skip +plugins/modules/rds_db_cluster.py compile-2.6!skip +plugins/modules/rds_db_cluster.py import-2.6!skip +plugins/modules/rds_db_parameter_group.py compile-2.7!skip +plugins/modules/rds_db_parameter_group.py compile-3.5!skip +plugins/modules/rds_db_parameter_group.py import-2.7!skip +plugins/modules/rds_db_parameter_group.py import-3.5!skip +plugins/modules/rds_db_parameter_group.py future-import-boilerplate!skip +plugins/modules/rds_db_parameter_group.py metaclass-boilerplate!skip +plugins/modules/rds_db_parameter_group.py compile-2.6!skip +plugins/modules/rds_db_parameter_group.py import-2.6!skip +plugins/modules/rds_event_subscription.py compile-2.7!skip +plugins/modules/rds_event_subscription.py compile-3.5!skip +plugins/modules/rds_event_subscription.py import-2.7!skip +plugins/modules/rds_event_subscription.py import-3.5!skip +plugins/modules/rds_event_subscription.py future-import-boilerplate!skip +plugins/modules/rds_event_subscription.py metaclass-boilerplate!skip +plugins/modules/rds_event_subscription.py compile-2.6!skip +plugins/modules/rds_event_subscription.py import-2.6!skip +plugins/modules/rds_db_proxy_target_group.py compile-2.7!skip +plugins/modules/rds_db_proxy_target_group.py compile-3.5!skip +plugins/modules/rds_db_proxy_target_group.py import-2.7!skip +plugins/modules/rds_db_proxy_target_group.py import-3.5!skip +plugins/modules/rds_db_proxy_target_group.py future-import-boilerplate!skip +plugins/modules/rds_db_proxy_target_group.py metaclass-boilerplate!skip +plugins/modules/rds_db_proxy_target_group.py compile-2.6!skip +plugins/modules/rds_db_proxy_target_group.py import-2.6!skip 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 @@ -438,3 +478,5 @@ plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusiv 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_web_acl_association.py validate-modules:mutually_exclusive-type +lugins/modules/eks_cluster.py compile-2.7!skip + From fabcac31a4e6dc02845a53bdb1624e0af6543e18 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 9 Aug 2023 21:07:20 +0200 Subject: [PATCH 16/32] Update Signed-off-by: Alina Buzachis --- meta/runtime.yml | 1 - plugins/modules/autoscaling_lifecycle_hook.py | 4 ++-- plugins/modules/cloudtrail_trail.py | 2 +- plugins/modules/cloudwatch_composite_alarm.py | 2 +- plugins/modules/cloudwatch_metric_stream.py | 2 +- plugins/modules/dynamodb_global_table.py | 2 +- .../modules/ecs_cluster_capacity_provider_associations.py | 2 +- plugins/modules/ecs_primary_task_set.py | 2 +- plugins/modules/eks_addon.py | 2 +- plugins/modules/eks_cluster.py | 2 +- plugins/modules/eks_fargate_profile.py | 6 +++--- plugins/modules/iam_instance_profile.py | 2 +- plugins/modules/iam_role.py | 2 +- plugins/modules/kms_alias.py | 2 +- plugins/modules/lambda_function.py | 2 +- plugins/modules/logs_metric_filter.py | 4 ++-- plugins/modules/logs_resource_policy.py | 2 +- plugins/modules/memorydb_cluster.py | 2 +- plugins/modules/memorydb_subnet_group.py | 2 +- plugins/modules/rds_custom_db_engine_version.py | 4 ++-- plugins/modules/rds_db_cluster_parameter_group.py | 2 +- plugins/modules/rds_db_parameter_group.py | 2 +- plugins/modules/rds_db_proxy.py | 2 +- plugins/modules/rds_db_proxy_endpoint.py | 2 +- plugins/modules/rds_db_subnet_group.py | 2 +- plugins/modules/rds_option_group.py | 4 ++-- plugins/modules/redshift_cluster.py | 6 +++--- plugins/modules/redshift_endpoint_access.py | 4 ++-- plugins/modules/redshift_endpoint_authorization.py | 2 +- plugins/modules/route53_key_signing_key.py | 2 +- plugins/modules/s3_multi_region_access_point.py | 2 +- plugins/modules/s3_multi_region_access_point_policy.py | 2 +- plugins/modules/s3objectlambda_access_point_policy.py | 2 +- plugins/modules/wafv2_logging_configuration.py | 2 +- plugins/modules/wafv2_web_acl_association.py | 2 +- tests/sanity/ignore-2.13.txt | 8 +------- tests/sanity/ignore-2.14.txt | 5 +---- tests/sanity/ignore-2.15.txt | 4 ---- tests/sanity/ignore-2.16.txt | 4 ---- 39 files changed, 45 insertions(+), 63 deletions(-) diff --git a/meta/runtime.yml b/meta/runtime.yml index 1bf3754a..227359eb 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -57,7 +57,6 @@ action_groups: - rds_db_cluster - rds_db_parameter_group - rds_event_subscription - - rds_db_proxy_target_group - rdsdb_proxy - s3_object_lambda_access_point - s3_object_lambda_access_point_policy diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index 3afd1b57..de0db2ec 100644 --- a/plugins/modules/autoscaling_lifecycle_hook.py +++ b/plugins/modules/autoscaling_lifecycle_hook.py @@ -221,10 +221,10 @@ def main(): "state", "present", [ - "identifier", - "auto_scaling_group_name", "lifecycle_transition", "lifecycle_hook_name", + "identifier", + "auto_scaling_group_name", ], True, ], diff --git a/plugins/modules/cloudtrail_trail.py b/plugins/modules/cloudtrail_trail.py index a7ab0c43..079987a7 100644 --- a/plugins/modules/cloudtrail_trail.py +++ b/plugins/modules/cloudtrail_trail.py @@ -519,7 +519,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["s3_bucket_name", "trail_name", "is_logging"], True], + ["state", "present", ["is_logging", "s3_bucket_name", "trail_name"], True], ["state", "absent", ["trail_name"], True], ["state", "get", ["trail_name"], True], ] diff --git a/plugins/modules/cloudwatch_composite_alarm.py b/plugins/modules/cloudwatch_composite_alarm.py index 06633172..dcacb5dd 100644 --- a/plugins/modules/cloudwatch_composite_alarm.py +++ b/plugins/modules/cloudwatch_composite_alarm.py @@ -219,7 +219,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["alarm_rule", "alarm_name"], True], + ["state", "present", ["alarm_name", "alarm_rule"], True], ["state", "absent", ["alarm_name"], True], ["state", "get", ["alarm_name"], True], ] diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index d30f2f96..f666a389 100644 --- a/plugins/modules/cloudwatch_metric_stream.py +++ b/plugins/modules/cloudwatch_metric_stream.py @@ -306,7 +306,7 @@ def main(): [ "state", "present", - ["firehose_arn", "output_format", "name", "role_arn"], + ["name", "firehose_arn", "output_format", "role_arn"], True, ], ["state", "absent", ["name"], True], diff --git a/plugins/modules/dynamodb_global_table.py b/plugins/modules/dynamodb_global_table.py index 087824e9..8c09c2ab 100644 --- a/plugins/modules/dynamodb_global_table.py +++ b/plugins/modules/dynamodb_global_table.py @@ -1048,7 +1048,7 @@ def main(): [ "state", "present", - ["table_name", "attribute_definitions", "replicas", "key_schema"], + ["replicas", "table_name", "attribute_definitions", "key_schema"], True, ], ["state", "absent", ["table_name"], True], diff --git a/plugins/modules/ecs_cluster_capacity_provider_associations.py b/plugins/modules/ecs_cluster_capacity_provider_associations.py index c71fb4ea..b24e81ed 100644 --- a/plugins/modules/ecs_cluster_capacity_provider_associations.py +++ b/plugins/modules/ecs_cluster_capacity_provider_associations.py @@ -173,7 +173,7 @@ def main(): [ "state", "present", - ["default_capacity_provider_strategy", "capacity_providers", "cluster"], + ["cluster", "capacity_providers", "default_capacity_provider_strategy"], True, ], ["state", "absent", ["cluster"], True], diff --git a/plugins/modules/ecs_primary_task_set.py b/plugins/modules/ecs_primary_task_set.py index eba815b2..6a611b2b 100644 --- a/plugins/modules/ecs_primary_task_set.py +++ b/plugins/modules/ecs_primary_task_set.py @@ -146,7 +146,7 @@ def main(): required_if = [ ["state", "list", ["cluster"], True], - ["state", "present", ["task_set_id", "identifier", "cluster", "service"], True], + ["state", "present", ["cluster", "service", "task_set_id", "identifier"], True], ["state", "absent", ["cluster", "service", "identifier"], True], ["state", "get", ["cluster", "service", "identifier"], True], ] diff --git a/plugins/modules/eks_addon.py b/plugins/modules/eks_addon.py index 722a7e68..a4fa3e64 100644 --- a/plugins/modules/eks_addon.py +++ b/plugins/modules/eks_addon.py @@ -205,7 +205,7 @@ def main(): required_if = [ ["state", "list", ["cluster_name"], True], - ["state", "present", ["addon_name", "identifier", "cluster_name"], True], + ["state", "present", ["identifier", "cluster_name", "addon_name"], True], ["state", "absent", ["cluster_name", "addon_name", "identifier"], True], ["state", "get", ["cluster_name", "addon_name", "identifier"], True], ] diff --git a/plugins/modules/eks_cluster.py b/plugins/modules/eks_cluster.py index d0af3619..8f3307be 100644 --- a/plugins/modules/eks_cluster.py +++ b/plugins/modules/eks_cluster.py @@ -445,7 +445,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["resources_vpc_config", "name", "role_arn"], True], + ["state", "present", ["name", "resources_vpc_config", "role_arn"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/eks_fargate_profile.py b/plugins/modules/eks_fargate_profile.py index df7ef920..7dd44666 100644 --- a/plugins/modules/eks_fargate_profile.py +++ b/plugins/modules/eks_fargate_profile.py @@ -328,11 +328,11 @@ def main(): "state", "present", [ - "fargate_profile_name", - "pod_execution_role_arn", "selectors", - "identifier", "cluster_name", + "pod_execution_role_arn", + "fargate_profile_name", + "identifier", ], True, ], diff --git a/plugins/modules/iam_instance_profile.py b/plugins/modules/iam_instance_profile.py index 36e08315..09005cb0 100644 --- a/plugins/modules/iam_instance_profile.py +++ b/plugins/modules/iam_instance_profile.py @@ -139,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], ] diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index 9c0f49b9..7eb63898 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -223,7 +223,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["assume_role_policy_document", "role_name"], True], + ["state", "present", ["role_name", "assume_role_policy_document"], True], ["state", "absent", ["role_name"], True], ["state", "get", ["role_name"], True], ] diff --git a/plugins/modules/kms_alias.py b/plugins/modules/kms_alias.py index c4983d97..42da74c2 100644 --- a/plugins/modules/kms_alias.py +++ b/plugins/modules/kms_alias.py @@ -132,7 +132,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["target_key_id", "alias_name"], True], + ["state", "present", ["alias_name", "target_key_id"], True], ["state", "absent", ["alias_name"], True], ["state", "get", ["alias_name"], True], ] diff --git a/plugins/modules/lambda_function.py b/plugins/modules/lambda_function.py index e45d7704..0651c0c6 100644 --- a/plugins/modules/lambda_function.py +++ b/plugins/modules/lambda_function.py @@ -571,7 +571,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["role", "function_name", "code"], True], + ["state", "present", ["function_name", "role", "code"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index 78e540f8..c4337118 100644 --- a/plugins/modules/logs_metric_filter.py +++ b/plugins/modules/logs_metric_filter.py @@ -296,10 +296,10 @@ def main(): "state", "present", [ - "log_group_name", "filter_name", - "metric_transformations", + "log_group_name", "filter_pattern", + "metric_transformations", "identifier", ], True, diff --git a/plugins/modules/logs_resource_policy.py b/plugins/modules/logs_resource_policy.py index 2f8cb60d..94f6ee4a 100644 --- a/plugins/modules/logs_resource_policy.py +++ b/plugins/modules/logs_resource_policy.py @@ -126,7 +126,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["policy_name", "policy_document"], True], + ["state", "present", ["policy_document", "policy_name"], True], ["state", "absent", ["policy_name"], True], ["state", "get", ["policy_name"], True], ] diff --git a/plugins/modules/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index 211f8a6c..e7df7a03 100644 --- a/plugins/modules/memorydb_cluster.py +++ b/plugins/modules/memorydb_cluster.py @@ -351,7 +351,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["acl_name", "node_type", "cluster_name"], True], + ["state", "present", ["acl_name", "cluster_name", "node_type"], True], ["state", "absent", ["cluster_name"], True], ["state", "get", ["cluster_name"], True], ] diff --git a/plugins/modules/memorydb_subnet_group.py b/plugins/modules/memorydb_subnet_group.py index 41df9721..f2e46b9b 100644 --- a/plugins/modules/memorydb_subnet_group.py +++ b/plugins/modules/memorydb_subnet_group.py @@ -157,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], ] diff --git a/plugins/modules/rds_custom_db_engine_version.py b/plugins/modules/rds_custom_db_engine_version.py index 61df33e9..cc7cb6d6 100644 --- a/plugins/modules/rds_custom_db_engine_version.py +++ b/plugins/modules/rds_custom_db_engine_version.py @@ -224,10 +224,10 @@ def main(): "state", "present", [ - "engine_version", "database_installation_files_s3_bucket_name", - "identifier", + "engine_version", "engine", + "identifier", ], True, ], diff --git a/plugins/modules/rds_db_cluster_parameter_group.py b/plugins/modules/rds_db_cluster_parameter_group.py index 926588d6..53869c93 100644 --- a/plugins/modules/rds_db_cluster_parameter_group.py +++ b/plugins/modules/rds_db_cluster_parameter_group.py @@ -166,7 +166,7 @@ def main(): [ "state", "present", - ["family", "parameters", "description", "db_cluster_parameter_group_name"], + ["parameters", "db_cluster_parameter_group_name", "family", "description"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], diff --git a/plugins/modules/rds_db_parameter_group.py b/plugins/modules/rds_db_parameter_group.py index fdd88709..7e70c805 100644 --- a/plugins/modules/rds_db_parameter_group.py +++ b/plugins/modules/rds_db_parameter_group.py @@ -162,7 +162,7 @@ def main(): [ "state", "present", - ["family", "db_parameter_group_name", "description"], + ["db_parameter_group_name", "family", "description"], True, ], ["state", "absent", ["db_parameter_group_name"], True], diff --git a/plugins/modules/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index 4312b537..fe82636a 100644 --- a/plugins/modules/rds_db_proxy.py +++ b/plugins/modules/rds_db_proxy.py @@ -299,7 +299,7 @@ def main(): [ "state", "present", - ["vpc_subnet_ids", "role_arn", "auth", "db_proxy_name", "engine_family"], + ["db_proxy_name", "engine_family", "auth", "role_arn", "vpc_subnet_ids"], True, ], ["state", "absent", ["db_proxy_name"], True], diff --git a/plugins/modules/rds_db_proxy_endpoint.py b/plugins/modules/rds_db_proxy_endpoint.py index 5754d2da..1ba3ab43 100644 --- a/plugins/modules/rds_db_proxy_endpoint.py +++ b/plugins/modules/rds_db_proxy_endpoint.py @@ -191,7 +191,7 @@ def main(): [ "state", "present", - ["vpc_subnet_ids", "db_proxy_endpoint_name", "db_proxy_name"], + ["vpc_subnet_ids", "db_proxy_name", "db_proxy_endpoint_name"], True, ], ["state", "absent", ["db_proxy_endpoint_name"], True], diff --git a/plugins/modules/rds_db_subnet_group.py b/plugins/modules/rds_db_subnet_group.py index 58863b20..45cdb5bd 100644 --- a/plugins/modules/rds_db_subnet_group.py +++ b/plugins/modules/rds_db_subnet_group.py @@ -163,7 +163,7 @@ def main(): [ "state", "present", - ["db_subnet_group_description", "db_subnet_group_name", "subnet_ids"], + ["db_subnet_group_description", "subnet_ids", "db_subnet_group_name"], True, ], ["state", "absent", ["db_subnet_group_name"], True], diff --git a/plugins/modules/rds_option_group.py b/plugins/modules/rds_option_group.py index cc0691f9..98fb3f77 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -257,10 +257,10 @@ def main(): "state", "present", [ + "major_engine_version", + "option_group_name", "option_group_description", "engine_name", - "option_group_name", - "major_engine_version", ], True, ], diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index 0484efa9..68a4817b 100644 --- a/plugins/modules/redshift_cluster.py +++ b/plugins/modules/redshift_cluster.py @@ -650,11 +650,11 @@ def main(): "state", "present", [ - "master_user_password", - "cluster_type", "cluster_identifier", - "node_type", "db_name", + "cluster_type", + "node_type", + "master_user_password", "master_username", ], True, diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index ff5b3b9c..f98f2cc6 100644 --- a/plugins/modules/redshift_endpoint_access.py +++ b/plugins/modules/redshift_endpoint_access.py @@ -163,10 +163,10 @@ def main(): "state", "present", [ + "endpoint_name", "vpc_security_group_ids", - "subnet_group_name", "cluster_identifier", - "endpoint_name", + "subnet_group_name", ], True, ], diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index 8f26dc6f..80eb4753 100644 --- a/plugins/modules/redshift_endpoint_authorization.py +++ b/plugins/modules/redshift_endpoint_authorization.py @@ -151,7 +151,7 @@ def main(): required_if = [ ["state", "list", ["cluster_identifier"], True], - ["state", "present", ["account", "cluster_identifier", "identifier"], True], + ["state", "present", ["account", "identifier", "cluster_identifier"], True], ["state", "absent", ["cluster_identifier", "account", "identifier"], True], ["state", "get", ["cluster_identifier", "account", "identifier"], True], ] diff --git a/plugins/modules/route53_key_signing_key.py b/plugins/modules/route53_key_signing_key.py index 2fde8611..63aa8309 100644 --- a/plugins/modules/route53_key_signing_key.py +++ b/plugins/modules/route53_key_signing_key.py @@ -166,10 +166,10 @@ def main(): "state", "present", [ - "status", "hosted_zone_id", "name", "key_management_service_arn", + "status", "identifier", ], True, diff --git a/plugins/modules/s3_multi_region_access_point.py b/plugins/modules/s3_multi_region_access_point.py index 2a31c536..1673f2a5 100644 --- a/plugins/modules/s3_multi_region_access_point.py +++ b/plugins/modules/s3_multi_region_access_point.py @@ -222,7 +222,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["regions", "name"], True], + ["state", "present", ["name", "regions"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/s3_multi_region_access_point_policy.py b/plugins/modules/s3_multi_region_access_point_policy.py index 3ff03691..85001fd2 100644 --- a/plugins/modules/s3_multi_region_access_point_policy.py +++ b/plugins/modules/s3_multi_region_access_point_policy.py @@ -126,7 +126,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["mrap_name", "policy"], True], + ["state", "present", ["policy", "mrap_name"], True], ["state", "absent", ["mrap_name"], True], ["state", "get", ["mrap_name"], True], ] diff --git a/plugins/modules/s3objectlambda_access_point_policy.py b/plugins/modules/s3objectlambda_access_point_policy.py index ec3091d7..136621bb 100644 --- a/plugins/modules/s3objectlambda_access_point_policy.py +++ b/plugins/modules/s3objectlambda_access_point_policy.py @@ -130,7 +130,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["object_lambda_access_point", "policy_document"], True], + ["state", "present", ["policy_document", "object_lambda_access_point"], True], ["state", "absent", ["object_lambda_access_point"], True], ["state", "get", ["object_lambda_access_point"], True], ] diff --git a/plugins/modules/wafv2_logging_configuration.py b/plugins/modules/wafv2_logging_configuration.py index 87667fd7..b085e09f 100644 --- a/plugins/modules/wafv2_logging_configuration.py +++ b/plugins/modules/wafv2_logging_configuration.py @@ -448,7 +448,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["log_destination_configs", "resource_arn"], True], + ["state", "present", ["resource_arn", "log_destination_configs"], True], ["state", "absent", ["resource_arn"], True], ["state", "get", ["resource_arn"], True], ] diff --git a/plugins/modules/wafv2_web_acl_association.py b/plugins/modules/wafv2_web_acl_association.py index 04705061..cb7fc97f 100644 --- a/plugins/modules/wafv2_web_acl_association.py +++ b/plugins/modules/wafv2_web_acl_association.py @@ -136,7 +136,7 @@ def main(): required_if = [ ["state", "list", ["resource_arn"], True], - ["state", "present", ["identifier", "resource_arn", "web_acl_arn"], 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], ] diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index 45975dc3..8487aa5c 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -66,11 +66,11 @@ 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 plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_proxy_target_group.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 @@ -79,10 +79,4 @@ plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusiv 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_web_acl_association.py validate-modules:mutually_exclusive-type -plugins/modules/rds_custom_db_engine_version.py validate-modules:mutually_exclusive-type -plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_cluster.py validate-modules:no-log-needed -plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice tools/update_constants.py shebang!skip diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 45975dc3..e706a966 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -80,9 +80,6 @@ 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_web_acl_association.py validate-modules:mutually_exclusive-type plugins/modules/rds_custom_db_engine_version.py validate-modules:mutually_exclusive-type -plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_cluster.py validate-modules:no-log-needed -plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_event_subscription.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.15.txt b/tests/sanity/ignore-2.15.txt index 8165138c..1d129041 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -76,9 +76,5 @@ plugins/modules/memorydb_subnet_group.py validate-modules:parameter-state-invali plugins/modules/memorydb_user.py validate-modules:parameter-state-invalid-choice plugins/modules/memorydb_user.py validate-modules:no-log-needed plugins/modules/rds_custom_db_engine_version.py validate-modules:mutually_exclusive-type -plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_cluster.py validate-modules:no-log-needed -plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice tools/update_constants.py shebang!skip diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index 8165138c..1d129041 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -76,9 +76,5 @@ plugins/modules/memorydb_subnet_group.py validate-modules:parameter-state-invali plugins/modules/memorydb_user.py validate-modules:parameter-state-invalid-choice plugins/modules/memorydb_user.py validate-modules:no-log-needed plugins/modules/rds_custom_db_engine_version.py validate-modules:mutually_exclusive-type -plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice plugins/modules/rds_db_cluster.py validate-modules:no-log-needed -plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice tools/update_constants.py shebang!skip From 17e16336d3c35fab8ba3276ac687d7df5e7a661d Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Thu, 10 Aug 2023 14:37:48 +0200 Subject: [PATCH 17/32] Re-generate Signed-off-by: Alina Buzachis --- config/modules.yaml | 29 - meta/runtime.yml | 4 - plugins/modules/autoscaling_lifecycle_hook.py | 2 +- plugins/modules/cloudwatch_composite_alarm.py | 2 +- plugins/modules/cloudwatch_metric_stream.py | 2 +- plugins/modules/dynamodb_global_table.py | 2 +- ..._cluster_capacity_provider_associations.py | 2 +- plugins/modules/ecs_primary_task_set.py | 2 +- plugins/modules/eks_addon.py | 2 +- plugins/modules/eks_cluster.py | 2 +- plugins/modules/eks_fargate_profile.py | 2 +- plugins/modules/iam_role.py | 2 +- plugins/modules/kms_alias.py | 2 +- plugins/modules/lambda_function.py | 2 +- plugins/modules/logs_metric_filter.py | 4 +- plugins/modules/logs_resource_policy.py | 2 +- plugins/modules/memorydb_cluster.py | 2 +- .../modules/rds_custom_db_engine_version.py | 328 ------ plugins/modules/rds_db_cluster.py | 995 ------------------ .../modules/rds_db_cluster_parameter_group.py | 2 +- plugins/modules/rds_db_parameter_group.py | 242 ----- plugins/modules/rds_db_proxy.py | 2 +- plugins/modules/rds_db_proxy_endpoint.py | 2 +- plugins/modules/rds_db_subnet_group.py | 2 +- plugins/modules/rds_event_subscription.py | 274 ----- plugins/modules/rds_option_group.py | 6 +- plugins/modules/redshift_cluster.py | 4 +- plugins/modules/redshift_endpoint_access.py | 4 +- .../redshift_endpoint_authorization.py | 2 +- plugins/modules/route53_key_signing_key.py | 6 +- plugins/modules/s3_access_point.py | 2 +- .../modules/s3_multi_region_access_point.py | 2 +- .../s3_multi_region_access_point_policy.py | 2 +- .../modules/s3objectlambda_access_point.py | 2 +- .../s3objectlambda_access_point_policy.py | 2 +- plugins/modules/ssm_document.py | 2 +- tests/integration/targets/memorydb/aliases | 3 + tests/sanity/ignore-2.10.txt | 46 - tests/sanity/ignore-2.11.txt | 46 - tests/sanity/ignore-2.12.txt | 11 - tests/sanity/ignore-2.13.txt | 6 +- tests/sanity/ignore-2.14.txt | 7 - tests/sanity/ignore-2.15.txt | 2 - tests/sanity/ignore-2.16.txt | 2 - tests/sanity/ignore-2.9.txt | 41 - 45 files changed, 41 insertions(+), 2069 deletions(-) delete mode 100644 plugins/modules/rds_custom_db_engine_version.py delete mode 100644 plugins/modules/rds_db_cluster.py delete mode 100644 plugins/modules/rds_db_parameter_group.py delete mode 100644 plugins/modules/rds_event_subscription.py diff --git a/config/modules.yaml b/config/modules.yaml index 7e606ec8..4da4f34f 100644 --- a/config/modules.yaml +++ b/config/modules.yaml @@ -409,32 +409,3 @@ - Creates a MemoryDB user. For more information, see U(https://docs.aws.amazon.com/memorydb/latest/devguide/clusters.acls.html) resource: AWS::MemoryDB::User -# 0.5.0 -- rds_custom_db_engine_version: - documentation: - short_description: Creates and manages a custom DB engine version (CEV) - description: - - Creates and manages a custom DB engine version (CEV). For more information, see - U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-customdbengineversion.html) - resource: AWS::RDS::CustomDBEngineVersion -- rds_db_cluster: - documentation: - short_description: Creates and manages an Amazon Aurora DB cluster or Multi-AZ DB cluster - description: - - Creates and manages an Amazon Aurora DB cluster or Multi-AZ DB cluster. For more information, see - U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html) - resource: AWS::RDS::DBCluster -- rds_db_parameter_group: - documentation: - short_description: Creates and manages a custom parameter group for an RDS database family - description: - - Creates and manages a custom parameter group for an RDS database family. For more information, see - U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbparametergroup.html) - resource: AWS::RDS::DBParameterGroup -- rds_event_subscription: - documentation: - short_description: Allows you to receive notifications for Amazon Relational Database Service events through the Amazon Simple Notification Service (Amazon SNS) - description: - - Allows you to receive notifications for Amazon Relational Database Service events through the Amazon Simple Notification Service (Amazon SNS). For more information, see - U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-eventsubscription.html) - resource: AWS::RDS::EventSubscription diff --git a/meta/runtime.yml b/meta/runtime.yml index 227359eb..d6c510bb 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -53,10 +53,6 @@ action_groups: - memorydb_parameter_group - memorydb_subnet_group - memorydb_user - - rds_custom_db_engine_version - - rds_db_cluster - - rds_db_parameter_group - - rds_event_subscription - rdsdb_proxy - s3_object_lambda_access_point - s3_object_lambda_access_point_policy diff --git a/plugins/modules/autoscaling_lifecycle_hook.py b/plugins/modules/autoscaling_lifecycle_hook.py index de0db2ec..3d2a111a 100644 --- a/plugins/modules/autoscaling_lifecycle_hook.py +++ b/plugins/modules/autoscaling_lifecycle_hook.py @@ -222,9 +222,9 @@ def main(): "present", [ "lifecycle_transition", - "lifecycle_hook_name", "identifier", "auto_scaling_group_name", + "lifecycle_hook_name", ], True, ], diff --git a/plugins/modules/cloudwatch_composite_alarm.py b/plugins/modules/cloudwatch_composite_alarm.py index dcacb5dd..06633172 100644 --- a/plugins/modules/cloudwatch_composite_alarm.py +++ b/plugins/modules/cloudwatch_composite_alarm.py @@ -219,7 +219,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["alarm_name", "alarm_rule"], True], + ["state", "present", ["alarm_rule", "alarm_name"], True], ["state", "absent", ["alarm_name"], True], ["state", "get", ["alarm_name"], True], ] diff --git a/plugins/modules/cloudwatch_metric_stream.py b/plugins/modules/cloudwatch_metric_stream.py index f666a389..646534f3 100644 --- a/plugins/modules/cloudwatch_metric_stream.py +++ b/plugins/modules/cloudwatch_metric_stream.py @@ -306,7 +306,7 @@ def main(): [ "state", "present", - ["name", "firehose_arn", "output_format", "role_arn"], + ["role_arn", "name", "output_format", "firehose_arn"], True, ], ["state", "absent", ["name"], True], diff --git a/plugins/modules/dynamodb_global_table.py b/plugins/modules/dynamodb_global_table.py index 8c09c2ab..afe5297f 100644 --- a/plugins/modules/dynamodb_global_table.py +++ b/plugins/modules/dynamodb_global_table.py @@ -1048,7 +1048,7 @@ def main(): [ "state", "present", - ["replicas", "table_name", "attribute_definitions", "key_schema"], + ["attribute_definitions", "replicas", "table_name", "key_schema"], True, ], ["state", "absent", ["table_name"], True], diff --git a/plugins/modules/ecs_cluster_capacity_provider_associations.py b/plugins/modules/ecs_cluster_capacity_provider_associations.py index b24e81ed..49da41f2 100644 --- a/plugins/modules/ecs_cluster_capacity_provider_associations.py +++ b/plugins/modules/ecs_cluster_capacity_provider_associations.py @@ -173,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], diff --git a/plugins/modules/ecs_primary_task_set.py b/plugins/modules/ecs_primary_task_set.py index 6a611b2b..8c7498c0 100644 --- a/plugins/modules/ecs_primary_task_set.py +++ b/plugins/modules/ecs_primary_task_set.py @@ -146,7 +146,7 @@ def main(): required_if = [ ["state", "list", ["cluster"], True], - ["state", "present", ["cluster", "service", "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], ] diff --git a/plugins/modules/eks_addon.py b/plugins/modules/eks_addon.py index a4fa3e64..26624075 100644 --- a/plugins/modules/eks_addon.py +++ b/plugins/modules/eks_addon.py @@ -205,7 +205,7 @@ def main(): required_if = [ ["state", "list", ["cluster_name"], True], - ["state", "present", ["identifier", "cluster_name", "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], ] diff --git a/plugins/modules/eks_cluster.py b/plugins/modules/eks_cluster.py index 8f3307be..009caa55 100644 --- a/plugins/modules/eks_cluster.py +++ b/plugins/modules/eks_cluster.py @@ -445,7 +445,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["name", "resources_vpc_config", "role_arn"], True], + ["state", "present", ["role_arn", "name", "resources_vpc_config"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/eks_fargate_profile.py b/plugins/modules/eks_fargate_profile.py index 7dd44666..6070ed89 100644 --- a/plugins/modules/eks_fargate_profile.py +++ b/plugins/modules/eks_fargate_profile.py @@ -329,10 +329,10 @@ def main(): "present", [ "selectors", - "cluster_name", "pod_execution_role_arn", "fargate_profile_name", "identifier", + "cluster_name", ], True, ], diff --git a/plugins/modules/iam_role.py b/plugins/modules/iam_role.py index 7eb63898..9c0f49b9 100644 --- a/plugins/modules/iam_role.py +++ b/plugins/modules/iam_role.py @@ -223,7 +223,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["role_name", "assume_role_policy_document"], True], + ["state", "present", ["assume_role_policy_document", "role_name"], True], ["state", "absent", ["role_name"], True], ["state", "get", ["role_name"], True], ] diff --git a/plugins/modules/kms_alias.py b/plugins/modules/kms_alias.py index 42da74c2..c4983d97 100644 --- a/plugins/modules/kms_alias.py +++ b/plugins/modules/kms_alias.py @@ -132,7 +132,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["alias_name", "target_key_id"], True], + ["state", "present", ["target_key_id", "alias_name"], True], ["state", "absent", ["alias_name"], True], ["state", "get", ["alias_name"], True], ] diff --git a/plugins/modules/lambda_function.py b/plugins/modules/lambda_function.py index 0651c0c6..bae9dfaa 100644 --- a/plugins/modules/lambda_function.py +++ b/plugins/modules/lambda_function.py @@ -571,7 +571,7 @@ def main(): argument_spec["purge_tags"] = {"type": "bool", "default": True} required_if = [ - ["state", "present", ["function_name", "role", "code"], True], + ["state", "present", ["code", "function_name", "role"], True], ["state", "absent", ["function_name"], True], ["state", "get", ["function_name"], True], ] diff --git a/plugins/modules/logs_metric_filter.py b/plugins/modules/logs_metric_filter.py index c4337118..c18e1bae 100644 --- a/plugins/modules/logs_metric_filter.py +++ b/plugins/modules/logs_metric_filter.py @@ -296,11 +296,11 @@ def main(): "state", "present", [ - "filter_name", - "log_group_name", "filter_pattern", + "filter_name", "metric_transformations", "identifier", + "log_group_name", ], True, ], diff --git a/plugins/modules/logs_resource_policy.py b/plugins/modules/logs_resource_policy.py index 94f6ee4a..2f8cb60d 100644 --- a/plugins/modules/logs_resource_policy.py +++ b/plugins/modules/logs_resource_policy.py @@ -126,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], ] diff --git a/plugins/modules/memorydb_cluster.py b/plugins/modules/memorydb_cluster.py index e7df7a03..07a36a3c 100644 --- a/plugins/modules/memorydb_cluster.py +++ b/plugins/modules/memorydb_cluster.py @@ -351,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], ] diff --git a/plugins/modules/rds_custom_db_engine_version.py b/plugins/modules/rds_custom_db_engine_version.py deleted file mode 100644 index cc7cb6d6..00000000 --- a/plugins/modules/rds_custom_db_engine_version.py +++ /dev/null @@ -1,328 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -DOCUMENTATION = r""" -module: rds_custom_db_engine_version -short_description: Creates and manages a custom DB engine version (CEV) -description: -- Creates and manages a custom DB engine version (CEV). For more information, see - U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-customdbengineversion.html) -options: - database_installation_files_s3_bucket_name: - aliases: - - DatabaseInstallationFilesS3BucketName - description: - - The name of an Amazon S3 bucket that contains database installation files - for your CEV. For example, a valid bucket name is my-custom-installation-files. - type: str - database_installation_files_s3_prefix: - aliases: - - DatabaseInstallationFilesS3Prefix - description: - - The Amazon S3 directory that contains the database installation files for - your CEV. For example, a valid bucket name is 123456789012/cev1. - - If this setting isnt specified, no prefix is assumed. - type: str - description: - aliases: - - Description - description: - - An optional description of your CEV. - type: str - engine: - aliases: - - Engine - description: - - The database engine to use for your custom engine version (CEV). The only - supported value is custom-oracle-ee. - type: str - engine_version: - aliases: - - EngineVersion - description: - - The name of your CEV. The name format is 19.customized_string . - - For example, a valid name is 19.my_cev1. - - This setting is required for RDS Custom for Oracle, but optional for Amazon - RDS. The combination of Engine and EngineVersion is unique per customer - per Region. - 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 - 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 - kms_key_id: - aliases: - - KMSKeyId - description: - - The AWS KMS key identifier for an encrypted CEV. A symmetric KMS key is - required for RDS Custom, but optional for Amazon RDS. - type: str - manifest: - aliases: - - Manifest - description: - - The CEV manifest, which is a JSON document that describes the installation - .zip files stored in Amazon S3. Specify the name/value pairs in a file - or a quoted string. - - RDS Custom applies the patches in the order in which they are listed. - 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 - status: - aliases: - - Status - choices: - - available - - inactive - - inactive-except-restore - default: available - description: - - The availability status to be assigned to the CEV. - 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 - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["database_installation_files_s3_bucket_name"] = { - "type": "str", - "aliases": ["DatabaseInstallationFilesS3BucketName"], - } - argument_spec["database_installation_files_s3_prefix"] = { - "type": "str", - "aliases": ["DatabaseInstallationFilesS3Prefix"], - } - argument_spec["description"] = {"type": "str", "aliases": ["Description"]} - argument_spec["engine"] = {"type": "str", "aliases": ["Engine"]} - argument_spec["engine_version"] = {"type": "str", "aliases": ["EngineVersion"]} - argument_spec["kms_key_id"] = {"type": "str", "aliases": ["KMSKeyId"]} - argument_spec["manifest"] = {"type": "str", "aliases": ["Manifest"]} - argument_spec["status"] = { - "type": "str", - "default": "available", - "choices": ["available", "inactive", "inactive-except-restore"], - "aliases": ["Status"], - } - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "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", ["engine"], True], - [ - "state", - "present", - [ - "database_installation_files_s3_bucket_name", - "engine_version", - "engine", - "identifier", - ], - True, - ], - ["state", "absent", ["engine", "engine_version", "identifier"], True], - ["state", "get", ["engine", "engine_version", "identifier"], True], - ] - mutually_exclusive = [[("engine", "engine_version"), "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::RDS::CustomDBEngineVersion" - - params = {} - - params["database_installation_files_s3_bucket_name"] = module.params.get( - "database_installation_files_s3_bucket_name" - ) - params["database_installation_files_s3_prefix"] = module.params.get( - "database_installation_files_s3_prefix" - ) - params["description"] = module.params.get("description") - params["engine"] = module.params.get("engine") - params["engine_version"] = module.params.get("engine_version") - params["identifier"] = module.params.get("identifier") - params["kms_key_id"] = module.params.get("kms_key_id") - params["manifest"] = module.params.get("manifest") - params["status"] = module.params.get("status") - params["tags"] = module.params.get("tags") - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _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"]) - - # 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 = [ - "/properties/Engine", - "/properties/EngineVersion", - "/properties/DatabaseInstallationFilesS3BucketName", - "/properties/DatabaseInstallationFilesS3Prefix", - "/properties/KMSKeyId", - "/properties/Manifest", - ] - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["/properties/Engine", "/properties/EngineVersion"] - if ( - state in ("present", "absent", "get", "describe") - and module.params.get("identifier") is None - ): - if not module.params.get("engine") or not module.params.get("engine_version"): - module.fail_json( - "You must specify all the ('engine', 'engine_version') 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/rds_db_cluster.py b/plugins/modules/rds_db_cluster.py deleted file mode 100644 index 52b30c36..00000000 --- a/plugins/modules/rds_db_cluster.py +++ /dev/null @@ -1,995 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -DOCUMENTATION = r""" -module: rds_db_cluster -short_description: Creates and manages an Amazon Aurora DB cluster or Multi-AZ DB - cluster -description: -- Creates and manages an Amazon Aurora DB cluster or Multi-AZ DB cluster. For more - information, see U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html) -options: - allocated_storage: - aliases: - - AllocatedStorage - description: - - The amount of storage in gibibytes (GiB) to allocate to each DB instance - in the Multi-AZ DB cluster. - type: int - associated_roles: - aliases: - - AssociatedRoles - description: - - Describes an AWS Identity and Access Management (IAM) role that is associated - with a DB cluster. - elements: dict - suboptions: - feature_name: - aliases: - - FeatureName - description: - - The name of the feature associated with the AWS Identity and Access - Management (IAM) role. - - For the list of supported feature names, see DBEngineVersion in - the Amazon RDS API Reference. - type: str - role_arn: - aliases: - - RoleArn - description: - - The Amazon Resource Name (ARN) of the IAM role that is associated - with the DB cluster. - 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 cluster during the maintenance window. - - By default, minor engine upgrades are applied automatically. - type: bool - availability_zones: - aliases: - - AvailabilityZones - description: - - A list of Availability Zones (AZs) where instances in the DB cluster can - be created. - - For information on AWS Regions and Availability Zones, see Choosing the - Regions and Availability Zones in the Amazon Aurora User Guide. - elements: str - type: list - backtrack_window: - aliases: - - BacktrackWindow - default: 0 - description: - - The target backtrack window, in seconds. - - To disable backtracking, set this value to 0. - type: int - backup_retention_period: - aliases: - - BackupRetentionPeriod - default: 1 - description: - - The number of days for which automated backups are retained. - type: int - copy_tags_to_snapshot: - aliases: - - CopyTagsToSnapshot - description: - - A value that indicates whether to copy all tags from the DB cluster to snapshots - of the DB cluster. - - The default is not to copy them. - type: bool - database_name: - aliases: - - DatabaseName - description: - - The name of your database. - - If you dont provide a name, then Amazon RDS wont create a database in this - DB cluster. - - For naming constraints, see Naming Constraints in the Amazon RDS User Guide. - type: str - db_cluster_identifier: - aliases: - - DBClusterIdentifier - description: - - The DB cluster identifier. - - This parameter is stored as a lowercase string. - type: str - db_cluster_instance_class: - aliases: - - DBClusterInstanceClass - description: - - The compute and memory capacity of each DB instance in the Multi-AZ DB cluster, - for example db.m6g.xlarge. - type: str - db_cluster_parameter_group_name: - aliases: - - DBClusterParameterGroupName - default: default.aurora5.6 - description: - - The name of the DB cluster parameter group to associate with this DB cluster. - type: str - db_instance_parameter_group_name: - aliases: - - DBInstanceParameterGroupName - description: - - The name of the DB parameter group to apply to all instances of the DB cluster. - type: str - db_subnet_group_name: - aliases: - - DBSubnetGroupName - description: - - A DB subnet group that you want to associate with this DB cluster. - type: str - db_system_id: - aliases: - - DBSystemId - description: - - Reserved for future use. - type: str - deletion_protection: - aliases: - - DeletionProtection - description: - - A value that indicates whether the DB cluster 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 cluster in. - 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. - - The values in the list depend on the DB engine being used. - - For more information, see Publishing Database Logs to Amazon CloudWatch - Logs in the Amazon Aurora User Guide. - elements: str - type: list - enable_http_endpoint: - aliases: - - EnableHttpEndpoint - description: - - A value that indicates whether to enable the HTTP endpoint for an Aurora - Serverless DB cluster. - - By default, the HTTP endpoint is disabled. - type: bool - 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 - engine: - aliases: - - Engine - description: - - The name of the database engine to be used for this DB cluster. - - 'Valid Values: aurora (for MySQL 5.6-compatible Aurora), aurora-mysql (for - MySQL 5.7-compatible Aurora), and aurora-postgresql.' - type: str - engine_mode: - aliases: - - EngineMode - description: - - The DB engine mode of the DB cluster, either provisioned, serverless, parallelquery, - global, or multimaster. - type: str - engine_version: - aliases: - - EngineVersion - description: - - The version number of the database engine to use. - 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 - global_cluster_identifier: - aliases: - - GlobalClusterIdentifier - description: - - If you are configuring an Aurora global database cluster and want your Aurora - DB cluster to be a secondary member in the global database cluster, specify - the global cluster ID of the global database cluster. - - To define the primary database cluster of the global cluster, use the AWS::RDS::GlobalCluster - resource. - - If you arent configuring a global database cluster, dont specify this property. - type: str - iops: - aliases: - - Iops - description: - - The amount of Provisioned IOPS (input/output operations per second) to be - initially allocated for each DB instance in the Multi-AZ DB cluster. - type: int - kms_key_id: - aliases: - - KmsKeyId - description: - - The Amazon Resource Name (ARN) of the AWS Key Management Service master - key that is used to encrypt the database instances in the DB cluster, - such as arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. - - If you enable the StorageEncrypted property but dont specify this property, - the default master key is used. - - If you specify this property, you must set the StorageEncrypted property - to true. - 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 master password for the DB instance. - type: str - master_username: - aliases: - - MasterUsername - description: - - The name of the master user for the DB cluster. - - You must specify MasterUsername, unless you specify SnapshotIdentifier. - - In that case, dont specify MasterUsername. - type: str - monitoring_interval: - aliases: - - MonitoringInterval - default: 0 - description: - - The interval, in seconds, between points when Enhanced Monitoring metrics - are collected for the DB cluster. - - To turn off collecting Enhanced Monitoring metrics, specify 0. - - The default is 0. - type: int - monitoring_role_arn: - aliases: - - MonitoringRoleArn - description: - - The Amazon Resource Name (ARN) for the IAM role that permits RDS to send - Enhanced Monitoring metrics to Amazon CloudWatch Logs. - type: str - network_type: - aliases: - - NetworkType - description: - - The network type of the DB cluster. - type: str - performance_insights_enabled: - aliases: - - PerformanceInsightsEnabled - description: - - A value that indicates whether to turn on Performance Insights for the DB - cluster. - type: bool - performance_insights_kms_key_id: - aliases: - - PerformanceInsightsKmsKeyId - description: - - The Amazon Web Services KMS key identifier for encryption of Performance - Insights data. - type: str - performance_insights_retention_period: - aliases: - - PerformanceInsightsRetentionPeriod - description: - - The amount of time, in days, to retain Performance Insights data. - type: int - port: - aliases: - - Port - description: - - The port number on which the instances in the DB cluster accept connections. - - 'Default: 3306 if engine is set as aurora or 5432 if set to aurora-postgresql.' - type: int - 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. - - The default is a 30-minute window selected at random from an 8-hour block - of time for each AWS Region. - - To see the time blocks available, see Adjusting the Preferred DB Cluster - Maintenance Window in the Amazon Aurora User Guide. - type: str - preferred_maintenance_window: - aliases: - - PreferredMaintenanceWindow - description: - - The weekly time range during which system maintenance can occur, in Universal - Coordinated Time (UTC). The default is a 30-minute window selected at - random from an 8-hour block of time for each AWS Region, occurring on - a random day of the week. - - To see the time blocks available, see Adjusting the Preferred DB Cluster - Maintenance Window in the Amazon Aurora User Guide. - type: str - publicly_accessible: - aliases: - - PubliclyAccessible - description: - - A value that indicates whether the DB cluster is publicly accessible. - type: bool - purge_tags: - default: true - description: - - Remove tags not listed in I(tags). - type: bool - replication_source_identifier: - aliases: - - ReplicationSourceIdentifier - description: - - The Amazon Resource Name (ARN) of the source DB instance or DB cluster if - this DB cluster is created as a Read Replica. - type: str - restore_to_time: - aliases: - - RestoreToTime - description: - - The date and time to restore the DB cluster to. - - Value must be a time in Universal Coordinated Time (UTC) format. - - 'An example: 2015-03-07C(T23):45:00Z.' - type: str - restore_type: - aliases: - - RestoreType - default: full-copy - description: - - The type of restore to be performed. - - You can specify one of the following values:. - - full-copy - The new DB cluster is restored as a full copy of the source - DB cluster. - - copy-on-write - The new DB cluster is restored as a clone of the source - DB cluster. - type: str - scaling_configuration: - aliases: - - ScalingConfiguration - description: - - The I(scaling_configuration) property type specifies the scaling configuration - of an Aurora Serverless DB cluster.The I(scaling_configuration) property - type specifies the scaling configuration of an Aurora Serverless DB cluster. - suboptions: - auto_pause: - aliases: - - AutoPause - description: - - A value that indicates whether to allow or disallow automatic pause - for an Aurora DB cluster in serverless DB engine mode. - - A DB cluster can be paused only when its idle (it has no connections). - type: bool - max_capacity: - aliases: - - MaxCapacity - description: - - The maximum capacity for an Aurora DB cluster in serverless DB engine - mode. - - For Aurora MySQL, valid capacity values are 1, 2, 4, 8, 16, 32, - 64, 128, and 256. - - For Aurora PostgreSQL, valid capacity values are 2, 4, 8, 16, 32, - 64, 192, and 384. - - The maximum capacity must be greater than or equal to the minimum - capacity. - type: int - min_capacity: - aliases: - - MinCapacity - description: - - The minimum capacity for an Aurora DB cluster in serverless DB engine - mode. - - For Aurora MySQL, valid capacity values are 1, 2, 4, 8, 16, 32, - 64, 128, and 256. - - For Aurora PostgreSQL, valid capacity values are 2, 4, 8, 16, 32, - 64, 192, and 384. - - The minimum capacity must be less than or equal to the maximum capacity. - type: int - seconds_before_timeout: - aliases: - - SecondsBeforeTimeout - description: - - The amount of time, in seconds, that Aurora Serverless v1 tries - to find a scaling point to perform seamless scaling before enforcing - the timeout action. - - The default is 300. - type: int - seconds_until_auto_pause: - aliases: - - SecondsUntilAutoPause - description: - - The time, in seconds, before an Aurora DB cluster in serverless - mode is paused. - type: int - timeout_action: - aliases: - - TimeoutAction - description: - - The action to take when the timeout is reached, either ForceApplyCapacityChange - or RollbackCapacityChange. - - ForceApplyCapacityChange sets the capacity to the specified value - as soon as possible. - - RollbackCapacityChange, the default, ignores the capacity change - if a scaling point isnt found in the timeout period. - - For more information, see Autoscaling for Aurora Serverless v1 in - the Amazon Aurora User Guide. - type: str - type: dict - serverless_v2_scaling_configuration: - aliases: - - ServerlessV2ScalingConfiguration - description: - - Contains the scaling configuration of an Aurora Serverless v2 DB cluster.Contains - the scaling configuration of an Aurora Serverless v2 DB cluster. - suboptions: - max_capacity: - aliases: - - MaxCapacity - description: - - The maximum number of Aurora capacity units (ACUs) for a DB instance - in an Aurora Serverless v2 cluster. - - You can specify ACU values in half-step increments, such as 40, - 40.5, 41, and so on. - - The largest value that you can use is 128. - type: int - min_capacity: - aliases: - - MinCapacity - description: - - The minimum number of Aurora capacity units (ACUs) for a DB instance - in an Aurora Serverless v2 cluster. - - You can specify ACU values in half-step increments, such as 8, 8.5, - 9, and so on. - - The smallest value that you can use is 0.5. - type: int - type: dict - snapshot_identifier: - aliases: - - SnapshotIdentifier - description: - - The identifier for the DB snapshot or DB cluster snapshot to restore from. - - You can use either the name or the Amazon Resource Name (ARN) to specify - a DB cluster snapshot. - - However, you can use only the ARN to specify a DB snapshot. - - After you restore a DB cluster with a SnapshotIdentifier property, you must - specify the same SnapshotIdentifier property for any future updates to - the DB cluster. - - When you specify this property for an update, the DB cluster is not restored - from the snapshot again, and the data in the database is not changed. - - However, if you dont specify the SnapshotIdentifier property, an empty DB - cluster is created, and the original DB cluster is deleted. - - If you specify a property that is different from the previous snapshot restore - property, the DB cluster is restored from the specified SnapshotIdentifier - property, and the original DB cluster is deleted. - type: str - source_db_cluster_identifier: - aliases: - - SourceDBClusterIdentifier - description: - - The identifier of the source DB cluster from which to restore. - type: str - source_region: - aliases: - - SourceRegion - description: - - The AWS Region which contains the source DB cluster when replicating a DB - cluster. - - For example, us-east-1. - 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 - storage_encrypted: - aliases: - - StorageEncrypted - description: - - Indicates whether the DB instance is encrypted. - - If you specify the DBClusterIdentifier, SnapshotIdentifier, or SourceDBInstanceIdentifier - property, dont specify this property. - - The value is inherited from the cluster, snapshot, or source DB instance. - type: bool - storage_type: - aliases: - - StorageType - description: - - Specifies the storage type to be associated with the DB 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 - use_latest_restorable_time: - aliases: - - UseLatestRestorableTime - description: - - A value that indicates whether to restore the DB cluster to the latest restorable - backup time. - - By default, the DB cluster is not restored to the latest restorable backup - time. - type: bool - vpc_security_group_ids: - aliases: - - VpcSecurityGroupIds - description: - - A list of EC2 VPC security groups to associate with this DB cluster. - elements: str - type: list - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["allocated_storage"] = { - "type": "int", - "aliases": ["AllocatedStorage"], - } - argument_spec["associated_roles"] = { - "type": "list", - "elements": "dict", - "options": { - "feature_name": {"type": "str", "aliases": ["FeatureName"]}, - "role_arn": {"type": "str", "aliases": ["RoleArn"]}, - }, - "aliases": ["AssociatedRoles"], - } - argument_spec["availability_zones"] = { - "type": "list", - "elements": "str", - "aliases": ["AvailabilityZones"], - } - argument_spec["auto_minor_version_upgrade"] = { - "type": "bool", - "aliases": ["AutoMinorVersionUpgrade"], - } - argument_spec["backtrack_window"] = { - "default": 0, - "type": "int", - "aliases": ["BacktrackWindow"], - } - argument_spec["backup_retention_period"] = { - "default": 1, - "type": "int", - "aliases": ["BackupRetentionPeriod"], - } - argument_spec["copy_tags_to_snapshot"] = { - "type": "bool", - "aliases": ["CopyTagsToSnapshot"], - } - argument_spec["database_name"] = {"type": "str", "aliases": ["DatabaseName"]} - argument_spec["db_cluster_instance_class"] = { - "type": "str", - "aliases": ["DBClusterInstanceClass"], - } - argument_spec["db_instance_parameter_group_name"] = { - "type": "str", - "aliases": ["DBInstanceParameterGroupName"], - } - argument_spec["db_system_id"] = {"type": "str", "aliases": ["DBSystemId"]} - argument_spec["global_cluster_identifier"] = { - "type": "str", - "aliases": ["GlobalClusterIdentifier"], - } - argument_spec["db_cluster_identifier"] = { - "type": "str", - "aliases": ["DBClusterIdentifier"], - } - argument_spec["db_cluster_parameter_group_name"] = { - "type": "str", - "default": "default.aurora5.6", - "aliases": ["DBClusterParameterGroupName"], - } - argument_spec["db_subnet_group_name"] = { - "type": "str", - "aliases": ["DBSubnetGroupName"], - } - 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_http_endpoint"] = { - "type": "bool", - "aliases": ["EnableHttpEndpoint"], - } - argument_spec["enable_iam_database_authentication"] = { - "type": "bool", - "aliases": ["EnableIAMDatabaseAuthentication"], - } - argument_spec["engine"] = {"type": "str", "aliases": ["Engine"]} - argument_spec["engine_mode"] = {"type": "str", "aliases": ["EngineMode"]} - 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["master_username"] = {"type": "str", "aliases": ["MasterUsername"]} - argument_spec["master_user_password"] = { - "type": "str", - "aliases": ["MasterUserPassword"], - } - argument_spec["monitoring_interval"] = { - "type": "int", - "default": 0, - "aliases": ["MonitoringInterval"], - } - argument_spec["monitoring_role_arn"] = { - "type": "str", - "aliases": ["MonitoringRoleArn"], - } - argument_spec["network_type"] = {"type": "str", "aliases": ["NetworkType"]} - argument_spec["performance_insights_enabled"] = { - "type": "bool", - "aliases": ["PerformanceInsightsEnabled"], - } - 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": "int", "aliases": ["Port"]} - argument_spec["preferred_backup_window"] = { - "type": "str", - "aliases": ["PreferredBackupWindow"], - } - argument_spec["preferred_maintenance_window"] = { - "type": "str", - "aliases": ["PreferredMaintenanceWindow"], - } - argument_spec["publicly_accessible"] = { - "type": "bool", - "aliases": ["PubliclyAccessible"], - } - argument_spec["replication_source_identifier"] = { - "type": "str", - "aliases": ["ReplicationSourceIdentifier"], - } - argument_spec["restore_to_time"] = {"type": "str", "aliases": ["RestoreToTime"]} - argument_spec["restore_type"] = { - "type": "str", - "default": "full-copy", - "aliases": ["RestoreType"], - } - argument_spec["serverless_v2_scaling_configuration"] = { - "type": "dict", - "options": { - "min_capacity": {"type": "int", "aliases": ["MinCapacity"]}, - "max_capacity": {"type": "int", "aliases": ["MaxCapacity"]}, - }, - "aliases": ["ServerlessV2ScalingConfiguration"], - } - argument_spec["scaling_configuration"] = { - "type": "dict", - "options": { - "auto_pause": {"type": "bool", "aliases": ["AutoPause"]}, - "max_capacity": {"type": "int", "aliases": ["MaxCapacity"]}, - "min_capacity": {"type": "int", "aliases": ["MinCapacity"]}, - "seconds_before_timeout": { - "type": "int", - "aliases": ["SecondsBeforeTimeout"], - }, - "seconds_until_auto_pause": { - "type": "int", - "aliases": ["SecondsUntilAutoPause"], - }, - "timeout_action": {"type": "str", "aliases": ["TimeoutAction"]}, - }, - "aliases": ["ScalingConfiguration"], - } - argument_spec["snapshot_identifier"] = { - "type": "str", - "aliases": ["SnapshotIdentifier"], - } - argument_spec["source_db_cluster_identifier"] = { - "type": "str", - "aliases": ["SourceDBClusterIdentifier"], - } - 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["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} - argument_spec["use_latest_restorable_time"] = { - "type": "bool", - "aliases": ["UseLatestRestorableTime"], - } - argument_spec["vpc_security_group_ids"] = { - "type": "list", - "elements": "str", - "aliases": ["VpcSecurityGroupIds"], - } - 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", ["db_cluster_identifier"], True], - ["state", "absent", ["db_cluster_identifier"], True], - ["state", "get", ["db_cluster_identifier"], 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::RDS::DBCluster" - - params = {} - - params["allocated_storage"] = module.params.get("allocated_storage") - params["associated_roles"] = module.params.get("associated_roles") - params["auto_minor_version_upgrade"] = module.params.get( - "auto_minor_version_upgrade" - ) - params["availability_zones"] = module.params.get("availability_zones") - params["backtrack_window"] = module.params.get("backtrack_window") - params["backup_retention_period"] = module.params.get("backup_retention_period") - params["copy_tags_to_snapshot"] = module.params.get("copy_tags_to_snapshot") - params["database_name"] = module.params.get("database_name") - params["db_cluster_identifier"] = module.params.get("db_cluster_identifier") - params["db_cluster_instance_class"] = module.params.get("db_cluster_instance_class") - params["db_cluster_parameter_group_name"] = module.params.get( - "db_cluster_parameter_group_name" - ) - params["db_instance_parameter_group_name"] = module.params.get( - "db_instance_parameter_group_name" - ) - params["db_subnet_group_name"] = module.params.get("db_subnet_group_name") - params["db_system_id"] = module.params.get("db_system_id") - params["deletion_protection"] = module.params.get("deletion_protection") - params["domain"] = module.params.get("domain") - params["domain_iam_role_name"] = module.params.get("domain_iam_role_name") - params["enable_cloudwatch_logs_exports"] = module.params.get( - "enable_cloudwatch_logs_exports" - ) - params["enable_http_endpoint"] = module.params.get("enable_http_endpoint") - params["enable_iam_database_authentication"] = module.params.get( - "enable_iam_database_authentication" - ) - params["engine"] = module.params.get("engine") - params["engine_mode"] = module.params.get("engine_mode") - params["engine_version"] = module.params.get("engine_version") - params["global_cluster_identifier"] = module.params.get("global_cluster_identifier") - params["iops"] = module.params.get("iops") - params["kms_key_id"] = module.params.get("kms_key_id") - params["manage_master_user_password"] = module.params.get( - "manage_master_user_password" - ) - params["master_user_password"] = module.params.get("master_user_password") - params["master_username"] = module.params.get("master_username") - params["monitoring_interval"] = module.params.get("monitoring_interval") - params["monitoring_role_arn"] = module.params.get("monitoring_role_arn") - params["network_type"] = module.params.get("network_type") - params["performance_insights_enabled"] = module.params.get( - "performance_insights_enabled" - ) - params["performance_insights_kms_key_id"] = module.params.get( - "performance_insights_kms_key_id" - ) - 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" - ) - params["publicly_accessible"] = module.params.get("publicly_accessible") - params["replication_source_identifier"] = module.params.get( - "replication_source_identifier" - ) - params["restore_to_time"] = module.params.get("restore_to_time") - params["restore_type"] = module.params.get("restore_type") - params["scaling_configuration"] = module.params.get("scaling_configuration") - params["serverless_v2_scaling_configuration"] = module.params.get( - "serverless_v2_scaling_configuration" - ) - params["snapshot_identifier"] = module.params.get("snapshot_identifier") - params["source_db_cluster_identifier"] = module.params.get( - "source_db_cluster_identifier" - ) - params["source_region"] = module.params.get("source_region") - params["storage_encrypted"] = module.params.get("storage_encrypted") - params["storage_type"] = module.params.get("storage_type") - params["tags"] = module.params.get("tags") - params["use_latest_restorable_time"] = module.params.get( - "use_latest_restorable_time" - ) - 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 = 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"]) - - # 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 = [ - "/properties/AvailabilityZones", - "/properties/DBClusterIdentifier", - "/properties/DBSubnetGroupName", - "/properties/DBSystemId", - "/properties/DatabaseName", - "/properties/EngineMode", - "/properties/KmsKeyId", - "/properties/PubliclyAccessible", - "/properties/RestoreToTime", - "/properties/RestoreType", - "/properties/SnapshotIdentifier", - "/properties/SourceDBClusterIdentifier", - "/properties/SourceRegion", - "/properties/StorageEncrypted", - "/properties/UseLatestRestorableTime", - ] - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["/properties/DBClusterIdentifier"] - - 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/rds_db_cluster_parameter_group.py b/plugins/modules/rds_db_cluster_parameter_group.py index 53869c93..acbef884 100644 --- a/plugins/modules/rds_db_cluster_parameter_group.py +++ b/plugins/modules/rds_db_cluster_parameter_group.py @@ -166,7 +166,7 @@ def main(): [ "state", "present", - ["parameters", "db_cluster_parameter_group_name", "family", "description"], + ["description", "parameters", "db_cluster_parameter_group_name", "family"], True, ], ["state", "absent", ["db_cluster_parameter_group_name"], True], diff --git a/plugins/modules/rds_db_parameter_group.py b/plugins/modules/rds_db_parameter_group.py deleted file mode 100644 index 7e70c805..00000000 --- a/plugins/modules/rds_db_parameter_group.py +++ /dev/null @@ -1,242 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -DOCUMENTATION = r""" -module: rds_db_parameter_group -short_description: Creates and manages a custom parameter group for an RDS database - family -description: -- Creates and manages a custom parameter group for an RDS database family. For more - information, see U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbparametergroup.html) -options: - db_parameter_group_name: - aliases: - - DBParameterGroupName - description: - - Specifies the name of the DB parameter group. - type: str - description: - aliases: - - Description - description: - - Provides the customer-specified description for this DB parameter group. - type: str - family: - aliases: - - Family - description: - - The DB parameter group family name. - 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 - parameters: - aliases: - - Parameters - description: - - An array of parameter names and values for the parameter update. - type: dict - 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: - - 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 - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["db_parameter_group_name"] = { - "type": "str", - "aliases": ["DBParameterGroupName"], - } - argument_spec["description"] = {"type": "str", "aliases": ["Description"]} - argument_spec["family"] = {"type": "str", "aliases": ["Family"]} - argument_spec["parameters"] = {"type": "dict", "aliases": ["Parameters"]} - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "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", - ["db_parameter_group_name", "family", "description"], - True, - ], - ["state", "absent", ["db_parameter_group_name"], True], - ["state", "get", ["db_parameter_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::RDS::DBParameterGroup" - - params = {} - - params["db_parameter_group_name"] = module.params.get("db_parameter_group_name") - params["description"] = module.params.get("description") - params["family"] = module.params.get("family") - params["parameters"] = module.params.get("parameters") - params["tags"] = module.params.get("tags") - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _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"]) - - # 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 = [ - "/properties/DBParameterGroupName", - "/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 = ["/properties/DBParameterGroupName"] - - 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/rds_db_proxy.py b/plugins/modules/rds_db_proxy.py index fe82636a..5b3077aa 100644 --- a/plugins/modules/rds_db_proxy.py +++ b/plugins/modules/rds_db_proxy.py @@ -299,7 +299,7 @@ def main(): [ "state", "present", - ["db_proxy_name", "engine_family", "auth", "role_arn", "vpc_subnet_ids"], + ["engine_family", "role_arn", "vpc_subnet_ids", "auth", "db_proxy_name"], True, ], ["state", "absent", ["db_proxy_name"], True], diff --git a/plugins/modules/rds_db_proxy_endpoint.py b/plugins/modules/rds_db_proxy_endpoint.py index 1ba3ab43..75834853 100644 --- a/plugins/modules/rds_db_proxy_endpoint.py +++ b/plugins/modules/rds_db_proxy_endpoint.py @@ -191,7 +191,7 @@ def main(): [ "state", "present", - ["vpc_subnet_ids", "db_proxy_name", "db_proxy_endpoint_name"], + ["db_proxy_endpoint_name", "vpc_subnet_ids", "db_proxy_name"], True, ], ["state", "absent", ["db_proxy_endpoint_name"], True], diff --git a/plugins/modules/rds_db_subnet_group.py b/plugins/modules/rds_db_subnet_group.py index 45cdb5bd..b9e87993 100644 --- a/plugins/modules/rds_db_subnet_group.py +++ b/plugins/modules/rds_db_subnet_group.py @@ -163,7 +163,7 @@ def main(): [ "state", "present", - ["db_subnet_group_description", "subnet_ids", "db_subnet_group_name"], + ["subnet_ids", "db_subnet_group_description", "db_subnet_group_name"], True, ], ["state", "absent", ["db_subnet_group_name"], True], diff --git a/plugins/modules/rds_event_subscription.py b/plugins/modules/rds_event_subscription.py deleted file mode 100644 index f981990d..00000000 --- a/plugins/modules/rds_event_subscription.py +++ /dev/null @@ -1,274 +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 ansible.content_builder. -# See: https://github.com/ansible-community/ansible.content_builder - - -DOCUMENTATION = r""" -module: rds_event_subscription -short_description: Allows you to receive notifications for Amazon Relational Database - Service events through the Amazon Simple Notification Service (Amazon SNS) -description: -- Allows you to receive notifications for Amazon Relational Database Service events - through the Amazon Simple Notification Service (Amazon SNS). For more information, - see U(https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-eventsubscription.html) -options: - enabled: - aliases: - - Enabled - default: true - description: - - A Boolean value; set to true to activate the subscription, set to false - to create the subscription but not active it. - type: bool - event_categories: - aliases: - - EventCategories - description: - - A list of event categories for a SourceType that you want to subscribe to. - - You can see a list of the categories for a given SourceType in the Events - topic in the Amazon RDS User Guide or by using the DescribeEventCategories - action. - elements: str - type: list - 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 - sns_topic_arn: - aliases: - - SnsTopicArn - description: - - The Amazon Resource Name (ARN) of the SNS topic created for event notification. - - The ARN is created by Amazon SNS when you create a topic and subscribe to - it. - type: str - source_ids: - aliases: - - SourceIds - description: - - The list of identifiers of the event sources for which events will be returned. - - If not specified, then all sources are included in the response. - - An identifier must begin with a letter and must contain only ASCII letters, - digits, and hyphens; it cannot end with a hyphen or contain two consecutive - hyphens. - elements: str - type: list - source_type: - aliases: - - SourceType - description: - - The type of source that will be generating the events. - - For example, if you want to be notified of events generated by a DB instance, - you would set this parameter to db-instance. if this value is not specified, - all events are returned. - 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 - subscription_name: - aliases: - - SubscriptionName - description: - - The name of the subscription. - 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 - 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 ( - ansible_dict_to_boto3_tag_list, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import ( - scrub_none_parameters, -) -from ansible_collections.amazon.cloud.plugins.module_utils.core import map_key_to_alias - - -def main(): - argument_spec = dict( - state=dict( - type="str", - choices=["present", "absent", "list", "describe", "get"], - default="present", - ), - ) - - argument_spec["tags"] = {"type": "dict", "aliases": ["Tags", "resource_tags"]} - argument_spec["subscription_name"] = { - "type": "str", - "aliases": ["SubscriptionName"], - } - argument_spec["enabled"] = {"type": "bool", "default": True, "aliases": ["Enabled"]} - argument_spec["event_categories"] = { - "type": "list", - "elements": "str", - "aliases": ["EventCategories"], - } - argument_spec["sns_topic_arn"] = {"type": "str", "aliases": ["SnsTopicArn"]} - argument_spec["source_ids"] = { - "type": "list", - "elements": "str", - "aliases": ["SourceIds"], - } - argument_spec["source_type"] = {"type": "str", "aliases": ["SourceType"]} - 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", ["sns_topic_arn", "subscription_name"], True], - ["state", "absent", ["subscription_name"], True], - ["state", "get", ["subscription_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::RDS::EventSubscription" - - params = {} - - params["enabled"] = module.params.get("enabled") - params["event_categories"] = module.params.get("event_categories") - params["sns_topic_arn"] = module.params.get("sns_topic_arn") - params["source_ids"] = module.params.get("source_ids") - params["source_type"] = module.params.get("source_type") - params["subscription_name"] = module.params.get("subscription_name") - params["tags"] = module.params.get("tags") - - # The DesiredState we pass to AWS must be a JSONArray of non-null values - _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"]) - - # 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 = ["/properties/SubscriptionName", "/properties/SnsTopicArn"] - - # Necessary to handle when module does not support all the states - handlers = ["create", "read", "update", "delete", "list"] - - state = module.params.get("state") - identifier = ["/properties/SubscriptionName"] - - 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/rds_option_group.py b/plugins/modules/rds_option_group.py index 98fb3f77..3fac819a 100644 --- a/plugins/modules/rds_option_group.py +++ b/plugins/modules/rds_option_group.py @@ -257,10 +257,10 @@ def main(): "state", "present", [ - "major_engine_version", - "option_group_name", - "option_group_description", "engine_name", + "option_group_description", + "option_group_name", + "major_engine_version", ], True, ], diff --git a/plugins/modules/redshift_cluster.py b/plugins/modules/redshift_cluster.py index 68a4817b..989c178e 100644 --- a/plugins/modules/redshift_cluster.py +++ b/plugins/modules/redshift_cluster.py @@ -651,11 +651,11 @@ def main(): "present", [ "cluster_identifier", + "master_user_password", + "master_username", "db_name", "cluster_type", "node_type", - "master_user_password", - "master_username", ], True, ], diff --git a/plugins/modules/redshift_endpoint_access.py b/plugins/modules/redshift_endpoint_access.py index f98f2cc6..ff5b3b9c 100644 --- a/plugins/modules/redshift_endpoint_access.py +++ b/plugins/modules/redshift_endpoint_access.py @@ -163,10 +163,10 @@ def main(): "state", "present", [ - "endpoint_name", "vpc_security_group_ids", - "cluster_identifier", "subnet_group_name", + "cluster_identifier", + "endpoint_name", ], True, ], diff --git a/plugins/modules/redshift_endpoint_authorization.py b/plugins/modules/redshift_endpoint_authorization.py index 80eb4753..aa3f6fc5 100644 --- a/plugins/modules/redshift_endpoint_authorization.py +++ b/plugins/modules/redshift_endpoint_authorization.py @@ -151,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], ] diff --git a/plugins/modules/route53_key_signing_key.py b/plugins/modules/route53_key_signing_key.py index 63aa8309..b8282e99 100644 --- a/plugins/modules/route53_key_signing_key.py +++ b/plugins/modules/route53_key_signing_key.py @@ -166,11 +166,11 @@ def main(): "state", "present", [ - "hosted_zone_id", - "name", - "key_management_service_arn", "status", + "key_management_service_arn", + "name", "identifier", + "hosted_zone_id", ], True, ], diff --git a/plugins/modules/s3_access_point.py b/plugins/modules/s3_access_point.py index c3b929d2..1bf4328b 100644 --- a/plugins/modules/s3_access_point.py +++ b/plugins/modules/s3_access_point.py @@ -237,7 +237,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["name", "bucket"], True], + ["state", "present", ["bucket", "name"], True], ["state", "absent", ["name"], True], ["state", "get", ["name"], True], ] diff --git a/plugins/modules/s3_multi_region_access_point.py b/plugins/modules/s3_multi_region_access_point.py index 1673f2a5..2a31c536 100644 --- a/plugins/modules/s3_multi_region_access_point.py +++ b/plugins/modules/s3_multi_region_access_point.py @@ -222,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], ] diff --git a/plugins/modules/s3_multi_region_access_point_policy.py b/plugins/modules/s3_multi_region_access_point_policy.py index 85001fd2..3ff03691 100644 --- a/plugins/modules/s3_multi_region_access_point_policy.py +++ b/plugins/modules/s3_multi_region_access_point_policy.py @@ -126,7 +126,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["policy", "mrap_name"], True], + ["state", "present", ["mrap_name", "policy"], True], ["state", "absent", ["mrap_name"], True], ["state", "get", ["mrap_name"], True], ] diff --git a/plugins/modules/s3objectlambda_access_point.py b/plugins/modules/s3objectlambda_access_point.py index 5bf255e0..0f250b93 100644 --- a/plugins/modules/s3objectlambda_access_point.py +++ b/plugins/modules/s3objectlambda_access_point.py @@ -244,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], ] diff --git a/plugins/modules/s3objectlambda_access_point_policy.py b/plugins/modules/s3objectlambda_access_point_policy.py index 136621bb..ec3091d7 100644 --- a/plugins/modules/s3objectlambda_access_point_policy.py +++ b/plugins/modules/s3objectlambda_access_point_policy.py @@ -130,7 +130,7 @@ def main(): argument_spec["force"] = {"type": "bool", "default": False} required_if = [ - ["state", "present", ["policy_document", "object_lambda_access_point"], True], + ["state", "present", ["object_lambda_access_point", "policy_document"], True], ["state", "absent", ["object_lambda_access_point"], True], ["state", "get", ["object_lambda_access_point"], True], ] diff --git a/plugins/modules/ssm_document.py b/plugins/modules/ssm_document.py index 91775d67..40b11e8c 100644 --- a/plugins/modules/ssm_document.py +++ b/plugins/modules/ssm_document.py @@ -313,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], ] diff --git a/tests/integration/targets/memorydb/aliases b/tests/integration/targets/memorydb/aliases index 4ef4b206..dc7a5939 100644 --- a/tests/integration/targets/memorydb/aliases +++ b/tests/integration/targets/memorydb/aliases @@ -1 +1,4 @@ cloud/aws + +# Missing permissions +disabled diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index 1e20bc22..501d6b15 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -499,51 +499,6 @@ 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/rds_custom_db_engine_version.py compile-2.7!skip -plugins/modules/rds_custom_db_engine_version.py compile-3.5!skip -plugins/modules/rds_custom_db_engine_version.py import-2.7!skip -plugins/modules/rds_custom_db_engine_version.py import-3.5!skip -plugins/modules/rds_custom_db_engine_version.py future-import-boilerplate!skip -plugins/modules/rds_custom_db_engine_version.py metaclass-boilerplate!skip -plugins/modules/rds_custom_db_engine_version.py compile-2.6!skip -plugins/modules/rds_custom_db_engine_version.py import-2.6!skip -plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_cluster.py compile-2.7!skip -plugins/modules/rds_db_cluster.py compile-3.5!skip -plugins/modules/rds_db_cluster.py import-2.7!skip -plugins/modules/rds_db_cluster.py import-3.5!skip -plugins/modules/rds_db_cluster.py future-import-boilerplate!skip -plugins/modules/rds_db_cluster.py metaclass-boilerplate!skip -plugins/modules/rds_db_cluster.py compile-2.6!skip -plugins/modules/rds_db_cluster.py import-2.6!skip -plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_parameter_group.py compile-2.7!skip -plugins/modules/rds_db_parameter_group.py compile-3.5!skip -plugins/modules/rds_db_parameter_group.py import-2.7!skip -plugins/modules/rds_db_parameter_group.py import-3.5!skip -plugins/modules/rds_db_parameter_group.py future-import-boilerplate!skip -plugins/modules/rds_db_parameter_group.py metaclass-boilerplate!skip -plugins/modules/rds_db_parameter_group.py compile-2.6!skip -plugins/modules/rds_db_parameter_group.py import-2.6!skip -plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_event_subscription.py compile-2.7!skip -plugins/modules/rds_event_subscription.py compile-3.5!skip -plugins/modules/rds_event_subscription.py import-2.7!skip -plugins/modules/rds_event_subscription.py import-3.5!skip -plugins/modules/rds_event_subscription.py future-import-boilerplate!skip -plugins/modules/rds_event_subscription.py metaclass-boilerplate!skip -plugins/modules/rds_event_subscription.py compile-2.6!skip -plugins/modules/rds_event_subscription.py import-2.6!skip -plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_proxy_target_group.py compile-2.7!skip -plugins/modules/rds_db_proxy_target_group.py compile-3.5!skip -plugins/modules/rds_db_proxy_target_group.py import-2.7!skip -plugins/modules/rds_db_proxy_target_group.py import-3.5!skip -plugins/modules/rds_db_proxy_target_group.py future-import-boilerplate!skip -plugins/modules/rds_db_proxy_target_group.py metaclass-boilerplate!skip -plugins/modules/rds_db_proxy_target_group.py compile-2.6!skip -plugins/modules/rds_db_proxy_target_group.py import-2.6!skip -plugins/modules/rds_db_proxy_target_group.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 @@ -552,4 +507,3 @@ plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusiv 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_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 index a8f0aeb0..61bf59fd 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -498,51 +498,6 @@ 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/rds_custom_db_engine_version.py compile-2.7!skip -plugins/modules/rds_custom_db_engine_version.py compile-3.5!skip -plugins/modules/rds_custom_db_engine_version.py import-2.7!skip -plugins/modules/rds_custom_db_engine_version.py import-3.5!skip -plugins/modules/rds_custom_db_engine_version.py future-import-boilerplate!skip -plugins/modules/rds_custom_db_engine_version.py metaclass-boilerplate!skip -plugins/modules/rds_custom_db_engine_version.py compile-2.6!skip -plugins/modules/rds_custom_db_engine_version.py import-2.6!skip -plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_cluster.py compile-2.7!skip -plugins/modules/rds_db_cluster.py compile-3.5!skip -plugins/modules/rds_db_cluster.py import-2.7!skip -plugins/modules/rds_db_cluster.py import-3.5!skip -plugins/modules/rds_db_cluster.py future-import-boilerplate!skip -plugins/modules/rds_db_cluster.py metaclass-boilerplate!skip -plugins/modules/rds_db_cluster.py compile-2.6!skip -plugins/modules/rds_db_cluster.py import-2.6!skip -plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_parameter_group.py compile-2.7!skip -plugins/modules/rds_db_parameter_group.py compile-3.5!skip -plugins/modules/rds_db_parameter_group.py import-2.7!skip -plugins/modules/rds_db_parameter_group.py import-3.5!skip -plugins/modules/rds_db_parameter_group.py future-import-boilerplate!skip -plugins/modules/rds_db_parameter_group.py metaclass-boilerplate!skip -plugins/modules/rds_db_parameter_group.py compile-2.6!skip -plugins/modules/rds_db_parameter_group.py import-2.6!skip -plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_event_subscription.py compile-2.7!skip -plugins/modules/rds_event_subscription.py compile-3.5!skip -plugins/modules/rds_event_subscription.py import-2.7!skip -plugins/modules/rds_event_subscription.py import-3.5!skip -plugins/modules/rds_event_subscription.py future-import-boilerplate!skip -plugins/modules/rds_event_subscription.py metaclass-boilerplate!skip -plugins/modules/rds_event_subscription.py compile-2.6!skip -plugins/modules/rds_event_subscription.py import-2.6!skip -plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_proxy_target_group.py compile-2.7!skip -plugins/modules/rds_db_proxy_target_group.py compile-3.5!skip -plugins/modules/rds_db_proxy_target_group.py import-2.7!skip -plugins/modules/rds_db_proxy_target_group.py import-3.5!skip -plugins/modules/rds_db_proxy_target_group.py future-import-boilerplate!skip -plugins/modules/rds_db_proxy_target_group.py metaclass-boilerplate!skip -plugins/modules/rds_db_proxy_target_group.py compile-2.6!skip -plugins/modules/rds_db_proxy_target_group.py import-2.6!skip -plugins/modules/rds_db_proxy_target_group.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 @@ -551,4 +506,3 @@ plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusiv 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_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 index fb4629ba..a5facba4 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -66,11 +66,6 @@ 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/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_proxy_target_group.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 @@ -79,9 +74,3 @@ plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusiv 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_web_acl_association.py validate-modules:mutually_exclusive-type -plugins/modules/rds_custom_db_engine_version.py validate-modules:mutually_exclusive-type -plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_cluster.py validate-modules:no-log-needed -plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index 8487aa5c..732b8179 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -66,11 +66,6 @@ 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 -plugins/modules/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_event_subscription.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 @@ -79,4 +74,5 @@ plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusiv 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_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 e706a966..732b8179 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -66,11 +66,6 @@ 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/rds_custom_db_engine_version.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_cluster.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_parameter_group.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_event_subscription.py validate-modules:parameter-state-invalid-choice -plugins/modules/rds_db_proxy_target_group.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 @@ -79,7 +74,5 @@ plugins/modules/autoscaling_lifecycle_hook.py validate-modules:mutually_exclusiv 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_web_acl_association.py validate-modules:mutually_exclusive-type -plugins/modules/rds_custom_db_engine_version.py validate-modules:mutually_exclusive-type -plugins/modules/rds_db_cluster.py validate-modules:no-log-needed 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 1d129041..e3496db4 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -75,6 +75,4 @@ plugins/modules/memorydb_parameter_group.py validate-modules:parameter-state-inv 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 -plugins/modules/rds_custom_db_engine_version.py validate-modules:mutually_exclusive-type -plugins/modules/rds_db_cluster.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 1d129041..e3496db4 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -75,6 +75,4 @@ plugins/modules/memorydb_parameter_group.py validate-modules:parameter-state-inv 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 -plugins/modules/rds_custom_db_engine_version.py validate-modules:mutually_exclusive-type -plugins/modules/rds_db_cluster.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 6ef02315..720753f3 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -430,46 +430,6 @@ 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/rds_custom_db_engine_version.py compile-2.7!skip -plugins/modules/rds_custom_db_engine_version.py compile-3.5!skip -plugins/modules/rds_custom_db_engine_version.py import-2.7!skip -plugins/modules/rds_custom_db_engine_version.py import-3.5!skip -plugins/modules/rds_custom_db_engine_version.py future-import-boilerplate!skip -plugins/modules/rds_custom_db_engine_version.py metaclass-boilerplate!skip -plugins/modules/rds_custom_db_engine_version.py compile-2.6!skip -plugins/modules/rds_custom_db_engine_version.py import-2.6!skip -plugins/modules/rds_db_cluster.py compile-2.7!skip -plugins/modules/rds_db_cluster.py compile-3.5!skip -plugins/modules/rds_db_cluster.py import-2.7!skip -plugins/modules/rds_db_cluster.py import-3.5!skip -plugins/modules/rds_db_cluster.py future-import-boilerplate!skip -plugins/modules/rds_db_cluster.py metaclass-boilerplate!skip -plugins/modules/rds_db_cluster.py compile-2.6!skip -plugins/modules/rds_db_cluster.py import-2.6!skip -plugins/modules/rds_db_parameter_group.py compile-2.7!skip -plugins/modules/rds_db_parameter_group.py compile-3.5!skip -plugins/modules/rds_db_parameter_group.py import-2.7!skip -plugins/modules/rds_db_parameter_group.py import-3.5!skip -plugins/modules/rds_db_parameter_group.py future-import-boilerplate!skip -plugins/modules/rds_db_parameter_group.py metaclass-boilerplate!skip -plugins/modules/rds_db_parameter_group.py compile-2.6!skip -plugins/modules/rds_db_parameter_group.py import-2.6!skip -plugins/modules/rds_event_subscription.py compile-2.7!skip -plugins/modules/rds_event_subscription.py compile-3.5!skip -plugins/modules/rds_event_subscription.py import-2.7!skip -plugins/modules/rds_event_subscription.py import-3.5!skip -plugins/modules/rds_event_subscription.py future-import-boilerplate!skip -plugins/modules/rds_event_subscription.py metaclass-boilerplate!skip -plugins/modules/rds_event_subscription.py compile-2.6!skip -plugins/modules/rds_event_subscription.py import-2.6!skip -plugins/modules/rds_db_proxy_target_group.py compile-2.7!skip -plugins/modules/rds_db_proxy_target_group.py compile-3.5!skip -plugins/modules/rds_db_proxy_target_group.py import-2.7!skip -plugins/modules/rds_db_proxy_target_group.py import-3.5!skip -plugins/modules/rds_db_proxy_target_group.py future-import-boilerplate!skip -plugins/modules/rds_db_proxy_target_group.py metaclass-boilerplate!skip -plugins/modules/rds_db_proxy_target_group.py compile-2.6!skip -plugins/modules/rds_db_proxy_target_group.py import-2.6!skip 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 @@ -479,4 +439,3 @@ 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_web_acl_association.py validate-modules:mutually_exclusive-type lugins/modules/eks_cluster.py compile-2.7!skip - From c6c78dae38bab1dd390f3095b5a1df5ba038123a Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Fri, 11 Aug 2023 20:21:27 +0200 Subject: [PATCH 18/32] Fix merge_dicts, add unit tests, delete ignore files for 2.10, 2.11 and 2.12, revert change Signed-off-by: Alina Buzachis --- plugins/module_utils/core.py | 1 - plugins/module_utils/utils.py | 39 +- tests/sanity/ignore-2.10.txt | 509 -------------------------- tests/sanity/ignore-2.11.txt | 508 ------------------------- tests/sanity/ignore-2.12.txt | 76 ---- tests/unit/module_utils/test_utils.py | 53 +++ 6 files changed, 84 insertions(+), 1102 deletions(-) delete mode 100644 tests/sanity/ignore-2.10.txt delete mode 100644 tests/sanity/ignore-2.11.txt delete mode 100644 tests/sanity/ignore-2.12.txt diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index 4dfbdde0..f883901e 100644 --- a/plugins/module_utils/core.py +++ b/plugins/module_utils/core.py @@ -70,7 +70,6 @@ scrub_none_parameters, ) - BOTO3_IMP_ERR = None try: import botocore diff --git a/plugins/module_utils/utils.py b/plugins/module_utils/utils.py index c89cc418..90780572 100644 --- a/plugins/module_utils/utils.py +++ b/plugins/module_utils/utils.py @@ -2,6 +2,7 @@ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +import ast import re import copy import json @@ -106,11 +107,8 @@ 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 not any(k in item for item in list_of_keys_to_remove) - } + + return {k: v for k, v in a_dict.items() if k not in list_of_keys_to_remove} def normalize_response(response: Iterable): @@ -306,17 +304,42 @@ def merge_dicts(list1, list2): matching_dicts = [ dict1 for dict1 in merged_list - if all(item in dict1.items() for item in dict2.items()) + if dict1.get("PolicyName") == dict2.get("PolicyName") ] + if matching_dicts: - for k, v in dict2.items(): - matching_dicts[0][k] = v + dict1 = matching_dicts[0] + for key, value in dict2.items(): + try: + value_dict = ast.literal_eval(value) + if isinstance(value_dict, dict): + dict1[key] = recursive_merge(dict1[key], value_dict) + elif isinstance(value_dict, list): + for item in value_dict: + if isinstance(item, dict): + dict1[key] = recursive_merge(dict1[key], item) + else: + dict1[key] = value + except (SyntaxError, ValueError): + dict1[key] = value else: merged_list.append(dict2) return merged_list +def recursive_merge(dict1, dict2): + 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) + else: + merged[key] = value + + return merged + + def make_op(path, old, new, strategy): _new_cpy = copy.deepcopy(new) diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt deleted file mode 100644 index 501d6b15..00000000 --- a/tests/sanity/ignore-2.10.txt +++ /dev/null @@ -1,509 +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/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_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_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/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/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/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_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/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_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 61bf59fd..00000000 --- a/tests/sanity/ignore-2.11.txt +++ /dev/null @@ -1,508 +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/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_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_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/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/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/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_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/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_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 a5facba4..00000000 --- a/tests/sanity/ignore-2.12.txt +++ /dev/null @@ -1,76 +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/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_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_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/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/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/wafv2_logging_configuration.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/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_web_acl_association.py validate-modules:mutually_exclusive-type diff --git a/tests/unit/module_utils/test_utils.py b/tests/unit/module_utils/test_utils.py index bc6a83d5..b996b06e 100644 --- a/tests/unit/module_utils/test_utils.py +++ b/tests/unit/module_utils/test_utils.py @@ -13,6 +13,7 @@ diff_dicts, normalize_response, tag_merge, + merge_dicts, ) @@ -295,3 +296,55 @@ def test_tag_merge_dicts(): tag_merge(dict_1, dict_2) assert dict_1 == expected + + +def test_tag_merge_empty_dicts(): + old = [ + { + "key1": [ + { + "key2": {"key3": ["value 1"]}, + "key4": {"key5": ["value 2"]}, + "key 6": {"key7": {"key8": {"key9": "value 3"}}}, + "key_10": [{"key_11": "value 4"}], + } + ], + "key12": '{"key 13": "value 4"}', + "key14": '[{"key 15": "value 5"}]', + "key16": "value6", + } + ] + + new = [ + { + "key1": [ + { + "key2": {"key3": ["value 1"]}, + "key4": {"key5": ["value 2 updated"]}, + "key 6": {"key7": {"key8": {"key9": "value 3 updated"}}}, + "key_10": [{"key_11": "value 4 updated"}], + } + ], + "key12": {"key 13": "value 4 updated"}, + "key14": [{"key 15": "value 5 updated"}], + } + ] + + expected = [ + { + "key1": [ + { + "key2": {"key3": ["value 1"]}, + "key4": {"key5": ["value 2 updated"]}, + "key 6": {"key7": {"key8": {"key9": "value 3 updated"}}}, + "key_10": [{"key_11": "value 4 updated"}], + } + ], + "key12": {"key 13": "value 4 updated"}, + "key14": [{"key 15": "value 5 updated"}], + "key16": "value6", + } + ] + + result = merge_dicts(old, new) + assert result == expected From 38836d10b152353544ebb3c4da1ca4efd9c991b5 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Mon, 14 Aug 2023 12:04:55 +0200 Subject: [PATCH 19/32] Rephrase as suggested --- plugins/module_utils/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index f883901e..b36da9e5 100644 --- a/plugins/module_utils/core.py +++ b/plugins/module_utils/core.py @@ -281,7 +281,7 @@ def present( if self.module.params.get("identifier"): _primary_identifier = [id.split("/")[-1] for id in primary_identifier] self.module.fail_json( - f"""You must specify together {*_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) From 0b136df7a9055015f028b0c08d4471d8ebdd5030 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Mon, 14 Aug 2023 12:09:59 +0200 Subject: [PATCH 20/32] Exclude python 3.9 testing on milestone from sanity and units Signed-off-by: Alina Buzachis --- .github/workflows/unit_and_sanity.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" From a70f412c4a6dea7175c1f896f43f1057fc7dad7d Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 16 Aug 2023 16:21:22 +0200 Subject: [PATCH 21/32] Enable memorydb tests Signed-off-by: Alina Buzachis --- plugins/module_utils/utils.py | 6 +----- tests/integration/targets/memorydb/aliases | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/plugins/module_utils/utils.py b/plugins/module_utils/utils.py index 90780572..cec8ee88 100644 --- a/plugins/module_utils/utils.py +++ b/plugins/module_utils/utils.py @@ -301,11 +301,7 @@ def merge_dicts(list1, list2): merged_list = list1.copy() for dict2 in list2: - matching_dicts = [ - dict1 - for dict1 in merged_list - if dict1.get("PolicyName") == dict2.get("PolicyName") - ] + matching_dicts = [dict1 for dict1 in merged_list] if matching_dicts: dict1 = matching_dicts[0] diff --git a/tests/integration/targets/memorydb/aliases b/tests/integration/targets/memorydb/aliases index dc7a5939..4ef4b206 100644 --- a/tests/integration/targets/memorydb/aliases +++ b/tests/integration/targets/memorydb/aliases @@ -1,4 +1 @@ cloud/aws - -# Missing permissions -disabled From f6ab466e4f1e94d5eee124afbc226bcc7d3ab0c4 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 16 Aug 2023 22:18:24 +0200 Subject: [PATCH 22/32] Fix merge_dicts Signed-off-by: Alina Buzachis --- plugins/module_utils/utils.py | 43 ++++++++++++++++----------- tests/unit/module_utils/test_utils.py | 35 ++++++++++++++++++++++ 2 files changed, 60 insertions(+), 18 deletions(-) diff --git a/plugins/module_utils/utils.py b/plugins/module_utils/utils.py index cec8ee88..7accc503 100644 --- a/plugins/module_utils/utils.py +++ b/plugins/module_utils/utils.py @@ -207,8 +207,9 @@ def boto3_tag_list_to_ansible_dict( ) -def map_key_to_alias(data, mapping): - mapped_data = {} +def map_key_to_alias(data: Dict, mapping: Dict) -> Dict: + mapped_data: Dict = {} + for key, value in data.items(): if key in mapping: mapped_key = mapping[key].get("aliases", [key])[0] @@ -297,34 +298,40 @@ def op(operation, path, value): return {"op": operation, "path": path, "value": value} -def merge_dicts(list1, list2): +def safe_json(data: str) -> Dict: + try: + json_object = json.loads(data) + except (ValueError, TypeError) as e: + return data + return json_object + + +def merge_dicts(list1: List, list2) -> List: merged_list = list1.copy() for dict2 in list2: - matching_dicts = [dict1 for dict1 in merged_list] - - if matching_dicts: - dict1 = matching_dicts[0] - for key, value in dict2.items(): - try: - value_dict = ast.literal_eval(value) - if isinstance(value_dict, dict): + 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: + dict1 = merged_list[index] + for key, value in dict2.items(): + value_dict = safe_json(value) + if isinstance(value_dict, dict) and isinstance(dict1[key], dict): dict1[key] = recursive_merge(dict1[key], value_dict) - elif isinstance(value_dict, list): - for item in value_dict: - if isinstance(item, dict): - dict1[key] = recursive_merge(dict1[key], item) + elif isinstance(value_dict, list) and isinstance(dict1[key], list): + dict1[key] = merge_dicts(dict1[key], value_dict) else: dict1[key] = value - except (SyntaxError, ValueError): - dict1[key] = value else: merged_list.append(dict2) return merged_list -def recursive_merge(dict1, dict2): +def recursive_merge(dict1: Dict, dict2: Dict) -> Dict: merged = dict1.copy() for key, value in dict2.items(): diff --git a/tests/unit/module_utils/test_utils.py b/tests/unit/module_utils/test_utils.py index b996b06e..ffe8abb6 100644 --- a/tests/unit/module_utils/test_utils.py +++ b/tests/unit/module_utils/test_utils.py @@ -348,3 +348,38 @@ def test_tag_merge_empty_dicts(): result = merge_dicts(old, new) assert result == expected + + +def test_merge_dicts_multi_dicts(): + old = [ + { + "key1": [{"key2": {"key3": ["A"]}, "key4": [{"key5": "B"}]}], + }, + { + "one key": [{"one key nested": {"one key very nested": ["C"]}}], + "another key": "D", + }, + ] + + new = [ + { + "key1": [{"key2": {"key3": ["A updated"]}}], + }, + { + "one key": [{"one key nested": {"one key very nested": ["F"]}}], + "another key": "D", + }, + ] + + expected = [ + { + "key1": [{"key2": {"key3": ["A updated"]}, "key4": [{"key5": "B"}]}], + }, + { + "one key": [{"one key nested": {"one key very nested": ["F"]}}], + "another key": "D", + }, + ] + + result = merge_dicts(old, new) + assert result == expected From b185d6b57949fa0649dac51fda13357c359a1ea2 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 16 Aug 2023 22:31:35 +0200 Subject: [PATCH 23/32] Remove unused import ast --- plugins/module_utils/utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/module_utils/utils.py b/plugins/module_utils/utils.py index 7accc503..5da679b1 100644 --- a/plugins/module_utils/utils.py +++ b/plugins/module_utils/utils.py @@ -2,7 +2,6 @@ # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -import ast import re import copy import json From f2b7c5674e298ab6997a01faeef23eef25a4c6d9 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 23 Aug 2023 16:16:16 +0200 Subject: [PATCH 24/32] Disable memorydb tests Signed-off-by: Alina Buzachis --- tests/integration/targets/memorydb/aliases | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/integration/targets/memorydb/aliases b/tests/integration/targets/memorydb/aliases index 4ef4b206..571cdff0 100644 --- a/tests/integration/targets/memorydb/aliases +++ b/tests/integration/targets/memorydb/aliases @@ -1 +1,4 @@ cloud/aws + +# Missing policy +disabled From 4e6e6d12599fbc174ba58f655b665d9131ed6feb Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Fri, 25 Aug 2023 16:27:38 +0200 Subject: [PATCH 25/32] Further fixes Signed-off-by: Alina Buzachis --- plugins/module_utils/core.py | 4 ++- plugins/module_utils/utils.py | 35 +++++++++++++++++++-- tests/unit/module_utils/test_utils.py | 44 ++++++++++++++++++++++++++- 3 files changed, 79 insertions(+), 4 deletions(-) diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index b36da9e5..716e59fa 100644 --- a/plugins/module_utils/core.py +++ b/plugins/module_utils/core.py @@ -59,6 +59,7 @@ camel_to_snake, json_patch, get_patch, + QuoteSwappingEncoder, ) 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 @@ -297,7 +298,8 @@ def present( def create_resource(self, type_name: str, params: Dict) -> bool: changed: bool = False - params = json.dumps(params) + + params = json.dumps(params, cls=QuoteSwappingEncoder) if not self.module.check_mode: try: diff --git a/plugins/module_utils/utils.py b/plugins/module_utils/utils.py index 5da679b1..2ee1f36f 100644 --- a/plugins/module_utils/utils.py +++ b/plugins/module_utils/utils.py @@ -207,6 +207,7 @@ 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(): @@ -306,6 +307,7 @@ def safe_json(data: str) -> Dict: def merge_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: @@ -318,9 +320,17 @@ def merge_dicts(list1: List, list2) -> List: dict1 = merged_list[index] for key, value in dict2.items(): value_dict = safe_json(value) - if isinstance(value_dict, dict) and isinstance(dict1[key], dict): + if ( + dict1.get(key, {}) + and isinstance(value_dict, dict) + and isinstance(dict1[key], dict) + ): dict1[key] = recursive_merge(dict1[key], value_dict) - elif isinstance(value_dict, list) and isinstance(dict1[key], list): + elif ( + dict1.get(key, []) + and isinstance(value_dict, list) + and isinstance(dict1[key], list) + ): dict1[key] = merge_dicts(dict1[key], value_dict) else: dict1[key] = value @@ -342,6 +352,27 @@ def recursive_merge(dict1: Dict, dict2: Dict) -> Dict: return merged +class QuoteSwappingEncoder(json.JSONEncoder): + def encode(self, o): + # Replace single quotes with double quotes and vice versa in the JSON data + def swap_quotes(item): + if isinstance(item, str): + return ( + item.replace("'", "__TEMP_SINGLE_QUOTE__") + .replace('"', "'") + .replace("__TEMP_SINGLE_QUOTE__", '"') + ) + elif isinstance(item, list): + return [swap_quotes(sub_item) for sub_item in item] + elif isinstance(item, dict): + return { + swap_quotes(key): swap_quotes(value) for key, value in item.items() + } + return item + + return super().encode(swap_quotes(o)) + + def make_op(path, old, new, strategy): _new_cpy = copy.deepcopy(new) diff --git a/tests/unit/module_utils/test_utils.py b/tests/unit/module_utils/test_utils.py index ffe8abb6..e5b56580 100644 --- a/tests/unit/module_utils/test_utils.py +++ b/tests/unit/module_utils/test_utils.py @@ -7,6 +7,9 @@ __metaclass__ = type + +import json + from ansible_collections.amazon.cloud.plugins.module_utils.utils import ( ansible_dict_to_boto3_tag_list, boto3_tag_list_to_ansible_dict, @@ -14,6 +17,7 @@ normalize_response, tag_merge, merge_dicts, + QuoteSwappingEncoder, ) @@ -298,7 +302,18 @@ def test_tag_merge_dicts(): assert dict_1 == expected -def test_tag_merge_empty_dicts(): +def test_merge_dicts_simple(): + old = [{"foo": "bar"}] + + new = [{"foo": "gaz", "someotherkey": {"blah": "asdf"}}] + + expected = [{"foo": "gaz", "someotherkey": {"blah": "asdf"}}] + + result = merge_dicts(old, new) + assert result == expected + + +def test_merge_dicts(): old = [ { "key1": [ @@ -383,3 +398,30 @@ def test_merge_dicts_multi_dicts(): result = merge_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"}' + + json.dumps(policy, indent=4, cls=QuoteSwappingEncoder) == expected From be09f29d3c03ad74720f53b8c427731b3c9a78c4 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Fri, 25 Aug 2023 16:49:57 +0200 Subject: [PATCH 26/32] Format Signed-off-by: Alina Buzachis --- tests/unit/module_utils/test_utils.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/unit/module_utils/test_utils.py b/tests/unit/module_utils/test_utils.py index e5b56580..5af1a6c7 100644 --- a/tests/unit/module_utils/test_utils.py +++ b/tests/unit/module_utils/test_utils.py @@ -416,12 +416,23 @@ def test_swap_quotes(): "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': '*'}]}", + "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"}' + 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"}' json.dumps(policy, indent=4, cls=QuoteSwappingEncoder) == expected From 610f28e0a7054b16be66fc19aabd326fa49d8d70 Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Fri, 25 Aug 2023 18:13:11 +0200 Subject: [PATCH 27/32] Revert s3 integration tests Signed-off-by: Alina Buzachis --- plugins/module_utils/core.py | 3 +++ tests/integration/targets/s3/aliases | 2 -- tests/integration/targets/s3/tasks/main.yml | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index 716e59fa..1726c232 100644 --- a/plugins/module_utils/core.py +++ b/plugins/module_utils/core.py @@ -230,6 +230,9 @@ 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: diff --git a/tests/integration/targets/s3/aliases b/tests/integration/targets/s3/aliases index b547e8f2..f1e0d7e3 100644 --- a/tests/integration/targets/s3/aliases +++ b/tests/integration/targets/s3/aliases @@ -1,4 +1,2 @@ cloud/aws zuul/aws/cloud_control - -disabled # Temporary disabled because they throw several ThrottlingExceptions and it needs further investigation diff --git a/tests/integration/targets/s3/tasks/main.yml b/tests/integration/targets/s3/tasks/main.yml index 13db84c3..fd451abf 100644 --- a/tests/integration/targets/s3/tasks/main.yml +++ b/tests/integration/targets/s3/tasks/main.yml @@ -57,16 +57,18 @@ that: - _result is success + # Add ignore_errors: true because it throws ThrottlingException - name: List S3 buckets amazon.cloud.s3_bucket: state: list register: _result tags: - docs + ignore_errors: true - - assert: - that: - - _result is success + # - assert: + # that: + # - _result is success - name: Create S3 bucket - idempotence amazon.cloud.s3_bucket: From 75dd8cb601bec7fd0b80e6820ad841554f27161e Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Fri, 25 Aug 2023 18:18:10 +0200 Subject: [PATCH 28/32] Revert s3 integration tests Signed-off-by: Alina Buzachis --- tests/integration/targets/s3/aliases | 2 ++ tests/integration/targets/s3/tasks/main.yml | 15 +++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/integration/targets/s3/aliases b/tests/integration/targets/s3/aliases index f1e0d7e3..b547e8f2 100644 --- a/tests/integration/targets/s3/aliases +++ b/tests/integration/targets/s3/aliases @@ -1,2 +1,4 @@ cloud/aws zuul/aws/cloud_control + +disabled # Temporary disabled because they throw several ThrottlingExceptions and it needs further investigation diff --git a/tests/integration/targets/s3/tasks/main.yml b/tests/integration/targets/s3/tasks/main.yml index fd451abf..ff657be7 100644 --- a/tests/integration/targets/s3/tasks/main.yml +++ b/tests/integration/targets/s3/tasks/main.yml @@ -9,7 +9,7 @@ - amazon.cloud block: - - name: Set S3 bucket name + - name: Set S3 bucket name set_fact: bucket_name: "{{ lookup('password', '/dev/null') | to_uuid }}" @@ -57,18 +57,16 @@ that: - _result is success - # Add ignore_errors: true because it throws ThrottlingException - name: List S3 buckets amazon.cloud.s3_bucket: state: list register: _result tags: - docs - ignore_errors: true - # - assert: - # that: - # - _result is success + - assert: + that: + - _result is success - name: Create S3 bucket - idempotence amazon.cloud.s3_bucket: @@ -136,10 +134,7 @@ - _result is changed - "'diff' in _result" - _result.diff.after != {} - # public_access_block_configuration settings are now all true by default and - # they will be always returned by the API. That's why _result.diff.before won't be - # expected to be empty anymore. - # - _result.diff.before == {} + - _result.diff.before == {} - name: Update S3 bucket public access block configuration and tags - idempotence (diff=true) amazon.cloud.s3_bucket: From d4986ba7e12c4b54523c05b11bfde1b05069a19a Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 30 Aug 2023 18:34:05 +0200 Subject: [PATCH 29/32] Fix merge_dicts and rename it to merge_list_of_dicts and add rds integration tests Signed-off-by: Alina Buzachis --- plugins/module_utils/core.py | 12 +- plugins/module_utils/utils.py | 184 +++++- tests/integration/targets/rds/aliases | 1 + .../integration/targets/rds/defaults/main.yml | 17 + tests/integration/targets/rds/tasks/main.yml | 606 ++++++++++++++++++ tests/unit/module_utils/test_utils.py | 232 +++++-- 6 files changed, 960 insertions(+), 92 deletions(-) create mode 100644 tests/integration/targets/rds/aliases create mode 100644 tests/integration/targets/rds/defaults/main.yml create mode 100644 tests/integration/targets/rds/tasks/main.yml diff --git a/plugins/module_utils/core.py b/plugins/module_utils/core.py index 1726c232..df09069a 100644 --- a/plugins/module_utils/core.py +++ b/plugins/module_utils/core.py @@ -59,7 +59,8 @@ camel_to_snake, json_patch, get_patch, - QuoteSwappingEncoder, + 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 @@ -302,7 +303,7 @@ def present( def create_resource(self, type_name: str, params: Dict) -> bool: changed: bool = False - params = json.dumps(params, cls=QuoteSwappingEncoder) + params = json.dumps(ensure_json_dumps(params)) if not self.module.check_mode: try: @@ -464,6 +465,9 @@ def update_resource( # Ignore createOnlyProperties that can be set only during resource creation 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: @@ -488,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') diff --git a/plugins/module_utils/utils.py b/plugins/module_utils/utils.py index 2ee1f36f..97cccd9a 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 @@ -298,15 +299,86 @@ def op(operation, path, value): return {"op": operation, "path": path, "value": value} -def safe_json(data: str) -> Dict: +def safe_json(data): try: json_object = json.loads(data) - except (ValueError, TypeError) as e: - return 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 merge_dicts(list1: List, list2) -> List: +def helper_sort_dict(obj): + """ + Order a nested complex dictionary + """ + 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=lambda x: json.dumps(x)) + + 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(type(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() @@ -317,24 +389,36 @@ def merge_dicts(list1: List, list2) -> List: if matching_indices: for index in matching_indices: - dict1 = merged_list[index] - 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) - ): - dict1[key] = merge_dicts(dict1[key], value_dict) - else: - dict1[key] = value + 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 @@ -346,6 +430,12 @@ def recursive_merge(dict1: Dict, dict2: Dict) -> Dict: 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 @@ -353,8 +443,7 @@ def recursive_merge(dict1: Dict, dict2: Dict) -> Dict: class QuoteSwappingEncoder(json.JSONEncoder): - def encode(self, o): - # Replace single quotes with double quotes and vice versa in the JSON data + def encode(self, obj): def swap_quotes(item): if isinstance(item, str): return ( @@ -362,15 +451,45 @@ def swap_quotes(item): .replace('"', "'") .replace("__TEMP_SINGLE_QUOTE__", '"') ) - elif isinstance(item, list): - return [swap_quotes(sub_item) for sub_item in item] - elif isinstance(item, dict): - return { - swap_quotes(key): swap_quotes(value) for key, value in item.items() - } return item - return super().encode(swap_quotes(o)) + return super().encode(swap_quotes(obj)) + + +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): @@ -381,11 +500,12 @@ def make_op(path, old, new, strategy): _new_cpy = dict(old, **new) elif isinstance(old, list): if strategy == "merge": + _old_cpy = copy.deepcopy(old) if path == "Tags": - _old_cpy = copy.deepcopy(old) _new_cpy = tag_merge(_old_cpy, new) else: - _new_cpy = merge_dicts(old, new) + # When list of dictionaries different with keys different that Key and values than Value need to be merged + _new_cpy = merge_list_of_dicts(_old_cpy, new) return op("replace", path, _new_cpy) 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/unit/module_utils/test_utils.py b/tests/unit/module_utils/test_utils.py index 5af1a6c7..efc08f36 100644 --- a/tests/unit/module_utils/test_utils.py +++ b/tests/unit/module_utils/test_utils.py @@ -16,8 +16,8 @@ diff_dicts, normalize_response, tag_merge, - merge_dicts, - QuoteSwappingEncoder, + merge_list_of_dicts, + ensure_json_dumps, ) @@ -302,101 +302,219 @@ def test_tag_merge_dicts(): assert dict_1 == expected -def test_merge_dicts_simple(): +def test_merge_list_of_dicts_simple(): old = [{"foo": "bar"}] - new = [{"foo": "gaz", "someotherkey": {"blah": "asdf"}}] - expected = [{"foo": "gaz", "someotherkey": {"blah": "asdf"}}] - result = merge_dicts(old, new) + result = merge_list_of_dicts(old, new) assert result == expected -def test_merge_dicts(): +def test_merge_list_of_dicts_rds_1(): old = [ { - "key1": [ - { - "key2": {"key3": ["value 1"]}, - "key4": {"key5": ["value 2"]}, - "key 6": {"key7": {"key8": {"key9": "value 3"}}}, - "key_10": [{"key_11": "value 4"}], - } + "VpcSecurityGroupMemberships": [ + "sg-0529298fedfbd1554", ], - "key12": '{"key 13": "value 4"}', - "key14": '[{"key 15": "value 5"}]', - "key16": "value6", + "OptionSettings": [ + {"Value": "20", "Name": "MAX_SIMULTANEOUS_CONNECTIONS"}, + {"Value": "10", "Name": "A"}, + {"Value": "40", "Name": "B"}, + ], + "Port": 11211, + "OptionName": "MEMCACHED", + "DBSecurityGroupMemberships": [], } ] new = [ { - "key1": [ - { - "key2": {"key3": ["value 1"]}, - "key4": {"key5": ["value 2 updated"]}, - "key 6": {"key7": {"key8": {"key9": "value 3 updated"}}}, - "key_10": [{"key_11": "value 4 updated"}], - } + "OptionName": "MEMCACHED", + "Port": 11211, + "VpcSecurityGroupMemberships": ["sg-0529298fedfbd1554", "sg-test"], + "OptionSettings": [ + {"Name": "MAX_SIMULTANEOUS_CONNECTIONS", "Value": "30"}, + {"Name": "CHUNK_SIZE_GROWTH_FACTOR", "Value": "1.25"}, ], - "key12": {"key 13": "value 4 updated"}, - "key14": [{"key 15": "value 5 updated"}], } ] - expected = [ { - "key1": [ - { - "key2": {"key3": ["value 1"]}, - "key4": {"key5": ["value 2 updated"]}, - "key 6": {"key7": {"key8": {"key9": "value 3 updated"}}}, - "key_10": [{"key_11": "value 4 updated"}], - } + "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"}, ], - "key12": {"key 13": "value 4 updated"}, - "key14": [{"key 15": "value 5 updated"}], - "key16": "value6", + "DBSecurityGroupMemberships": [], } ] - result = merge_dicts(old, new) + result = merge_list_of_dicts(old, new) assert result == expected -def test_merge_dicts_multi_dicts(): +def test_merge_list_of_dicts_rds_2(): old = [ { - "key1": [{"key2": {"key3": ["A"]}, "key4": [{"key5": "B"}]}], - }, + "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 = [ { - "one key": [{"one key nested": {"one key very nested": ["C"]}}], - "another key": "D", - }, + "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 = [ { - "key1": [{"key2": {"key3": ["A updated"]}}], - }, + "PolicyName": "dr-lambda-policy", + "PolicyDocument": "{'Version': '2012-10-17', 'Statement': [{'Effect': 'Allow', 'Action': ['logs:CreateLogGroup', 'logs:CreateLogStream', 'logs:PutLogEvents'], 'Resource': 'arn:aws:logs:*:*:*'}]}", + } + ] + expected = [ { - "one key": [{"one key nested": {"one key very nested": ["F"]}}], - "another key": "D", - }, + "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", + }, + ], + }, + } ] - expected = [ + result = merge_list_of_dicts(old, new) + assert result == expected + + +def test_merge_list_of_dicts_eks(): + old = [{"labels": [{"key": "test", "value": "test"}], "namespace": "fp-default"}] + + new = [ { - "key1": [{"key2": {"key3": ["A updated"]}, "key4": [{"key5": "B"}]}], - }, + "labels": [ + {"key": "test", "value": "test"}, + {"key": "another key label name", "value": "another key label value"}, + ], + "namespace": "fp-default", + } + ] + expected = [ { - "one key": [{"one key nested": {"one key very nested": ["F"]}}], - "another key": "D", - }, + "labels": [ + {"key": "test", "value": "test"}, + {"key": "another key label name", "value": "another key label value"}, + ], + "namespace": "fp-default", + } ] - result = merge_dicts(old, new) + result = merge_list_of_dicts(old, new) assert result == expected @@ -435,4 +553,4 @@ def test_swap_quotes(): {\\"Effect\\": \\"Allow\\", \\"Action\\": \\"lambda:InvokeFunction\\", \\"Resource\\": \\"*\\"}]}"}], \ "RoleName": "dr-lambda-role"}' - json.dumps(policy, indent=4, cls=QuoteSwappingEncoder) == expected + ensure_json_dumps(policy) == expected From 04bf82042e0297b670a032a23dfe7d7fc403308c Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 30 Aug 2023 18:57:05 +0200 Subject: [PATCH 30/32] Fix linter Signed-off-by: Alina Buzachis --- plugins/module_utils/utils.py | 2 +- tests/unit/module_utils/test_utils.py | 26 -------------------------- tox.ini | 6 +++--- 3 files changed, 4 insertions(+), 30 deletions(-) diff --git a/plugins/module_utils/utils.py b/plugins/module_utils/utils.py index 97cccd9a..8b644495 100644 --- a/plugins/module_utils/utils.py +++ b/plugins/module_utils/utils.py @@ -504,7 +504,7 @@ def make_op(path, old, new, strategy): if path == "Tags": _new_cpy = tag_merge(_old_cpy, new) else: - # When list of dictionaries different with keys different that Key and values than Value need to be merged + # 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/tests/unit/module_utils/test_utils.py b/tests/unit/module_utils/test_utils.py index efc08f36..7db8bc3e 100644 --- a/tests/unit/module_utils/test_utils.py +++ b/tests/unit/module_utils/test_utils.py @@ -492,32 +492,6 @@ def test_merge_list_of_dicts_iam(): assert result == expected -def test_merge_list_of_dicts_eks(): - old = [{"labels": [{"key": "test", "value": "test"}], "namespace": "fp-default"}] - - new = [ - { - "labels": [ - {"key": "test", "value": "test"}, - {"key": "another key label name", "value": "another key label value"}, - ], - "namespace": "fp-default", - } - ] - expected = [ - { - "labels": [ - {"key": "test", "value": "test"}, - {"key": "another key label name", "value": "another key label value"}, - ], - "namespace": "fp-default", - } - ] - - result = merge_list_of_dicts(old, new) - assert result == expected - - def test_swap_quotes(): policy = { "AssumeRolePolicyDocument": { diff --git a/tox.ini b/tox.ini index 94eb47f4..856b0033 100644 --- a/tox.ini +++ b/tox.ini @@ -61,18 +61,18 @@ setenv = [flake8] # E123, E125 skipped as they are invalid PEP-8. show-source = True -ignore = E123,E125,E203,E402,E501,E741,F401,F811,F841,W503 +ignore = E123,E125,E203,E402,E501,E741,F401,F811,F841,W503, E721 max-line-length = 160 builtins = _ exclude = .git,.tox,tests/unit/compat/ [testenv:prepare_release] -deps = +deps = pyyaml antsibull-changelog -allowlist_externals = +allowlist_externals = {toxinidir}/tools/update_constants.py commands = From a8c15023e21543b7bda49ee5f1dc96e85cee6bea Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 30 Aug 2023 19:26:15 +0200 Subject: [PATCH 31/32] Make linter happy Signed-off-by: Alina Buzachis --- plugins/module_utils/utils.py | 14 ++++++++++---- tests/unit/module_utils/test_utils.py | 6 +++--- tox.ini | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/plugins/module_utils/utils.py b/plugins/module_utils/utils.py index 8b644495..4045471e 100644 --- a/plugins/module_utils/utils.py +++ b/plugins/module_utils/utils.py @@ -316,6 +316,10 @@ 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(): @@ -326,7 +330,7 @@ def helper_sort_dict(obj): for i, v in enumerate(obj): if isinstance(v, dict) or isinstance(v, list): obj[i] = helper_sort_dict(v) - obj = sorted(obj, key=lambda x: json.dumps(x)) + obj = sorted(obj, key=custom_key) return obj @@ -348,7 +352,9 @@ def merge_lists(list1, list2): for key in dict2: if dict1.get(key) == dict2.get(key): # Enforce matching between dictionaries - if all(type(dict1[key]) == type(dict2[key]) for key in dict1): + 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: @@ -443,7 +449,7 @@ def recursive_merge(dict1: Dict, dict2: Dict) -> Dict: class QuoteSwappingEncoder(json.JSONEncoder): - def encode(self, obj): + def encode(self, o): def swap_quotes(item): if isinstance(item, str): return ( @@ -453,7 +459,7 @@ def swap_quotes(item): ) return item - return super().encode(swap_quotes(obj)) + return super().encode(swap_quotes(o)) def ensure_json_dumps(data): diff --git a/tests/unit/module_utils/test_utils.py b/tests/unit/module_utils/test_utils.py index 7db8bc3e..40bfe765 100644 --- a/tests/unit/module_utils/test_utils.py +++ b/tests/unit/module_utils/test_utils.py @@ -8,8 +8,6 @@ __metaclass__ = type -import json - from ansible_collections.amazon.cloud.plugins.module_utils.utils import ( ansible_dict_to_boto3_tag_list, boto3_tag_list_to_ansible_dict, @@ -460,7 +458,9 @@ def test_merge_list_of_dicts_iam(): new = [ { "PolicyName": "dr-lambda-policy", - "PolicyDocument": "{'Version': '2012-10-17', 'Statement': [{'Effect': 'Allow', 'Action': ['logs:CreateLogGroup', 'logs:CreateLogStream', 'logs:PutLogEvents'], 'Resource': 'arn:aws:logs:*:*:*'}]}", + "PolicyDocument": "{'Version': '2012-10-17', \ + 'Statement': [{'Effect': 'Allow', 'Action': ['logs:CreateLogGroup', 'logs:CreateLogStream', 'logs:PutLogEvents'], \ + 'Resource': 'arn:aws:logs:*:*:*'}]}", } ] expected = [ diff --git a/tox.ini b/tox.ini index 856b0033..1cb9fabf 100644 --- a/tox.ini +++ b/tox.ini @@ -61,7 +61,7 @@ setenv = [flake8] # E123, E125 skipped as they are invalid PEP-8. show-source = True -ignore = E123,E125,E203,E402,E501,E741,F401,F811,F841,W503, E721 +ignore = E123,E125,E203,E402,E501,E741,F401,F811,F841,W503 max-line-length = 160 builtins = _ exclude = .git,.tox,tests/unit/compat/ From 92b6d786fe0c66a8c125439041f5c8322e838c9a Mon Sep 17 00:00:00 2001 From: Alina Buzachis Date: Wed, 30 Aug 2023 21:59:59 +0200 Subject: [PATCH 32/32] Use amazon.cloud.iam_role instead of community.aws.iam_role to avoid installing the community.aws collection Signed-off-by: Alina Buzachis --- .../integration/targets/eks/tasks/cleanup.yml | 11 ++--- .../targets/eks/tasks/eks_cluster.yml | 14 +++--- .../targets/eks/tasks/eks_fargate_profile.yml | 45 +++++++++---------- .../targets/eks/tasks/set_facts.yml | 2 +- tests/integration/targets/memorydb/aliases | 3 -- 5 files changed, 36 insertions(+), 39 deletions(-) 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/memorydb/aliases b/tests/integration/targets/memorydb/aliases index 571cdff0..4ef4b206 100644 --- a/tests/integration/targets/memorydb/aliases +++ b/tests/integration/targets/memorydb/aliases @@ -1,4 +1 @@ cloud/aws - -# Missing policy -disabled