@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.927Z") @Stability(value=Stable) public interface ClusterOptions extends software.amazon.jsii.JsiiSerializable, CommonClusterOptions
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.kms.*;
import software.amazon.awscdk.services.lambda.*;
AlbControllerVersion albControllerVersion;
EndpointAccess endpointAccess;
Key key;
KubernetesVersion kubernetesVersion;
LayerVersion layerVersion;
Object policy;
Role role;
SecurityGroup securityGroup;
Size size;
Subnet subnet;
SubnetFilter subnetFilter;
Vpc vpc;
ClusterOptions clusterOptions = ClusterOptions.builder()
.version(kubernetesVersion)
// the properties below are optional
.albController(AlbControllerOptions.builder()
.version(albControllerVersion)
// the properties below are optional
.policy(policy)
.repository("repository")
.build())
.clusterHandlerEnvironment(Map.of(
"clusterHandlerEnvironmentKey", "clusterHandlerEnvironment"))
.clusterHandlerSecurityGroup(securityGroup)
.clusterLogging(List.of(ClusterLoggingTypes.API))
.clusterName("clusterName")
.coreDnsComputeType(CoreDnsComputeType.EC2)
.endpointAccess(endpointAccess)
.kubectlEnvironment(Map.of(
"kubectlEnvironmentKey", "kubectlEnvironment"))
.kubectlLayer(layerVersion)
.kubectlMemory(size)
.mastersRole(role)
.onEventLayer(layerVersion)
.outputClusterName(false)
.outputConfigCommand(false)
.outputMastersRoleArn(false)
.placeClusterHandlerInVpc(false)
.prune(false)
.role(role)
.secretsEncryptionKey(key)
.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();
| Modifier and Type | Interface and Description |
|---|---|
static class |
ClusterOptions.Builder
A builder for
ClusterOptions |
static class |
ClusterOptions.Jsii$Proxy
An implementation for
ClusterOptions |
| Modifier and Type | Method and Description |
|---|---|
static ClusterOptions.Builder |
builder() |
default AlbControllerOptions |
getAlbController()
Install the AWS Load Balancer Controller onto the cluster.
|
default Map<String,String> |
getClusterHandlerEnvironment()
Custom environment variables when interacting with the EKS endpoint to manage the cluster lifecycle.
|
default ISecurityGroup |
getClusterHandlerSecurityGroup()
A security group to associate with the Cluster Handler's Lambdas.
|
default List<ClusterLoggingTypes> |
getClusterLogging()
The cluster log types which you want to enable.
|
default CoreDnsComputeType |
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 EndpointAccess |
getEndpointAccess()
Configure access to the Kubernetes API server endpoint..
|
default Map<String,String> |
getKubectlEnvironment()
Environment variables for the kubectl execution.
|
default ILayerVersion |
getKubectlLayer()
An AWS Lambda Layer which includes `kubectl`, Helm and the AWS CLI.
|
default Size |
getKubectlMemory()
Amount of memory to allocate to the provider's lambda function.
|
default IRole |
getMastersRole()
An IAM role that will be added to the `system:masters` Kubernetes RBAC group.
|
default ILayerVersion |
getOnEventLayer()
An AWS Lambda Layer which includes the NPM dependency `proxy-agent`.
|
default Boolean |
getOutputMastersRoleArn()
Determines whether a CloudFormation output with the ARN of the "masters" IAM role will be synthesized (if `mastersRole` is specified).
|
default Boolean |
getPlaceClusterHandlerInVpc()
If set to true, the cluster handler functions will be placed in the private subnets of the cluster vpc, subject to the `vpcSubnets` selection strategy.
|
default Boolean |
getPrune()
Indicates whether Kubernetes resources added through `addManifest()` can be automatically pruned.
|
default IKey |
getSecretsEncryptionKey()
KMS secret for envelope encryption for Kubernetes secrets.
|
default String |
getServiceIpv4Cidr()
The CIDR block to assign Kubernetes service IP addresses from.
|
getClusterName, getOutputClusterName, getOutputConfigCommand, getRole, getSecurityGroup, getVersion, getVpc, getVpcSubnets@Stability(value=Stable) @Nullable default AlbControllerOptions getAlbController()
Default: - The controller is not installed.
@Stability(value=Stable) @Nullable default Map<String,String> getClusterHandlerEnvironment()
Default: - No environment variables.
@Stability(value=Stable) @Nullable default ISecurityGroup getClusterHandlerSecurityGroup()
The Cluster Handler's Lambdas are responsible for calling AWS's EKS API.
Requires placeClusterHandlerInVpc to be set to true.
Default: - No security group.
@Stability(value=Stable) @Nullable default List<ClusterLoggingTypes> getClusterLogging()
Default: - none
@Stability(value=Stable) @Nullable default CoreDnsComputeType getCoreDnsComputeType()
Default: CoreDnsComputeType.EC2 (for `FargateCluster` the default is FARGATE)
@Stability(value=Stable) @Nullable default EndpointAccess getEndpointAccess()
Default: EndpointAccess.PUBLIC_AND_PRIVATE
@Stability(value=Stable) @Nullable default Map<String,String> getKubectlEnvironment()
Only relevant for kubectl enabled clusters.
Default: - No environment variables.
@Stability(value=Stable) @Nullable default ILayerVersion getKubectlLayer()
By default, the provider will use the layer included in the "aws-lambda-layer-kubectl" SAR application which is available in all commercial regions.
To deploy the layer locally, visit https://github.com/aws-samples/aws-lambda-layer-kubectl/blob/master/cdk/README.md for instructions on how to prepare the .zip file and then define it in your app as follows:
LayerVersion layer = LayerVersion.Builder.create(this, "kubectl-layer")
.code(Code.fromAsset(String.format("%s/layer.zip", __dirname)))
.compatibleRuntimes(List.of(Runtime.PROVIDED))
.build();
Default: - the layer provided by the `aws-lambda-layer-kubectl` SAR app.
@Stability(value=Stable) @Nullable default Size getKubectlMemory()
Default: Size.gibibytes(1)
@Stability(value=Stable) @Nullable default IRole getMastersRole()
Default: - a role that assumable by anyone with permissions in the same account will automatically be defined
@Stability(value=Stable) @Nullable default ILayerVersion getOnEventLayer()
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_14_X))
.build();
Default: - a layer bundled with this module.
@Stability(value=Stable) @Nullable default Boolean getOutputMastersRoleArn()
Default: false
@Stability(value=Stable) @Nullable default Boolean getPlaceClusterHandlerInVpc()
Default: false
@Stability(value=Stable) @Nullable default Boolean getPrune()
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
@Stability(value=Stable) @Nullable default IKey getSecretsEncryptionKey()
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.
@Stability(value=Stable) @Nullable default String getServiceIpv4Cidr()
Default: - Kubernetes assigns addresses from either the 10.100.0.0/16 or 172.20.0.0/16 CIDR blocks
@Stability(value=Stable) static ClusterOptions.Builder builder()
builder in interface CommonClusterOptionsClusterOptions.Builder of ClusterOptionsCopyright © 2022. All rights reserved.