KubectlProviderOptions

class aws_cdk.aws_eks_v2_alpha.KubectlProviderOptions(*, kubectl_layer, awscli_layer=None, environment=None, memory=None, private_subnets=None, removal_policy=None, role=None, security_group=None)

Bases: object

Parameters:
  • kubectl_layer (ILayerVersion) – (experimental) An AWS Lambda layer that includes kubectl and helm.

  • awscli_layer (Optional[ILayerVersion]) – (experimental) 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 (Optional[Mapping[str, str]]) – (experimental) Custom environment variables when running kubectl against this cluster.

  • memory (Optional[Size]) – (experimental) The amount of memory allocated to the kubectl provider’s lambda function.

  • private_subnets (Optional[Sequence[ISubnet]]) – (experimental) Subnets to host the kubectl compute resources. If not specified, the k8s endpoint is expected to be accessible publicly.

  • removal_policy (Optional[RemovalPolicy]) – (experimental) 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

  • role (Optional[IRole]) – (experimental) 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.

  • security_group (Optional[ISecurityGroup]) – (experimental) A security group to use for kubectl execution. Default: - If not specified, the k8s endpoint is expected to be accessible publicly.

Stability:

experimental

ExampleMetadata:

infused

Example:

from aws_cdk.lambda_layer_kubectl_v34 import KubectlV34Layer


cluster = eks.Cluster(self, "hello-eks",
    version=eks.KubernetesVersion.V1_34,
    kubectl_provider_options=eks.KubectlProviderOptions(
        kubectl_layer=KubectlV34Layer(self, "kubectl"),
        environment={
            "http_proxy": "http://proxy.myproxy.com"
        }
    )
)

Attributes

awscli_layer

(experimental) An AWS Lambda layer that contains the aws CLI.

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

Stability:

experimental

environment

(experimental) Custom environment variables when running kubectl against this cluster.

Stability:

experimental

kubectl_layer

(experimental) An AWS Lambda layer that includes kubectl and helm.

Stability:

experimental

memory

(experimental) The amount of memory allocated to the kubectl provider’s lambda function.

Stability:

experimental

private_subnets

(experimental) Subnets to host the kubectl compute resources.

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

Stability:

experimental

removal_policy

(experimental) 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

Stability:

experimental

role

(experimental) 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.

Stability:

experimental

security_group

(experimental) A security group to use for kubectl execution.

Default:

  • If not specified, the k8s endpoint is expected to be accessible

publicly.

Stability:

experimental