aws-cdk-lib 2.166.0__py3-none-any.whl → 2.167.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of aws-cdk-lib might be problematic. Click here for more details.

Files changed (38) hide show
  1. aws_cdk/__init__.py +1 -1
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.166.0.jsii.tgz → aws-cdk-lib@2.167.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_apigateway/__init__.py +9 -0
  5. aws_cdk/aws_appsync/__init__.py +209 -79
  6. aws_cdk/aws_bedrock/__init__.py +51 -45
  7. aws_cdk/aws_cleanrooms/__init__.py +66 -5
  8. aws_cdk/aws_cloudfront/__init__.py +21 -3
  9. aws_cdk/aws_cloudfront/experimental/__init__.py +3 -3
  10. aws_cdk/aws_codebuild/__init__.py +59 -29
  11. aws_cdk/aws_datasync/__init__.py +51 -0
  12. aws_cdk/aws_ec2/__init__.py +305 -9
  13. aws_cdk/aws_ecs/__init__.py +37 -34
  14. aws_cdk/aws_elasticache/__init__.py +5 -3
  15. aws_cdk/aws_elasticloadbalancingv2/__init__.py +73 -46
  16. aws_cdk/aws_gamelift/__init__.py +52 -40
  17. aws_cdk/aws_inspectorv2/__init__.py +6 -12
  18. aws_cdk/aws_kms/__init__.py +2 -0
  19. aws_cdk/aws_lambda/__init__.py +336 -19
  20. aws_cdk/aws_lambda_nodejs/__init__.py +3 -3
  21. aws_cdk/aws_logs/__init__.py +214 -0
  22. aws_cdk/aws_nimblestudio/__init__.py +6 -103
  23. aws_cdk/aws_quicksight/__init__.py +481 -10
  24. aws_cdk/aws_rds/__init__.py +602 -0
  25. aws_cdk/aws_s3_assets/__init__.py +37 -0
  26. aws_cdk/aws_s3_deployment/__init__.py +5 -0
  27. aws_cdk/aws_servicecatalog/__init__.py +52 -4
  28. aws_cdk/aws_ses/__init__.py +5 -3
  29. aws_cdk/aws_stepfunctions/__init__.py +8 -0
  30. aws_cdk/aws_synthetics/__init__.py +12 -1
  31. aws_cdk/aws_wisdom/__init__.py +344 -24
  32. aws_cdk/triggers/__init__.py +3 -3
  33. {aws_cdk_lib-2.166.0.dist-info → aws_cdk_lib-2.167.0.dist-info}/METADATA +1 -1
  34. {aws_cdk_lib-2.166.0.dist-info → aws_cdk_lib-2.167.0.dist-info}/RECORD +38 -38
  35. {aws_cdk_lib-2.166.0.dist-info → aws_cdk_lib-2.167.0.dist-info}/WHEEL +1 -1
  36. {aws_cdk_lib-2.166.0.dist-info → aws_cdk_lib-2.167.0.dist-info}/LICENSE +0 -0
  37. {aws_cdk_lib-2.166.0.dist-info → aws_cdk_lib-2.167.0.dist-info}/NOTICE +0 -0
  38. {aws_cdk_lib-2.166.0.dist-info → aws_cdk_lib-2.167.0.dist-info}/top_level.txt +0 -0
@@ -16,8 +16,29 @@ fn = lambda_.Function(self, "MyFunction",
16
16
  The `lambda.Code` class includes static convenience methods for various types of
17
17
  runtime code.
18
18
 
19
- * `lambda.Code.fromBucket(bucket, key[, objectVersion])` - specify an S3 object
19
+ * `lambda.Code.fromBucket(bucket, key, objectVersion)` - specify an S3 object
20
20
  that contains the archive of your runtime code.
21
+ * `lambda.Code.fromBucketV2(bucket, key, {objectVersion: version, sourceKMSKey: key})` - specify an S3 object
22
+ that contains the archive of your runtime code.
23
+
24
+ ```python
25
+ from aws_cdk.aws_kms import Key
26
+ import aws_cdk.aws_s3 as s3
27
+ # key: Key
28
+
29
+
30
+ bucket = s3.Bucket(self, "Bucket")
31
+
32
+ options = {
33
+ "source_kMSKey": key
34
+ }
35
+ fn_bucket = lambda_.Function(self, "myFunction2",
36
+ runtime=lambda_.Runtime.NODEJS_LATEST,
37
+ handler="index.handler",
38
+ code=lambda_.Code.from_bucket_v2(bucket, "python-lambda-handler.zip", options)
39
+ )
40
+ ```
41
+
21
42
  * `lambda.Code.fromInline(code)` - inline the handle code as a string. This is
22
43
  limited to supported runtimes.
23
44
  * `lambda.Code.fromAsset(path)` - specify a directory or a .zip file in the local
@@ -1050,7 +1071,7 @@ https://docs.aws.amazon.com/lambda/latest/dg/invocation-recursion.html
1050
1071
 
1051
1072
  ## Lambda with SnapStart
1052
1073
 
1053
- SnapStart is currently supported only on Java 11 and later [Java managed runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). SnapStart does not support provisioned concurrency, Amazon Elastic File System (Amazon EFS), or ephemeral storage greater than 512 MB. After you enable Lambda SnapStart for a particular Lambda function, publishing a new version of the function will trigger an optimization process.
1074
+ SnapStart is currently supported on Python 3.12, Python 3.13, .NET 8, and Java 11 and later [Java managed runtimes](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html). SnapStart does not support provisioned concurrency, Amazon Elastic File System (Amazon EFS), or ephemeral storage greater than 512 MB. After you enable Lambda SnapStart for a particular Lambda function, publishing a new version of the function will trigger an optimization process.
1054
1075
 
1055
1076
  See [the AWS documentation](https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html) to learn more about AWS Lambda SnapStart
1056
1077
 
@@ -2972,6 +2993,80 @@ class AutoScalingOptions:
2972
2993
  )
2973
2994
 
2974
2995
 
2996
+ @jsii.data_type(
2997
+ jsii_type="aws-cdk-lib.aws_lambda.BucketOptions",
2998
+ jsii_struct_bases=[],
2999
+ name_mapping={"object_version": "objectVersion", "source_kms_key": "sourceKMSKey"},
3000
+ )
3001
+ class BucketOptions:
3002
+ def __init__(
3003
+ self,
3004
+ *,
3005
+ object_version: typing.Optional[builtins.str] = None,
3006
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
3007
+ ) -> None:
3008
+ '''Optional parameters for creating code using bucket.
3009
+
3010
+ :param object_version: Optional S3 object version.
3011
+ :param 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.
3012
+
3013
+ :exampleMetadata: infused
3014
+
3015
+ Example::
3016
+
3017
+ from aws_cdk.aws_kms import Key
3018
+ import aws_cdk.aws_s3 as s3
3019
+ # key: Key
3020
+
3021
+
3022
+ bucket = s3.Bucket(self, "Bucket")
3023
+
3024
+ options = {
3025
+ "source_kMSKey": key
3026
+ }
3027
+ fn_bucket = lambda_.Function(self, "myFunction2",
3028
+ runtime=lambda_.Runtime.NODEJS_LATEST,
3029
+ handler="index.handler",
3030
+ code=lambda_.Code.from_bucket_v2(bucket, "python-lambda-handler.zip", options)
3031
+ )
3032
+ '''
3033
+ if __debug__:
3034
+ type_hints = typing.get_type_hints(_typecheckingstub__ea5994c9827298565c305f3f7f771ab57a19a60665d41006e56da4741c2d0d56)
3035
+ check_type(argname="argument object_version", value=object_version, expected_type=type_hints["object_version"])
3036
+ check_type(argname="argument source_kms_key", value=source_kms_key, expected_type=type_hints["source_kms_key"])
3037
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
3038
+ if object_version is not None:
3039
+ self._values["object_version"] = object_version
3040
+ if source_kms_key is not None:
3041
+ self._values["source_kms_key"] = source_kms_key
3042
+
3043
+ @builtins.property
3044
+ def object_version(self) -> typing.Optional[builtins.str]:
3045
+ '''Optional S3 object version.'''
3046
+ result = self._values.get("object_version")
3047
+ return typing.cast(typing.Optional[builtins.str], result)
3048
+
3049
+ @builtins.property
3050
+ def source_kms_key(self) -> typing.Optional[_IKey_5f11635f]:
3051
+ '''The ARN of the KMS key used to encrypt the handler code.
3052
+
3053
+ :default: - the default server-side encryption with Amazon S3 managed keys(SSE-S3) key will be used.
3054
+ '''
3055
+ result = self._values.get("source_kms_key")
3056
+ return typing.cast(typing.Optional[_IKey_5f11635f], result)
3057
+
3058
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
3059
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
3060
+
3061
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
3062
+ return not (rhs == self)
3063
+
3064
+ def __repr__(self) -> str:
3065
+ return "BucketOptions(%s)" % ", ".join(
3066
+ k + "=" + repr(v) for k, v in self._values.items()
3067
+ )
3068
+
3069
+
2975
3070
  @jsii.implements(_IInspectable_c2943556)
