interface CodeConfig
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Lambda.CodeConfig |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslambda#CodeConfig |
Java | software.amazon.awscdk.services.lambda.CodeConfig |
Python | aws_cdk.aws_lambda.CodeConfig |
TypeScript (source) | aws-cdk-lib » aws_lambda » CodeConfig |
Obtainable from
Asset.bind(), Asset.bind(), Cfn.bind(), Code.bind(), Ecr.bind(), Inline.bind(), S3.bind(), S3.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',
},
s3ObjectStorageMode: lambda.S3ObjectStorageMode.COPY,
sourceKMSKeyArn: 'sourceKMSKeyArn',
};
Properties
| Name | Type | Description |
|---|---|---|
| image? | Code | Docker image configuration (mutually exclusive with s3Location and inlineCode). |
| inline | string | Inline code (mutually exclusive with s3Location and image). |
| s3 | Location | The location of the code in S3 (mutually exclusive with inlineCode and image). |
| s3 | S3 | How Lambda manages the storage of your code package. |
| source | string | The ARN of the KMS key that Lambda uses to encrypt the deployment package in Lambda-managed storage. |
image?
Type:
Code
(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).
s3ObjectStorageMode?
Type:
S3
(optional, default: Lambda copies the deployment package from your S3 bucket into Lambda-managed storage.)
How Lambda manages the storage of your code package.
sourceKMSKeyArn?
Type:
string
(optional, default: Lambda uses an AWS owned key)
The ARN of the KMS key that Lambda uses to encrypt the deployment package in Lambda-managed storage.
This is not the key used to encrypt the source object in Amazon S3.

.NET
Go
Java
Python
TypeScript (