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',
},
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). |
| source | string | The ARN of the KMS key used to encrypt the handler code. |
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).
sourceKMSKeyArn?
Type:
string
(optional, default: the default server-side encryption with Amazon S3 managed keys(SSE-S3) key will be used.)
The ARN of the KMS key used to encrypt the handler code.

.NET
Go
Java
Python
TypeScript (