2976
3071
  class CfnAlias(
2977
3072
  _CfnResource_9df397a6,
@@ -7059,6 +7154,10 @@ class CfnFunction(
7059
7154
  ) -> None:
7060
7155
  '''The `deployment package <https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html>`_ for a Lambda function. To deploy a function defined as a container image, you specify the location of a container image in the Amazon ECR registry. For a .zip file deployment package, you can specify the location of an object in Amazon S3. For Node.js and Python functions, you can specify the function code inline in the template.
7061
7156
 
7157
+ .. epigraph::
7158
+
7159
+ When you specify source code inline for a Node.js function, the ``index`` file that AWS CloudFormation creates uses the extension ``.js`` . This means that Lambda treats the file as a CommonJS module. ES modules aren't supported for inline functions.
7160
+
7062
7161
  Changes to a deployment package in Amazon S3 or a container image in ECR are not detected automatically during stack updates. To update the function code, change the object key or version in the template.
7063
7162
 
7064
7163
  :param image_uri: URI of a `container image <https://docs.aws.amazon.com/lambda/latest/dg/lambda-images.html>`_ in the Amazon ECR registry.
@@ -7066,7 +7165,7 @@ class CfnFunction(
7066
7165
  :param s3_key: The Amazon S3 key of the deployment package.
7067
7166
  :param s3_object_version: For versioned objects, the version of the deployment package object to use.
7068
7167
  :param source_kms_key_arn:
7069
- :param zip_file: (Node.js and Python) The source code of your Lambda function. If you include your function source inline with this parameter, AWS CloudFormation places it in a file named ``index`` and zips it to create a `deployment package <https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html>`_ . This zip file cannot exceed 4MB. For the ``Handler`` property, the first part of the handler identifier must be ``index`` . For example, ``index.handler`` . For JSON, you must escape quotes and special characters such as newline ( ``\\n`` ) with a backslash. If you specify a function that interacts with an AWS CloudFormation custom resource, you don't have to write your own functions to send responses to the custom resource that invoked the function. AWS CloudFormation provides a response module ( `cfn-response <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code-cfnresponsemodule.html>`_ ) that simplifies sending responses. See `Using AWS Lambda with AWS CloudFormation <https://docs.aws.amazon.com/lambda/latest/dg/services-cloudformation.html>`_ for details.
7168
+ :param zip_file: (Node.js and Python) The source code of your Lambda function. If you include your function source inline with this parameter, AWS CloudFormation places it in a file named ``index`` and zips it to create a `deployment package <https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html>`_ . This zip file cannot exceed 4MB. For the ``Handler`` property, the first part of the handler identifier must be ``index`` . For example, ``index.handler`` . .. epigraph:: When you specify source code inline for a Node.js function, the ``index`` file that AWS CloudFormation creates uses the extension ``.js`` . This means that Lambda treats the file as a CommonJS module. ES modules aren't supported for inline functions. For JSON, you must escape quotes and special characters such as newline ( ``\\n`` ) with a backslash. If you specify a function that interacts with an AWS CloudFormation custom resource, you don't have to write your own functions to send responses to the custom resource that invoked the function. AWS CloudFormation provides a response module ( `cfn-response <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code-cfnresponsemodule.html>`_ ) that simplifies sending responses. See `Using AWS Lambda with AWS CloudFormation <https://docs.aws.amazon.com/lambda/latest/dg/services-cloudformation.html>`_ for details.
7070
7169
 
7071
7170
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html
7072
7171
  :exampleMetadata: fixture=_generated
@@ -7158,6 +7257,10 @@ class CfnFunction(
7158
7257
  def zip_file(self) -> typing.Optional[builtins.str]:
7159
7258
  '''(Node.js and Python) The source code of your Lambda function. If you include your function source inline with this parameter, AWS CloudFormation places it in a file named ``index`` and zips it to create a `deployment package <https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html>`_ . This zip file cannot exceed 4MB. For the ``Handler`` property, the first part of the handler identifier must be ``index`` . For example, ``index.handler`` .
7160
7259
 
7260
+ .. epigraph::
7261
+
7262
+ When you specify source code inline for a Node.js function, the ``index`` file that AWS CloudFormation creates uses the extension ``.js`` . This means that Lambda treats the file as a CommonJS module. ES modules aren't supported for inline functions.
7263
+
7161
7264
  For JSON, you must escape quotes and special characters such as newline ( ``\\n`` ) with a backslash.
7162
7265
 
7163
7266
  If you specify a function that interacts with an AWS CloudFormation custom resource, you don't have to write your own functions to send responses to the custom resource that invoked the function. AWS CloudFormation provides a response module ( `cfn-response <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code-cfnresponsemodule.html>`_ ) that simplifies sending responses. See `Using AWS Lambda with AWS CloudFormation <https://docs.aws.amazon.com/lambda/latest/dg/services-cloudformation.html>`_ for details.
@@ -9293,6 +9396,7 @@ class CfnLayerVersionProps:
9293
9396
  name_mapping={
9294
9397
  "bucket_name_param": "bucketNameParam",
9295
9398
  "object_key_param": "objectKeyParam",
9399
+ "source_kms_key": "sourceKMSKey",
9296
9400
  },
9297
9401
  )
9298
9402
  class CfnParametersCodeProps:
@@ -9301,11 +9405,13 @@ class CfnParametersCodeProps:
9301
9405
  *,
9302
9406
  bucket_name_param: typing.Optional[_CfnParameter_48fc1866] = None,
9303
9407
  object_key_param: typing.Optional[_CfnParameter_48fc1866] = None,
9408
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
9304
9409
  ) -> None:
9305
9410
  '''Construction properties for ``CfnParametersCode``.
9306
9411
 
9307
9412
  :param bucket_name_param: The CloudFormation parameter that represents the name of the S3 Bucket where the Lambda code will be located in. Must be of type 'String'. Default: a new parameter will be created
9308
9413
  :param object_key_param: The CloudFormation parameter that represents the path inside the S3 Bucket where the Lambda code will be located at. Must be of type 'String'. Default: a new parameter will be created
9414
+ :param 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.
9309
9415
 
9310
9416
  :exampleMetadata: fixture=_generated
9311
9417
 
@@ -9314,24 +9420,30 @@ class CfnParametersCodeProps:
9314
9420
  # The code below shows an example of how to instantiate this type.
9315
9421
  # The values are placeholders you should change.
9316
9422
  import aws_cdk as cdk
9423
+ from aws_cdk import aws_kms as kms
9317
9424
  from aws_cdk import aws_lambda as lambda_
9318
9425
 
9319
9426
  # cfn_parameter: cdk.CfnParameter
9427
+ # key: kms.Key
9320
9428
 
9321
9429
  cfn_parameters_code_props = lambda.CfnParametersCodeProps(
9322
9430
  bucket_name_param=cfn_parameter,
9323
- object_key_param=cfn_parameter
9431
+ object_key_param=cfn_parameter,
9432
+ source_kMSKey=key
9324
9433
  )
9325
9434
  '''
9326
9435
  if __debug__:
9327
9436
  type_hints = typing.get_type_hints(_typecheckingstub__45ce02257c922b893446f407552a2416c3356585f4b95a19a9069a0bb7e9115f)
9328
9437
  check_type(argname="argument bucket_name_param", value=bucket_name_param, expected_type=type_hints["bucket_name_param"])
