BucketOptions
- class aws_cdk.aws_lambda.BucketOptions(*, object_version=None, source_kms_key=None)
Bases:
object
Optional parameters for creating code using bucket.
- Parameters:
object_version (
Optional
[str
]) – Optional S3 object version.source_kms_key (
Optional
[IKey
]) – The ARN of the KMS key used to encrypt the handler code. Default: - the default server-side encryption with Amazon S3 managed keys(SSE-S3) key will be used.
- ExampleMetadata:
infused
Example:
from aws_cdk.aws_kms import Key import aws_cdk.aws_s3 as s3 # key: Key bucket = s3.Bucket(self, "Bucket") options = { "source_kMSKey": key } fn_bucket = lambda_.Function(self, "myFunction2", runtime=lambda_.Runtime.NODEJS_LATEST, handler="index.handler", code=lambda_.Code.from_bucket_v2(bucket, "python-lambda-handler.zip", options) )
Attributes
- object_version
Optional S3 object version.
- source_kms_key
The ARN of the KMS key used to encrypt the handler code.
- Default:
the default server-side encryption with Amazon S3 managed keys(SSE-S3) key will be used.