Interface ClusterOptions
- All Superinterfaces:
CommonClusterOptions,software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
ClusterProps,FargateClusterProps
- All Known Implementing Classes:
ClusterOptions.Jsii$Proxy,ClusterProps.Jsii$Proxy,FargateClusterProps.Jsii$Proxy
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;
import software.amazon.awscdk.services.ec2.*;
import software.amazon.awscdk.services.eks.*;
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.lambda.*;
import software.amazon.awscdk.interfaces.kms.*;
AlbControllerVersion albControllerVersion;
EndpointAccess endpointAccess;
IKeyRef keyRef;
KubernetesVersion kubernetesVersion;
LayerVersion layerVersion;
Object policy;
Role role;
SecurityGroup securityGroup;
Size size;
Subnet subnet;
SubnetFilter subnetFilter;
Vpc vpc;
ClusterOptions clusterOptions = ClusterOptions.builder()
.kubectlLayer(layerVersion)
.version(kubernetesVersion)
// the properties below are optional
.albController(AlbControllerOptions.builder()
.version(albControllerVersion)
// the properties below are optional
.additionalHelmChartValues(AlbControllerHelmChartOptions.builder()
.enableWaf(false)
.enableWafv2(false)
.build())
.policy(policy)
.repository("repository")
.build())
.authenticationMode(AuthenticationMode.CONFIG_MAP)
.awscliLayer(layerVersion)
.clusterHandlerEnvironment(Map.of(
"clusterHandlerEnvironmentKey", "clusterHandlerEnvironment"))
.clusterHandlerSecurityGroup(securityGroup)
.clusterLogging(List.of(ClusterLoggingTypes.API))
.clusterName("clusterName")
.coreDnsComputeType(CoreDnsComputeType.EC2)
.endpointAccess(endpointAccess)
.ipFamily(IpFamily.IP_V4)
.kubectlEnvironment(Map.of(
"kubectlEnvironmentKey", "kubectlEnvironment"))
.kubectlMemory(size)
.mastersRole(role)
.onEventLayer(layerVersion)
.outputClusterName(false)
.outputConfigCommand(false)
.outputMastersRoleArn(false)
.placeClusterHandlerInVpc(false)
.prune(false)
.remoteNodeNetworks(List.of(RemoteNodeNetwork.builder()
.cidrs(List.of("cidrs"))
.build()))
.remotePodNetworks(List.of(RemotePodNetwork.builder()
.cidrs(List.of("cidrs"))
.build()))
.removalPolicy(RemovalPolicy.DESTROY)
.role(role)
.secretsEncryptionKey(keyRef)
.securityGroup(securityGroup)
.serviceIpv4Cidr("serviceIpv4Cidr")
.vpc(vpc)
.vpcSubnets(List.of(SubnetSelection.builder()
.availabilityZones(List.of("availabilityZones"))
.onePerAz(false)
.subnetFilters(List.of(subnetFilter))
.subnetGroupName("subnetGroupName")
.subnets(List.of(subnet))
.subnetType(SubnetType.PRIVATE_ISOLATED)
.build()))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forClusterOptionsstatic final classAn implementation forClusterOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic ClusterOptions.Builderbuilder()default AlbControllerOptionsInstall the AWS Load Balancer Controller onto the cluster.default AuthenticationModeThe desired authentication mode for the cluster.default ILayerVersionAn AWS Lambda layer that contains theawsCLI.Custom environment variables when interacting with the EKS endpoint to manage the cluster lifecycle.default ISecurityGroupA security group to associate with the Cluster Handler's Lambdas.default List<ClusterLoggingTypes> The cluster log types which you want to enable.default CoreDnsComputeTypeControls the "eks.amazonaws.com/compute-type" annotation in the CoreDNS configuration on your cluster to determine which compute type to use for CoreDNS.default EndpointAccessConfigure access to the Kubernetes API server endpoint..default IpFamilySpecify which IP family is used to assign Kubernetes pod and service IP addresses.Environment variables for the kubectl execution.An AWS Lambda Layer which includeskubectland Helm.default SizeAmount of memory to allocate to the provider's lambda function.default IRoleAn IAM role that will be added to thesystem:mastersKubernetes RBAC group.default ILayerVersionAn AWS Lambda Layer which includes the NPM dependencyproxy-agent.default BooleanDetermines whether a CloudFormation output with the ARN of the "masters" IAM role will be synthesized (ifmastersRoleis specified).default BooleanIf set to true, the cluster handler functions will be placed in the private subnets of the cluster vpc, subject to thevpcSubnetsselection strategy.default BooleangetPrune()Indicates whether Kubernetes resources added throughaddManifest()can be automatically pruned.default List<RemoteNodeNetwork> IPv4 CIDR blocks defining the expected address range of hybrid nodes that will join the cluster.default List<RemotePodNetwork> IPv4 CIDR blocks for Pods running Kubernetes webhooks on hybrid nodes.default RemovalPolicyThe removal policy applied to all CloudFormation resources created by this construct when they are no longer managed by CloudFormation.default IKeyRefKMS secret for envelope encryption for Kubernetes secrets.default StringThe CIDR block to assign Kubernetes service IP addresses from.Methods inherited from interface software.amazon.awscdk.services.eks.CommonClusterOptions
getClusterName, getOutputClusterName, getOutputConfigCommand, getRole, getSecurityGroup, getVersion, getVpc, getVpcSubnetsMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getKubectlLayer
An AWS Lambda Layer which includeskubectland Helm.This layer is used by the kubectl handler to apply manifests and install helm charts. You must pick an appropriate releases of one of the
@aws-cdk/layer-kubectl-vXXpackages, that works with the version of Kubernetes you have chosen.The handler expects the layer to include the following executables:
/opt/helm/helm /opt/kubectl/kubectl
-
getAlbController
Install the AWS Load Balancer Controller onto the cluster.Default: - The controller is not installed.
- See Also:
-
getAuthenticationMode
The desired authentication mode for the cluster.Default: AuthenticationMode.CONFIG_MAP
-
getAwscliLayer
An AWS Lambda layer that contains theawsCLI.The handler expects the layer to include the following executables:
/opt/awscli/aws
Default: - a default layer with the AWS CLI 1.x
-
getClusterHandlerEnvironment
Custom environment variables when interacting with the EKS endpoint to manage the cluster lifecycle.Default: - No environment variables.
-
getClusterHandlerSecurityGroup
A security group to associate with the Cluster Handler's Lambdas.The Cluster Handler's Lambdas are responsible for calling AWS's EKS API.
Requires
placeClusterHandlerInVpcto be set to true.Default: - No security group.
-
getClusterLogging
The cluster log types which you want to enable.Default: - none
-
getCoreDnsComputeType
Controls the "eks.amazonaws.com/compute-type" annotation in the CoreDNS configuration on your cluster to determine which compute type to use for CoreDNS.Default: CoreDnsComputeType.EC2 (for `FargateCluster` the default is FARGATE)
-
getEndpointAccess
Configure access to the Kubernetes API server endpoint..Default: EndpointAccess.PUBLIC_AND_PRIVATE
- See Also:
-
getIpFamily
Specify which IP family is used to assign Kubernetes pod and service IP addresses.Default: - IpFamily.IP_V4
- See Also:
-
getKubectlEnvironment
Environment variables for the kubectl execution.Only relevant for kubectl enabled clusters.
Default: - No environment variables.
-
getKubectlMemory
Amount of memory to allocate to the provider's lambda function.Default: Size.gibibytes(1)
-
getMastersRole
An IAM role that will be added to thesystem:mastersKubernetes RBAC group.Default: - no masters role.
- See Also:
-
getOnEventLayer
An AWS Lambda Layer which includes the NPM dependencyproxy-agent.This layer is used by the onEvent handler to route AWS SDK requests through a proxy.
By default, the provider will use the layer included in the "aws-lambda-layer-node-proxy-agent" SAR application which is available in all commercial regions.
To deploy the layer locally define it in your app as follows:
LayerVersion layer = LayerVersion.Builder.create(this, "proxy-agent-layer") .code(Code.fromAsset(String.format("%s/layer.zip", __dirname))) .compatibleRuntimes(List.of(Runtime.NODEJS_LATEST)) .build();Default: - a layer bundled with this module.
-
getOutputMastersRoleArn
Determines whether a CloudFormation output with the ARN of the "masters" IAM role will be synthesized (ifmastersRoleis specified).Default: false
-
getPlaceClusterHandlerInVpc
If set to true, the cluster handler functions will be placed in the private subnets of the cluster vpc, subject to thevpcSubnetsselection strategy.Default: false
-
getPrune
Indicates whether Kubernetes resources added throughaddManifest()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 applyoperation with the--pruneswitch.Default: true
-
getRemoteNodeNetworks
IPv4 CIDR blocks defining the expected address range of hybrid nodes that will join the cluster.Default: - none
-
getRemotePodNetworks
IPv4 CIDR blocks for Pods running Kubernetes webhooks on hybrid nodes.Default: - none
-
getRemovalPolicy
The removal policy applied to all CloudFormation resources created by this construct when they are no longer managed by CloudFormation.This can happen in one of three situations:
- The resource is removed from the template, so CloudFormation stops managing it;
- A change to the resource is made that requires it to be replaced, so CloudFormation stops managing it;
- The stack is deleted, so CloudFormation stops managing all resources in it.
This affects the EKS cluster itself, associated IAM roles, node groups, security groups, VPC and any other CloudFormation resources managed by this construct.
Default: - Resources will be deleted.
-
getSecretsEncryptionKey
KMS secret for envelope encryption for Kubernetes secrets.Default: - By default, Kubernetes stores all secret object data within etcd and all etcd volumes used by Amazon EKS are encrypted at the disk-level using AWS-Managed encryption keys.
-
getServiceIpv4Cidr
The CIDR block to assign Kubernetes service IP addresses from.Default: - Kubernetes assigns addresses from either the 10.100.0.0/16 or 172.20.0.0/16 CIDR blocks
- See Also:
-
builder
- Returns:
- a
ClusterOptions.BuilderofClusterOptions
-