9329
9438
  check_type(argname="argument object_key_param", value=object_key_param, expected_type=type_hints["object_key_param"])
9439
+ check_type(argname="argument source_kms_key", value=source_kms_key, expected_type=type_hints["source_kms_key"])
9330
9440
  self._values: typing.Dict[builtins.str, typing.Any] = {}
9331
9441
  if bucket_name_param is not None:
9332
9442
  self._values["bucket_name_param"] = bucket_name_param
9333
9443
  if object_key_param is not None:
9334
9444
  self._values["object_key_param"] = object_key_param
9445
+ if source_kms_key is not None:
9446
+ self._values["source_kms_key"] = source_kms_key
9335
9447
 
9336
9448
  @builtins.property
9337
9449
  def bucket_name_param(self) -> typing.Optional[_CfnParameter_48fc1866]:
@@ -9355,6 +9467,15 @@ class CfnParametersCodeProps:
9355
9467
  result = self._values.get("object_key_param")
9356
9468
  return typing.cast(typing.Optional[_CfnParameter_48fc1866], result)
9357
9469
 
9470
+ @builtins.property
9471
+ def source_kms_key(self) -> typing.Optional[_IKey_5f11635f]:
9472
+ '''The ARN of the KMS key used to encrypt the handler code.
9473
+
9474
+ :default: - the default server-side encryption with Amazon S3 managed keys(SSE-S3) key will be used.
9475
+ '''
9476
+ result = self._values.get("source_kms_key")
9477
+ return typing.cast(typing.Optional[_IKey_5f11635f], result)
9478
+
9358
9479
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
9359
9480
  return isinstance(rhs, self.__class__) and rhs._values == self._values
9360
9481
 
