ClusterAttributes

class aws_cdk.aws_eks_v2.ClusterAttributes(*, cluster_name, cluster_certificate_authority_data=None, cluster_encryption_config_key_arn=None, cluster_endpoint=None, cluster_security_group_id=None, ip_family=None, kubectl_provider=None, kubectl_provider_options=None, open_id_connect_provider=None, prune=None, security_group_ids=None, vpc=None)

Bases: object

Attributes for EKS clusters.

Parameters:
  • cluster_name (str) – The physical name of the Cluster.

  • cluster_certificate_authority_data (Optional[str]) – The certificate-authority-data for your cluster. Default: - if not specified cluster.clusterCertificateAuthorityData will throw an error

  • cluster_encryption_config_key_arn (Optional[str]) – Amazon Resource Name (ARN) or alias of the customer master key (CMK). Default: - if not specified cluster.clusterEncryptionConfigKeyArn will throw an error

  • cluster_endpoint (Optional[str]) – The API Server endpoint URL. Default: - if not specified cluster.clusterEndpoint will throw an error.

  • cluster_security_group_id (Optional[str]) – The cluster security group that was created by Amazon EKS for the cluster. Default: - if not specified cluster.clusterSecurityGroupId will throw an error

  • ip_family (Optional[IpFamily]) – Specify which IP family is used to assign Kubernetes pod and service IP addresses. Default: - IpFamily.IP_V4

  • kubectl_provider (Optional[IKubectlProvider]) – KubectlProvider for issuing kubectl commands. Default: - Default CDK provider

  • kubectl_provider_options (Union[KubectlProviderOptions, Dict[str, Any], None]) – Options for creating the kubectl provider - a lambda function that executes kubectl and helm against the cluster. If defined, kubectlLayer is a required property. Default: - kubectl provider will not be created by default.

  • open_id_connect_provider (Optional[IOpenIdConnectProvider]) – An Open ID Connect provider for this cluster that can be used to configure service accounts. You can either import an existing provider using iam.OpenIdConnectProvider.fromProviderArn, or create a new provider using new eks.OpenIdConnectProvider Default: - if not specified cluster.openIdConnectProvider and cluster.addServiceAccount will throw an error.

  • prune (Optional[bool]) – Indicates whether Kubernetes resources added through addManifest() can be automatically pruned. When this is enabled (default), prune labels will be allocated and injected to each resource. These labels will then be used when issuing the kubectl apply operation with the --prune switch. Default: true

  • security_group_ids (Optional[Sequence[str]]) – Additional security groups associated with this cluster. Default: - if not specified, no additional security groups will be considered in cluster.connections.

  • vpc (Optional[IVpc]) – The VPC in which this Cluster was created. Default: - if not specified cluster.vpc will throw an error

ExampleMetadata:

infused

Example:

handler_role = iam.Role.from_role_arn(self, "HandlerRole", "arn:aws:iam::123456789012:role/lambda-role")
# get the serivceToken from the custom resource provider
function_arn = lambda_.Function.from_function_name(self, "ProviderOnEventFunc", "ProviderframeworkonEvent-XXX").function_arn
kubectl_provider = eks.KubectlProvider.from_kubectl_provider_attributes(self, "KubectlProvider",
    service_token=function_arn,
    role=handler_role
)

cluster = eks.Cluster.from_cluster_attributes(self, "Cluster",
    cluster_name="cluster",
    kubectl_provider=kubectl_provider
)

Attributes

cluster_certificate_authority_data

The certificate-authority-data for your cluster.

Default:

  • if not specified cluster.clusterCertificateAuthorityData will

throw an error

cluster_encryption_config_key_arn

Amazon Resource Name (ARN) or alias of the customer master key (CMK).

Default:

  • if not specified cluster.clusterEncryptionConfigKeyArn will

throw an error

cluster_endpoint

The API Server endpoint URL.

Default:
  • if not specified cluster.clusterEndpoint will throw an error.

cluster_name

The physical name of the Cluster.

cluster_security_group_id

The cluster security group that was created by Amazon EKS for the cluster.

Default:

  • if not specified cluster.clusterSecurityGroupId will throw an

error

ip_family

Specify which IP family is used to assign Kubernetes pod and service IP addresses.

Default:
  • IpFamily.IP_V4

See:

https://docs.aws.amazon.com/eks/latest/APIReference/API_KubernetesNetworkConfigRequest.html#AmazonEKS-Type-KubernetesNetworkConfigRequest-ipFamily

kubectl_provider

KubectlProvider for issuing kubectl commands.

Default:
  • Default CDK provider

kubectl_provider_options

Options for creating the kubectl provider - a lambda function that executes kubectl and helm against the cluster.

If defined, kubectlLayer is a required property.

Default:
  • kubectl provider will not be created by default.

open_id_connect_provider

An Open ID Connect provider for this cluster that can be used to configure service accounts.

You can either import an existing provider using iam.OpenIdConnectProvider.fromProviderArn, or create a new provider using new eks.OpenIdConnectProvider

Default:
  • if not specified cluster.openIdConnectProvider and cluster.addServiceAccount will throw an error.

prune

Indicates whether Kubernetes resources added through addManifest() can be automatically pruned.

When this is enabled (default), prune labels will be allocated and injected to each resource. These labels will then be used when issuing the kubectl apply operation with the --prune switch.

Default:

true

security_group_ids

Additional security groups associated with this cluster.

Default:

  • if not specified, no additional security groups will be

considered in cluster.connections.

vpc

The VPC in which this Cluster was created.

Default:
  • if not specified cluster.vpc will throw an error