aws-cdk-lib.aws_lambda.CodeConfig

interface CodeConfig

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

Obtainable from AssetCode.bind(), AssetImageCode.bind(), CfnParametersCode.bind(), Code.bind(), EcrImageCode.bind(), InlineCode.bind(), S3Code.bind()

Result of binding Code into a Function.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_lambda as lambda } from 'aws-cdk-lib';
const codeConfig: lambda.CodeConfig = {
  image: {
    imageUri: 'imageUri',

    // the properties below are optional
    cmd: ['cmd'],
    entrypoint: ['entrypoint'],
    workingDirectory: 'workingDirectory',
  },
  inlineCode: 'inlineCode',
  s3Location: {
    bucketName: 'bucketName',
    objectKey: 'objectKey',

    // the properties below are optional
    objectVersion: 'objectVersion',
  },
};

Properties

NameTypeDescription
image?CodeImageConfigDocker image configuration (mutually exclusive with s3Location and inlineCode).
inlineCode?stringInline code (mutually exclusive with s3Location and image).
s3Location?LocationThe location of the code in S3 (mutually exclusive with inlineCode and image).

image?

Type: CodeImageConfig (optional, default: code is not an ECR container image)

Docker image configuration (mutually exclusive with s3Location and inlineCode).


inlineCode?

Type: string (optional, default: code is not inline code)

Inline code (mutually exclusive with s3Location and image).


s3Location?

Type: Location (optional, default: code is not an s3 location)

The location of the code in S3 (mutually exclusive with inlineCode and image).