@@ -10841,6 +10962,7 @@ class Code(metaclass=jsii.JSIIAbstractClass, jsii_type="aws-cdk-lib.aws_lambda.C
10841
10962
  *,
10842
10963
  deploy_time: typing.Optional[builtins.bool] = None,
10843
10964
  readers: typing.Optional[typing.Sequence[_IGrantable_71c4f5de]] = None,
10965
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
10844
10966
  asset_hash: typing.Optional[builtins.str] = None,
10845
10967
  asset_hash_type: typing.Optional[_AssetHashType_05b67f2d] = None,
10846
10968
  bundling: typing.Optional[typing.Union[_BundlingOptions_588cc936, typing.Dict[builtins.str, typing.Any]]] = None,
@@ -10853,6 +10975,7 @@ class Code(metaclass=jsii.JSIIAbstractClass, jsii_type="aws-cdk-lib.aws_lambda.C
10853
10975
  :param path: Either a directory with the Lambda code bundle or a .zip file.
10854
10976
  :param deploy_time: Whether or not the asset needs to exist beyond deployment time; i.e. are copied over to a different location and not needed afterwards. Setting this property to true has an impact on the lifecycle of the asset, because we will assume that it is safe to delete after the CloudFormation deployment succeeds. For example, Lambda Function assets are copied over to Lambda during deployment. Therefore, it is not necessary to store the asset in S3, so we consider those deployTime assets. Default: false
10855
10977
  :param readers: A list of principals that should be able to read this asset from S3. You can use ``asset.grantRead(principal)`` to grant read permissions later. Default: - No principals that can read file asset.
10978
+ :param 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.
10856
10979
  :param asset_hash: Specify a custom hash for this asset. If ``assetHashType`` is set it must be set to ``AssetHashType.CUSTOM``. For consistency, this custom hash will be SHA256 hashed and encoded as hex. The resulting hash will be the asset hash. NOTE: the hash is used in order to identify a specific revision of the asset, and used for optimizing and caching deployment activities related to this asset such as packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will need to make sure it is updated every time the asset changes, or otherwise it is possible that some deployments will not be invalidated. Default: - based on ``assetHashType``
10857
10980
  :param asset_hash_type: Specifies the type of hash to calculate for this asset. If ``assetHash`` is configured, this option must be ``undefined`` or ``AssetHashType.CUSTOM``. Default: - the default is ``AssetHashType.SOURCE``, but if ``assetHash`` is explicitly specified this value defaults to ``AssetHashType.CUSTOM``.
10858
10981
  :param bundling: Bundle the asset by executing a command in a Docker container or a custom bundling provider. The asset path will be mounted at ``/asset-input``. The Docker container is responsible for putting content at ``/asset-output``. The content at ``/asset-output`` will be zipped and used as the final asset. Default: - uploaded as-is to S3 if the asset is a regular file or a .zip file, archived into a .zip file and uploaded to S3 otherwise
@@ -10866,6 +10989,7 @@ class Code(metaclass=jsii.JSIIAbstractClass, jsii_type="aws-cdk-lib.aws_lambda.C
10866
10989
  options = _AssetOptions_2aa69621(
10867
10990
  deploy_time=deploy_time,
10868
10991
  readers=readers,
10992
+ source_kms_key=source_kms_key,
10869
10993
  asset_hash=asset_hash,
10870
10994
  asset_hash_type=asset_hash_type,
10871
10995
  bundling=bundling,
@@ -10976,6 +11100,33 @@ class Code(metaclass=jsii.JSIIAbstractClass, jsii_type="aws-cdk-lib.aws_lambda.C
10976
11100
  check_type(argname="argument object_version", value=object_version, expected_type=type_hints["object_version"])
10977
11101
  return typing.cast("S3Code", jsii.sinvoke(cls, "fromBucket", [bucket, key, object_version]))
10978
11102
 
11103
+ @jsii.member(jsii_name="fromBucketV2")
11104
+ @builtins.classmethod
11105
+ def from_bucket_v2(
11106
+ cls,
11107
+ bucket: _IBucket_42e086fd,
11108
+ key: builtins.str,
11109
+ *,
11110
+ object_version: typing.Optional[builtins.str] = None,
11111
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
11112
+ ) -> "S3CodeV2":
11113
+ '''Lambda handler code as an S3 object.
11114
+
11115
+ :param bucket: The S3 bucket.
11116
+ :param key: The object key.
11117
+ :param object_version: Optional S3 object version.
11118
+ :param 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.
11119
+ '''
11120
+ if __debug__:
11121
+ type_hints = typing.get_type_hints(_typecheckingstub__b3435b4d9a286e912d3934fc747c05554a23d64416b95f4dd12b911cd5bce166)
11122
+ check_type(argname="argument bucket", value=bucket, expected_type=type_hints["bucket"])
11123
+ check_type(argname="argument key", value=key, expected_type=type_hints["key"])
11124
+ options = BucketOptions(
11125
+ object_version=object_version, source_kms_key=source_kms_key
11126
+ )
11127
+
11128
+ return typing.cast("S3CodeV2", jsii.sinvoke(cls, "fromBucketV2", [bucket, key, options]))
11129
+
10979
11130
  @jsii.member(jsii_name="fromCfnParameters")
10980
11131
  @builtins.classmethod
10981
11132
  def from_cfn_parameters(
@@ -10983,16 +11134,20 @@ class Code(metaclass=jsii.JSIIAbstractClass, jsii_type="aws-cdk-lib.aws_lambda.C
10983
11134
  *,
10984
11135
  bucket_name_param: typing.Optional[_CfnParameter_48fc1866] = None,
10985
11136
  object_key_param: typing.Optional[_CfnParameter_48fc1866] = None,
11137
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
10986
11138
  ) -> "CfnParametersCode":
10987
11139
  '''Creates a new Lambda source defined using CloudFormation parameters.
10988
11140
 
10989
11141
  :param bucket_name_param: The CloudFormation parameter that represents the name of the S3 Bucket where the Lambda code will be located in. Must be of type 'String'. Default: a new parameter will be created
10990
11142
  :param object_key_param: The CloudFormation parameter that represents the path inside the S3 Bucket where the Lambda code will be located at. Must be of type 'String'. Default: a new parameter will be created
11143
+ :param 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.
10991
11144
 
10992
11145
  :return: a new instance of ``CfnParametersCode``
10993
11146
  '''
10994
11147
  props = CfnParametersCodeProps(
10995
- bucket_name_param=bucket_name_param, object_key_param=object_key_param
11148
+ bucket_name_param=bucket_name_param,
11149
+ object_key_param=object_key_param,
11150
+ source_kms_key=source_kms_key,
10996
11151
  )
10997
11152
 
10998
11153
  return typing.cast("CfnParametersCode", jsii.sinvoke(cls, "fromCfnParameters", [props]))
@@ -11007,6 +11162,7 @@ class Code(metaclass=jsii.JSIIAbstractClass, jsii_type="aws-cdk-lib.aws_lambda.C
11007
11162
  command_options: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
11008
11163
  deploy_time: typing.Optional[builtins.bool] = None,
11009
11164
  readers: typing.Optional[typing.Sequence[_IGrantable_71c4f5de]] = None,
11165
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
11010
11166
  asset_hash: typing.Optional[builtins.str] = None,
11011
11167
  asset_hash_type: typing.Optional[_AssetHashType_05b67f2d] = None,
11012
11168
  bundling: typing.Optional[typing.Union[_BundlingOptions_588cc936, typing.Dict[builtins.str, typing.Any]]] = None,
@@ -11021,6 +11177,7 @@ class Code(metaclass=jsii.JSIIAbstractClass, jsii_type="aws-cdk-lib.aws_lambda.C
11021
11177
  :param command_options: options that are passed to the spawned process, which determine the characteristics of the spawned process. Default: : see ``child_process.SpawnSyncOptions`` (https://nodejs.org/api/child_process.html#child_processspawnsynccommand-args-options).
11022
11178
  :param deploy_time: Whether or not the asset needs to exist beyond deployment time; i.e. are copied over to a different location and not needed afterwards. Setting this property to true has an impact on the lifecycle of the asset, because we will assume that it is safe to delete after the CloudFormation deployment succeeds. For example, Lambda Function assets are copied over to Lambda during deployment. Therefore, it is not necessary to store the asset in S3, so we consider those deployTime assets. Default: false
11023
11179
  :param readers: A list of principals that should be able to read this asset from S3. You can use ``asset.grantRead(principal)`` to grant read permissions later. Default: - No principals that can read file asset.
11180
+ :param 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.
11024
11181
  :param asset_hash: Specify a custom hash for this asset. If ``assetHashType`` is set it must be set to ``AssetHashType.CUSTOM``. For consistency, this custom hash will be SHA256 hashed and encoded as hex. The resulting hash will be the asset hash. NOTE: the hash is used in order to identify a specific revision of the asset, and used for optimizing and caching deployment activities related to this asset such as packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will need to make sure it is updated every time the asset changes, or otherwise it is possible that some deployments will not be invalidated. Default: - based on ``assetHashType``
11025
11182
  :param asset_hash_type: Specifies the type of hash to calculate for this asset. If ``assetHash`` is configured, this option must be ``undefined`` or ``AssetHashType.CUSTOM``. Default: - the default is ``AssetHashType.SOURCE``, but if ``assetHash`` is explicitly specified this value defaults to ``AssetHashType.CUSTOM``.
11026
11183
  :param bundling: Bundle the asset by executing a command in a Docker container or a custom bundling provider. The asset path will be mounted at ``/asset-input``. The Docker container is responsible for putting content at ``/asset-output``. The content at ``/asset-output`` will be zipped and used as the final asset. Default: - uploaded as-is to S3 if the asset is a regular file or a .zip file, archived into a .zip file and uploaded to S3 otherwise
@@ -11036,6 +11193,7 @@ class Code(metaclass=jsii.JSIIAbstractClass, jsii_type="aws-cdk-lib.aws_lambda.C
11036
11193
  command_options=command_options,
11037
11194
  deploy_time=deploy_time,
11038
11195
  readers=readers,
11196
+ source_kms_key=source_kms_key,
11039
11197
  asset_hash=asset_hash,
11040
11198
  asset_hash_type=asset_hash_type,
11041
11199
  bundling=bundling,
@@ -11198,6 +11356,7 @@ typing.cast(typing.Any, Code).__jsii_proxy_class__ = lambda : _CodeProxy
11198
11356
  "image": "image",
11199
11357
  "inline_code": "inlineCode",
11200
11358
  "s3_location": "s3Location",
11359
+ "source_kms_key_arn": "sourceKMSKeyArn",
11201
11360
  },
11202
11361
  )
11203
11362
  class CodeConfig:
@@ -11207,12 +11366,14 @@ class CodeConfig:
11207
11366
  image: typing.Optional[typing.Union["CodeImageConfig", typing.Dict[builtins.str, typing.Any]]] = None,
11208
11367
  inline_code: typing.Optional[builtins.str] = None,
11209
11368
  s3_location: typing.Optional[typing.Union[_Location_0948fa7f, typing.Dict[builtins.str, typing.Any]]] = None,
11369
+ source_kms_key_arn: typing.Optional[builtins.str] = None,
11210
11370
  ) -> None:
11211
11371
  '''Result of binding ``Code`` into a ``Function``.
11212
11372
 
11213
11373
  :param image: Docker image configuration (mutually exclusive with ``s3Location`` and ``inlineCode``). Default: - code is not an ECR container image
11214
11374
  :param inline_code: Inline code (mutually exclusive with ``s3Location`` and ``image``). Default: - code is not inline code
11215
11375
  :param s3_location: The location of the code in S3 (mutually exclusive with ``inlineCode`` and ``image``). Default: - code is not an s3 location
11376
+ :param source_kms_key_arn: 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.
11216
11377
 
11217
11378
  :exampleMetadata: fixture=_generated
11218
11379
 
@@ -11238,7 +11399,8 @@ class CodeConfig:
11238
11399
 
11239
11400
  # the properties below are optional
11240
11401
  object_version="objectVersion"
11241
- )
11402
+ ),
11403
+ source_kMSKey_arn="sourceKMSKeyArn"
11242
11404
  )
11243
11405
  '''
11244
11406
  if isinstance(image, dict):
@@ -11250,6 +11412,7 @@ class CodeConfig:
11250
11412
  check_type(argname="argument image", value=image, expected_type=type_hints["image"])
11251
11413
  check_type(argname="argument inline_code", value=inline_code, expected_type=type_hints["inline_code"])
11252
11414
  check_type(argname="argument s3_location", value=s3_location, expected_type=type_hints["s3_location"])
11415
+ check_type(argname="argument source_kms_key_arn", value=source_kms_key_arn, expected_type=type_hints["source_kms_key_arn"])
11253
11416
  self._values: typing.Dict[builtins.str, typing.Any] = {}
11254
11417
  if image is not None:
11255
11418
  self._values["image"] = image
@@ -11257,6 +11420,8 @@ class CodeConfig:
11257
11420
  self._values["inline_code"] = inline_code
11258
11421
  if s3_location is not None:
11259
11422
  self._values["s3_location"] = s3_location
11423
+ if source_kms_key_arn is not None:
11424
+ self._values["source_kms_key_arn"] = source_kms_key_arn
11260
11425
 
11261
11426
  @builtins.property
11262
11427
  def image(self) -> typing.Optional["CodeImageConfig"]:
@@ -11285,6 +11450,15 @@ class CodeConfig:
11285
11450
  result = self._values.get("s3_location")
11286
11451
  return typing.cast(typing.Optional[_Location_0948fa7f], result)
11287
11452
 
11453
+ @builtins.property
11454
+ def source_kms_key_arn(self) -> typing.Optional[builtins.str]:
11455
+ '''The ARN of the KMS key used to encrypt the handler code.
11456
+
11457
+ :default: - the default server-side encryption with Amazon S3 managed keys(SSE-S3) key will be used.
11458
+ '''
11459
+ result = self._values.get("source_kms_key_arn")
11460
+ return typing.cast(typing.Optional[builtins.str], result)
11461
+
11288
11462
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
11289
11463
  return isinstance(rhs, self.__class__) and rhs._values == self._values
11290
11464
 
@@ -11529,6 +11703,7 @@ class CodeSigningConfigProps:
11529
11703
  "ignore_mode": "ignoreMode",
11530
11704
  "deploy_time": "deployTime",
11531
11705
  "readers": "readers",
11706
+ "source_kms_key": "sourceKMSKey",
11532
11707
  "command_options": "commandOptions",
11533
11708
  },
11534
11709
  )
@@ -11544,6 +11719,7 @@ class CustomCommandOptions(_AssetOptions_2aa69621):
11544
11719
  ignore_mode: typing.Optional[_IgnoreMode_655a98e8] = None,
11545
11720
  deploy_time: typing.Optional[builtins.bool] = None,
11546
11721
  readers: typing.Optional[typing.Sequence[_IGrantable_71c4f5de]] = None,
11722
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
11547
11723
  command_options: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
11548
11724
  ) -> None:
11549
11725
  '''Options for creating ``AssetCode`` with a custom command, such as running a buildfile.
@@ -11556,6 +11732,7 @@ class CustomCommandOptions(_AssetOptions_2aa69621):
11556
11732
  :param ignore_mode: The ignore behavior to use for ``exclude`` patterns. Default: IgnoreMode.GLOB
11557
11733
  :param deploy_time: Whether or not the asset needs to exist beyond deployment time; i.e. are copied over to a different location and not needed afterwards. Setting this property to true has an impact on the lifecycle of the asset, because we will assume that it is safe to delete after the CloudFormation deployment succeeds. For example, Lambda Function assets are copied over to Lambda during deployment. Therefore, it is not necessary to store the asset in S3, so we consider those deployTime assets. Default: false
11558
11734
  :param readers: A list of principals that should be able to read this asset from S3. You can use ``asset.grantRead(principal)`` to grant read permissions later. Default: - No principals that can read file asset.
11735
+ :param 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.
11559
11736
  :param command_options: options that are passed to the spawned process, which determine the characteristics of the spawned process. Default: : see ``child_process.SpawnSyncOptions`` (https://nodejs.org/api/child_process.html#child_processspawnsynccommand-args-options).
11560
11737
 
11561
11738
  :exampleMetadata: fixture=_generated
@@ -11566,11 +11743,13 @@ class CustomCommandOptions(_AssetOptions_2aa69621):
11566
11743
  # The values are placeholders you should change.
11567
11744
  import aws_cdk as cdk
11568
11745
  from aws_cdk import aws_iam as iam
11746
+ from aws_cdk import aws_kms as kms
11569
11747
  from aws_cdk import aws_lambda as lambda_
11570
11748
 
11571
11749
  # command_options: Any
11572
11750
  # docker_image: cdk.DockerImage
11573
11751
  # grantable: iam.IGrantable
11752
+ # key: kms.Key
11574
11753
  # local_bundling: cdk.ILocalBundling
11575
11754
 
11576
11755
  custom_command_options = lambda.CustomCommandOptions(
@@ -11609,7 +11788,8 @@ class CustomCommandOptions(_AssetOptions_2aa69621):
11609
11788
  exclude=["exclude"],
11610
11789
  follow_symlinks=cdk.SymlinkFollowMode.NEVER,
11611
11790
  ignore_mode=cdk.IgnoreMode.GLOB,
11612
- readers=[grantable]
11791
+ readers=[grantable],
11792
+ source_kMSKey=key
11613
11793
  )
11614
11794
  '''
11615
11795
  if isinstance(bundling, dict):
@@ -11624,6 +11804,7 @@ class CustomCommandOptions(_AssetOptions_2aa69621):
11624
11804
  check_type(argname="argument ignore_mode", value=ignore_mode, expected_type=type_hints["ignore_mode"])
11625
11805
  check_type(argname="argument deploy_time", value=deploy_time, expected_type=type_hints["deploy_time"])
11626
11806
  check_type(argname="argument readers", value=readers, expected_type=type_hints["readers"])
11807
+ check_type(argname="argument source_kms_key", value=source_kms_key, expected_type=type_hints["source_kms_key"])
11627
11808
  check_type(argname="argument command_options", value=command_options, expected_type=type_hints["command_options"])
11628
11809
  self._values: typing.Dict[builtins.str, typing.Any] = {}
11629
11810
  if asset_hash is not None:
@@ -11642,6 +11823,8 @@ class CustomCommandOptions(_AssetOptions_2aa69621):
11642
11823
  self._values["deploy_time"] = deploy_time
11643
11824
  if readers is not None:
11644
11825
  self._values["readers"] = readers
11826
+ if source_kms_key is not None:
11827
+ self._values["source_kms_key"] = source_kms_key
11645
11828
  if command_options is not None:
11646
11829
  self._values["command_options"] = command_options
11647
11830
 
@@ -11757,6 +11940,15 @@ class CustomCommandOptions(_AssetOptions_2aa69621):
11757
11940
  result = self._values.get("readers")
11758
11941
  return typing.cast(typing.Optional[typing.List[_IGrantable_71c4f5de]], result)
11759
11942
 
11943
+ @builtins.property
11944
+ def source_kms_key(self) -> typing.Optional[_IKey_5f11635f]:
11945
+ '''The ARN of the KMS key used to encrypt the handler code.
11946
+
11947
+ :default: - the default server-side encryption with Amazon S3 managed keys(SSE-S3) key will be used.
11948
+ '''
11949
+ result = self._values.get("source_kms_key")
11950
+ return typing.cast(typing.Optional[_IKey_5f11635f], result)
11951
+
11760
11952
  @builtins.property
11761
11953
  def command_options(
11762
11954
  self,
@@ -14536,7 +14728,7 @@ class FunctionOptions(EventInvokeConfigOptions):
14536
14728
  :param role: Lambda execution role. This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the 'lambda.amazonaws.com' service principal. The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself. The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and "service-role/AWSLambdaVPCAccessExecutionRole". Default: - A unique role will be generated for this lambda function. Both supplied and generated roles can always be changed by calling ``addToRolePolicy``.
14537
14729
  :param runtime_management_mode: Sets the runtime management configuration for a function's version. Default: Auto
14538
14730
  :param security_groups: The list of security groups to associate with the Lambda's network interfaces. Only used if 'vpc' is supplied. Default: - If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.
14539
- :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported only for Java 11, 17 runtime Default: - No snapstart
14731
+ :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported for Java 11, Java 17, Python 3.12, Python 3.13, and .NET 8 runtime Default: - No snapstart
14540
14732
  :param system_log_level: (deprecated) Sets the system log level for the function. Default: "INFO"
14541
14733
  :param system_log_level_v2: Sets the system log level for the function. Default: SystemLogLevel.INFO
14542
14734
  :param timeout: The function execution time (in seconds) after which Lambda terminates the function. Because the execution time affects cost, set this value based on the function's expected execution time. Default: Duration.seconds(3)
@@ -15332,7 +15524,7 @@ class FunctionOptions(EventInvokeConfigOptions):
15332
15524
  def snap_start(self) -> typing.Optional["SnapStartConf"]:
15333
15525
  '''Enable SnapStart for Lambda Function.
15334
15526
 
15335
- SnapStart is currently supported only for Java 11, 17 runtime
15527
+ SnapStart is currently supported for Java 11, Java 17, Python 3.12, Python 3.13, and .NET 8 runtime
15336
15528
 
15337
15529
  :default: - No snapstart
15338
15530
  '''
@@ -15579,7 +15771,7 @@ class FunctionProps(FunctionOptions):
15579
15771
  :param role: Lambda execution role. This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the 'lambda.amazonaws.com' service principal. The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself. The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and "service-role/AWSLambdaVPCAccessExecutionRole". Default: - A unique role will be generated for this lambda function. Both supplied and generated roles can always be changed by calling ``addToRolePolicy``.
15580
15772
  :param runtime_management_mode: Sets the runtime management configuration for a function's version. Default: Auto
15581
15773
  :param security_groups: The list of security groups to associate with the Lambda's network interfaces. Only used if 'vpc' is supplied. Default: - If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.
15582
- :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported only for Java 11, 17 runtime Default: - No snapstart
15774
+ :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported for Java 11, Java 17, Python 3.12, Python 3.13, and .NET 8 runtime Default: - No snapstart
15583
15775
  :param system_log_level: (deprecated) Sets the system log level for the function. Default: "INFO"
15584
15776
  :param system_log_level_v2: Sets the system log level for the function. Default: SystemLogLevel.INFO
15585
15777
  :param timeout: The function execution time (in seconds) after which Lambda terminates the function. Because the execution time affects cost, set this value based on the function's expected execution time. Default: Duration.seconds(3)
@@ -16296,7 +16488,7 @@ class FunctionProps(FunctionOptions):
16296
16488
  def snap_start(self) -> typing.Optional["SnapStartConf"]:
16297
16489
  '''Enable SnapStart for Lambda Function.
16298
16490
 
16299
- SnapStart is currently supported only for Java 11, 17 runtime
16491
+ SnapStart is currently supported for Java 11, Java 17, Python 3.12, Python 3.13, and .NET 8 runtime
16300
16492
 
16301
16493
  :default: - No snapstart
16302
16494
  '''
@@ -20637,6 +20829,12 @@ class Runtime(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_lambda.Runtime
20637
20829
  '''The Python 3.12 runtime (python3.12).'''
20638
20830
  return typing.cast("Runtime", jsii.sget(cls, "PYTHON_3_12"))
20639
20831
 
20832
+ @jsii.python.classproperty
20833
+ @jsii.member(jsii_name="PYTHON_3_13")
20834
+ def PYTHON_3_13(cls) -> "Runtime":
20835
+ '''The Python 3.13 runtime (python3.13).'''
20836
+ return typing.cast("Runtime", jsii.sget(cls, "PYTHON_3_13"))
20837
+
20640
20838
  @jsii.python.classproperty
20641
20839
  @jsii.member(jsii_name="PYTHON_3_6")
20642
20840
  def PYTHON_3_6(cls) -> "Runtime":
@@ -20901,6 +21099,76 @@ class S3Code(Code, metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_lambda.S3
20901
21099
  return typing.cast(builtins.bool, jsii.get(self, "isInline"))
20902
21100
 
20903
21101
 
21102
+ class S3CodeV2(
21103
+ Code,
21104
+ metaclass=jsii.JSIIMeta,
21105
+ jsii_type="aws-cdk-lib.aws_lambda.S3CodeV2",
21106
+ ):
21107
+ '''Lambda code from an S3 archive.
21108
+
21109
+ With option to set KMSKey for encryption.
21110
+
21111
+ :exampleMetadata: fixture=_generated
21112
+
21113
+ Example::
21114
+
21115
+ # The code below shows an example of how to instantiate this type.
21116
+ # The values are placeholders you should change.
21117
+ from aws_cdk import aws_kms as kms
21118
+ from aws_cdk import aws_lambda as lambda_
21119
+ from aws_cdk import aws_s3 as s3
21120
+
21121
+ # bucket: s3.Bucket
21122
+ # key: kms.Key
21123
+
21124
+ s3_code_v2 = lambda_.S3CodeV2(bucket, "key",
21125
+ object_version="objectVersion",
21126
+ source_kMSKey=key
21127
+ )
21128
+ '''
21129
+
21130
+ def __init__(
21131
+ self,
21132
+ bucket: _IBucket_42e086fd,
21133
+ key: builtins.str,
21134
+ *,
21135
+ object_version: typing.Optional[builtins.str] = None,
21136
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
21137
+ ) -> None:
21138
+ '''
21139
+ :param bucket: -
21140
+ :param key: -
21141
+ :param object_version: Optional S3 object version.
21142
+ :param 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.
21143
+ '''
21144
+ if __debug__:
21145
+ type_hints = typing.get_type_hints(_typecheckingstub__b41ca6a89b02f4abbd158513a5c812e15217b49cbb3e409cff1690bdb9e00f3c)
21146
+ check_type(argname="argument bucket", value=bucket, expected_type=type_hints["bucket"])
21147
+ check_type(argname="argument key", value=key, expected_type=type_hints["key"])
21148
+ options = BucketOptions(
21149
+ object_version=object_version, source_kms_key=source_kms_key
21150
+ )
21151
+
21152
+ jsii.create(self.__class__, self, [bucket, key, options])
21153
+
21154
+ @jsii.member(jsii_name="bind")
21155
+ def bind(self, _scope: _constructs_77d1e7e8.Construct) -> CodeConfig:
21156
+ '''Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun.
21157
+
21158
+ :param _scope: -
21159
+ '''
21160
+ if __debug__:
21161
+ type_hints = typing.get_type_hints(_typecheckingstub__304505e97ff3b397f5306079c5410e06bb217281e1cc348ada6eef6ae77771f2)
21162
+ check_type(argname="argument _scope", value=_scope, expected_type=type_hints["_scope"])
21163
+ return typing.cast(CodeConfig, jsii.invoke(self, "bind", [_scope]))
21164
+
21165
+ @builtins.property
21166
+ @jsii.member(jsii_name="isInline")
21167
+ def is_inline(self) -> builtins.bool:
21168
+ '''Determines whether this Code is inline code or not.'''
21169
+ return typing.cast(builtins.bool, jsii.get(self, "isInline"))
21170
+
21171
+
20904
21172
  @jsii.data_type(
20905
21173
  jsii_type="aws-cdk-lib.aws_lambda.SingletonFunctionProps",
20906
21174
  jsii_struct_bases=[FunctionProps],
@@ -21064,7 +21332,7 @@ class SingletonFunctionProps(FunctionProps):
21064
21332
  :param role: Lambda execution role. This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the 'lambda.amazonaws.com' service principal. The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself. The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and "service-role/AWSLambdaVPCAccessExecutionRole". Default: - A unique role will be generated for this lambda function. Both supplied and generated roles can always be changed by calling ``addToRolePolicy``.
21065
21333
  :param runtime_management_mode: Sets the runtime management configuration for a function's version. Default: Auto
21066
21334
  :param security_groups: The list of security groups to associate with the Lambda's network interfaces. Only used if 'vpc' is supplied. Default: - If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.
21067
- :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported only for Java 11, 17 runtime Default: - No snapstart
21335
+ :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported for Java 11, Java 17, Python 3.12, Python 3.13, and .NET 8 runtime Default: - No snapstart
21068
21336
  :param system_log_level: (deprecated) Sets the system log level for the function. Default: "INFO"
21069
21337
  :param system_log_level_v2: Sets the system log level for the function. Default: SystemLogLevel.INFO
21070
21338
  :param timeout: The function execution time (in seconds) after which Lambda terminates the function. Because the execution time affects cost, set this value based on the function's expected execution time. Default: Duration.seconds(3)
@@ -21769,7 +22037,7 @@ class SingletonFunctionProps(FunctionProps):
21769
22037
  def snap_start(self) -> typing.Optional["SnapStartConf"]:
21770
22038
  '''Enable SnapStart for Lambda Function.
21771
22039
 
21772
- SnapStart is currently supported only for Java 11, 17 runtime
22040
+ SnapStart is currently supported for Java 11, Java 17, Python 3.12, Python 3.13, and .NET 8 runtime
21773
22041
 
21774
22042
  :default: - No snapstart
21775
22043
  '''
@@ -23291,6 +23559,7 @@ class AssetCode(
23291
23559
  *,
23292
23560
  deploy_time: typing.Optional[builtins.bool] = None,
23293
23561
  readers: typing.Optional[typing.Sequence[_IGrantable_71c4f5de]] = None,
23562
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
23294
23563
  asset_hash: typing.Optional[builtins.str] = None,
23295
23564
  asset_hash_type: typing.Optional[_AssetHashType_05b67f2d] = None,
23296
23565
  bundling: typing.Optional[typing.Union[_BundlingOptions_588cc936, typing.Dict[builtins.str, typing.Any]]] = None,
@@ -23302,6 +23571,7 @@ class AssetCode(
23302
23571
  :param path: The path to the asset file or directory.
23303
23572
  :param deploy_time: Whether or not the asset needs to exist beyond deployment time; i.e. are copied over to a different location and not needed afterwards. Setting this property to true has an impact on the lifecycle of the asset, because we will assume that it is safe to delete after the CloudFormation deployment succeeds. For example, Lambda Function assets are copied over to Lambda during deployment. Therefore, it is not necessary to store the asset in S3, so we consider those deployTime assets. Default: false
23304
23573
  :param readers: A list of principals that should be able to read this asset from S3. You can use ``asset.grantRead(principal)`` to grant read permissions later. Default: - No principals that can read file asset.
23574
+ :param 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.
23305
23575
  :param asset_hash: Specify a custom hash for this asset. If ``assetHashType`` is set it must be set to ``AssetHashType.CUSTOM``. For consistency, this custom hash will be SHA256 hashed and encoded as hex. The resulting hash will be the asset hash. NOTE: the hash is used in order to identify a specific revision of the asset, and used for optimizing and caching deployment activities related to this asset such as packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will need to make sure it is updated every time the asset changes, or otherwise it is possible that some deployments will not be invalidated. Default: - based on ``assetHashType``
23306
23576
  :param asset_hash_type: Specifies the type of hash to calculate for this asset. If ``assetHash`` is configured, this option must be ``undefined`` or ``AssetHashType.CUSTOM``. Default: - the default is ``AssetHashType.SOURCE``, but if ``assetHash`` is explicitly specified this value defaults to ``AssetHashType.CUSTOM``.
23307
23577
  :param bundling: Bundle the asset by executing a command in a Docker container or a custom bundling provider. The asset path will be mounted at ``/asset-input``. The Docker container is responsible for putting content at ``/asset-output``. The content at ``/asset-output`` will be zipped and used as the final asset. Default: - uploaded as-is to S3 if the asset is a regular file or a .zip file, archived into a .zip file and uploaded to S3 otherwise
@@ -23315,6 +23585,7 @@ class AssetCode(
23315
23585
  options = _AssetOptions_2aa69621(
23316
23586
  deploy_time=deploy_time,
23317
23587
  readers=readers,
23588
+ source_kms_key=source_kms_key,
23318
23589
  asset_hash=asset_hash,
23319
23590
  asset_hash_type=asset_hash_type,
23320
23591
  bundling=bundling,
@@ -23701,13 +23972,17 @@ class CfnParametersCode(
23701
23972
  *,
23702
23973
  bucket_name_param: typing.Optional[_CfnParameter_48fc1866] = None,
23703
23974
  object_key_param: typing.Optional[_CfnParameter_48fc1866] = None,
23975
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
23704
23976
  ) -> None:
23705
23977
  '''
23706
23978
  :param bucket_name_param: The CloudFormation parameter that represents the name of the S3 Bucket where the Lambda code will be located in. Must be of type 'String'. Default: a new parameter will be created
23707
23979
  :param object_key_param: The CloudFormation parameter that represents the path inside the S3 Bucket where the Lambda code will be located at. Must be of type 'String'. Default: a new parameter will be created
23980
+ :param 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.
23708
23981
  '''
23709
23982
  props = CfnParametersCodeProps(
23710
- bucket_name_param=bucket_name_param, object_key_param=object_key_param
23983
+ bucket_name_param=bucket_name_param,
23984
+ object_key_param=object_key_param,
23985
+ source_kms_key=source_kms_key,
23711
23986
  )
23712
23987
 
23713
23988
  jsii.create(self.__class__, self, [props])
@@ -24018,7 +24293,7 @@ class DockerImageFunctionProps(FunctionOptions):
24018
24293
  :param role: Lambda execution role. This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the 'lambda.amazonaws.com' service principal. The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself. The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and "service-role/AWSLambdaVPCAccessExecutionRole". Default: - A unique role will be generated for this lambda function. Both supplied and generated roles can always be changed by calling ``addToRolePolicy``.
24019
24294
  :param runtime_management_mode: Sets the runtime management configuration for a function's version. Default: Auto
24020
24295
  :param security_groups: The list of security groups to associate with the Lambda's network interfaces. Only used if 'vpc' is supplied. Default: - If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.
24021
- :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported only for Java 11, 17 runtime Default: - No snapstart
24296
+ :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported for Java 11, Java 17, Python 3.12, Python 3.13, and .NET 8 runtime Default: - No snapstart
24022
24297
  :param system_log_level: (deprecated) Sets the system log level for the function. Default: "INFO"
24023
24298
  :param system_log_level_v2: Sets the system log level for the function. Default: SystemLogLevel.INFO
24024
24299
  :param timeout: The function execution time (in seconds) after which Lambda terminates the function. Because the execution time affects cost, set this value based on the function's expected execution time. Default: Duration.seconds(3)
@@ -24708,7 +24983,7 @@ class DockerImageFunctionProps(FunctionOptions):
24708
24983
  def snap_start(self) -> typing.Optional[SnapStartConf]:
24709
24984
  '''Enable SnapStart for Lambda Function.
24710
24985
 
24711
- SnapStart is currently supported only for Java 11, 17 runtime
24986
+ SnapStart is currently supported for Java 11, Java 17, Python 3.12, Python 3.13, and .NET 8 runtime
24712
24987
 
24713
24988
  :default: - No snapstart
24714
24989
  '''
@@ -26105,7 +26380,7 @@ class SingletonFunction(
26105
26380
  :param role: Lambda execution role. This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the 'lambda.amazonaws.com' service principal. The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself. The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and "service-role/AWSLambdaVPCAccessExecutionRole". Default: - A unique role will be generated for this lambda function. Both supplied and generated roles can always be changed by calling ``addToRolePolicy``.
26106
26381
  :param runtime_management_mode: Sets the runtime management configuration for a function's version. Default: Auto
26107
26382
  :param security_groups: The list of security groups to associate with the Lambda's network interfaces. Only used if 'vpc' is supplied. Default: - If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.
26108
- :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported only for Java 11, 17 runtime Default: - No snapstart
26383
+ :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported for Java 11, Java 17, Python 3.12, Python 3.13, and .NET 8 runtime Default: - No snapstart
26109
26384
  :param system_log_level: (deprecated) Sets the system log level for the function. Default: "INFO"
26110
26385
  :param system_log_level_v2: Sets the system log level for the function. Default: SystemLogLevel.INFO
26111
26386
  :param timeout: The function execution time (in seconds) after which Lambda terminates the function. Because the execution time affects cost, set this value based on the function's expected execution time. Default: Duration.seconds(3)
@@ -27095,7 +27370,7 @@ class Function(
27095
27370
  :param role: Lambda execution role. This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the 'lambda.amazonaws.com' service principal. The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself. The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and "service-role/AWSLambdaVPCAccessExecutionRole". Default: - A unique role will be generated for this lambda function. Both supplied and generated roles can always be changed by calling ``addToRolePolicy``.
27096
27371
  :param runtime_management_mode: Sets the runtime management configuration for a function's version. Default: Auto
27097
27372
  :param security_groups: The list of security groups to associate with the Lambda's network interfaces. Only used if 'vpc' is supplied. Default: - If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.
27098
- :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported only for Java 11, 17 runtime Default: - No snapstart
27373
+ :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported for Java 11, Java 17, Python 3.12, Python 3.13, and .NET 8 runtime Default: - No snapstart
27099
27374
  :param system_log_level: (deprecated) Sets the system log level for the function. Default: "INFO"
27100
27375
  :param system_log_level_v2: Sets the system log level for the function. Default: SystemLogLevel.INFO
27101
27376
  :param timeout: The function execution time (in seconds) after which Lambda terminates the function. Because the execution time affects cost, set this value based on the function's expected execution time. Default: Duration.seconds(3)
@@ -27891,7 +28166,7 @@ class DockerImageFunction(
27891
28166
  :param role: Lambda execution role. This is the role that will be assumed by the function upon execution. It controls the permissions that the function will have. The Role must be assumable by the 'lambda.amazonaws.com' service principal. The default Role automatically has permissions granted for Lambda execution. If you provide a Role, you must add the relevant AWS managed policies yourself. The relevant managed policies are "service-role/AWSLambdaBasicExecutionRole" and "service-role/AWSLambdaVPCAccessExecutionRole". Default: - A unique role will be generated for this lambda function. Both supplied and generated roles can always be changed by calling ``addToRolePolicy``.
27892
28167
  :param runtime_management_mode: Sets the runtime management configuration for a function's version. Default: Auto
27893
28168
  :param security_groups: The list of security groups to associate with the Lambda's network interfaces. Only used if 'vpc' is supplied. Default: - If the function is placed within a VPC and a security group is not specified, either by this or securityGroup prop, a dedicated security group will be created for this function.
27894
- :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported only for Java 11, 17 runtime Default: - No snapstart
28169
+ :param snap_start: Enable SnapStart for Lambda Function. SnapStart is currently supported for Java 11, Java 17, Python 3.12, Python 3.13, and .NET 8 runtime Default: - No snapstart
27895
28170
  :param system_log_level: (deprecated) Sets the system log level for the function. Default: "INFO"
27896
28171
  :param system_log_level_v2: Sets the system log level for the function. Default: SystemLogLevel.INFO
27897
28172
  :param timeout: The function execution time (in seconds) after which Lambda terminates the function. Because the execution time affects cost, set this value based on the function's expected execution time. Default: Duration.seconds(3)
@@ -27982,6 +28257,7 @@ __all__ = [
27982
28257
  "AssetImageCode",
27983
28258
  "AssetImageCodeProps",
27984
28259
  "AutoScalingOptions",
28260
+ "BucketOptions",
27985
28261
  "CfnAlias",
27986
28262
  "CfnAliasProps",
27987
28263
  "CfnCodeSigningConfig",
@@ -28079,6 +28355,7 @@ __all__ = [
28079
28355
  "RuntimeFamily",
28080
28356
  "RuntimeManagementMode",
28081
28357
  "S3Code",
28358
+ "S3CodeV2",
28082
28359
  "SingletonFunction",
28083
28360
  "SingletonFunctionProps",
28084
28361
  "SnapStartConf",
@@ -28220,6 +28497,14 @@ def _typecheckingstub__d87a0ce22b000498263273a478e075d6808ca7f5931890c7a99744eb4
28220
28497
  """Type checking stubs"""
28221
28498
  pass
28222
28499
 
28500
+ def _typecheckingstub__ea5994c9827298565c305f3f7f771ab57a19a60665d41006e56da4741c2d0d56(
28501
+ *,
28502
+ object_version: typing.Optional[builtins.str] = None,
28503
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
28504
+ ) -> None:
28505
+ """Type checking stubs"""
28506
+ pass
28507
+
28223
28508
  def _typecheckingstub__681471c67952a7e725f76572ad9bf09e1c634a81914690dff68e934c039fd2f9(
28224
28509
  scope: _constructs_77d1e7e8.Construct,
28225
28510
  id: builtins.str,
@@ -29260,6 +29545,7 @@ def _typecheckingstub__45ce02257c922b893446f407552a2416c3356585f4b95a19a9069a0bb
29260
29545
  *,
29261
29546
  bucket_name_param: typing.Optional[_CfnParameter_48fc1866] = None,
29262
29547
  object_key_param: typing.Optional[_CfnParameter_48fc1866] = None,
29548
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
29263
29549
  ) -> None:
29264
29550
  """Type checking stubs"""
29265
29551
  pass
@@ -29526,6 +29812,7 @@ def _typecheckingstub__f040a1ba6e87fe9c9a6496be4b8fbf73f2646b80291bfc4d04979d6ef
29526
29812
  *,
29527
29813
  deploy_time: typing.Optional[builtins.bool] = None,
29528
29814
  readers: typing.Optional[typing.Sequence[_IGrantable_71c4f5de]] = None,
29815
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
29529
29816
  asset_hash: typing.Optional[builtins.str] = None,
29530
29817
  asset_hash_type: typing.Optional[_AssetHashType_05b67f2d] = None,
29531
29818
  bundling: typing.Optional[typing.Union[_BundlingOptions_588cc936, typing.Dict[builtins.str, typing.Any]]] = None,
@@ -29571,6 +29858,16 @@ def _typecheckingstub__cf2f362d90d470e1ea550c48af2d201151dbe9e28567f1f024ec091a2
29571
29858
  """Type checking stubs"""
29572
29859
  pass
29573
29860
 
29861
+ def _typecheckingstub__b3435b4d9a286e912d3934fc747c05554a23d64416b95f4dd12b911cd5bce166(
29862
+ bucket: _IBucket_42e086fd,
29863
+ key: builtins.str,
29864
+ *,
29865
+ object_version: typing.Optional[builtins.str] = None,
29866
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
29867
+ ) -> None:
29868
+ """Type checking stubs"""
29869
+ pass
29870
+
29574
29871
  def _typecheckingstub__f107aedaa96b9385600e34088d5cda9d8035f15776c846b0f0b4fbbe35d118df(
29575
29872
  output: builtins.str,
29576
29873
  command: typing.Sequence[builtins.str],
@@ -29578,6 +29875,7 @@ def _typecheckingstub__f107aedaa96b9385600e34088d5cda9d8035f15776c846b0f0b4fbbe3
29578
29875
  command_options: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
29579
29876
  deploy_time: typing.Optional[builtins.bool] = None,
29580
29877
  readers: typing.Optional[typing.Sequence[_IGrantable_71c4f5de]] = None,
29878
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
29581
29879
  asset_hash: typing.Optional[builtins.str] = None,
29582
29880
  asset_hash_type: typing.Optional[_AssetHashType_05b67f2d] = None,
29583
29881
  bundling: typing.Optional[typing.Union[_BundlingOptions_588cc936, typing.Dict[builtins.str, typing.Any]]] = None,
@@ -29641,6 +29939,7 @@ def _typecheckingstub__9f94faae4fd35a06e3f67763f77da934d65414f84781e7e17169eece9
29641
29939
  image: typing.Optional[typing.Union[CodeImageConfig, typing.Dict[builtins.str, typing.Any]]] = None,
29642
29940
  inline_code: typing.Optional[builtins.str] = None,
29643
29941
  s3_location: typing.Optional[typing.Union[_Location_0948fa7f, typing.Dict[builtins.str, typing.Any]]] = None,
29942
+ source_kms_key_arn: typing.Optional[builtins.str] = None,
29644
29943
  ) -> None:
29645
29944
  """Type checking stubs"""
29646
29945
  pass
@@ -29674,6 +29973,7 @@ def _typecheckingstub__69255a578358e8a47662200dda7ce2e0b1f2ee573c1469268f14060b0
29674
29973
  ignore_mode: typing.Optional[_IgnoreMode_655a98e8] = None,
29675
29974
  deploy_time: typing.Optional[builtins.bool] = None,
29676
29975
  readers: typing.Optional[typing.Sequence[_IGrantable_71c4f5de]] = None,
29976
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
29677
29977
  command_options: typing.Optional[typing.Mapping[builtins.str, typing.Any]] = None,
29678
29978
  ) -> None:
29679
29979
  """Type checking stubs"""
@@ -30502,6 +30802,22 @@ def _typecheckingstub__cbc76142aaf180fc781ccfffd9ddf0cea89284555d302bceebc998bd3
30502
30802
  """Type checking stubs"""
30503
30803
  pass
30504
30804
 
30805
+ def _typecheckingstub__b41ca6a89b02f4abbd158513a5c812e15217b49cbb3e409cff1690bdb9e00f3c(
30806
+ bucket: _IBucket_42e086fd,
30807
+ key: builtins.str,
30808
+ *,
30809
+ object_version: typing.Optional[builtins.str] = None,
30810
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
30811
+ ) -> None:
30812
+ """Type checking stubs"""
30813
+ pass
30814
+
30815
+ def _typecheckingstub__304505e97ff3b397f5306079c5410e06bb217281e1cc348ada6eef6ae77771f2(
30816
+ _scope: _constructs_77d1e7e8.Construct,
30817
+ ) -> None:
30818
+ """Type checking stubs"""
30819
+ pass
30820
+
30505
30821
  def _typecheckingstub__68a03ec9f866a29c77aabcf8328c63a49511790fa9714874f255b3292623893c(
30506
30822
  *,
30507
30823
  max_event_age: typing.Optional[_Duration_4839e8c3] = None,
@@ -30665,6 +30981,7 @@ def _typecheckingstub__2f05314dba16cc49614c6f64783d2cd85683aeb754a1d8b045caf7c7f
30665
30981
  *,
30666
30982
  deploy_time: typing.Optional[builtins.bool] = None,
30667
30983
  readers: typing.Optional[typing.Sequence[_IGrantable_71c4f5de]] = None,
30984
+ source_kms_key: typing.Optional[_IKey_5f11635f] = None,
30668
30985
  asset_hash: typing.Optional[builtins.str] = None,
30669
30986
  asset_hash_type: typing.Optional[_AssetHashType_05b67f2d] = None,
30670
30987
  bundling: typing.Optional[typing.Union[_BundlingOptions_588cc936, typing.Dict[builtins.str, typing.Any]]] = None,