aws-cdk-lib.aws_lambda.DockerImageCode

class DockerImageCode

LanguageType name
.NETAmazon.CDK.AWS.Lambda.DockerImageCode
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslambda#DockerImageCode
Javasoftware.amazon.awscdk.services.lambda.DockerImageCode
Pythonaws_cdk.aws_lambda.DockerImageCode
TypeScript (source)aws-cdk-lib » aws_lambda » DockerImageCode

Code property for the DockerImageFunction construct.

Example

new lambda.DockerImageFunction(this, 'AssetFunction', {
  code: lambda.DockerImageCode.fromImageAsset(path.join(__dirname, 'docker-handler')),
});

Initializer

new DockerImageCode()

Methods

NameDescription
static fromEcr(repository, props?)Use an existing ECR image as the Lambda code.
static fromImageAsset(directory, props?)Create an ECR image from the specified asset and bind it as the Lambda code.

static fromEcr(repository, props?)

public static fromEcr(repository: IRepository, props?: EcrImageCodeProps): DockerImageCode

Parameters

  • repository IRepository — the ECR repository that the image is in.
  • props EcrImageCodeProps — properties to further configure the selected image.

Returns

  • DockerImageCode

Use an existing ECR image as the Lambda code.


static fromImageAsset(directory, props?)

public static fromImageAsset(directory: string, props?: AssetImageCodeProps): DockerImageCode

Parameters

  • directory string — the directory from which the asset must be created.
  • props AssetImageCodeProps — properties to further configure the selected image.

Returns

  • DockerImageCode

Create an ECR image from the specified asset and bind it as the Lambda code.