BucketOptions Struct
Optional parameters for creating code using bucket.
Example
ts
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
objectVersionoptionalstringobject_versionoptionalstrobjectVersionoptionalStringObjectVersionoptionalstringObjectVersionoptional*string#Optional S3 object version.
Default: no object version
Required when s3ObjectStorageMode is set to S3ObjectStorageMode.REFERENCE.
s3ObjectStorageModeoptionalS3ObjectStorageModes3_object_storage_modeoptionalS3ObjectStorageModes3ObjectStorageModeoptionalS3ObjectStorageModeS3ObjectStorageModeoptionalS3ObjectStorageModeS3ObjectStorageModeoptionalS3ObjectStorageMode#How Lambda manages the storage of your code package.
Default: Lambda copies the deployment package from your S3 bucket into Lambda-managed storage.
sourceKMSKeyoptionalIKeyRefsource_kms_keyoptionalIKeyRefsourceKMSKeyoptionalIKeyRefSourceKMSKeyoptionalIKeyRefSourceKMSKeyoptionalIKeyRef#The KMS key that Lambda uses to encrypt the deployment package in Lambda-managed storage.
Default: Lambda uses an AWS owned key
This is not the key used to encrypt the source object in Amazon S3.