Options
All
  • Public
  • Public/Protected
  • All
Menu

Same as AssetCode but exposes the sourceHash: https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/aws-lambda/lib/code.ts Feature request to expose sourceHash on the official AssetCode class: https://github.com/aws/aws-cdk/issues/4901

Hierarchy

  • Code
    • HashedCode

Index

Constructors

constructor

  • new HashedCode(path: string, options?: AssetOptions): HashedCode

Properties

Private Optional asset

asset: Asset

Readonly isInline

isInline: false = false

Private Readonly options

options: AssetOptions

Readonly path

path: string

Optional sourceHash

sourceHash: undefined | string

Methods

bind

  • bind(scope: Construct): CodeConfig

bindToResource

  • bindToResource(resource: CfnResource, options?: ResourceBindOptions): void

Static asset

  • asset(path: string): AssetCode
  • (deprecated) DEPRECATED.

    deprecated

    use fromAsset

    Parameters

    • path: string

    Returns AssetCode

Static bucket

  • bucket(bucket: IBucket, key: string, objectVersion?: undefined | string): S3Code
  • (deprecated) DEPRECATED.

    deprecated

    use fromBucket

    Parameters

    • bucket: IBucket
    • key: string
    • Optional objectVersion: undefined | string

    Returns S3Code

Static cfnParameters

  • cfnParameters(props?: CfnParametersCodeProps): CfnParametersCode
  • (deprecated) DEPRECATED.

    deprecated

    use fromCfnParameters

    Parameters

    • Optional props: CfnParametersCodeProps

    Returns CfnParametersCode

Static fromAsset

  • fromAsset(path: string, options?: s3_assets.AssetOptions): AssetCode
  • Loads the function code from a local disk path.

    stability

    stable

    Parameters

    • path: string

      Either a directory with the Lambda code bundle or a .zip file.

    • Optional options: s3_assets.AssetOptions

    Returns AssetCode

Static fromAssetImage

  • fromAssetImage(directory: string, props?: AssetImageCodeProps): AssetImageCode
  • Create an ECR image from the specified asset and bind it as the Lambda code.

    stability

    stable

    Parameters

    • directory: string

      the directory from which the asset must be created.

    • Optional props: AssetImageCodeProps

      properties to further configure the selected image.

    Returns AssetImageCode

Static fromBucket

  • fromBucket(bucket: IBucket, key: string, objectVersion?: undefined | string): S3Code
  • Lambda handler code as an S3 object.

    stability

    stable

    Parameters

    • bucket: IBucket

      The S3 bucket.

    • key: string

      The object key.

    • Optional objectVersion: undefined | string

      Optional S3 object version.

    Returns S3Code

Static fromCfnParameters

  • fromCfnParameters(props?: CfnParametersCodeProps): CfnParametersCode
  • Creates a new Lambda source defined using CloudFormation parameters.

    stability

    stable

    Parameters

    • Optional props: CfnParametersCodeProps

      optional construction properties of {@link CfnParametersCode}.

    Returns CfnParametersCode

    a new instance of CfnParametersCode

Static fromEcrImage

  • fromEcrImage(repository: IRepository, props?: EcrImageCodeProps): EcrImageCode
  • Use an existing ECR image as the Lambda code.

    stability

    stable

    Parameters

    • repository: IRepository

      the ECR repository that the image is in.

    • Optional props: EcrImageCodeProps

      properties to further configure the selected image.

    Returns EcrImageCode

Static fromInline

  • fromInline(code: string): InlineCode
  • Inline code for Lambda handler.

    stability

    stable

    Parameters

    • code: string

      The actual handler code (limited to 4KiB).

    Returns InlineCode

    LambdaInlineCode with inline code.

Static inline

  • inline(code: string): InlineCode
  • (deprecated) DEPRECATED.

    deprecated

    use fromInline

    Parameters

    • code: string

    Returns InlineCode

Legend

  • Constructor
  • Property
  • Method
  • Constructor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Private property
  • Private method
  • Static property
  • Static method

Generated using TypeDoc