Skip to content
v2.275.0

ClusterAttributes Struct ​

Attributes for EKS clusters.

Example ​

ts
const handlerRole = iam.Role.fromRoleArn(this, 'HandlerRole', 'arn:aws:iam::123456789012:role/lambda-role');
// get the serviceToken from the custom resource provider
const functionArn = lambda.Function.fromFunctionName(this, 'ProviderOnEventFunc', 'ProviderframeworkonEvent-XXX').functionArn;
const kubectlProvider = eks.KubectlProvider.fromKubectlProviderAttributes(this, 'KubectlProvider', {
  serviceToken: functionArn,
  role: handlerRole,
});

const cluster = eks.Cluster.fromClusterAttributes(this, 'Cluster', {
  clusterName: 'cluster',
  kubectlProvider,
});

Properties ​

clusterCertificateAuthorityDataoptionalstringcluster_certificate_authority_dataoptionalstrclusterCertificateAuthorityDataoptionalStringClusterCertificateAuthorityDataoptionalstringClusterCertificateAuthorityDataoptional*string#
The certificate-authority-data for your cluster.

Default: if not specified cluster.clusterCertificateAuthorityData will throw an error

clusterEncryptionConfigKeyArnoptionalstringcluster_encryption_config_key_arnoptionalstrclusterEncryptionConfigKeyArnoptionalStringClusterEncryptionConfigKeyArnoptionalstringClusterEncryptionConfigKeyArnoptional*string#
Amazon Resource Name (ARN) or alias of the customer master key (CMK).

Default: if not specified cluster.clusterEncryptionConfigKeyArn will throw an error

clusterEndpointoptionalstringcluster_endpointoptionalstrclusterEndpointoptionalStringClusterEndpointoptionalstringClusterEndpointoptional*string#
The API Server endpoint URL.

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

clusterNamestringcluster_namestrclusterNameStringClusterNamestringClusterName*stringrequired#
The physical name of the Cluster.
clusterSecurityGroupIdoptionalstringcluster_security_group_idoptionalstrclusterSecurityGroupIdoptionalStringClusterSecurityGroupIdoptionalstringClusterSecurityGroupIdoptional*string#
The cluster security group that was created by Amazon EKS for the cluster.

Default: if not specified cluster.clusterSecurityGroupId will throw an error

ipFamilyoptionalIpFamilyip_familyoptionalIpFamilyipFamilyoptionalIpFamilyIpFamilyoptionalIpFamilyIpFamilyoptionalIpFamily= IpFamily.IP_V4#
Specify which IP family is used to assign Kubernetes pod and service IP addresses.
kubectlProvideroptionalIKubectlProviderkubectl_provideroptionalIKubectlProviderkubectlProvideroptionalIKubectlProviderKubectlProvideroptionalIKubectlProviderKubectlProvideroptionalIKubectlProvider#
KubectlProvider for issuing kubectl commands.

Default: Default CDK provider

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

Default: kubectl provider will not be created by default.

If defined, kubectlLayer is a required property.

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

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

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

pruneoptionalbooleanpruneoptionalboolpruneoptionalBooleanPruneoptionalboolPruneoptional*bool= true#
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.

securityGroupIdsoptionalstring[]security_group_idsoptionaltyping.List[str]securityGroupIdsoptionalList<String>SecurityGroupIdsoptionalstring[]SecurityGroupIdsoptional*[]*string#
Additional security groups associated with this cluster.

Default: if not specified, no additional security groups will be considered in cluster.connections.

vpcoptionalIVpcvpcoptionalIVpcvpcoptionalIVpcVpcoptionalIVpcVpcoptionalIVpc#
The VPC in which this Cluster was created.

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