KubectlLayer

class aws_cdk.aws_eks.KubectlLayer(scope, id, *, application_id=None, version=None)

Bases: aws_cdk.core.Construct

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

See

https://github.com/aws-samples/aws-lambda-layer-kubectl

Stability

experimental

Parameters
  • scope (Construct) –

  • id (str) –

  • application_id (Optional[str]) – (experimental) The Serverless Application Repository application ID which contains the kubectl layer. Default: - The ARN for the lambda-layer-kubectl SAR app.

  • version (Optional[str]) – (experimental) The semantic version of the kubectl AWS Lambda Layer SAR app to use. Default: ‘2.0.0’

Stability

experimental

Methods

add_permission(_id, *, account_id, organization_id=None)

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

Parameters
  • _id (str) –

  • account_id (str) – The AWS Account id of the account that is authorized to use a Lambda Layer Version. The wild-card '*' can be used to grant access to “any” account (or any account in an organization when organizationId is specified).

  • organization_id (Optional[str]) – The ID of the AWS Organization to hwich the grant is restricted. Can only be specified if accountId is '*'

Stability

experimental

Return type

None

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

compatible_runtimes

(experimental) All runtimes are compatible.

Stability

experimental

Return type

Optional[List[Runtime]]

env

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

Stability

experimental

Return type

ResourceEnvironment

layer_version_arn

(experimental) The ARN of the AWS Lambda layer version.

Stability

experimental

Return type

str

node

The construct tree node associated with this construct.

Return type

ConstructNode

stack

(experimental) The stack in which this resource is defined.

Stability

experimental

Return type

Stack

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool