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