Skip to content
v2.274.0

ICluster Interface ​

An EKS cluster.

Properties ​

clusterArnstringcluster_arnstrclusterArnStringClusterArnstringClusterArn*stringrequired#
The unique ARN assigned to the service by AWS in the form of arn:aws:eks:.
clusterCertificateAuthorityDatastringcluster_certificate_authority_datastrclusterCertificateAuthorityDataStringClusterCertificateAuthorityDatastringClusterCertificateAuthorityData*stringrequired#
The certificate-authority-data for your cluster.
clusterEncryptionConfigKeyArnstringcluster_encryption_config_key_arnstrclusterEncryptionConfigKeyArnStringClusterEncryptionConfigKeyArnstringClusterEncryptionConfigKeyArn*stringrequired#
Amazon Resource Name (ARN) or alias of the customer master key (CMK).
clusterEndpointstringcluster_endpointstrclusterEndpointStringClusterEndpointstringClusterEndpoint*stringrequired#
The API Server endpoint URL.
clusterNamestringcluster_namestrclusterNameStringClusterNamestringClusterName*stringrequired#
The physical name of the Cluster.
clusterRefClusterReferencecluster_refClusterReferenceclusterRefClusterReferenceClusterRefClusterReferenceClusterRefClusterReferencerequired#
A reference to a Cluster resource.
clusterSecurityGroupISecurityGroupcluster_security_groupISecurityGroupclusterSecurityGroupISecurityGroupClusterSecurityGroupISecurityGroupClusterSecurityGroupISecurityGrouprequired#
The cluster security group that was created by Amazon EKS for the cluster.
clusterSecurityGroupIdstringcluster_security_group_idstrclusterSecurityGroupIdStringClusterSecurityGroupIdstringClusterSecurityGroupId*stringrequired#
The id of the cluster security group that was created by Amazon EKS for the cluster.
connectionsConnectionsconnectionsConnectionsconnectionsConnectionsConnectionsConnectionsConnectionsConnectionsrequired#
The network connections associated with this resource.
eksPodIdentityAgentIAddoneks_pod_identity_agentIAddoneksPodIdentityAgentIAddonEksPodIdentityAgentIAddonEksPodIdentityAgentIAddon#
The EKS Pod Identity Agent addon for the EKS cluster.
notes

The EKS Pod Identity Agent is responsible for managing the temporary credentials used by pods in the cluster to access AWS resources. It runs as a DaemonSet on each node and provides the necessary credentials to the pods based on their associated service account.

This property returns the CfnAddon resource representing the EKS Pod Identity Agent addon. If the addon has not been created yet, it will be created and returned.

The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

ipFamilyIpFamilyip_familyIpFamilyipFamilyIpFamilyIpFamilyIpFamilyIpFamilyIpFamily= IpFamily.IP_V4#
Specify which IP family is used to assign Kubernetes pod and service IP addresses.
kubectlProviderIKubectlProviderkubectl_providerIKubectlProviderkubectlProviderIKubectlProviderKubectlProviderIKubectlProviderKubectlProviderIKubectlProvider#
Kubectl Provider for issuing kubectl commands against it.

If not defined, a default provider will be used

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

Default: kubectl provider will not be created

If defined, kubectlLayer is a required property.

nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
openIdConnectProviderIOpenIdConnectProvideropen_id_connect_providerIOpenIdConnectProvideropenIdConnectProviderIOpenIdConnectProviderOpenIdConnectProviderIOpenIdConnectProviderOpenIdConnectProviderIOpenIdConnectProviderrequired#
The Open ID Connect Provider of the cluster used to configure Service Accounts.
prunebooleanpruneboolpruneBooleanPruneboolPrune*boolrequired#
Indicates whether Kubernetes resources 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.

stackStackstackStackstackStackStackStackStackStackrequired#
The stack in which this resource is defined.
vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpcrequired#
The VPC in which this Cluster was created.

Methods ​

