interface BucketOptions
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.Lambda.BucketOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awslambda#BucketOptions |
Java | software.amazon.awscdk.services.lambda.BucketOptions |
Python | aws_cdk.aws_lambda.BucketOptions |
TypeScript (source) | aws-cdk-lib » aws_lambda » BucketOptions |
Optional parameters for creating code using bucket.
Example
import { Key } from 'aws-cdk-lib/aws-kms';
import * as s3 from 'aws-cdk-lib/aws-s3';
const bucket = new s3.Bucket(this, 'Bucket');
declare const key: Key;
const options = {
sourceKMSKey: key,
};
const fnBucket = new lambda.Function(this, 'myFunction2', {
runtime: lambda.Runtime.NODEJS_LATEST,
handler: 'index.handler',
code: lambda.Code.fromBucketV2(bucket, 'python-lambda-handler.zip', options),
});
Properties
| Name | Type | Description |
|---|---|---|
| object | string | Optional S3 object version. |
| s3 | S3 | How Lambda manages the storage of your code package. |
| source | IKey | The KMS key that Lambda uses to encrypt the deployment package in Lambda-managed storage. |
objectVersion?
Type:
string
(optional, default: no object version)
Optional S3 object version.
Required when s3ObjectStorageMode is set to S3ObjectStorageMode.REFERENCE.
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.
sourceKMSKey?
Type:
IKey
(optional, default: Lambda uses an AWS owned key)
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 (