Interface ClusterAttributes

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
ClusterAttributes.Jsii$Proxy

@Generated(value="jsii-pacmak/1.126.0 (build 206d44b)", date="2026-02-23T18:58:18.909Z") @Stability(Stable) public interface ClusterAttributes extends software.amazon.jsii.JsiiSerializable
Attributes for EKS clusters.

Example:

 IRole handlerRole = Role.fromRoleArn(this, "HandlerRole", "arn:aws:iam::123456789012:role/lambda-role");
 // get the serivceToken from the custom resource provider
 String functionArn = Function.fromFunctionName(this, "ProviderOnEventFunc", "ProviderframeworkonEvent-XXX").getFunctionArn();
 IKubectlProvider kubectlProvider = KubectlProvider.fromKubectlProviderAttributes(this, "KubectlProvider", KubectlProviderAttributes.builder()
         .serviceToken(functionArn)
         .role(handlerRole)
         .build());
 ICluster cluster = Cluster.fromClusterAttributes(this, "Cluster", ClusterAttributes.builder()
         .clusterName("cluster")
         .kubectlProvider(kubectlProvider)
         .build());
 
  • Method Details

    • getClusterName

      @Stability(Stable) @NotNull String getClusterName()
      The physical name of the Cluster.
    • getClusterCertificateAuthorityData

      @Stability(Stable) @Nullable default String getClusterCertificateAuthorityData()
      The certificate-authority-data for your cluster.

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

    • getClusterEncryptionConfigKeyArn

      @Stability(Stable) @Nullable default String getClusterEncryptionConfigKeyArn()
      Amazon Resource Name (ARN) or alias of the customer master key (CMK).

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

    • getClusterEndpoint

      @Stability(Stable) @Nullable default String getClusterEndpoint()
      The API Server endpoint URL.

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

    • getClusterSecurityGroupId

      @Stability(Stable) @Nullable default String getClusterSecurityGroupId()
      The cluster security group that was created by Amazon EKS for the cluster.

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

    • getIpFamily

      @Stability(Stable) @Nullable default IpFamily getIpFamily()
      Specify which IP family is used to assign Kubernetes pod and service IP addresses.

      Default: - IpFamily.IP_V4

      See Also:
    • getKubectlProvider

      @Stability(Stable) @Nullable default IKubectlProvider getKubectlProvider()
      KubectlProvider for issuing kubectl commands.

      Default: - Default CDK provider

    • getKubectlProviderOptions

      @Stability(Stable) @Nullable default KubectlProviderOptions getKubectlProviderOptions()
      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.

    • getOpenIdConnectProvider

      @Stability(Stable) @Nullable default IOpenIdConnectProvider getOpenIdConnectProvider()
      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.

    • getPrune

      @Stability(Stable) @Nullable default Boolean getPrune()
      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

    • getSecurityGroupIds

      @Stability(Stable) @Nullable default List<String> getSecurityGroupIds()
      Additional security groups associated with this cluster.

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

    • getVpc

      @Stability(Stable) @Nullable default IVpc getVpc()
      The VPC in which this Cluster was created.

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

    • builder

      @Stability(Stable) static ClusterAttributes.Builder builder()
      Returns:
      a ClusterAttributes.Builder of ClusterAttributes