ICluster

class aws_cdk.aws_eks.ICluster(*args, **kwds)

Bases: aws_cdk.core.IResource, aws_cdk.aws_ec2.IConnectable, typing_extensions.Protocol

(experimental) An EKS cluster.

Stability

experimental

Methods

add_cdk8s_chart(id, chart)

(experimental) Defines a CDK8s chart in this cluster.

Parameters
  • id (str) – logical id of this chart.

  • chart (Construct) – the cdk8s chart.

Return type

KubernetesManifest

Returns

a KubernetesManifest construct representing the chart.

Stability

experimental

add_helm_chart(id, *, chart, create_namespace=None, namespace=None, release=None, repository=None, timeout=None, values=None, version=None, wait=None)

(experimental) Defines a Helm chart in this cluster.

Parameters
  • id (str) – logical id of this chart.

  • chart (str) – (experimental) The name of the chart.

  • create_namespace (Optional[bool]) – (experimental) create namespace if not exist. Default: true

  • namespace (Optional[str]) – (experimental) The Kubernetes namespace scope of the requests. Default: default

  • release (Optional[str]) – (experimental) The name of the release. Default: - If no release name is given, it will use the last 53 characters of the node’s unique id.

  • repository (Optional[str]) – (experimental) The repository which contains the chart. For example: https://kubernetes-charts.storage.googleapis.com/ Default: - No repository will be used, which means that the chart needs to be an absolute URL.

  • timeout (Optional[Duration]) – (experimental) Amount of time to wait for any individual Kubernetes operation. Maximum 15 minutes. Default: Duration.minutes(5)

  • values (Optional[Mapping[str, Any]]) – (experimental) The values to be used by the chart. Default: - No values are provided to the chart.

  • version (Optional[str]) – (experimental) The chart version to install. Default: - If this is not specified, the latest version is installed

  • wait (Optional[bool]) – (experimental) Whether or not Helm should wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet are in a ready state before marking the release as successful. Default: - Helm will not wait before marking release as successful

Return type

HelmChart

Returns

a HelmChart construct

Stability

experimental

add_manifest(id, *manifest)

(experimental) Defines a Kubernetes resource in this cluster.

The manifest will be applied/deleted using kubectl as needed.

Parameters
  • id (str) – logical id of this manifest.

  • manifest (Any) – a list of Kubernetes resource specifications.

Return type

KubernetesManifest

Returns

a KubernetesManifest object.

Stability

experimental

Attributes

cluster_arn

eks:.

Stability

experimental

Attribute

true

Type

(experimental) The unique ARN assigned to the service by AWS in the form of arn

Type

aws

Return type

str

cluster_certificate_authority_data

(experimental) The certificate-authority-data for your cluster.

Stability

experimental

Attribute

true

Return type

str

cluster_encryption_config_key_arn

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

Stability

experimental

Attribute

true

Return type

str

cluster_endpoint

(experimental) The API Server endpoint URL.

Stability

experimental

Attribute

true

Return type

str

cluster_name

(experimental) The physical name of the Cluster.

Stability

experimental

Attribute

true

Return type

str

cluster_security_group_id

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

Stability

experimental

Attribute

true

Return type

str

connections
Return type

Connections

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

Return type

ResourceEnvironment

kubectl_environment

(experimental) Custom environment variables when running kubectl against this cluster.

Default
  • no additional environment variables

Stability

experimental

Return type

Optional[Mapping[str, str]]

kubectl_layer

(experimental) An AWS Lambda layer that includes kubectl, helm and the aws CLI.

If not defined, a default layer will be used.

Stability

experimental

Return type

Optional[ILayerVersion]

kubectl_private_subnets

(experimental) Subnets to host the kubectl compute resources.

Default

  • If not specified, the k8s endpoint is expected to be accessible

publicly.

Stability

experimental

Return type

Optional[List[ISubnet]]

kubectl_role

(experimental) An IAM role that can perform kubectl operations against this cluster.

The role should be mapped to the system:masters Kubernetes RBAC role.

Stability

experimental

Return type

Optional[IRole]

kubectl_security_group

(experimental) A security group to use for kubectl execution.

Default

  • If not specified, the k8s endpoint is expected to be accessible

publicly.

Stability

experimental

Return type

Optional[ISecurityGroup]

node

The construct tree node for this construct.

Return type

ConstructNode

stack

The stack in which this resource is defined.

Return type

Stack

vpc

(experimental) The VPC in which this Cluster was created.

Stability

experimental

Return type

IVpc