This module exports a single class called KubectlV29Layer
which is a lambda.LayerVersion
that
bundles the kubectl
and the
helm
command line.
- Helm Version: 3.14.0
- Kubectl Version: 1.29.1
Usage:
// KubectlLayer bundles the 'kubectl' and 'helm' command lines
import { KubectlV29Layer } from '@aws-cdk/lambda-layer-kubectl-v29';
import * as lambda from 'aws-cdk-lib/aws-lambda';
declare const fn: lambda.Function;
const kubectl = new KubectlV29Layer(this, 'KubectlLayer');
fn.addLayers(kubectl);
kubectl
will be installed under /opt/kubectl/kubectl
, and helm
will be installed under /opt/helm/helm
.
A CDK Asset construct that contains kubectl
and helm
.
import { KubectlV29Layer } from '@aws-cdk/lambda-layer-kubectl-v29'
new KubectlV29Layer(scope: Construct, id: string)
Name | Type | Description |
---|---|---|
scope |
constructs.Construct |
No description. |
id |
string |
No description. |
- Type: constructs.Construct
- Type: string
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
applyRemovalPolicy |
Apply the given removal policy to this resource. |
addPermission |
Add permission for this layer version to specific entities. |
public toString(): string
Returns a string representation of this construct.
public applyRemovalPolicy(policy: RemovalPolicy): void
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
- Type: aws-cdk-lib.RemovalPolicy
public addPermission(id: string, permission: LayerVersionPermission): void
Add permission for this layer version to specific entities.
Usage within
the same account where the layer is defined is always allowed and does not
require calling this method. Note that the principal that creates the
Lambda function using the layer (for example, a CloudFormation changeset
execution role) also needs to have the lambda:GetLayerVersion
permission on the layer version.
- Type: string
- Type: aws-cdk-lib.aws_lambda.LayerVersionPermission
Name | Description |
---|---|
isConstruct |
Checks if x is a construct. |
isResource |
Check whether the given construct is a Resource. |
fromLayerVersionArn |
Imports a layer version by ARN. |
fromLayerVersionAttributes |
Imports a Layer that has been defined externally. |
import { KubectlV29Layer } from '@aws-cdk/lambda-layer-kubectl-v29'
KubectlV29Layer.isConstruct(x: any)
Checks if x
is a construct.
- Type: any
Any object.
import { KubectlV29Layer } from '@aws-cdk/lambda-layer-kubectl-v29'
KubectlV29Layer.isResource(construct: IConstruct)
Check whether the given construct is a Resource.
- Type: constructs.IConstruct
import { KubectlV29Layer } from '@aws-cdk/lambda-layer-kubectl-v29'
KubectlV29Layer.fromLayerVersionArn(scope: Construct, id: string, layerVersionArn: string)
Imports a layer version by ARN.
Assumes it is compatible with all Lambda runtimes.
- Type: constructs.Construct
- Type: string
- Type: string
import { KubectlV29Layer } from '@aws-cdk/lambda-layer-kubectl-v29'
KubectlV29Layer.fromLayerVersionAttributes(scope: Construct, id: string, attrs: LayerVersionAttributes)
Imports a Layer that has been defined externally.
- Type: constructs.Construct
the parent Construct that will use the imported layer.
- Type: string
the id of the imported layer in the construct tree.
- Type: aws-cdk-lib.aws_lambda.LayerVersionAttributes
the properties of the imported layer.
Name | Type | Description |
---|---|---|
node |
constructs.Node |
The tree node. |
env |
aws-cdk-lib.ResourceEnvironment |
The environment this resource belongs to. |
stack |
aws-cdk-lib.Stack |
The stack in which this resource is defined. |
layerVersionArn |
string |
The ARN of the Lambda Layer version that this Layer defines. |
compatibleRuntimes |
aws-cdk-lib.aws_lambda.Runtime[] |
The runtimes compatible with this Layer. |
public readonly node: Node;
- Type: constructs.Node
The tree node.
public readonly env: ResourceEnvironment;
- Type: aws-cdk-lib.ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
public readonly stack: Stack;
- Type: aws-cdk-lib.Stack
The stack in which this resource is defined.
public readonly layerVersionArn: string;
- Type: string
The ARN of the Lambda Layer version that this Layer defines.
public readonly compatibleRuntimes: Runtime[];
- Type: aws-cdk-lib.aws_lambda.Runtime[]
The runtimes compatible with this Layer.