Learn Idem

Learn Idem

Powered by Idem Project

aws.eks.cluster

**Autogenerated function**

Deletes the Amazon EKS cluster control plane. If you have active services in your cluster that are associated
with a load balancer, you must delete those services before deleting the cluster so that the load balancers are
deleted properly. Otherwise, you can have orphaned resources in your VPC that prevent you from being able to
delete the VPC. For more information, see Deleting a Cluster in the Amazon EKS User Guide. If you have managed
node groups or Fargate profiles attached to the cluster, you must delete them first. For more information, see
DeleteNodegroup and DeleteFargateProfile.

Args:
    name(Text): An Idem name of the EKS cluster resource.
    resource_id(Text, optional): AWS EKS cluster name. Idem automatically considers this resource being absent
     if this field is not specified.
    timeout(Dict, optional): Timeout configuration for deleting cluster.
        * delete (Dict) -- Timeout configuration for deleting cluster
            * delay(int, default=60) -- The amount of time in seconds to wait between attempts.
            * max_attempts(int, default=40) -- Customized timeout configuration containing delay and max attempts.


Request syntax:
    [eks_cluster_name]:
      aws.eks.cluster.absent:
        - name: 'string'
        - resource_id: 'string'

Returns:
    Dict[str, Any]

Examples:

    .. code-block:: sls

        eks_cluster_prod:
          aws.eks.cluster.absent:
            - name: eks_cluster_prod
            - resource_id: eks_cluster_prod
**Autogenerated function**

Describe the resource in a way that can be recreated/managed with the corresponding "present" function


Lists the Amazon EKS clusters in your Amazon Web Services account in the specified Region.


Returns:
    Dict[str, Any]

Examples:

    .. code-block:: bash

        $ idem describe aws.eks.cluster
**Autogenerated function**

Creates an Amazon EKS control plane.  The Amazon EKS control plane consists of control plane instances that run
the Kubernetes software, such as etcd and the API server. The control plane runs in an account managed by Amazon
Web Services, and the Kubernetes API is exposed by the Amazon EKS API server endpoint. Each Amazon EKS cluster
control plane is single tenant and unique. It runs on its own set of Amazon EC2 instances. The cluster control
plane is provisioned across multiple Availability Zones and fronted by an Elastic Load Balancing Network Load
Balancer. Amazon EKS also provisions elastic network interfaces in your VPC subnets to provide connectivity from
the control plane instances to the nodes (for example, to support kubectl exec, logs, and proxy data flows).
Amazon EKS nodes run in your Amazon Web Services account and connect to your cluster's control plane over the
Kubernetes API server endpoint and a certificate file that is created for your cluster. In most cases, it takes
several minutes to create a cluster. After you create an Amazon EKS cluster, you must configure your Kubernetes
tooling to communicate with the API server and launch nodes into your cluster. For more information, see
Managing Cluster Authentication and Launching Amazon EKS nodes in the Amazon EKS User Guide.

