aws-cdk-lib 2.117.0__py3-none-any.whl → 2.119.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.
- aws_cdk/__init__.py +138 -25
- aws_cdk/_jsii/__init__.py +1 -1
- aws_cdk/_jsii/{aws-cdk-lib@2.117.0.jsii.tgz → aws-cdk-lib@2.119.0.jsii.tgz} +0 -0
- aws_cdk/amzn_sdc/__init__.py +496 -0
- aws_cdk/aws_appsync/__init__.py +94 -22
- aws_cdk/aws_autoscaling/__init__.py +139 -74
- aws_cdk/aws_certificatemanager/__init__.py +164 -3
- aws_cdk/aws_cloud9/__init__.py +3 -3
- aws_cdk/aws_cloudfront/__init__.py +853 -38
- aws_cdk/aws_cloudtrail/__init__.py +54 -34
- aws_cdk/aws_cloudwatch_actions/__init__.py +105 -0
- aws_cdk/aws_codebuild/__init__.py +46 -5
- aws_cdk/aws_codecommit/__init__.py +9 -3
- aws_cdk/aws_codepipeline_actions/__init__.py +54 -0
- aws_cdk/aws_codetest/__init__.py +788 -0
- aws_cdk/aws_cognito/__init__.py +104 -0
- aws_cdk/aws_connect/__init__.py +626 -78
- aws_cdk/aws_docdb/__init__.py +442 -0
- aws_cdk/aws_dynamodb/__init__.py +14 -0
- aws_cdk/aws_ec2/__init__.py +372 -44
- aws_cdk/aws_ecs/__init__.py +192 -35
- aws_cdk/aws_emrserverless/__init__.py +20 -13
- aws_cdk/aws_events/__init__.py +90 -1
- aws_cdk/aws_fis/__init__.py +12 -32
- aws_cdk/aws_globalaccelerator/__init__.py +19 -0
- aws_cdk/aws_glue/__init__.py +329 -0
- aws_cdk/aws_iam/__init__.py +50 -24
- aws_cdk/aws_iot/__init__.py +112 -0
- aws_cdk/aws_iotsitewise/__init__.py +4 -4
- aws_cdk/aws_kendra/__init__.py +10 -5
- aws_cdk/aws_kinesisfirehose/__init__.py +111 -0
- aws_cdk/aws_lambda/__init__.py +180 -407
- aws_cdk/aws_location/__init__.py +1132 -17
- aws_cdk/aws_mediatailor/__init__.py +120 -17
- aws_cdk/aws_networkfirewall/__init__.py +2 -2
- aws_cdk/aws_networkmanager/__init__.py +1 -1
- aws_cdk/aws_omics/__init__.py +4 -4
- aws_cdk/aws_opensearchservice/__init__.py +58 -0
- aws_cdk/aws_pinpoint/__init__.py +14 -6
- aws_cdk/aws_pipes/__init__.py +7 -2
- aws_cdk/aws_rds/__init__.py +247 -16
- aws_cdk/aws_redshift/__init__.py +103 -0
- aws_cdk/aws_route53/__init__.py +68 -20
- aws_cdk/aws_s3/__init__.py +2 -4
- aws_cdk/aws_s3objectlambda/__init__.py +2 -2
- aws_cdk/aws_servicecatalogappregistry/__init__.py +3 -3
- aws_cdk/aws_signer/__init__.py +27 -4
- aws_cdk/aws_ssm/__init__.py +76 -13
- aws_cdk/aws_stepfunctions/__init__.py +110 -5
- aws_cdk/aws_stepfunctions_tasks/__init__.py +84 -29
- aws_cdk/pipelines/__init__.py +136 -37
- {aws_cdk_lib-2.117.0.dist-info → aws_cdk_lib-2.119.0.dist-info}/LICENSE +1 -1
- {aws_cdk_lib-2.117.0.dist-info → aws_cdk_lib-2.119.0.dist-info}/METADATA +98 -12
- {aws_cdk_lib-2.117.0.dist-info → aws_cdk_lib-2.119.0.dist-info}/NOTICE +1 -1
- {aws_cdk_lib-2.117.0.dist-info → aws_cdk_lib-2.119.0.dist-info}/RECORD +57 -55
- {aws_cdk_lib-2.117.0.dist-info → aws_cdk_lib-2.119.0.dist-info}/WHEEL +0 -0
- {aws_cdk_lib-2.117.0.dist-info → aws_cdk_lib-2.119.0.dist-info}/top_level.txt +0 -0
|
@@ -524,7 +524,8 @@ You can also deploy CloudFront functions and add them to a CloudFront distributi
|
|
|
524
524
|
# s3_bucket: s3.Bucket
|
|
525
525
|
# Add a cloudfront Function to a Distribution
|
|
526
526
|
cf_function = cloudfront.Function(self, "Function",
|
|
527
|
-
code=cloudfront.FunctionCode.from_inline("function handler(event) { return event.request }")
|
|
527
|
+
code=cloudfront.FunctionCode.from_inline("function handler(event) { return event.request }"),
|
|
528
|
+
runtime=cloudfront.FunctionRuntime.JS_2_0
|
|
528
529
|
)
|
|
529
530
|
cloudfront.Distribution(self, "distro",
|
|
530
531
|
default_behavior=cloudfront.BehaviorOptions(
|
|
@@ -541,6 +542,27 @@ It will auto-generate the name of the function and deploy it to the `live` stage
|
|
|
541
542
|
|
|
542
543
|
Additionally, you can load the function's code from a file using the `FunctionCode.fromFile()` method.
|
|
543
544
|
|
|
545
|
+
### Key Value Store
|
|
546
|
+
|
|
547
|
+
A CloudFront Key Value Store can be created and optionally have data imported from a JSON file
|
|
548
|
+
by default.
|
|
549
|
+
|
|
550
|
+
To create an empty Key Value Store:
|
|
551
|
+
|
|
552
|
+
```python
|
|
553
|
+
store = cloudfront.KeyValueStore(self, "KeyValueStore")
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
To also include an initial set of value, the `source` property can be specified. For the
|
|
557
|
+
structure of this file, see [Creating a file of key value pairs](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/kvs-with-functions-create-s3-kvp.html).
|
|
558
|
+
|
|
559
|
+
```python
|
|
560
|
+
store = cloudfront.KeyValueStore(self, "KeyValueStore",
|
|
561
|
+
key_value_store_name="KeyValueStore",
|
|
562
|
+
source=cloudfront.ImportSource.from_asset("path-to-data.json")
|
|
563
|
+
)
|
|
564
|
+
```
|
|
565
|
+
|
|
544
566
|
### Logging
|
|
545
567
|
|
|
546
568
|
You can configure CloudFront to create log files that contain detailed information about every user request that CloudFront receives.
|
|
@@ -1122,6 +1144,8 @@ from .._jsii import *
|
|
|
1122
1144
|
|
|
1123
1145
|
import constructs as _constructs_77d1e7e8
|
|
1124
1146
|
from .. import (
|
|
1147
|
+
AssetHashType as _AssetHashType_05b67f2d,
|
|
1148
|
+
BundlingOptions as _BundlingOptions_588cc936,
|
|
1125
1149
|
CfnResource as _CfnResource_9df397a6,
|
|
1126
1150
|
CfnTag as _CfnTag_f6864754,
|
|
1127
1151
|
Duration as _Duration_4839e8c3,
|
|
@@ -1129,7 +1153,9 @@ from .. import (
|
|
|
1129
1153
|
IResolvable as _IResolvable_da3f097b,
|
|
1130
1154
|
IResource as _IResource_c80c4260,
|
|
1131
1155
|
ITaggable as _ITaggable_36806126,
|
|
1156
|
+
IgnoreMode as _IgnoreMode_655a98e8,
|
|
1132
1157
|
Resource as _Resource_45bc6135,
|
|
1158
|
+
SymlinkFollowMode as _SymlinkFollowMode_047ec1f6,
|
|
1133
1159
|
TagManager as _TagManager_0a598cb3,
|
|
1134
1160
|
TreeInspector as _TreeInspector_488e0dd5,
|
|
1135
1161
|
)
|
|
@@ -1143,6 +1169,7 @@ from ..aws_iam import (
|
|
|
1143
1169
|
from ..aws_kinesis import IStream as _IStream_4e2457d2
|
|
1144
1170
|
from ..aws_lambda import IVersion as _IVersion_faf7234e
|
|
1145
1171
|
from ..aws_s3 import IBucket as _IBucket_42e086fd
|
|
1172
|
+
from ..aws_s3_assets import AssetOptions as _AssetOptions_2aa69621
|
|
1146
1173
|
|
|
1147
1174
|
|
|
1148
1175
|
@jsii.data_type(
|
|
@@ -1799,18 +1826,20 @@ class BehaviorOptions(AddBehaviorOptions):
|
|
|
1799
1826
|
|
|
1800
1827
|
Example::
|
|
1801
1828
|
|
|
1829
|
+
# Adding an existing Lambda@Edge function created in a different stack
|
|
1830
|
+
# to a CloudFront distribution.
|
|
1802
1831
|
# s3_bucket: s3.Bucket
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
)
|
|
1832
|
+
|
|
1833
|
+
function_version = lambda_.Version.from_version_arn(self, "Version", "arn:aws:lambda:us-east-1:123456789012:function:functionName:1")
|
|
1834
|
+
|
|
1807
1835
|
cloudfront.Distribution(self, "distro",
|
|
1808
1836
|
default_behavior=cloudfront.BehaviorOptions(
|
|
1809
1837
|
origin=origins.S3Origin(s3_bucket),
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
event_type=cloudfront.
|
|
1813
|
-
)
|
|
1838
|
+
edge_lambdas=[cloudfront.EdgeLambda(
|
|
1839
|
+
function_version=function_version,
|
|
1840
|
+
event_type=cloudfront.LambdaEdgeEventType.VIEWER_REQUEST
|
|
1841
|
+
)
|
|
1842
|
+
]
|
|
1814
1843
|
)
|
|
1815
1844
|
)
|
|
1816
1845
|
'''
|
|
@@ -8858,7 +8887,12 @@ class CfnFunction(
|
|
|
8858
8887
|
function_code="functionCode",
|
|
8859
8888
|
function_config=cloudfront.CfnFunction.FunctionConfigProperty(
|
|
8860
8889
|
comment="comment",
|
|
8861
|
-
runtime="runtime"
|
|
8890
|
+
runtime="runtime",
|
|
8891
|
+
|
|
8892
|
+
# the properties below are optional
|
|
8893
|
+
key_value_store_associations=[cloudfront.CfnFunction.KeyValueStoreAssociationProperty(
|
|
8894
|
+
key_value_store_arn="keyValueStoreArn"
|
|
8895
|
+
)]
|
|
8862
8896
|
),
|
|
8863
8897
|
name="name",
|
|
8864
8898
|
|
|
@@ -9053,14 +9087,25 @@ class CfnFunction(
|
|
|
9053
9087
|
@jsii.data_type(
|
|
9054
9088
|
jsii_type="aws-cdk-lib.aws_cloudfront.CfnFunction.FunctionConfigProperty",
|
|
9055
9089
|
jsii_struct_bases=[],
|
|
9056
|
-
name_mapping={
|
|
9090
|
+
name_mapping={
|
|
9091
|
+
"comment": "comment",
|
|
9092
|
+
"runtime": "runtime",
|
|
9093
|
+
"key_value_store_associations": "keyValueStoreAssociations",
|
|
9094
|
+
},
|
|
9057
9095
|
)
|
|
9058
9096
|
class FunctionConfigProperty:
|
|
9059
|
-
def __init__(
|
|
9097
|
+
def __init__(
|
|
9098
|
+
self,
|
|
9099
|
+
*,
|
|
9100
|
+
comment: builtins.str,
|
|
9101
|
+
runtime: builtins.str,
|
|
9102
|
+
key_value_store_associations: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Sequence[typing.Union[_IResolvable_da3f097b, typing.Union["CfnFunction.KeyValueStoreAssociationProperty", typing.Dict[builtins.str, typing.Any]]]]]] = None,
|
|
9103
|
+
) -> None:
|
|
9060
9104
|
'''Contains configuration information about a CloudFront function.
|
|
9061
9105
|
|
|
9062
9106
|
:param comment: A comment to describe the function.
|
|
9063
9107
|
:param runtime: The function's runtime environment version.
|
|
9108
|
+
:param key_value_store_associations: The configuration for the Key Value Store associations.
|
|
9064
9109
|
|
|
9065
9110
|
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-functionconfig.html
|
|
9066
9111
|
:exampleMetadata: fixture=_generated
|
|
@@ -9073,17 +9118,25 @@ class CfnFunction(
|
|
|
9073
9118
|
|
|
9074
9119
|
function_config_property = cloudfront.CfnFunction.FunctionConfigProperty(
|
|
9075
9120
|
comment="comment",
|
|
9076
|
-
runtime="runtime"
|
|
9121
|
+
runtime="runtime",
|
|
9122
|
+
|
|
9123
|
+
# the properties below are optional
|
|
9124
|
+
key_value_store_associations=[cloudfront.CfnFunction.KeyValueStoreAssociationProperty(
|
|
9125
|
+
key_value_store_arn="keyValueStoreArn"
|
|
9126
|
+
)]
|
|
9077
9127
|
)
|
|
9078
9128
|
'''
|
|
9079
9129
|
if __debug__:
|
|
9080
9130
|
type_hints = typing.get_type_hints(_typecheckingstub__e34db5cf326a0cd47f00dc35b60e1fbde4ec723cb88839d65178012682abd233)
|
|
9081
9131
|
check_type(argname="argument comment", value=comment, expected_type=type_hints["comment"])
|
|
9082
9132
|
check_type(argname="argument runtime", value=runtime, expected_type=type_hints["runtime"])
|
|
9133
|
+
check_type(argname="argument key_value_store_associations", value=key_value_store_associations, expected_type=type_hints["key_value_store_associations"])
|
|
9083
9134
|
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
9084
9135
|
"comment": comment,
|
|
9085
9136
|
"runtime": runtime,
|
|
9086
9137
|
}
|
|
9138
|
+
if key_value_store_associations is not None:
|
|
9139
|
+
self._values["key_value_store_associations"] = key_value_store_associations
|
|
9087
9140
|
|
|
9088
9141
|
@builtins.property
|
|
9089
9142
|
def comment(self) -> builtins.str:
|
|
@@ -9105,6 +9158,17 @@ class CfnFunction(
|
|
|
9105
9158
|
assert result is not None, "Required property 'runtime' is missing"
|
|
9106
9159
|
return typing.cast(builtins.str, result)
|
|
9107
9160
|
|
|
9161
|
+
@builtins.property
|
|
9162
|
+
def key_value_store_associations(
|
|
9163
|
+
self,
|
|
9164
|
+
) -> typing.Optional[typing.Union[_IResolvable_da3f097b, typing.List[typing.Union[_IResolvable_da3f097b, "CfnFunction.KeyValueStoreAssociationProperty"]]]]:
|
|
9165
|
+
'''The configuration for the Key Value Store associations.
|
|
9166
|
+
|
|
9167
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-functionconfig.html#cfn-cloudfront-function-functionconfig-keyvaluestoreassociations
|
|
9168
|
+
'''
|
|
9169
|
+
result = self._values.get("key_value_store_associations")
|
|
9170
|
+
return typing.cast(typing.Optional[typing.Union[_IResolvable_da3f097b, typing.List[typing.Union[_IResolvable_da3f097b, "CfnFunction.KeyValueStoreAssociationProperty"]]]], result)
|
|
9171
|
+
|
|
9108
9172
|
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
9109
9173
|
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
9110
9174
|
|
|
@@ -9173,6 +9237,58 @@ class CfnFunction(
|
|
|
9173
9237
|
k + "=" + repr(v) for k, v in self._values.items()
|
|
9174
9238
|
)
|
|
9175
9239
|
|
|
9240
|
+
@jsii.data_type(
|
|
9241
|
+
jsii_type="aws-cdk-lib.aws_cloudfront.CfnFunction.KeyValueStoreAssociationProperty",
|
|
9242
|
+
jsii_struct_bases=[],
|
|
9243
|
+
name_mapping={"key_value_store_arn": "keyValueStoreArn"},
|
|
9244
|
+
)
|
|
9245
|
+
class KeyValueStoreAssociationProperty:
|
|
9246
|
+
def __init__(self, *, key_value_store_arn: builtins.str) -> None:
|
|
9247
|
+
'''The Key Value Store association.
|
|
9248
|
+
|
|
9249
|
+
:param key_value_store_arn: The Amazon Resource Name (ARN) of the Key Value Store association.
|
|
9250
|
+
|
|
9251
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-keyvaluestoreassociation.html
|
|
9252
|
+
:exampleMetadata: fixture=_generated
|
|
9253
|
+
|
|
9254
|
+
Example::
|
|
9255
|
+
|
|
9256
|
+
# The code below shows an example of how to instantiate this type.
|
|
9257
|
+
# The values are placeholders you should change.
|
|
9258
|
+
from aws_cdk import aws_cloudfront as cloudfront
|
|
9259
|
+
|
|
9260
|
+
key_value_store_association_property = cloudfront.CfnFunction.KeyValueStoreAssociationProperty(
|
|
9261
|
+
key_value_store_arn="keyValueStoreArn"
|
|
9262
|
+
)
|
|
9263
|
+
'''
|
|
9264
|
+
if __debug__:
|
|
9265
|
+
type_hints = typing.get_type_hints(_typecheckingstub__a7d3d29786c9dae5b37c513099f68b7af9dbc6d9fae4e0cbdcb48e77b4e6f592)
|
|
9266
|
+
check_type(argname="argument key_value_store_arn", value=key_value_store_arn, expected_type=type_hints["key_value_store_arn"])
|
|
9267
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
9268
|
+
"key_value_store_arn": key_value_store_arn,
|
|
9269
|
+
}
|
|
9270
|
+
|
|
9271
|
+
@builtins.property
|
|
9272
|
+
def key_value_store_arn(self) -> builtins.str:
|
|
9273
|
+
'''The Amazon Resource Name (ARN) of the Key Value Store association.
|
|
9274
|
+
|
|
9275
|
+
:see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-function-keyvaluestoreassociation.html#cfn-cloudfront-function-keyvaluestoreassociation-keyvaluestorearn
|
|
9276
|
+
'''
|
|
9277
|
+
result = self._values.get("key_value_store_arn")
|
|
9278
|
+
assert result is not None, "Required property 'key_value_store_arn' is missing"
|
|
9279
|
+
return typing.cast(builtins.str, result)
|
|
9280
|
+
|
|
9281
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
9282
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
9283
|
+
|
|
9284
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
9285
|
+
return not (rhs == self)
|
|
9286
|
+
|
|
9287
|
+
def __repr__(self) -> str:
|
|
9288
|
+
return "KeyValueStoreAssociationProperty(%s)" % ", ".join(
|
|
9289
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
9290
|
+
)
|
|
9291
|
+
|
|
9176
9292
|
|
|
9177
9293
|
@jsii.data_type(
|
|
9178
9294
|
jsii_type="aws-cdk-lib.aws_cloudfront.CfnFunctionProps",
|
|
@@ -9216,7 +9332,12 @@ class CfnFunctionProps:
|
|
|
9216
9332
|
function_code="functionCode",
|
|
9217
9333
|
function_config=cloudfront.CfnFunction.FunctionConfigProperty(
|
|
9218
9334
|
comment="comment",
|
|
9219
|
-
runtime="runtime"
|
|
9335
|
+
runtime="runtime",
|
|
9336
|
+
|
|
9337
|
+
# the properties below are optional
|
|
9338
|
+
key_value_store_associations=[cloudfront.CfnFunction.KeyValueStoreAssociationProperty(
|
|
9339
|
+
key_value_store_arn="keyValueStoreArn"
|
|
9340
|
+
)]
|
|
9220
9341
|
),
|
|
9221
9342
|
name="name",
|
|
9222
9343
|
|
|
@@ -15404,18 +15525,20 @@ class DistributionProps:
|
|
|
15404
15525
|
|
|
15405
15526
|
Example::
|
|
15406
15527
|
|
|
15528
|
+
# Adding an existing Lambda@Edge function created in a different stack
|
|
15529
|
+
# to a CloudFront distribution.
|
|
15407
15530
|
# s3_bucket: s3.Bucket
|
|
15408
|
-
|
|
15409
|
-
|
|
15410
|
-
|
|
15411
|
-
)
|
|
15531
|
+
|
|
15532
|
+
function_version = lambda_.Version.from_version_arn(self, "Version", "arn:aws:lambda:us-east-1:123456789012:function:functionName:1")
|
|
15533
|
+
|
|
15412
15534
|
cloudfront.Distribution(self, "distro",
|
|
15413
15535
|
default_behavior=cloudfront.BehaviorOptions(
|
|
15414
15536
|
origin=origins.S3Origin(s3_bucket),
|
|
15415
|
-
|
|
15416
|
-
|
|
15417
|
-
event_type=cloudfront.
|
|
15418
|
-
)
|
|
15537
|
+
edge_lambdas=[cloudfront.EdgeLambda(
|
|
15538
|
+
function_version=function_version,
|
|
15539
|
+
event_type=cloudfront.LambdaEdgeEventType.VIEWER_REQUEST
|
|
15540
|
+
)
|
|
15541
|
+
]
|
|
15419
15542
|
)
|
|
15420
15543
|
)
|
|
15421
15544
|
'''
|
|
@@ -16142,7 +16265,11 @@ class FunctionAssociation:
|
|
|
16142
16265
|
@jsii.data_type(
|
|
16143
16266
|
jsii_type="aws-cdk-lib.aws_cloudfront.FunctionAttributes",
|
|
16144
16267
|
jsii_struct_bases=[],
|
|
16145
|
-
name_mapping={
|
|
16268
|
+
name_mapping={
|
|
16269
|
+
"function_arn": "functionArn",
|
|
16270
|
+
"function_name": "functionName",
|
|
16271
|
+
"function_runtime": "functionRuntime",
|
|
16272
|
+
},
|
|
16146
16273
|
)
|
|
16147
16274
|
class FunctionAttributes:
|
|
16148
16275
|
def __init__(
|
|
@@ -16150,11 +16277,13 @@ class FunctionAttributes:
|
|
|
16150
16277
|
*,
|
|
16151
16278
|
function_arn: builtins.str,
|
|
16152
16279
|
function_name: builtins.str,
|
|
16280
|
+
function_runtime: typing.Optional[builtins.str] = None,
|
|
16153
16281
|
) -> None:
|
|
16154
16282
|
'''Attributes of an existing CloudFront Function to import it.
|
|
16155
16283
|
|
|
16156
16284
|
:param function_arn: The ARN of the function.
|
|
16157
16285
|
:param function_name: The name of the function.
|
|
16286
|
+
:param function_runtime: The Runtime of the function. Default: FunctionRuntime.JS_1_0
|
|
16158
16287
|
|
|
16159
16288
|
:exampleMetadata: fixture=_generated
|
|
16160
16289
|
|
|
@@ -16166,17 +16295,23 @@ class FunctionAttributes:
|
|
|
16166
16295
|
|
|
16167
16296
|
function_attributes = cloudfront.FunctionAttributes(
|
|
16168
16297
|
function_arn="functionArn",
|
|
16169
|
-
function_name="functionName"
|
|
16298
|
+
function_name="functionName",
|
|
16299
|
+
|
|
16300
|
+
# the properties below are optional
|
|
16301
|
+
function_runtime="functionRuntime"
|
|
16170
16302
|
)
|
|
16171
16303
|
'''
|
|
16172
16304
|
if __debug__:
|
|
16173
16305
|
type_hints = typing.get_type_hints(_typecheckingstub__903bbff401b8a2560d333137b7ac614ba7cdaa77d8d3034c4d8a9e13de5b1b01)
|
|
16174
16306
|
check_type(argname="argument function_arn", value=function_arn, expected_type=type_hints["function_arn"])
|
|
16175
16307
|
check_type(argname="argument function_name", value=function_name, expected_type=type_hints["function_name"])
|
|
16308
|
+
check_type(argname="argument function_runtime", value=function_runtime, expected_type=type_hints["function_runtime"])
|
|
16176
16309
|
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
16177
16310
|
"function_arn": function_arn,
|
|
16178
16311
|
"function_name": function_name,
|
|
16179
16312
|
}
|
|
16313
|
+
if function_runtime is not None:
|
|
16314
|
+
self._values["function_runtime"] = function_runtime
|
|
16180
16315
|
|
|
16181
16316
|
@builtins.property
|
|
16182
16317
|
def function_arn(self) -> builtins.str:
|
|
@@ -16192,6 +16327,15 @@ class FunctionAttributes:
|
|
|
16192
16327
|
assert result is not None, "Required property 'function_name' is missing"
|
|
16193
16328
|
return typing.cast(builtins.str, result)
|
|
16194
16329
|
|
|
16330
|
+
@builtins.property
|
|
16331
|
+
def function_runtime(self) -> typing.Optional[builtins.str]:
|
|
16332
|
+
'''The Runtime of the function.
|
|
16333
|
+
|
|
16334
|
+
:default: FunctionRuntime.JS_1_0
|
|
16335
|
+
'''
|
|
16336
|
+
result = self._values.get("function_runtime")
|
|
16337
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
16338
|
+
|
|
16195
16339
|
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
16196
16340
|
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
16197
16341
|
|
|
@@ -16217,7 +16361,8 @@ class FunctionCode(
|
|
|
16217
16361
|
# s3_bucket: s3.Bucket
|
|
16218
16362
|
# Add a cloudfront Function to a Distribution
|
|
16219
16363
|
cf_function = cloudfront.Function(self, "Function",
|
|
16220
|
-
code=cloudfront.FunctionCode.from_inline("function handler(event) { return event.request }")
|
|
16364
|
+
code=cloudfront.FunctionCode.from_inline("function handler(event) { return event.request }"),
|
|
16365
|
+
runtime=cloudfront.FunctionRuntime.JS_2_0
|
|
16221
16366
|
)
|
|
16222
16367
|
cloudfront.Distribution(self, "distro",
|
|
16223
16368
|
default_behavior=cloudfront.BehaviorOptions(
|
|
@@ -16288,7 +16433,8 @@ class FunctionEventType(enum.Enum):
|
|
|
16288
16433
|
# s3_bucket: s3.Bucket
|
|
16289
16434
|
# Add a cloudfront Function to a Distribution
|
|
16290
16435
|
cf_function = cloudfront.Function(self, "Function",
|
|
16291
|
-
code=cloudfront.FunctionCode.from_inline("function handler(event) { return event.request }")
|
|
16436
|
+
code=cloudfront.FunctionCode.from_inline("function handler(event) { return event.request }"),
|
|
16437
|
+
runtime=cloudfront.FunctionRuntime.JS_2_0
|
|
16292
16438
|
)
|
|
16293
16439
|
cloudfront.Distribution(self, "distro",
|
|
16294
16440
|
default_behavior=cloudfront.BehaviorOptions(
|
|
@@ -16314,6 +16460,7 @@ class FunctionEventType(enum.Enum):
|
|
|
16314
16460
|
"code": "code",
|
|
16315
16461
|
"comment": "comment",
|
|
16316
16462
|
"function_name": "functionName",
|
|
16463
|
+
"runtime": "runtime",
|
|
16317
16464
|
},
|
|
16318
16465
|
)
|
|
16319
16466
|
class FunctionProps:
|
|
@@ -16323,12 +16470,14 @@ class FunctionProps:
|
|
|
16323
16470
|
code: FunctionCode,
|
|
16324
16471
|
comment: typing.Optional[builtins.str] = None,
|
|
16325
16472
|
function_name: typing.Optional[builtins.str] = None,
|
|
16473
|
+
runtime: typing.Optional["FunctionRuntime"] = None,
|
|
16326
16474
|
) -> None:
|
|
16327
16475
|
'''Properties for creating a CloudFront Function.
|
|
16328
16476
|
|
|
16329
16477
|
:param code: The source code of the function.
|
|
16330
16478
|
:param comment: A comment to describe the function. Default: - same as ``functionName``
|
|
16331
16479
|
:param function_name: A name to identify the function. Default: - generated from the ``id``
|
|
16480
|
+
:param runtime: The runtime environment for the function. Default: FunctionRuntime.JS_1_0
|
|
16332
16481
|
|
|
16333
16482
|
:exampleMetadata: infused
|
|
16334
16483
|
|
|
@@ -16337,7 +16486,8 @@ class FunctionProps:
|
|
|
16337
16486
|
# s3_bucket: s3.Bucket
|
|
16338
16487
|
# Add a cloudfront Function to a Distribution
|
|
16339
16488
|
cf_function = cloudfront.Function(self, "Function",
|
|
16340
|
-
code=cloudfront.FunctionCode.from_inline("function handler(event) { return event.request }")
|
|
16489
|
+
code=cloudfront.FunctionCode.from_inline("function handler(event) { return event.request }"),
|
|
16490
|
+
runtime=cloudfront.FunctionRuntime.JS_2_0
|
|
16341
16491
|
)
|
|
16342
16492
|
cloudfront.Distribution(self, "distro",
|
|
16343
16493
|
default_behavior=cloudfront.BehaviorOptions(
|
|
@@ -16354,6 +16504,7 @@ class FunctionProps:
|
|
|
16354
16504
|
check_type(argname="argument code", value=code, expected_type=type_hints["code"])
|
|
16355
16505
|
check_type(argname="argument comment", value=comment, expected_type=type_hints["comment"])
|
|
16356
16506
|
check_type(argname="argument function_name", value=function_name, expected_type=type_hints["function_name"])
|
|
16507
|
+
check_type(argname="argument runtime", value=runtime, expected_type=type_hints["runtime"])
|
|
16357
16508
|
self._values: typing.Dict[builtins.str, typing.Any] = {
|
|
16358
16509
|
"code": code,
|
|
16359
16510
|
}
|
|
@@ -16361,6 +16512,8 @@ class FunctionProps:
|
|
|
16361
16512
|
self._values["comment"] = comment
|
|
16362
16513
|
if function_name is not None:
|
|
16363
16514
|
self._values["function_name"] = function_name
|
|
16515
|
+
if runtime is not None:
|
|
16516
|
+
self._values["runtime"] = runtime
|
|
16364
16517
|
|
|
16365
16518
|
@builtins.property
|
|
16366
16519
|
def code(self) -> FunctionCode:
|
|
@@ -16387,6 +16540,15 @@ class FunctionProps:
|
|
|
16387
16540
|
result = self._values.get("function_name")
|
|
16388
16541
|
return typing.cast(typing.Optional[builtins.str], result)
|
|
16389
16542
|
|
|
16543
|
+
@builtins.property
|
|
16544
|
+
def runtime(self) -> typing.Optional["FunctionRuntime"]:
|
|
16545
|
+
'''The runtime environment for the function.
|
|
16546
|
+
|
|
16547
|
+
:default: FunctionRuntime.JS_1_0
|
|
16548
|
+
'''
|
|
16549
|
+
result = self._values.get("runtime")
|
|
16550
|
+
return typing.cast(typing.Optional["FunctionRuntime"], result)
|
|
16551
|
+
|
|
16390
16552
|
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
16391
16553
|
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
16392
16554
|
|
|
@@ -16399,6 +16561,65 @@ class FunctionProps:
|
|
|
16399
16561
|
)
|
|
16400
16562
|
|
|
16401
16563
|
|
|
16564
|
+
class FunctionRuntime(
|
|
16565
|
+
metaclass=jsii.JSIIMeta,
|
|
16566
|
+
jsii_type="aws-cdk-lib.aws_cloudfront.FunctionRuntime",
|
|
16567
|
+
):
|
|
16568
|
+
'''The function's runtime environment version.
|
|
16569
|
+
|
|
16570
|
+
:exampleMetadata: infused
|
|
16571
|
+
|
|
16572
|
+
Example::
|
|
16573
|
+
|
|
16574
|
+
# s3_bucket: s3.Bucket
|
|
16575
|
+
# Add a cloudfront Function to a Distribution
|
|
16576
|
+
cf_function = cloudfront.Function(self, "Function",
|
|
16577
|
+
code=cloudfront.FunctionCode.from_inline("function handler(event) { return event.request }"),
|
|
16578
|
+
runtime=cloudfront.FunctionRuntime.JS_2_0
|
|
16579
|
+
)
|
|
16580
|
+
cloudfront.Distribution(self, "distro",
|
|
16581
|
+
default_behavior=cloudfront.BehaviorOptions(
|
|
16582
|
+
origin=origins.S3Origin(s3_bucket),
|
|
16583
|
+
function_associations=[cloudfront.FunctionAssociation(
|
|
16584
|
+
function=cf_function,
|
|
16585
|
+
event_type=cloudfront.FunctionEventType.VIEWER_REQUEST
|
|
16586
|
+
)]
|
|
16587
|
+
)
|
|
16588
|
+
)
|
|
16589
|
+
'''
|
|
16590
|
+
|
|
16591
|
+
@jsii.member(jsii_name="custom")
|
|
16592
|
+
@builtins.classmethod
|
|
16593
|
+
def custom(cls, runtime_string: builtins.str) -> "FunctionRuntime":
|
|
16594
|
+
'''A custom runtime string.
|
|
16595
|
+
|
|
16596
|
+
Gives full control over the runtime string fragment.
|
|
16597
|
+
|
|
16598
|
+
:param runtime_string: -
|
|
16599
|
+
'''
|
|
16600
|
+
if __debug__:
|
|
16601
|
+
type_hints = typing.get_type_hints(_typecheckingstub__631c8d0b51cac2d9ffcbfad4bfbcc5e76ea97cde669fb05e21ba361b851513db)
|
|
16602
|
+
check_type(argname="argument runtime_string", value=runtime_string, expected_type=type_hints["runtime_string"])
|
|
16603
|
+
return typing.cast("FunctionRuntime", jsii.sinvoke(cls, "custom", [runtime_string]))
|
|
16604
|
+
|
|
16605
|
+
@jsii.python.classproperty
|
|
16606
|
+
@jsii.member(jsii_name="JS_1_0")
|
|
16607
|
+
def JS_1_0(cls) -> "FunctionRuntime":
|
|
16608
|
+
'''cloudfront-js-1.0.'''
|
|
16609
|
+
return typing.cast("FunctionRuntime", jsii.sget(cls, "JS_1_0"))
|
|
16610
|
+
|
|
16611
|
+
@jsii.python.classproperty
|
|
16612
|
+
@jsii.member(jsii_name="JS_2_0")
|
|
16613
|
+
def JS_2_0(cls) -> "FunctionRuntime":
|
|
16614
|
+
'''cloudfront-js-2.0.'''
|
|
16615
|
+
return typing.cast("FunctionRuntime", jsii.sget(cls, "JS_2_0"))
|
|
16616
|
+
|
|
16617
|
+
@builtins.property
|
|
16618
|
+
@jsii.member(jsii_name="value")
|
|
16619
|
+
def value(self) -> builtins.str:
|
|
16620
|
+
return typing.cast(builtins.str, jsii.get(self, "value"))
|
|
16621
|
+
|
|
16622
|
+
|
|
16402
16623
|
class GeoRestriction(
|
|
16403
16624
|
metaclass=jsii.JSIIMeta,
|
|
16404
16625
|
jsii_type="aws-cdk-lib.aws_cloudfront.GeoRestriction",
|
|
@@ -16847,6 +17068,76 @@ class _IKeyGroupProxy(
|
|
|
16847
17068
|
typing.cast(typing.Any, IKeyGroup).__jsii_proxy_class__ = lambda : _IKeyGroupProxy
|
|
16848
17069
|
|
|
16849
17070
|
|
|
17071
|
+
@jsii.interface(jsii_type="aws-cdk-lib.aws_cloudfront.IKeyValueStore")
|
|
17072
|
+
class IKeyValueStore(_IResource_c80c4260, typing_extensions.Protocol):
|
|
17073
|
+
'''A CloudFront Key Value Store.'''
|
|
17074
|
+
|
|
17075
|
+
@builtins.property
|
|
17076
|
+
@jsii.member(jsii_name="keyValueStoreArn")
|
|
17077
|
+
def key_value_store_arn(self) -> builtins.str:
|
|
17078
|
+
'''The ARN of the Key Value Store.
|
|
17079
|
+
|
|
17080
|
+
:attribute: true
|
|
17081
|
+
'''
|
|
17082
|
+
...
|
|
17083
|
+
|
|
17084
|
+
@builtins.property
|
|
17085
|
+
@jsii.member(jsii_name="keyValueStoreId")
|
|
17086
|
+
def key_value_store_id(self) -> builtins.str:
|
|
17087
|
+
'''The Unique ID of the Key Value Store.
|
|
17088
|
+
|
|
17089
|
+
:attribute: true
|
|
17090
|
+
'''
|
|
17091
|
+
...
|
|
17092
|
+
|
|
17093
|
+
@builtins.property
|
|
17094
|
+
@jsii.member(jsii_name="keyValueStoreStatus")
|
|
17095
|
+
def key_value_store_status(self) -> builtins.str:
|
|
17096
|
+
'''The status of the Key Value Store.
|
|
17097
|
+
|
|
17098
|
+
:attribute: true
|
|
17099
|
+
'''
|
|
17100
|
+
...
|
|
17101
|
+
|
|
17102
|
+
|
|
17103
|
+
class _IKeyValueStoreProxy(
|
|
17104
|
+
jsii.proxy_for(_IResource_c80c4260), # type: ignore[misc]
|
|
17105
|
+
):
|
|
17106
|
+
'''A CloudFront Key Value Store.'''
|
|
17107
|
+
|
|
17108
|
+
__jsii_type__: typing.ClassVar[str] = "aws-cdk-lib.aws_cloudfront.IKeyValueStore"
|
|
17109
|
+
|
|
17110
|
+
@builtins.property
|
|
17111
|
+
@jsii.member(jsii_name="keyValueStoreArn")
|
|
17112
|
+
def key_value_store_arn(self) -> builtins.str:
|
|
17113
|
+
'''The ARN of the Key Value Store.
|
|
17114
|
+
|
|
17115
|
+
:attribute: true
|
|
17116
|
+
'''
|
|
17117
|
+
return typing.cast(builtins.str, jsii.get(self, "keyValueStoreArn"))
|
|
17118
|
+
|
|
17119
|
+
@builtins.property
|
|
17120
|
+
@jsii.member(jsii_name="keyValueStoreId")
|
|
17121
|
+
def key_value_store_id(self) -> builtins.str:
|
|
17122
|
+
'''The Unique ID of the Key Value Store.
|
|
17123
|
+
|
|
17124
|
+
:attribute: true
|
|
17125
|
+
'''
|
|
17126
|
+
return typing.cast(builtins.str, jsii.get(self, "keyValueStoreId"))
|
|
17127
|
+
|
|
17128
|
+
@builtins.property
|
|
17129
|
+
@jsii.member(jsii_name="keyValueStoreStatus")
|
|
17130
|
+
def key_value_store_status(self) -> builtins.str:
|
|
17131
|
+
'''The status of the Key Value Store.
|
|
17132
|
+
|
|
17133
|
+
:attribute: true
|
|
17134
|
+
'''
|
|
17135
|
+
return typing.cast(builtins.str, jsii.get(self, "keyValueStoreStatus"))
|
|
17136
|
+
|
|
17137
|
+
# Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
|
|
17138
|
+
typing.cast(typing.Any, IKeyValueStore).__jsii_proxy_class__ = lambda : _IKeyValueStoreProxy
|
|
17139
|
+
|
|
17140
|
+
|
|
16850
17141
|
@jsii.interface(jsii_type="aws-cdk-lib.aws_cloudfront.IOrigin")
|
|
16851
17142
|
class IOrigin(typing_extensions.Protocol):
|
|
16852
17143
|
'''Represents the concept of a CloudFront Origin.
|
|
@@ -17105,6 +17396,94 @@ class _IResponseHeadersPolicyProxy:
|
|
|
17105
17396
|
typing.cast(typing.Any, IResponseHeadersPolicy).__jsii_proxy_class__ = lambda : _IResponseHeadersPolicyProxy
|
|
17106
17397
|
|
|
17107
17398
|
|
|
17399
|
+
class ImportSource(
|
|
17400
|
+
metaclass=jsii.JSIIAbstractClass,
|
|
17401
|
+
jsii_type="aws-cdk-lib.aws_cloudfront.ImportSource",
|
|
17402
|
+
):
|
|
17403
|
+
'''The data to be imported to the key value store.
|
|
17404
|
+
|
|
17405
|
+
:exampleMetadata: infused
|
|
17406
|
+
|
|
17407
|
+
Example::
|
|
17408
|
+
|
|
17409
|
+
store = cloudfront.KeyValueStore(self, "KeyValueStore",
|
|
17410
|
+
key_value_store_name="KeyValueStore",
|
|
17411
|
+
source=cloudfront.ImportSource.from_asset("path-to-data.json")
|
|
17412
|
+
)
|
|
17413
|
+
'''
|
|
17414
|
+
|
|
17415
|
+
def __init__(self) -> None:
|
|
17416
|
+
jsii.create(self.__class__, self, [])
|
|
17417
|
+
|
|
17418
|
+
@jsii.member(jsii_name="fromAsset")
|
|
17419
|
+
@builtins.classmethod
|
|
17420
|
+
def from_asset(
|
|
17421
|
+
cls,
|
|
17422
|
+
path: builtins.str,
|
|
17423
|
+
*,
|
|
17424
|
+
deploy_time: typing.Optional[builtins.bool] = None,
|
|
17425
|
+
readers: typing.Optional[typing.Sequence[_IGrantable_71c4f5de]] = None,
|
|
17426
|
+
asset_hash: typing.Optional[builtins.str] = None,
|
|
17427
|
+
asset_hash_type: typing.Optional[_AssetHashType_05b67f2d] = None,
|
|
17428
|
+
bundling: typing.Optional[typing.Union[_BundlingOptions_588cc936, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
17429
|
+
exclude: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
17430
|
+
follow_symlinks: typing.Optional[_SymlinkFollowMode_047ec1f6] = None,
|
|
17431
|
+
ignore_mode: typing.Optional[_IgnoreMode_655a98e8] = None,
|
|
17432
|
+
) -> "ImportSource":
|
|
17433
|
+
'''An import source that exists as a local file.
|
|
17434
|
+
|
|
17435
|
+
:param path: the path to the local file.
|
|
17436
|
+
: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
|
|
17437
|
+
: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.
|
|
17438
|
+
: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``
|
|
17439
|
+
: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``.
|
|
17440
|
+
: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
|
|
17441
|
+
:param exclude: File paths matching the patterns will be excluded. See ``ignoreMode`` to set the matching behavior. Has no effect on Assets bundled using the ``bundling`` property. Default: - nothing is excluded
|
|
17442
|
+
:param follow_symlinks: A strategy for how to handle symlinks. Default: SymlinkFollowMode.NEVER
|
|
17443
|
+
:param ignore_mode: The ignore behavior to use for ``exclude`` patterns. Default: IgnoreMode.GLOB
|
|
17444
|
+
'''
|
|
17445
|
+
if __debug__:
|
|
17446
|
+
type_hints = typing.get_type_hints(_typecheckingstub__f5d4750ca4d7703f815ca46be8b91e46ea0b813f42846026dff63e00f3b01302)
|
|
17447
|
+
check_type(argname="argument path", value=path, expected_type=type_hints["path"])
|
|
17448
|
+
options = _AssetOptions_2aa69621(
|
|
17449
|
+
deploy_time=deploy_time,
|
|
17450
|
+
readers=readers,
|
|
17451
|
+
asset_hash=asset_hash,
|
|
17452
|
+
asset_hash_type=asset_hash_type,
|
|
17453
|
+
bundling=bundling,
|
|
17454
|
+
exclude=exclude,
|
|
17455
|
+
follow_symlinks=follow_symlinks,
|
|
17456
|
+
ignore_mode=ignore_mode,
|
|
17457
|
+
)
|
|
17458
|
+
|
|
17459
|
+
return typing.cast("ImportSource", jsii.sinvoke(cls, "fromAsset", [path, options]))
|
|
17460
|
+
|
|
17461
|
+
@jsii.member(jsii_name="fromBucket")
|
|
17462
|
+
@builtins.classmethod
|
|
17463
|
+
def from_bucket(
|
|
17464
|
+
cls,
|
|
17465
|
+
bucket: _IBucket_42e086fd,
|
|
17466
|
+
key: builtins.str,
|
|
17467
|
+
) -> "ImportSource":
|
|
17468
|
+
'''An import source that exists as an object in an S3 bucket.
|
|
17469
|
+
|
|
17470
|
+
:param bucket: the S3 bucket that contains the data.
|
|
17471
|
+
:param key: the key within the S3 bucket that contains the data.
|
|
17472
|
+
'''
|
|
17473
|
+
if __debug__:
|
|
17474
|
+
type_hints = typing.get_type_hints(_typecheckingstub__199a9d2f509e6bf2ce32ccd58ce284ca48a05841123773473504a43c39588730)
|
|
17475
|
+
check_type(argname="argument bucket", value=bucket, expected_type=type_hints["bucket"])
|
|
17476
|
+
check_type(argname="argument key", value=key, expected_type=type_hints["key"])
|
|
17477
|
+
return typing.cast("ImportSource", jsii.sinvoke(cls, "fromBucket", [bucket, key]))
|
|
17478
|
+
|
|
17479
|
+
|
|
17480
|
+
class _ImportSourceProxy(ImportSource):
|
|
17481
|
+
pass
|
|
17482
|
+
|
|
17483
|
+
# Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class
|
|
17484
|
+
typing.cast(typing.Any, ImportSource).__jsii_proxy_class__ = lambda : _ImportSourceProxy
|
|
17485
|
+
|
|
17486
|
+
|
|
17108
17487
|
@jsii.implements(IKeyGroup)
|
|
17109
17488
|
class KeyGroup(
|
|
17110
17489
|
_Resource_45bc6135,
|
|
@@ -17294,6 +17673,175 @@ class KeyGroupProps:
|
|
|
17294
17673
|
)
|
|
17295
17674
|
|
|
17296
17675
|
|
|
17676
|
+
@jsii.implements(IKeyValueStore)
|
|
17677
|
+
class KeyValueStore(
|
|
17678
|
+
_Resource_45bc6135,
|
|
17679
|
+
metaclass=jsii.JSIIMeta,
|
|
17680
|
+
jsii_type="aws-cdk-lib.aws_cloudfront.KeyValueStore",
|
|
17681
|
+
):
|
|
17682
|
+
'''A CloudFront Key Value Store.
|
|
17683
|
+
|
|
17684
|
+
:resource: AWS::CloudFront::KeyValueStore
|
|
17685
|
+
:exampleMetadata: infused
|
|
17686
|
+
|
|
17687
|
+
Example::
|
|
17688
|
+
|
|
17689
|
+
store = cloudfront.KeyValueStore(self, "KeyValueStore")
|
|
17690
|
+
'''
|
|
17691
|
+
|
|
17692
|
+
def __init__(
|
|
17693
|
+
self,
|
|
17694
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
17695
|
+
id: builtins.str,
|
|
17696
|
+
*,
|
|
17697
|
+
comment: typing.Optional[builtins.str] = None,
|
|
17698
|
+
key_value_store_name: typing.Optional[builtins.str] = None,
|
|
17699
|
+
source: typing.Optional[ImportSource] = None,
|
|
17700
|
+
) -> None:
|
|
17701
|
+
'''
|
|
17702
|
+
:param scope: -
|
|
17703
|
+
:param id: -
|
|
17704
|
+
:param comment: A comment for the Key Value Store. Default: No comment will be specified
|
|
17705
|
+
:param key_value_store_name: The unique name of the Key Value Store. Default: A generated name
|
|
17706
|
+
:param source: The import source for the Key Value Store. This will populate the initial items in the Key Value Store. The source data must be in a valid JSON format. Default: No data will be imported to the store
|
|
17707
|
+
'''
|
|
17708
|
+
if __debug__:
|
|
17709
|
+
type_hints = typing.get_type_hints(_typecheckingstub__fbcb7711d84a000f571b2303bf96f7a4319741a396d620e3f2c749be479fdde1)
|
|
17710
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
17711
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
17712
|
+
props = KeyValueStoreProps(
|
|
17713
|
+
comment=comment, key_value_store_name=key_value_store_name, source=source
|
|
17714
|
+
)
|
|
17715
|
+
|
|
17716
|
+
jsii.create(self.__class__, self, [scope, id, props])
|
|
17717
|
+
|
|
17718
|
+
@jsii.member(jsii_name="fromKeyValueStoreArn")
|
|
17719
|
+
@builtins.classmethod
|
|
17720
|
+
def from_key_value_store_arn(
|
|
17721
|
+
cls,
|
|
17722
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
17723
|
+
id: builtins.str,
|
|
17724
|
+
key_value_store_arn: builtins.str,
|
|
17725
|
+
) -> IKeyValueStore:
|
|
17726
|
+
'''Import a Key Value Store using its ARN.
|
|
17727
|
+
|
|
17728
|
+
:param scope: -
|
|
17729
|
+
:param id: -
|
|
17730
|
+
:param key_value_store_arn: -
|
|
17731
|
+
'''
|
|
17732
|
+
if __debug__:
|
|
17733
|
+
type_hints = typing.get_type_hints(_typecheckingstub__6286cfc55d9b5b70d728248f5d869f6b99814bbec3d61416b9ff28849cdca011)
|
|
17734
|
+
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
17735
|
+
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
17736
|
+
check_type(argname="argument key_value_store_arn", value=key_value_store_arn, expected_type=type_hints["key_value_store_arn"])
|
|
17737
|
+
return typing.cast(IKeyValueStore, jsii.sinvoke(cls, "fromKeyValueStoreArn", [scope, id, key_value_store_arn]))
|
|
17738
|
+
|
|
17739
|
+
@builtins.property
|
|
17740
|
+
@jsii.member(jsii_name="keyValueStoreArn")
|
|
17741
|
+
def key_value_store_arn(self) -> builtins.str:
|
|
17742
|
+
'''The ARN of the Key Value Store.'''
|
|
17743
|
+
return typing.cast(builtins.str, jsii.get(self, "keyValueStoreArn"))
|
|
17744
|
+
|
|
17745
|
+
@builtins.property
|
|
17746
|
+
@jsii.member(jsii_name="keyValueStoreId")
|
|
17747
|
+
def key_value_store_id(self) -> builtins.str:
|
|
17748
|
+
'''The Unique ID of the Key Value Store.'''
|
|
17749
|
+
return typing.cast(builtins.str, jsii.get(self, "keyValueStoreId"))
|
|
17750
|
+
|
|
17751
|
+
@builtins.property
|
|
17752
|
+
@jsii.member(jsii_name="keyValueStoreStatus")
|
|
17753
|
+
def key_value_store_status(self) -> builtins.str:
|
|
17754
|
+
'''The status of the Key Value Store.'''
|
|
17755
|
+
return typing.cast(builtins.str, jsii.get(self, "keyValueStoreStatus"))
|
|
17756
|
+
|
|
17757
|
+
|
|
17758
|
+
@jsii.data_type(
|
|
17759
|
+
jsii_type="aws-cdk-lib.aws_cloudfront.KeyValueStoreProps",
|
|
17760
|
+
jsii_struct_bases=[],
|
|
17761
|
+
name_mapping={
|
|
17762
|
+
"comment": "comment",
|
|
17763
|
+
"key_value_store_name": "keyValueStoreName",
|
|
17764
|
+
"source": "source",
|
|
17765
|
+
},
|
|
17766
|
+
)
|
|
17767
|
+
class KeyValueStoreProps:
|
|
17768
|
+
def __init__(
|
|
17769
|
+
self,
|
|
17770
|
+
*,
|
|
17771
|
+
comment: typing.Optional[builtins.str] = None,
|
|
17772
|
+
key_value_store_name: typing.Optional[builtins.str] = None,
|
|
17773
|
+
source: typing.Optional[ImportSource] = None,
|
|
17774
|
+
) -> None:
|
|
17775
|
+
'''The properties to create a Key Value Store.
|
|
17776
|
+
|
|
17777
|
+
:param comment: A comment for the Key Value Store. Default: No comment will be specified
|
|
17778
|
+
:param key_value_store_name: The unique name of the Key Value Store. Default: A generated name
|
|
17779
|
+
:param source: The import source for the Key Value Store. This will populate the initial items in the Key Value Store. The source data must be in a valid JSON format. Default: No data will be imported to the store
|
|
17780
|
+
|
|
17781
|
+
:exampleMetadata: infused
|
|
17782
|
+
|
|
17783
|
+
Example::
|
|
17784
|
+
|
|
17785
|
+
store = cloudfront.KeyValueStore(self, "KeyValueStore",
|
|
17786
|
+
key_value_store_name="KeyValueStore",
|
|
17787
|
+
source=cloudfront.ImportSource.from_asset("path-to-data.json")
|
|
17788
|
+
)
|
|
17789
|
+
'''
|
|
17790
|
+
if __debug__:
|
|
17791
|
+
type_hints = typing.get_type_hints(_typecheckingstub__0885cf023551545b14a4696bf116b851a0c7733cc2987782ba95a29b134a062e)
|
|
17792
|
+
check_type(argname="argument comment", value=comment, expected_type=type_hints["comment"])
|
|
17793
|
+
check_type(argname="argument key_value_store_name", value=key_value_store_name, expected_type=type_hints["key_value_store_name"])
|
|
17794
|
+
check_type(argname="argument source", value=source, expected_type=type_hints["source"])
|
|
17795
|
+
self._values: typing.Dict[builtins.str, typing.Any] = {}
|
|
17796
|
+
if comment is not None:
|
|
17797
|
+
self._values["comment"] = comment
|
|
17798
|
+
if key_value_store_name is not None:
|
|
17799
|
+
self._values["key_value_store_name"] = key_value_store_name
|
|
17800
|
+
if source is not None:
|
|
17801
|
+
self._values["source"] = source
|
|
17802
|
+
|
|
17803
|
+
@builtins.property
|
|
17804
|
+
def comment(self) -> typing.Optional[builtins.str]:
|
|
17805
|
+
'''A comment for the Key Value Store.
|
|
17806
|
+
|
|
17807
|
+
:default: No comment will be specified
|
|
17808
|
+
'''
|
|
17809
|
+
result = self._values.get("comment")
|
|
17810
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
17811
|
+
|
|
17812
|
+
@builtins.property
|
|
17813
|
+
def key_value_store_name(self) -> typing.Optional[builtins.str]:
|
|
17814
|
+
'''The unique name of the Key Value Store.
|
|
17815
|
+
|
|
17816
|
+
:default: A generated name
|
|
17817
|
+
'''
|
|
17818
|
+
result = self._values.get("key_value_store_name")
|
|
17819
|
+
return typing.cast(typing.Optional[builtins.str], result)
|
|
17820
|
+
|
|
17821
|
+
@builtins.property
|
|
17822
|
+
def source(self) -> typing.Optional[ImportSource]:
|
|
17823
|
+
'''The import source for the Key Value Store.
|
|
17824
|
+
|
|
17825
|
+
This will populate the initial items in the Key Value Store. The
|
|
17826
|
+
source data must be in a valid JSON format.
|
|
17827
|
+
|
|
17828
|
+
:default: No data will be imported to the store
|
|
17829
|
+
'''
|
|
17830
|
+
result = self._values.get("source")
|
|
17831
|
+
return typing.cast(typing.Optional[ImportSource], result)
|
|
17832
|
+
|
|
17833
|
+
def __eq__(self, rhs: typing.Any) -> builtins.bool:
|
|
17834
|
+
return isinstance(rhs, self.__class__) and rhs._values == self._values
|
|
17835
|
+
|
|
17836
|
+
def __ne__(self, rhs: typing.Any) -> builtins.bool:
|
|
17837
|
+
return not (rhs == self)
|
|
17838
|
+
|
|
17839
|
+
def __repr__(self) -> str:
|
|
17840
|
+
return "KeyValueStoreProps(%s)" % ", ".join(
|
|
17841
|
+
k + "=" + repr(v) for k, v in self._values.items()
|
|
17842
|
+
)
|
|
17843
|
+
|
|
17844
|
+
|
|
17297
17845
|
@jsii.enum(jsii_type="aws-cdk-lib.aws_cloudfront.LambdaEdgeEventType")
|
|
17298
17846
|
class LambdaEdgeEventType(enum.Enum):
|
|
17299
17847
|
'''The type of events that a Lambda@Edge function can be invoked in response to.
|
|
@@ -20857,6 +21405,51 @@ class ResponseSecurityHeadersBehavior:
|
|
|
20857
21405
|
)
|
|
20858
21406
|
|
|
20859
21407
|
|
|
21408
|
+
class S3ImportSource(
|
|
21409
|
+
ImportSource,
|
|
21410
|
+
metaclass=jsii.JSIIMeta,
|
|
21411
|
+
jsii_type="aws-cdk-lib.aws_cloudfront.S3ImportSource",
|
|
21412
|
+
):
|
|
21413
|
+
'''An import source from an S3 object.
|
|
21414
|
+
|
|
21415
|
+
:exampleMetadata: fixture=_generated
|
|
21416
|
+
|
|
21417
|
+
Example::
|
|
21418
|
+
|
|
21419
|
+
# The code below shows an example of how to instantiate this type.
|
|
21420
|
+
# The values are placeholders you should change.
|
|
21421
|
+
from aws_cdk import aws_cloudfront as cloudfront
|
|
21422
|
+
from aws_cdk import aws_s3 as s3
|
|
21423
|
+
|
|
21424
|
+
# bucket: s3.Bucket
|
|
21425
|
+
|
|
21426
|
+
s3_import_source = cloudfront.S3ImportSource(bucket, "key")
|
|
21427
|
+
'''
|
|
21428
|
+
|
|
21429
|
+
def __init__(self, bucket: _IBucket_42e086fd, key: builtins.str) -> None:
|
|
21430
|
+
'''
|
|
21431
|
+
:param bucket: the S3 bucket that contains the data.
|
|
21432
|
+
:param key: the key within the S3 bucket that contains the data.
|
|
21433
|
+
'''
|
|
21434
|
+
if __debug__:
|
|
21435
|
+
type_hints = typing.get_type_hints(_typecheckingstub__50b2e52880076ae956da5eb2d05fa8de1161eb1b2df762d8dafbf8e6bbfa4639)
|
|
21436
|
+
check_type(argname="argument bucket", value=bucket, expected_type=type_hints["bucket"])
|
|
21437
|
+
check_type(argname="argument key", value=key, expected_type=type_hints["key"])
|
|
21438
|
+
jsii.create(self.__class__, self, [bucket, key])
|
|
21439
|
+
|
|
21440
|
+
@builtins.property
|
|
21441
|
+
@jsii.member(jsii_name="bucket")
|
|
21442
|
+
def bucket(self) -> _IBucket_42e086fd:
|
|
21443
|
+
'''the S3 bucket that contains the data.'''
|
|
21444
|
+
return typing.cast(_IBucket_42e086fd, jsii.get(self, "bucket"))
|
|
21445
|
+
|
|
21446
|
+
@builtins.property
|
|
21447
|
+
@jsii.member(jsii_name="key")
|
|
21448
|
+
def key(self) -> builtins.str:
|
|
21449
|
+
'''the key within the S3 bucket that contains the data.'''
|
|
21450
|
+
return typing.cast(builtins.str, jsii.get(self, "key"))
|
|
21451
|
+
|
|
21452
|
+
|
|
20860
21453
|
@jsii.data_type(
|
|
20861
21454
|
jsii_type="aws-cdk-lib.aws_cloudfront.S3OriginConfig",
|
|
20862
21455
|
jsii_struct_bases=[],
|
|
@@ -21582,6 +22175,111 @@ class ViewerProtocolPolicy(enum.Enum):
|
|
|
21582
22175
|
'''Both HTTP and HTTPS supported.'''
|
|
21583
22176
|
|
|
21584
22177
|
|
|
22178
|
+
class AssetImportSource(
|
|
22179
|
+
ImportSource,
|
|
22180
|
+
metaclass=jsii.JSIIMeta,
|
|
22181
|
+
jsii_type="aws-cdk-lib.aws_cloudfront.AssetImportSource",
|
|
22182
|
+
):
|
|
22183
|
+
'''An import source from a local file.
|
|
22184
|
+
|
|
22185
|
+
:exampleMetadata: fixture=_generated
|
|
22186
|
+
|
|
22187
|
+
Example::
|
|
22188
|
+
|
|
22189
|
+
# The code below shows an example of how to instantiate this type.
|
|
22190
|
+
# The values are placeholders you should change.
|
|
22191
|
+
import aws_cdk as cdk
|
|
22192
|
+
from aws_cdk import aws_cloudfront as cloudfront
|
|
22193
|
+
from aws_cdk import aws_iam as iam
|
|
22194
|
+
|
|
22195
|
+
# docker_image: cdk.DockerImage
|
|
22196
|
+
# grantable: iam.IGrantable
|
|
22197
|
+
# local_bundling: cdk.ILocalBundling
|
|
22198
|
+
|
|
22199
|
+
asset_import_source = cloudfront.AssetImportSource("path",
|
|
22200
|
+
asset_hash="assetHash",
|
|
22201
|
+
asset_hash_type=cdk.AssetHashType.SOURCE,
|
|
22202
|
+
bundling=cdk.BundlingOptions(
|
|
22203
|
+
image=docker_image,
|
|
22204
|
+
|
|
22205
|
+
# the properties below are optional
|
|
22206
|
+
bundling_file_access=cdk.BundlingFileAccess.VOLUME_COPY,
|
|
22207
|
+
command=["command"],
|
|
22208
|
+
entrypoint=["entrypoint"],
|
|
22209
|
+
environment={
|
|
22210
|
+
"environment_key": "environment"
|
|
22211
|
+
},
|
|
22212
|
+
local=local_bundling,
|
|
22213
|
+
network="network",
|
|
22214
|
+
output_type=cdk.BundlingOutput.ARCHIVED,
|
|
22215
|
+
platform="platform",
|
|
22216
|
+
security_opt="securityOpt",
|
|
22217
|
+
user="user",
|
|
22218
|
+
volumes=[cdk.DockerVolume(
|
|
22219
|
+
container_path="containerPath",
|
|
22220
|
+
host_path="hostPath",
|
|
22221
|
+
|
|
22222
|
+
# the properties below are optional
|
|
22223
|
+
consistency=cdk.DockerVolumeConsistency.CONSISTENT
|
|
22224
|
+
)],
|
|
22225
|
+
volumes_from=["volumesFrom"],
|
|
22226
|
+
working_directory="workingDirectory"
|
|
22227
|
+
),
|
|
22228
|
+
deploy_time=False,
|
|
22229
|
+
exclude=["exclude"],
|
|
22230
|
+
follow_symlinks=cdk.SymlinkFollowMode.NEVER,
|
|
22231
|
+
ignore_mode=cdk.IgnoreMode.GLOB,
|
|
22232
|
+
readers=[grantable]
|
|
22233
|
+
)
|
|
22234
|
+
'''
|
|
22235
|
+
|
|
22236
|
+
def __init__(
|
|
22237
|
+
self,
|
|
22238
|
+
path: builtins.str,
|
|
22239
|
+
*,
|
|
22240
|
+
deploy_time: typing.Optional[builtins.bool] = None,
|
|
22241
|
+
readers: typing.Optional[typing.Sequence[_IGrantable_71c4f5de]] = None,
|
|
22242
|
+
asset_hash: typing.Optional[builtins.str] = None,
|
|
22243
|
+
asset_hash_type: typing.Optional[_AssetHashType_05b67f2d] = None,
|
|
22244
|
+
bundling: typing.Optional[typing.Union[_BundlingOptions_588cc936, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
22245
|
+
exclude: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
22246
|
+
follow_symlinks: typing.Optional[_SymlinkFollowMode_047ec1f6] = None,
|
|
22247
|
+
ignore_mode: typing.Optional[_IgnoreMode_655a98e8] = None,
|
|
22248
|
+
) -> None:
|
|
22249
|
+
'''
|
|
22250
|
+
:param path: the path to the local file.
|
|
22251
|
+
: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
|
|
22252
|
+
: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.
|
|
22253
|
+
: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``
|
|
22254
|
+
: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``.
|
|
22255
|
+
: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
|
|
22256
|
+
:param exclude: File paths matching the patterns will be excluded. See ``ignoreMode`` to set the matching behavior. Has no effect on Assets bundled using the ``bundling`` property. Default: - nothing is excluded
|
|
22257
|
+
:param follow_symlinks: A strategy for how to handle symlinks. Default: SymlinkFollowMode.NEVER
|
|
22258
|
+
:param ignore_mode: The ignore behavior to use for ``exclude`` patterns. Default: IgnoreMode.GLOB
|
|
22259
|
+
'''
|
|
22260
|
+
if __debug__:
|
|
22261
|
+
type_hints = typing.get_type_hints(_typecheckingstub__62441d3d3228ae5fb69aaca12e603944f07f9335dae80f70ce3b04e8e353f020)
|
|
22262
|
+
check_type(argname="argument path", value=path, expected_type=type_hints["path"])
|
|
22263
|
+
options = _AssetOptions_2aa69621(
|
|
22264
|
+
deploy_time=deploy_time,
|
|
22265
|
+
readers=readers,
|
|
22266
|
+
asset_hash=asset_hash,
|
|
22267
|
+
asset_hash_type=asset_hash_type,
|
|
22268
|
+
bundling=bundling,
|
|
22269
|
+
exclude=exclude,
|
|
22270
|
+
follow_symlinks=follow_symlinks,
|
|
22271
|
+
ignore_mode=ignore_mode,
|
|
22272
|
+
)
|
|
22273
|
+
|
|
22274
|
+
jsii.create(self.__class__, self, [path, options])
|
|
22275
|
+
|
|
22276
|
+
@builtins.property
|
|
22277
|
+
@jsii.member(jsii_name="path")
|
|
22278
|
+
def path(self) -> builtins.str:
|
|
22279
|
+
'''the path to the local file.'''
|
|
22280
|
+
return typing.cast(builtins.str, jsii.get(self, "path"))
|
|
22281
|
+
|
|
22282
|
+
|
|
21585
22283
|
@jsii.implements(ICachePolicy)
|
|
21586
22284
|
class CachePolicy(
|
|
21587
22285
|
_Resource_45bc6135,
|
|
@@ -21929,18 +22627,20 @@ class Distribution(
|
|
|
21929
22627
|
|
|
21930
22628
|
Example::
|
|
21931
22629
|
|
|
22630
|
+
# Adding an existing Lambda@Edge function created in a different stack
|
|
22631
|
+
# to a CloudFront distribution.
|
|
21932
22632
|
# s3_bucket: s3.Bucket
|
|
21933
|
-
|
|
21934
|
-
|
|
21935
|
-
|
|
21936
|
-
)
|
|
22633
|
+
|
|
22634
|
+
function_version = lambda_.Version.from_version_arn(self, "Version", "arn:aws:lambda:us-east-1:123456789012:function:functionName:1")
|
|
22635
|
+
|
|
21937
22636
|
cloudfront.Distribution(self, "distro",
|
|
21938
22637
|
default_behavior=cloudfront.BehaviorOptions(
|
|
21939
22638
|
origin=origins.S3Origin(s3_bucket),
|
|
21940
|
-
|
|
21941
|
-
|
|
21942
|
-
event_type=cloudfront.
|
|
21943
|
-
)
|
|
22639
|
+
edge_lambdas=[cloudfront.EdgeLambda(
|
|
22640
|
+
function_version=function_version,
|
|
22641
|
+
event_type=cloudfront.LambdaEdgeEventType.VIEWER_REQUEST
|
|
22642
|
+
)
|
|
22643
|
+
]
|
|
21944
22644
|
)
|
|
21945
22645
|
)
|
|
21946
22646
|
'''
|
|
@@ -22171,7 +22871,8 @@ class Function(
|
|
|
22171
22871
|
# s3_bucket: s3.Bucket
|
|
22172
22872
|
# Add a cloudfront Function to a Distribution
|
|
22173
22873
|
cf_function = cloudfront.Function(self, "Function",
|
|
22174
|
-
code=cloudfront.FunctionCode.from_inline("function handler(event) { return event.request }")
|
|
22874
|
+
code=cloudfront.FunctionCode.from_inline("function handler(event) { return event.request }"),
|
|
22875
|
+
runtime=cloudfront.FunctionRuntime.JS_2_0
|
|
22175
22876
|
)
|
|
22176
22877
|
cloudfront.Distribution(self, "distro",
|
|
22177
22878
|
default_behavior=cloudfront.BehaviorOptions(
|
|
@@ -22192,6 +22893,7 @@ class Function(
|
|
|
22192
22893
|
code: FunctionCode,
|
|
22193
22894
|
comment: typing.Optional[builtins.str] = None,
|
|
22194
22895
|
function_name: typing.Optional[builtins.str] = None,
|
|
22896
|
+
runtime: typing.Optional[FunctionRuntime] = None,
|
|
22195
22897
|
) -> None:
|
|
22196
22898
|
'''
|
|
22197
22899
|
:param scope: -
|
|
@@ -22199,12 +22901,15 @@ class Function(
|
|
|
22199
22901
|
:param code: The source code of the function.
|
|
22200
22902
|
:param comment: A comment to describe the function. Default: - same as ``functionName``
|
|
22201
22903
|
:param function_name: A name to identify the function. Default: - generated from the ``id``
|
|
22904
|
+
:param runtime: The runtime environment for the function. Default: FunctionRuntime.JS_1_0
|
|
22202
22905
|
'''
|
|
22203
22906
|
if __debug__:
|
|
22204
22907
|
type_hints = typing.get_type_hints(_typecheckingstub__036fe4f21793a85724c37ca1ffc5912522571664ab980383ee3babc485339b2e)
|
|
22205
22908
|
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
22206
22909
|
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
22207
|
-
props = FunctionProps(
|
|
22910
|
+
props = FunctionProps(
|
|
22911
|
+
code=code, comment=comment, function_name=function_name, runtime=runtime
|
|
22912
|
+
)
|
|
22208
22913
|
|
|
22209
22914
|
jsii.create(self.__class__, self, [scope, id, props])
|
|
22210
22915
|
|
|
@@ -22217,6 +22922,7 @@ class Function(
|
|
|
22217
22922
|
*,
|
|
22218
22923
|
function_arn: builtins.str,
|
|
22219
22924
|
function_name: builtins.str,
|
|
22925
|
+
function_runtime: typing.Optional[builtins.str] = None,
|
|
22220
22926
|
) -> IFunction:
|
|
22221
22927
|
'''Imports a function by its name and ARN.
|
|
22222
22928
|
|
|
@@ -22224,13 +22930,16 @@ class Function(
|
|
|
22224
22930
|
:param id: -
|
|
22225
22931
|
:param function_arn: The ARN of the function.
|
|
22226
22932
|
:param function_name: The name of the function.
|
|
22933
|
+
:param function_runtime: The Runtime of the function. Default: FunctionRuntime.JS_1_0
|
|
22227
22934
|
'''
|
|
22228
22935
|
if __debug__:
|
|
22229
22936
|
type_hints = typing.get_type_hints(_typecheckingstub__5989cbf7079014eacde0ab3a45d42fc3fb56a2cf17ecfbacd7bc46da0a11701d)
|
|
22230
22937
|
check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
|
|
22231
22938
|
check_type(argname="argument id", value=id, expected_type=type_hints["id"])
|
|
22232
22939
|
attrs = FunctionAttributes(
|
|
22233
|
-
function_arn=function_arn,
|
|
22940
|
+
function_arn=function_arn,
|
|
22941
|
+
function_name=function_name,
|
|
22942
|
+
function_runtime=function_runtime,
|
|
22234
22943
|
)
|
|
22235
22944
|
|
|
22236
22945
|
return typing.cast(IFunction, jsii.sinvoke(cls, "fromFunctionAttributes", [scope, id, attrs]))
|
|
@@ -22253,6 +22962,15 @@ class Function(
|
|
|
22253
22962
|
'''
|
|
22254
22963
|
return typing.cast(builtins.str, jsii.get(self, "functionName"))
|
|
22255
22964
|
|
|
22965
|
+
@builtins.property
|
|
22966
|
+
@jsii.member(jsii_name="functionRuntime")
|
|
22967
|
+
def function_runtime(self) -> builtins.str:
|
|
22968
|
+
'''the runtime of the CloudFront function.
|
|
22969
|
+
|
|
22970
|
+
:attribute: true
|
|
22971
|
+
'''
|
|
22972
|
+
return typing.cast(builtins.str, jsii.get(self, "functionRuntime"))
|
|
22973
|
+
|
|
22256
22974
|
@builtins.property
|
|
22257
22975
|
@jsii.member(jsii_name="functionStage")
|
|
22258
22976
|
def function_stage(self) -> builtins.str:
|
|
@@ -22266,6 +22984,7 @@ class Function(
|
|
|
22266
22984
|
__all__ = [
|
|
22267
22985
|
"AddBehaviorOptions",
|
|
22268
22986
|
"AllowedMethods",
|
|
22987
|
+
"AssetImportSource",
|
|
22269
22988
|
"Behavior",
|
|
22270
22989
|
"BehaviorOptions",
|
|
22271
22990
|
"CacheCookieBehavior",
|
|
@@ -22322,6 +23041,7 @@ __all__ = [
|
|
|
22322
23041
|
"FunctionCode",
|
|
22323
23042
|
"FunctionEventType",
|
|
22324
23043
|
"FunctionProps",
|
|
23044
|
+
"FunctionRuntime",
|
|
22325
23045
|
"GeoRestriction",
|
|
22326
23046
|
"HeadersFrameOption",
|
|
22327
23047
|
"HeadersReferrerPolicy",
|
|
@@ -22330,14 +23050,18 @@ __all__ = [
|
|
|
22330
23050
|
"IDistribution",
|
|
22331
23051
|
"IFunction",
|
|
22332
23052
|
"IKeyGroup",
|
|
23053
|
+
"IKeyValueStore",
|
|
22333
23054
|
"IOrigin",
|
|
22334
23055
|
"IOriginAccessIdentity",
|
|
22335
23056
|
"IOriginRequestPolicy",
|
|
22336
23057
|
"IPublicKey",
|
|
22337
23058
|
"IRealtimeLogConfig",
|
|
22338
23059
|
"IResponseHeadersPolicy",
|
|
23060
|
+
"ImportSource",
|
|
22339
23061
|
"KeyGroup",
|
|
22340
23062
|
"KeyGroupProps",
|
|
23063
|
+
"KeyValueStore",
|
|
23064
|
+
"KeyValueStoreProps",
|
|
22341
23065
|
"LambdaEdgeEventType",
|
|
22342
23066
|
"LambdaFunctionAssociation",
|
|
22343
23067
|
"LoggingConfiguration",
|
|
@@ -22373,6 +23097,7 @@ __all__ = [
|
|
|
22373
23097
|
"ResponseHeadersStrictTransportSecurity",
|
|
22374
23098
|
"ResponseHeadersXSSProtection",
|
|
22375
23099
|
"ResponseSecurityHeadersBehavior",
|
|
23100
|
+
"S3ImportSource",
|
|
22376
23101
|
"S3OriginConfig",
|
|
22377
23102
|
"SSLMethod",
|
|
22378
23103
|
"SecurityPolicyProtocol",
|
|
@@ -23084,6 +23809,7 @@ def _typecheckingstub__e34db5cf326a0cd47f00dc35b60e1fbde4ec723cb88839d6517801268
|
|
|
23084
23809
|
*,
|
|
23085
23810
|
comment: builtins.str,
|
|
23086
23811
|
runtime: builtins.str,
|
|
23812
|
+
key_value_store_associations: typing.Optional[typing.Union[_IResolvable_da3f097b, typing.Sequence[typing.Union[_IResolvable_da3f097b, typing.Union[CfnFunction.KeyValueStoreAssociationProperty, typing.Dict[builtins.str, typing.Any]]]]]] = None,
|
|
23087
23813
|
) -> None:
|
|
23088
23814
|
"""Type checking stubs"""
|
|
23089
23815
|
pass
|
|
@@ -23095,6 +23821,13 @@ def _typecheckingstub__4371917f1ba460651436f0ac35c2459332e11b39c45862ccbe97c6bd6
|
|
|
23095
23821
|
"""Type checking stubs"""
|
|
23096
23822
|
pass
|
|
23097
23823
|
|
|
23824
|
+
def _typecheckingstub__a7d3d29786c9dae5b37c513099f68b7af9dbc6d9fae4e0cbdcb48e77b4e6f592(
|
|
23825
|
+
*,
|
|
23826
|
+
key_value_store_arn: builtins.str,
|
|
23827
|
+
) -> None:
|
|
23828
|
+
"""Type checking stubs"""
|
|
23829
|
+
pass
|
|
23830
|
+
|
|
23098
23831
|
def _typecheckingstub__8288752acdcd70ed40eb65e878d490645ed376ded173a5c2d02caa4e1e180024(
|
|
23099
23832
|
*,
|
|
23100
23833
|
function_code: builtins.str,
|
|
@@ -23885,6 +24618,7 @@ def _typecheckingstub__903bbff401b8a2560d333137b7ac614ba7cdaa77d8d3034c4d8a9e13d
|
|
|
23885
24618
|
*,
|
|
23886
24619
|
function_arn: builtins.str,
|
|
23887
24620
|
function_name: builtins.str,
|
|
24621
|
+
function_runtime: typing.Optional[builtins.str] = None,
|
|
23888
24622
|
) -> None:
|
|
23889
24623
|
"""Type checking stubs"""
|
|
23890
24624
|
pass
|
|
@@ -23900,6 +24634,13 @@ def _typecheckingstub__8243b62a44e046850892a519da42366ef0e5b346474e3be3ebcb455dd
|
|
|
23900
24634
|
code: FunctionCode,
|
|
23901
24635
|
comment: typing.Optional[builtins.str] = None,
|
|
23902
24636
|
function_name: typing.Optional[builtins.str] = None,
|
|
24637
|
+
runtime: typing.Optional[FunctionRuntime] = None,
|
|
24638
|
+
) -> None:
|
|
24639
|
+
"""Type checking stubs"""
|
|
24640
|
+
pass
|
|
24641
|
+
|
|
24642
|
+
def _typecheckingstub__631c8d0b51cac2d9ffcbfad4bfbcc5e76ea97cde669fb05e21ba361b851513db(
|
|
24643
|
+
runtime_string: builtins.str,
|
|
23903
24644
|
) -> None:
|
|
23904
24645
|
"""Type checking stubs"""
|
|
23905
24646
|
pass
|
|
@@ -23937,6 +24678,28 @@ def _typecheckingstub__88031486a507fddae1a9cd6ed970521f2a57d7953a1e564c2c5d97b85
|
|
|
23937
24678
|
"""Type checking stubs"""
|
|
23938
24679
|
pass
|
|
23939
24680
|
|
|
24681
|
+
def _typecheckingstub__f5d4750ca4d7703f815ca46be8b91e46ea0b813f42846026dff63e00f3b01302(
|
|
24682
|
+
path: builtins.str,
|
|
24683
|
+
*,
|
|
24684
|
+
deploy_time: typing.Optional[builtins.bool] = None,
|
|
24685
|
+
readers: typing.Optional[typing.Sequence[_IGrantable_71c4f5de]] = None,
|
|
24686
|
+
asset_hash: typing.Optional[builtins.str] = None,
|
|
24687
|
+
asset_hash_type: typing.Optional[_AssetHashType_05b67f2d] = None,
|
|
24688
|
+
bundling: typing.Optional[typing.Union[_BundlingOptions_588cc936, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
24689
|
+
exclude: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
24690
|
+
follow_symlinks: typing.Optional[_SymlinkFollowMode_047ec1f6] = None,
|
|
24691
|
+
ignore_mode: typing.Optional[_IgnoreMode_655a98e8] = None,
|
|
24692
|
+
) -> None:
|
|
24693
|
+
"""Type checking stubs"""
|
|
24694
|
+
pass
|
|
24695
|
+
|
|
24696
|
+
def _typecheckingstub__199a9d2f509e6bf2ce32ccd58ce284ca48a05841123773473504a43c39588730(
|
|
24697
|
+
bucket: _IBucket_42e086fd,
|
|
24698
|
+
key: builtins.str,
|
|
24699
|
+
) -> None:
|
|
24700
|
+
"""Type checking stubs"""
|
|
24701
|
+
pass
|
|
24702
|
+
|
|
23940
24703
|
def _typecheckingstub__8c6747d6cf01bdf872790a9315f48bb3e3363e1c57d3a822e5cf812d017c9661(
|
|
23941
24704
|
scope: _constructs_77d1e7e8.Construct,
|
|
23942
24705
|
id: builtins.str,
|
|
@@ -23965,6 +24728,34 @@ def _typecheckingstub__8c42362898414602d0064aac5432fc41cadd378821fd0d3ec155f7a75
|
|
|
23965
24728
|
"""Type checking stubs"""
|
|
23966
24729
|
pass
|
|
23967
24730
|
|
|
24731
|
+
def _typecheckingstub__fbcb7711d84a000f571b2303bf96f7a4319741a396d620e3f2c749be479fdde1(
|
|
24732
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
24733
|
+
id: builtins.str,
|
|
24734
|
+
*,
|
|
24735
|
+
comment: typing.Optional[builtins.str] = None,
|
|
24736
|
+
key_value_store_name: typing.Optional[builtins.str] = None,
|
|
24737
|
+
source: typing.Optional[ImportSource] = None,
|
|
24738
|
+
) -> None:
|
|
24739
|
+
"""Type checking stubs"""
|
|
24740
|
+
pass
|
|
24741
|
+
|
|
24742
|
+
def _typecheckingstub__6286cfc55d9b5b70d728248f5d869f6b99814bbec3d61416b9ff28849cdca011(
|
|
24743
|
+
scope: _constructs_77d1e7e8.Construct,
|
|
24744
|
+
id: builtins.str,
|
|
24745
|
+
key_value_store_arn: builtins.str,
|
|
24746
|
+
) -> None:
|
|
24747
|
+
"""Type checking stubs"""
|
|
24748
|
+
pass
|
|
24749
|
+
|
|
24750
|
+
def _typecheckingstub__0885cf023551545b14a4696bf116b851a0c7733cc2987782ba95a29b134a062e(
|
|
24751
|
+
*,
|
|
24752
|
+
comment: typing.Optional[builtins.str] = None,
|
|
24753
|
+
key_value_store_name: typing.Optional[builtins.str] = None,
|
|
24754
|
+
source: typing.Optional[ImportSource] = None,
|
|
24755
|
+
) -> None:
|
|
24756
|
+
"""Type checking stubs"""
|
|
24757
|
+
pass
|
|
24758
|
+
|
|
23968
24759
|
def _typecheckingstub__1cc70f1ca9c8fff5a72f34c1e001c9ece45f76199d1574048a6ec3fa44fbba48(
|
|
23969
24760
|
*,
|
|
23970
24761
|
event_type: LambdaEdgeEventType,
|
|
@@ -24337,6 +25128,13 @@ def _typecheckingstub__fb11968ba35df78b776ef4a98fdb6f7be69c1246b510ef919ab61befd
|
|
|
24337
25128
|
"""Type checking stubs"""
|
|
24338
25129
|
pass
|
|
24339
25130
|
|
|
25131
|
+
def _typecheckingstub__50b2e52880076ae956da5eb2d05fa8de1161eb1b2df762d8dafbf8e6bbfa4639(
|
|
25132
|
+
bucket: _IBucket_42e086fd,
|
|
25133
|
+
key: builtins.str,
|
|
25134
|
+
) -> None:
|
|
25135
|
+
"""Type checking stubs"""
|
|
25136
|
+
pass
|
|
25137
|
+
|
|
24340
25138
|
def _typecheckingstub__e5837aa017bcf235e169321284a6cfe3cd3ac7b3c0baef0d9b68b55e8da518be(
|
|
24341
25139
|
*,
|
|
24342
25140
|
s3_bucket_source: _IBucket_42e086fd,
|
|
@@ -24398,6 +25196,21 @@ def _typecheckingstub__d1fca8e67199164c4d795df93e2e45befd6c6e688025259d033408b16
|
|
|
24398
25196
|
"""Type checking stubs"""
|
|
24399
25197
|
pass
|
|
24400
25198
|
|
|
25199
|
+
def _typecheckingstub__62441d3d3228ae5fb69aaca12e603944f07f9335dae80f70ce3b04e8e353f020(
|
|
25200
|
+
path: builtins.str,
|
|
25201
|
+
*,
|
|
25202
|
+
deploy_time: typing.Optional[builtins.bool] = None,
|
|
25203
|
+
readers: typing.Optional[typing.Sequence[_IGrantable_71c4f5de]] = None,
|
|
25204
|
+
asset_hash: typing.Optional[builtins.str] = None,
|
|
25205
|
+
asset_hash_type: typing.Optional[_AssetHashType_05b67f2d] = None,
|
|
25206
|
+
bundling: typing.Optional[typing.Union[_BundlingOptions_588cc936, typing.Dict[builtins.str, typing.Any]]] = None,
|
|
25207
|
+
exclude: typing.Optional[typing.Sequence[builtins.str]] = None,
|
|
25208
|
+
follow_symlinks: typing.Optional[_SymlinkFollowMode_047ec1f6] = None,
|
|
25209
|
+
ignore_mode: typing.Optional[_IgnoreMode_655a98e8] = None,
|
|
25210
|
+
) -> None:
|
|
25211
|
+
"""Type checking stubs"""
|
|
25212
|
+
pass
|
|
25213
|
+
|
|
24401
25214
|
def _typecheckingstub__c8a9474ce476b57ed85f97b060b559f6bc96bb0780255754efa416b3f31f18e5(
|
|
24402
25215
|
scope: _constructs_77d1e7e8.Construct,
|
|
24403
25216
|
id: builtins.str,
|
|
@@ -24545,6 +25358,7 @@ def _typecheckingstub__036fe4f21793a85724c37ca1ffc5912522571664ab980383ee3babc48
|
|
|
24545
25358
|
code: FunctionCode,
|
|
24546
25359
|
comment: typing.Optional[builtins.str] = None,
|
|
24547
25360
|
function_name: typing.Optional[builtins.str] = None,
|
|
25361
|
+
runtime: typing.Optional[FunctionRuntime] = None,
|
|
24548
25362
|
) -> None:
|
|
24549
25363
|
"""Type checking stubs"""
|
|
24550
25364
|
pass
|
|
@@ -24555,6 +25369,7 @@ def _typecheckingstub__5989cbf7079014eacde0ab3a45d42fc3fb56a2cf17ecfbacd7bc46da0
|
|
|
24555
25369
|
*,
|
|
24556
25370
|
function_arn: builtins.str,
|
|
24557
25371
|
function_name: builtins.str,
|
|
25372
|
+
function_runtime: typing.Optional[builtins.str] = None,
|
|
24558
25373
|
) -> None:
|
|
24559
25374
|
"""Type checking stubs"""
|
|
24560
25375
|
pass
|