UNPKG

1.67 kBTypeScriptView Raw
1import * as ecr from '@aws-cdk/aws-ecr';
2import { Construct } from 'constructs';
3import { AssetImageCodeProps, EcrImageCodeProps, Code } from './code';
4import { Function, FunctionOptions } from './function';
5/**
6 * Properties to configure a new DockerImageFunction construct.
7 */
8export interface DockerImageFunctionProps extends FunctionOptions {
9 /**
10 * The source code of your Lambda function. You can point to a file in an
11 * Amazon Simple Storage Service (Amazon S3) bucket or specify your source
12 * code as inline text.
13 */
14 readonly code: DockerImageCode;
15}
16/**
17 * Code property for the DockerImageFunction construct
18 */
19export declare abstract class DockerImageCode {
20 /**
21 * Use an existing ECR image as the Lambda code.
22 * @param repository the ECR repository that the image is in
23 * @param props properties to further configure the selected image
24 */
25 static fromEcr(repository: ecr.IRepository, props?: EcrImageCodeProps): DockerImageCode;
26 /**
27 * Create an ECR image from the specified asset and bind it as the Lambda code.
28 * @param directory the directory from which the asset must be created
29 * @param props properties to further configure the selected image
30 */
31 static fromImageAsset(directory: string, props?: AssetImageCodeProps): DockerImageCode;
32 /**
33 * Produce a `Code` instance from this `DockerImageCode`.
34 * @internal
35 */
36 abstract _bind(): Code;
37}
38/**
39 * Create a lambda function where the handler is a docker image
40 */
41export declare class DockerImageFunction extends Function {
42 constructor(scope: Construct, id: string, props: DockerImageFunctionProps);
43}