KubectlProviderProps Struct
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 cdk from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_eks_v2 as eks_v2 } 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.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.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,
securityGroups: [securityGroup],
};
Properties
awscliLayeroptionalILayerVersionawscli_layeroptionalILayerVersionawscliLayeroptionalILayerVersionAwscliLayeroptionalILayerVersionAwscliLayeroptionalILayerVersion#Default: If not defined, a default layer will be used containing the AWS CLI 2.x.
environmentoptional{ [key: string]: string }environmentoptionaltyping.Mapping[str, str]environmentoptionalMap<String, String>EnvironmentoptionalIDictionary<string, string>Environmentoptional*map[string]*string#Default: No custom environment variables
kubectlLayerILayerVersionkubectl_layerILayerVersionkubectlLayerILayerVersionKubectlLayerILayerVersionKubectlLayerILayerVersionrequired#privateSubnetsoptionalISubnet[]private_subnetsoptionaltyping.List[ISubnet]privateSubnetsoptionalList<ISubnet>PrivateSubnetsoptionalISubnet[]PrivateSubnetsoptional*[]ISubnet#Default: the k8s is accessible publicly
If not specified, the k8s endpoint is expected to be accessible publicly.
removalPolicyoptionalRemovalPolicyremoval_policyoptionalRemovalPolicyremovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicyRemovalPolicyoptionalRemovalPolicy= RemovalPolicy.DESTROY#notes
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: if not specified, the default role created by a lambda function will be used.
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.
securityGroupoptionalISecurityGroupsecurity_groupoptionalISecurityGroupsecurityGroupoptionalISecurityGroupSecurityGroupoptionalISecurityGroupSecurityGroupoptionalISecurityGroupdeprecated#Default: If not specified, the k8s endpoint is expected to be accessible publicly.
securityGroupsoptionalISecurityGroup[]security_groupsoptionaltyping.List[ISecurityGroup]securityGroupsoptionalList<ISecurityGroup>SecurityGroupsoptionalISecurityGroup[]SecurityGroupsoptional*[]ISecurityGroup#Default: If not specified, the k8s endpoint is expected to be accessible publicly.