interface KubectlProviderProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Eks.V2.Alpha.KubectlProviderProps |
Go | github.com/aws/aws-cdk-go/awscdkeksv2alpha/v2#KubectlProviderProps |
Java | software.amazon.awscdk.services.eks.v2.alpha.KubectlProviderProps |
Python | aws_cdk.aws_eks_v2_alpha.KubectlProviderProps |
TypeScript (source) | @aws-cdk/aws-eks-v2-alpha ยป KubectlProviderProps |
Implements
Kubectl
Properties for a KubectlProvider.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as eks_v2_alpha from '@aws-cdk/aws-eks-v2-alpha';
import * as cdk from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_iam as iam } from 'aws-cdk-lib';
import { aws_lambda as lambda } from 'aws-cdk-lib';
declare const cluster: eks_v2_alpha.Cluster;
declare const layerVersion: lambda.LayerVersion;
declare const role: iam.Role;
declare const securityGroup: ec2.SecurityGroup;
declare const size: cdk.Size;
declare const subnet: ec2.Subnet;
const kubectlProviderProps: eks_v2_alpha.KubectlProviderProps = {
cluster: cluster,
kubectlLayer: layerVersion,
// the properties below are optional
awscliLayer: layerVersion,
environment: {
environmentKey: 'environment',
},
memory: size,
privateSubnets: [subnet],
removalPolicy: cdk.RemovalPolicy.DESTROY,
role: role,
securityGroup: securityGroup,
};
Properties
| Name | Type | Description |
|---|---|---|
| cluster | ICluster | The cluster to control. |
| kubectl | ILayer | An AWS Lambda layer that includes kubectl and helm. |
| awscli | ILayer | An AWS Lambda layer that contains the aws CLI. |
| environment? | { [string]: string } | Custom environment variables when running kubectl against this cluster. |
| memory? | Size | The amount of memory allocated to the kubectl provider's lambda function. |
| private | ISubnet[] | Subnets to host the kubectl compute resources. |
| removal | Removal | The removal policy applied to the custom resource that provides kubectl. |
| role? | IRole | An IAM role that can perform kubectl operations against this cluster. |
| security | ISecurity | A security group to use for kubectl execution. |
cluster
Type:
ICluster
The cluster to control.
kubectlLayer
Type:
ILayer
An AWS Lambda layer that includes kubectl and helm.
awscliLayer?
Type:
ILayer
(optional)
An AWS Lambda layer that contains the aws CLI.
If not defined, a default layer will be used containing the AWS CLI 2.x.
environment?
Type:
{ [string]: string }
(optional)
Custom environment variables when running kubectl against this cluster.
memory?
Type:
Size
(optional)
The amount of memory allocated to the kubectl provider's lambda function.
privateSubnets?
Type:
ISubnet[]
(optional)
Subnets to host the kubectl compute resources.
If not specified, the k8s endpoint is expected to be accessible publicly.
removalPolicy?
Type:
Removal
(optional, default: RemovalPolicy.DESTROY)
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
role?
Type:
IRole
(optional, default: if not specified, the default role created by a lambda function will
be used.)
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.
securityGroup?
Type:
ISecurity
(optional, default: If not specified, the k8s endpoint is expected to be accessible
publicly.)
A security group to use for kubectl execution.

.NET
Go
Java
Python
TypeScript (