Args:
    name(str): The unique name to give to your cluster.
    resource_id(Text, optional): An identifier of the resource in the provider. Defaults to None.
    version(str, optional): The desired Kubernetes version for your cluster. If you don't specify a value here, the latest
        version available in Amazon EKS is used. Defaults to None.
    role_arn(str): The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes
        control plane to make calls to Amazon Web Services API operations on your behalf. For more
        information, see Amazon EKS Service IAM Role in the  Amazon EKS User Guide .
    resources_vpc_config(Dict[str, Any]): The VPC configuration that's used by the cluster control plane. Amazon EKS VPC resources have
        specific requirements to work properly with Kubernetes. For more information, see Cluster VPC
        Considerations and Cluster Security Group Considerations in the Amazon EKS User Guide. You must
        specify at least two subnets. You can specify up to five security groups. However, we recommend
        that you use a dedicated security group for your cluster control plane.
        * subnetIds (List[str], optional): Specify subnets for your Amazon EKS nodes. Amazon EKS creates cross-account elastic network
            interfaces in these subnets to allow communication between your nodes and the Kubernetes control
            plane.
        * securityGroupIds (List[str], optional): Specify one or more security groups for the cross-account elastic network interfaces that Amazon
            EKS creates to use that allow communication between your nodes and the Kubernetes control plane.
            If you don't specify any security groups, then familiarize yourself with the difference between
            Amazon EKS defaults for clusters deployed with Kubernetes:   1.14 Amazon EKS platform version
            eks.2 and earlier   1.14 Amazon EKS platform version eks.3 and later    For more information,
            see Amazon EKS security group considerations in the  Amazon EKS User Guide.
        * endpointPublicAccess (bool, optional): Set this value to false to disable public access to your cluster's Kubernetes API server
            endpoint. If you disable public access, your cluster's Kubernetes API server can only receive
            requests from within the cluster VPC. The default value for this parameter is true, which
            enables public access for your Kubernetes API server. For more information, see Amazon EKS
            cluster endpoint access control in the  Amazon EKS User Guide.
        * endpointPrivateAccess (bool, optional): Set this value to true to enable private access for your cluster's Kubernetes API server
            endpoint. If you enable private access, Kubernetes API requests from within your cluster's VPC
            use the private VPC endpoint. The default value for this parameter is false, which disables
            private access for your Kubernetes API server. If you disable private access and you have nodes
            or Fargate pods in the cluster, then ensure that publicAccessCidrs includes the necessary CIDR
            blocks for communication with the nodes or Fargate pods. For more information, see Amazon EKS
            cluster endpoint access control in the  Amazon EKS User Guide.
        * publicAccessCidrs (List[str], optional): The CIDR blocks that are allowed access to your cluster's public Kubernetes API server endpoint.
            Communication to the endpoint from addresses outside of the CIDR blocks that you specify is
            denied. The default value is 0.0.0.0/0. If you've disabled private endpoint access and you have
            nodes or Fargate pods in the cluster, then ensure that you specify the necessary CIDR blocks.
            For more information, see Amazon EKS cluster endpoint access control in the  Amazon EKS User
            Guide.
    kubernetes_network_config(Dict[str, Any], optional): The Kubernetes network configuration for the cluster. Defaults to None.
        * serviceIpv4Cidr (str, optional): Don't specify a value if you select ipv6 for ipFamily. The CIDR block to assign Kubernetes
            service IP addresses from. If you don't 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.
            The block must meet the following requirements:   Within one of the following private IP address
            blocks: 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16.   Doesn't overlap with any CIDR block
            assigned to the VPC that you selected for VPC.   Between /24 and /12.    You can only specify a
            custom CIDR block when you create a cluster and can't change this value once the cluster is
            created.
        * ipFamily (str, optional): Specify which IP family is used to assign Kubernetes pod and service IP addresses. If you don't
            specify a value, ipv4 is used by default. You can only specify an IP family when you create a
            cluster and can't change this value once the cluster is created. If you specify ipv6, the VPC
            and subnets that you specify for cluster creation must have both IPv4 and IPv6 CIDR blocks
            assigned to them. You can't specify ipv6 for clusters in China Regions. 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.
            If you specify ipv6, then ensure that your VPC meets the requirements listed in the
            considerations listed in Assigning IPv6 addresses to pods and services in the Amazon EKS User
            Guide. Kubernetes assigns services IPv6 addresses from the unique local address range
            (fc00::/7). You can't specify a custom IPv6 CIDR block. Pod addresses are assigned from the
            subnet's IPv6 CIDR.
    logging(Dict[str, Any], optional): Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch
        Logs. By default, cluster control plane logs aren't exported to CloudWatch Logs. For more
        information, see Amazon EKS Cluster control plane logs in the  Amazon EKS User Guide .
        CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control
        plane logs. For more information, see CloudWatch Pricing. Defaults to None.
        * clusterLogging (List[Dict[str, Any]], optional): The cluster control plane logging configuration for your cluster.
            * types (List[str], optional): The available cluster control plane log types.
            * enabled (bool, optional): If a log type is enabled, that log type exports its control plane logs to CloudWatch Logs. If a
                log type isn't enabled, that log type doesn't export its control plane logs. Each individual log
                type can be enabled or disabled independently.
    tags(Dict[str, str], optional): The metadata to apply to the cluster to assist with categorization and organization. Each tag
        consists of a key and an optional value. You define both. Defaults to None.
    encryption_config(List[Dict[str, Any]], optional): The encryption configuration for the cluster. Defaults to None.
        * resources (List[str], optional): Specifies the resources to be encrypted. The only supported value is "secrets".
        * provider (Dict[str, Any], optional): Key Management Service (KMS) key. Either the ARN or the alias can be used.
            * keyArn (str, optional): Amazon Resource Name (ARN) or alias of the KMS key. The KMS key must be symmetric, created in
                the same region as the cluster, and if the KMS key was created in a different account, the user
                must have access to the KMS key. For more information, see Allowing Users in Other Accounts to
                Use a KMS key in the Key Management Service Developer Guide.
    timeout(Dict, optional): Timeout configuration for creating or updating cluster.
        * create (Dict) -- Timeout configuration for creating cluster
            * delay(int, default=60) -- The amount of time in seconds to wait between attempts.
            * max_attempts(int, default=40) -- Customized timeout configuration containing delay and max attempts.
        * update (string) -- Timeout configuration for updating cluster
            * delay(int, default=60) -- The amount of time in seconds to wait between attempts.
            * max_attempts(int, default=40) -- Customized timeout configuration containing delay and max attempts.

