Class ClusterAttributes.Builder
java.lang.Object
software.amazon.awscdk.services.eks.ClusterAttributes.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ClusterAttributes>
- Enclosing interface:
- ClusterAttributes
@Stability(Stable)
public static final class ClusterAttributes.Builder
extends Object
implements software.amazon.jsii.Builder<ClusterAttributes>
A builder for
ClusterAttributes
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.clusterCertificateAuthorityData
(String clusterCertificateAuthorityData) Sets the value ofClusterAttributes.getClusterCertificateAuthorityData()
clusterEncryptionConfigKeyArn
(String clusterEncryptionConfigKeyArn) Sets the value ofClusterAttributes.getClusterEncryptionConfigKeyArn()
clusterEndpoint
(String clusterEndpoint) Sets the value ofClusterAttributes.getClusterEndpoint()
clusterHandlerSecurityGroupId
(String clusterHandlerSecurityGroupId) Sets the value ofClusterAttributes.getClusterHandlerSecurityGroupId()
clusterName
(String clusterName) Sets the value ofClusterAttributes.getClusterName()
clusterSecurityGroupId
(String clusterSecurityGroupId) Sets the value ofClusterAttributes.getClusterSecurityGroupId()
kubectlEnvironment
(Map<String, String> kubectlEnvironment) Sets the value ofClusterAttributes.getKubectlEnvironment()
kubectlLambdaRole
(IRole kubectlLambdaRole) Sets the value ofClusterAttributes.getKubectlLambdaRole()
kubectlLayer
(ILayerVersion kubectlLayer) Sets the value ofClusterAttributes.getKubectlLayer()
kubectlMemory
(Size kubectlMemory) Sets the value ofClusterAttributes.getKubectlMemory()
kubectlPrivateSubnetIds
(List<String> kubectlPrivateSubnetIds) Sets the value ofClusterAttributes.getKubectlPrivateSubnetIds()
kubectlProvider
(IKubectlProvider kubectlProvider) Sets the value ofClusterAttributes.getKubectlProvider()
kubectlRoleArn
(String kubectlRoleArn) Sets the value ofClusterAttributes.getKubectlRoleArn()
kubectlSecurityGroupId
(String kubectlSecurityGroupId) Sets the value ofClusterAttributes.getKubectlSecurityGroupId()
onEventLayer
(ILayerVersion onEventLayer) Sets the value ofClusterAttributes.getOnEventLayer()
openIdConnectProvider
(IOpenIdConnectProvider openIdConnectProvider) Sets the value ofClusterAttributes.getOpenIdConnectProvider()
Sets the value ofClusterAttributes.getPrune()
securityGroupIds
(List<String> securityGroupIds) Sets the value ofClusterAttributes.getSecurityGroupIds()
Sets the value ofClusterAttributes.getVpc()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
clusterName
Sets the value ofClusterAttributes.getClusterName()
- Parameters:
clusterName
- The physical name of the Cluster. This parameter is required.- Returns:
this
-
clusterCertificateAuthorityData
@Stability(Stable) public ClusterAttributes.Builder clusterCertificateAuthorityData(String clusterCertificateAuthorityData) Sets the value ofClusterAttributes.getClusterCertificateAuthorityData()
- Parameters:
clusterCertificateAuthorityData
- The certificate-authority-data for your cluster.- Returns:
this
-
clusterEncryptionConfigKeyArn
@Stability(Stable) public ClusterAttributes.Builder clusterEncryptionConfigKeyArn(String clusterEncryptionConfigKeyArn) Sets the value ofClusterAttributes.getClusterEncryptionConfigKeyArn()
- Parameters:
clusterEncryptionConfigKeyArn
- Amazon Resource Name (ARN) or alias of the customer master key (CMK).- Returns:
this
-
clusterEndpoint
Sets the value ofClusterAttributes.getClusterEndpoint()
- Parameters:
clusterEndpoint
- The API Server endpoint URL.- Returns:
this
-
clusterHandlerSecurityGroupId
@Stability(Stable) public ClusterAttributes.Builder clusterHandlerSecurityGroupId(String clusterHandlerSecurityGroupId) Sets the value ofClusterAttributes.getClusterHandlerSecurityGroupId()
- Parameters:
clusterHandlerSecurityGroupId
- A security group id to associate with the Cluster Handler's Lambdas. The Cluster Handler's Lambdas are responsible for calling AWS's EKS API.- Returns:
this
-
clusterSecurityGroupId
@Stability(Stable) public ClusterAttributes.Builder clusterSecurityGroupId(String clusterSecurityGroupId) Sets the value ofClusterAttributes.getClusterSecurityGroupId()
- Parameters:
clusterSecurityGroupId
- The cluster security group that was created by Amazon EKS for the cluster.- Returns:
this
-
kubectlEnvironment
@Stability(Stable) public ClusterAttributes.Builder kubectlEnvironment(Map<String, String> kubectlEnvironment) Sets the value ofClusterAttributes.getKubectlEnvironment()
- Parameters:
kubectlEnvironment
- Environment variables to use when runningkubectl
against this cluster.- Returns:
this
-
kubectlLambdaRole
Sets the value ofClusterAttributes.getKubectlLambdaRole()
- Parameters:
kubectlLambdaRole
- An IAM role that can perform kubectl operations against this cluster. The role should be mapped to thesystem:masters
Kubernetes RBAC role.This role is directly passed to the lambda handler that sends Kube Ctl commands to the cluster.
- Returns:
this
-
kubectlLayer
Sets the value ofClusterAttributes.getKubectlLayer()
- Parameters:
kubectlLayer
- An AWS Lambda Layer which includeskubectl
, Helm and the AWS CLI. This layer is used by the kubectl handler to apply manifests and install helm charts.The handler expects the layer to include the following executables:
helm/helm kubectl/kubectl awscli/aws
- Returns:
this
-
kubectlMemory
Sets the value ofClusterAttributes.getKubectlMemory()
- Parameters:
kubectlMemory
- Amount of memory to allocate to the provider's lambda function.- Returns:
this
-
kubectlPrivateSubnetIds
@Stability(Stable) public ClusterAttributes.Builder kubectlPrivateSubnetIds(List<String> kubectlPrivateSubnetIds) Sets the value ofClusterAttributes.getKubectlPrivateSubnetIds()
- Parameters:
kubectlPrivateSubnetIds
- Subnets to host thekubectl
compute resources. If not specified, the k8s endpoint is expected to be accessible publicly.- Returns:
this
-
kubectlProvider
@Stability(Stable) public ClusterAttributes.Builder kubectlProvider(IKubectlProvider kubectlProvider) Sets the value ofClusterAttributes.getKubectlProvider()
- Parameters:
kubectlProvider
- KubectlProvider for issuing kubectl commands.- Returns:
this
-
kubectlRoleArn
Sets the value ofClusterAttributes.getKubectlRoleArn()
- Parameters:
kubectlRoleArn
- An IAM role with cluster administrator and "system:masters" permissions.- Returns:
this
-
kubectlSecurityGroupId
@Stability(Stable) public ClusterAttributes.Builder kubectlSecurityGroupId(String kubectlSecurityGroupId) Sets the value ofClusterAttributes.getKubectlSecurityGroupId()
- Parameters:
kubectlSecurityGroupId
- A security group to use forkubectl
execution. If not specified, the k8s endpoint is expected to be accessible publicly.- Returns:
this
-
onEventLayer
Sets the value ofClusterAttributes.getOnEventLayer()
- Parameters:
onEventLayer
- 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.The handler expects the layer to include the following node_modules:
proxy-agent
- Returns:
this
-
openIdConnectProvider
@Stability(Stable) public ClusterAttributes.Builder openIdConnectProvider(IOpenIdConnectProvider openIdConnectProvider) Sets the value ofClusterAttributes.getOpenIdConnectProvider()
- Parameters:
openIdConnectProvider
- An Open ID Connect provider for this cluster that can be used to configure service accounts. You can either import an existing provider usingiam.OpenIdConnectProvider.fromProviderArn
, or create a new provider usingnew eks.OpenIdConnectProvider
- Returns:
this
-
prune
Sets the value ofClusterAttributes.getPrune()
- Parameters:
prune
- 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 thekubectl apply
operation with the--prune
switch.- Returns:
this
-
securityGroupIds
Sets the value ofClusterAttributes.getSecurityGroupIds()
- Parameters:
securityGroupIds
- Additional security groups associated with this cluster.- Returns:
this
-
vpc
Sets the value ofClusterAttributes.getVpc()
- Parameters:
vpc
- The VPC in which this Cluster was created.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<ClusterAttributes>
- Returns:
- a new instance of
ClusterAttributes
- Throws:
NullPointerException
- if any required attribute was not provided
-