Enum S3ObjectStorageMode

java.lang.Object
java.lang.Enum<S3ObjectStorageMode>
software.amazon.awscdk.services.lambda.S3ObjectStorageMode
All Implemented Interfaces:
Serializable, Comparable<S3ObjectStorageMode>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.140.0 (build 79fd58c)", date="2026-09-25T13:53:53.449Z") @Stability(Stable) public enum S3ObjectStorageMode extends Enum<S3ObjectStorageMode>
How Lambda manages the storage of your code package.

Example:

 import software.amazon.awscdk.services.s3.*;
 IBucket bucket;
 String objectVersion;
 Function.Builder.create(this, "MyFunction")
         .functionName("my-function")
         .runtime(Runtime.NODEJS_LATEST)
         .handler("index.handler")
         .code(Code.fromBucketV2(bucket, "my-function.zip", BucketOptions.builder()
                 .objectVersion(objectVersion)
                 .s3ObjectStorageMode(S3ObjectStorageMode.REFERENCE)
                 .build()))
         .build();
 LayerVersion.Builder.create(this, "MyLayer")
         .layerVersionName("my-layer")
         .code(Code.fromBucketV2(bucket, "my-layer.zip", BucketOptions.builder()
                 .objectVersion(objectVersion)
                 .s3ObjectStorageMode(S3ObjectStorageMode.REFERENCE)
                 .build()))
         .build();
 
  • Enum Constant Details

    • COPY

      @Stability(Stable) public static final S3ObjectStorageMode COPY
      Lambda copies the deployment package from your S3 bucket into Lambda-managed storage.
    • REFERENCE

      @Stability(Stable) public static final S3ObjectStorageMode REFERENCE
      Lambda references your code directly from your S3 bucket.
  • Method Details

    • values

      public static S3ObjectStorageMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static S3ObjectStorageMode valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null