Request Syntax:
    [eks-cluster-resource-name]:
        aws.eks.cluster.present:
          - role_arn: 'string'
          - version: 'string'
          - resource_id: 'string'
          - resources_vpc_config:
              endpointPrivateAccess: boolean
              endpointPublicAccess: boolean
              publicAccessCidrs: list
              securityGroupIds:
              - 'string'
              subnetIds:
              - 'string'
              - 'string'
          - kubernetes_network_config:
              ipFamily: 'string'
              serviceIpv4Cidr: 'string'
          - logging:
              clusterLogging:
              - enabled: boolean
                types:
                - 'string'
                - 'string'
              - enabled: boolean
                types:
                - 'string'
                - 'string'
                - 'string'
          - tags:
             'string': 'string'
          - timeout:
               create:
                  delay: 'integer'
                  max_attempts: 'integer'
               update:
                  delay: 'integer'
                  max_attempts: 'integer

Returns:
    Dict[str, Any]

Examples:

    .. code-block:: sls

        my_cluster:
          aws.eks.cluster.present:
          - role_arn: arn:aws:iam::202236654445:role/ek1
          - version: '1.21'
          - resource_id: eks-e45k5n423
          - resources_vpc_config:
              endpointPrivateAccess: true
              endpointPublicAccess: false
              publicAccessCidrs: []
              securityGroupIds:
              - sg-000b8c21b6b480577
              subnetIds:
              - subnet-07bc4715744fb7b39
              - subnet-0aa66edffb00d8881
          - kubernetes_network_config:
              ipFamily: ipv4
              serviceIpv4Cidr: 172.20.0.0/16
          - logging:
              clusterLogging:
              - enabled: true
                types:
                - api
                - audit
              - enabled: false
                types:
                - authenticator
                - controllerManager
                - scheduler
          - tags:
              Name: eks-cluster-name
Provides details about a specific Cluster as a data-source.

Args:
    name(Text):
         An Idem name of the EKS cluster resource.

    resource_id(Text, optional):
        AWS EKS cluster name to identify the resource.


Request Syntax:
    [Idem-state-name]:
      aws.eks.cluster.search:
          - name: 'string'
          - resource_id: 'string'

Response Syntax:
    The following fields will be returned in the `new_state` of the response.

    - name: 'string'
    - resource_id: 'string'
    - role_arn: 'string'
    - arn: 'string'
    - status: 'string'
    - version: 'string'
    - resources_vpc_config:
        clusterSecurityGroupId: 'string'
        endpointPrivateAccess: boolean
        endpointPublicAccess: boolean
        publicAccessCidrs:
        - 'string'
        securityGroupIds: list
        subnetIds:
        - 'string'
        - 'string'
        vpcId: 'string'
    - kubernetes_network_config:
        ipFamily: 'string'
        serviceIpv4Cidr: 'string'
    - logging:
        clusterLogging:
        - enabled: boolean
          types:
          - 'string'
          - 'string'
          - 'string'
          - 'string'
    - tags:
        'string': 'string'
    - oidc_identity_issuer: 'string'
    - endpoint: 'string'
    - certificate_authority:
        data: 'string'

Examples:

    Input state file:

    .. code-block:: bash

        idem-test-cluster-search:
            aws.eks.cluster.search:
              - name: idem-test-cluster-search
              - resource_id: cluster-1

    Sample response:

        - name: cluster-1
        - resource_id: cluster-1
        - role_arn: arn:aws:iam::598227425989:role/eksClusterRole
        - arn: arn:aws:eks:us-west-2:598227425989:cluster/cluster01
        - status: ACTIVE
        - version: '1.21'
        - resources_vpc_config:
            clusterSecurityGroupId: sg-0e364c2e68739a515
            endpointPrivateAccess: false
            endpointPublicAccess: true
            publicAccessCidrs:
            - 0.0.0.0/0
            securityGroupIds: []
            subnetIds:
            - subnet-0f08315b4e261dd70
            - subnet-0a8bfb7b1298755e0
            vpcId: vpc-06ad93e0c4ccdf8b3
        - kubernetes_network_config:
            ipFamily: ipv4
            serviceIpv4Cidr: 172.20.0.0/16
        - logging:
            clusterLogging:
            - enabled: false
              types:
              - api
              - audit
              - authenticator
              - controllerManager
              - scheduler
        - tags:
            Name: cluster-1
        - oidc_identity_issuer: https://oidc.eks.us-west-2.amazonaws.com/id/4E0FCBD1CFBD5DD3C662D0AED6514340
        - endpoint: https://4E0FCBD1CFBD5DD3C662D0AED6514340.sk1.us-west-2.eks.amazonaws.com
        - certificate_authority:
            data: LS0tLjdExMNgpnQU5GQmtOYk5tUWxoaUkyZmg0dzB2SGVUTlN4MkNnYk5VN29mTEt4cmxNNjhvZ0YyXZUOEQ3TDEvaHhQQW9YMzZ6lyCjBEcDRvb

Full plugin documentation is available on the Idem documentation site - aws.eks.cluster .

Last updated on 20 Sep 2022
 Edit on GitHub