Interface CodeConfig

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CodeConfig.Jsii$Proxy

@Generated(value="jsii-pacmak/1.140.0 (build 79fd58c)", date="2026-09-25T13:53:53.349Z") @Stability(Stable) public interface CodeConfig extends software.amazon.jsii.JsiiSerializable
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 software.amazon.awscdk.services.lambda.*;
 CodeConfig codeConfig = CodeConfig.builder()
         .image(CodeImageConfig.builder()
                 .imageUri("imageUri")
                 // the properties below are optional
                 .cmd(List.of("cmd"))
                 .entrypoint(List.of("entrypoint"))
                 .workingDirectory("workingDirectory")
                 .build())
         .inlineCode("inlineCode")
         .s3Location(Location.builder()
                 .bucketName("bucketName")
                 .objectKey("objectKey")
                 // the properties below are optional
                 .objectVersion("objectVersion")
                 .build())
         .s3ObjectStorageMode(S3ObjectStorageMode.COPY)
         .sourceKMSKeyArn("sourceKMSKeyArn")
         .build();
 
  • Method Details

    • getImage

      @Stability(Stable) @Nullable default CodeImageConfig getImage()
      Docker image configuration (mutually exclusive with s3Location and inlineCode).

      Default: - code is not an ECR container image

    • getInlineCode

      @Stability(Stable) @Nullable default String getInlineCode()
      Inline code (mutually exclusive with s3Location and image).

      Default: - code is not inline code

    • getS3Location

      @Stability(Stable) @Nullable default Location getS3Location()
      The location of the code in S3 (mutually exclusive with inlineCode and image).

      Default: - code is not an s3 location

    • getS3ObjectStorageMode

      @Stability(Stable) @Nullable default S3ObjectStorageMode getS3ObjectStorageMode()
      How Lambda manages the storage of your code package.

      Default: - Lambda copies the deployment package from your S3 bucket into Lambda-managed storage.

    • getSourceKMSKeyArn

      @Stability(Stable) @Nullable default String getSourceKMSKeyArn()
      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.

      Default: - Lambda uses an AWS owned key

    • builder

      @Stability(Stable) static CodeConfig.Builder builder()
      Returns:
      a CodeConfig.Builder of CodeConfig