Interface BucketOptions

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

@Generated(value="jsii-pacmak/1.140.0 (build 79fd58c)", date="2026-09-25T13:53:53.232Z") @Stability(Stable) public interface BucketOptions extends software.amazon.jsii.JsiiSerializable
Optional parameters for creating code using bucket.

Example:

 import software.amazon.awscdk.services.kms.Key;
 import software.amazon.awscdk.services.s3.*;
 Key key;
 Bucket bucket = new Bucket(this, "Bucket");
 Map<String, Key> options = Map.of(
         "sourceKMSKey", key);
 Function fnBucket = Function.Builder.create(this, "myFunction2")
         .runtime(Runtime.NODEJS_LATEST)
         .handler("index.handler")
         .code(Code.fromBucketV2(bucket, "python-lambda-handler.zip", options))
         .build();
 
  • Method Details

    • getObjectVersion

      @Stability(Stable) @Nullable default String getObjectVersion()
      Optional S3 object version.

      Required when s3ObjectStorageMode is set to S3ObjectStorageMode.REFERENCE.

      Default: - no object version

    • 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.

    • getSourceKMSKey

      @Stability(Stable) @Nullable default IKeyRef getSourceKMSKey()
      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 BucketOptions.Builder builder()
      Returns:
      a BucketOptions.Builder of BucketOptions