addCdk8sChart(id: string, chart: Construct, options?: KubernetesManifestOptions): KubernetesManifestdef add_cdk8s_chart(self, id: str, chart: Construct, options: typing.Optional[KubernetesManifestOptions] = None) -> KubernetesManifestpublic KubernetesManifest addCdk8sChart(String id, Construct chart, KubernetesManifestOptions options)public KubernetesManifest AddCdk8sChart(string id, Construct chart, KubernetesManifestOptions? options = null)func AddCdk8sChart(Id *string, Chart Construct, Options KubernetesManifestOptions) KubernetesManifest#
Defines a CDK8s chart in this cluster.
2 parameters · returns

Parameters

  • ididididId — logical id of this chart.
  • chartchartchartchartChart — the cdk8s chart.

Returns: a KubernetesManifest construct representing the chart.

addHelmChart(id: string, options: HelmChartOptions): HelmChartdef add_helm_chart(self, id: str, options: HelmChartOptions) -> HelmChartpublic HelmChart addHelmChart(String id, HelmChartOptions options)public HelmChart AddHelmChart(string id, HelmChartOptions options)func AddHelmChart(Id *string, Options HelmChartOptions) HelmChart#
Defines a Helm chart in this cluster.
2 parameters · returns

Parameters

  • ididididId — logical id of this chart.
  • optionsoptionsoptionsoptionsOptions — options of this chart.

Returns: a HelmChart construct

addManifest(id: string, ...manifest: { [key: string]: any }[]): KubernetesManifestdef add_manifest(self, id: str, manifest: typing.Mapping[str, Any]) -> KubernetesManifestpublic KubernetesManifest addManifest(String id, Map<String, Object> manifest)public KubernetesManifest AddManifest(string id, IDictionary<string, object> manifest)func AddManifest(Id *string, Manifest *map[string]interface{}) KubernetesManifest#
Defines a Kubernetes resource in this cluster.

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

2 parameters · returns

Parameters

  • ididididId — logical id of this manifest.
  • manifestmanifestmanifestmanifestManifest — a list of Kubernetes resource specifications.

Returns: a KubernetesManifest object.

addServiceAccount(id: string, options?: ServiceAccountOptions): ServiceAccountdef add_service_account(self, id: str, options: typing.Optional[ServiceAccountOptions] = None) -> ServiceAccountpublic ServiceAccount addServiceAccount(String id, ServiceAccountOptions options)public ServiceAccount AddServiceAccount(string id, ServiceAccountOptions? options = null)func AddServiceAccount(Id *string, Options ServiceAccountOptions) ServiceAccount#
Creates a new service account with corresponding IAM Role (IRSA).
2 parameters

Parameters

  • ididididId — logical id of service account.
  • optionsoptionsoptionsoptionsOptions — service account options.
applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy)#
Apply the given removal policy to this resource.
notes

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

connectAutoScalingGroupCapacity(autoScalingGroup: AutoScalingGroup, options: AutoScalingGroupOptions): voiddef connect_auto_scaling_group_capacity(self, auto_scaling_group: AutoScalingGroup, options: AutoScalingGroupOptions) -> Nonepublic void connectAutoScalingGroupCapacity(AutoScalingGroup autoScalingGroup, AutoScalingGroupOptions options)public void ConnectAutoScalingGroupCapacity(AutoScalingGroup autoScalingGroup, AutoScalingGroupOptions options)func ConnectAutoScalingGroupCapacity(AutoScalingGroup AutoScalingGroup, Options AutoScalingGroupOptions)#
Connect capacity in the form of an existing AutoScalingGroup to the EKS cluster.
notes · 2 parameters

The AutoScalingGroup must be running an EKS-optimized AMI containing the /etc/eks/bootstrap.sh script. This method will configure Security Groups, add the right policies to the instance role, apply the right tags, and add the required user data to the instance's launch configuration.

Prefer to use addAutoScalingGroupCapacity if possible.

Parameters

  • autoScalingGroupauto_scaling_groupautoScalingGroupautoScalingGroupAutoScalingGroup — [disable-awslint:ref-via-interface].
  • optionsoptionsoptionsoptionsOptions — options for adding auto scaling groups, like customizing the bootstrap script.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.

1 parameter · returns

Parameters

  • mixinsmixinsmixinsmixinsMixins — The mixins to apply.

Returns: This construct for chaining