AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

KubectlProvider

Implementation of Kubectl Lambda.

Import

import { KubectlProvider } from 'aws-cdk-lib/aws-eks-v2';

Or use the module namespace:

import * as eks_v2 from 'aws-cdk-lib/aws-eks-v2';
// eks_v2.KubectlProvider

Properties

Configuration passed to the constructor as KubectlProviderProps.

clusterRequired
ICluster

The cluster to control.

9 properties inherited from KubectlProviderOptions
kubectlLayerRequiredinherited from KubectlProviderOptions
ILayerVersion

An AWS Lambda layer that includes `kubectl` and `helm`.

awscliLayerOptionalinherited from KubectlProviderOptions
ILayerVersion

An AWS Lambda layer that contains the `aws` CLI.

Default: - If not defined, a default layer will be used containing the AWS CLI 2.x.

environmentOptionalinherited from KubectlProviderOptions
{ [key: string]: string }

Custom environment variables when running `kubectl` against this cluster.

Default: - No custom environment variables

memoryOptionalinherited from KubectlProviderOptions
Size

The amount of memory allocated to the kubectl provider's lambda function.

Default: - 1024

privateSubnetsOptionalinherited from KubectlProviderOptions
ISubnet[]

Subnets to host the `kubectl` compute resources. If not specified, the k8s endpoint is expected to be accessible publicly.

Default: - the k8s is accessible publicly

removalPolicyOptionalinherited from KubectlProviderOptions
RemovalPolicy

The removal policy applied to the custom resource that provides kubectl. The removal policy controls what happens to the resource if it stops being 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

Default: RemovalPolicy.DESTROY

roleOptionalinherited from KubectlProviderOptions
IRole

An IAM role that can perform kubectl operations against this cluster. The role should be mapped to the `system:masters` Kubernetes RBAC role. This role is directly passed to the lambda handler that sends Kube Ctl commands to the cluster.

Default: - if not specified, the default role created by a lambda function will be used.

securityGroupOptionalDeprecatedinherited from KubectlProviderOptions
ISecurityGroup

A security group to use for `kubectl` execution.

Default: - If not specified, the k8s endpoint is expected to be accessible publicly.

Deprecated: Use `securityGroups` instead.

securityGroupsOptionalinherited from KubectlProviderOptions
ISecurityGroup[]

Security groups to use for `kubectl` execution.

Default: - If not specified, the k8s endpoint is expected to be accessible publicly.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL2 (Higher-level)
Moduleaws-eks-v2
Properties10

External Links