aws-cdk-lib 2.178.1__py3-none-any.whl → 2.179.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 (34) hide show
  1. aws_cdk/__init__.py +69 -35
  2. aws_cdk/_jsii/__init__.py +1 -2
  3. aws_cdk/_jsii/{aws-cdk-lib@2.178.1.jsii.tgz → aws-cdk-lib@2.179.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_apigateway/__init__.py +170 -29
  5. aws_cdk/aws_apigatewayv2/__init__.py +151 -32
  6. aws_cdk/aws_apigatewayv2_integrations/__init__.py +348 -0
  7. aws_cdk/aws_applicationautoscaling/__init__.py +8 -8
  8. aws_cdk/aws_appsync/__init__.py +6 -4
  9. aws_cdk/aws_cloudfront/__init__.py +5 -5
  10. aws_cdk/aws_codebuild/__init__.py +216 -0
  11. aws_cdk/aws_codepipeline/__init__.py +89 -28
  12. aws_cdk/aws_codepipeline_actions/__init__.py +526 -62
  13. aws_cdk/aws_cognito/__init__.py +676 -20
  14. aws_cdk/aws_ec2/__init__.py +25 -9
  15. aws_cdk/aws_ecs/__init__.py +8 -8
  16. aws_cdk/aws_eks/__init__.py +555 -179
  17. aws_cdk/aws_elasticloadbalancingv2/__init__.py +99 -0
  18. aws_cdk/aws_events/__init__.py +9 -15
  19. aws_cdk/aws_events_targets/__init__.py +303 -16
  20. aws_cdk/aws_iam/__init__.py +3 -3
  21. aws_cdk/aws_ivs/__init__.py +241 -73
  22. aws_cdk/aws_logs/__init__.py +62 -13
  23. aws_cdk/aws_pinpoint/__init__.py +14 -9
  24. aws_cdk/aws_rds/__init__.py +168 -24
  25. aws_cdk/aws_s3/__init__.py +9 -9
  26. aws_cdk/aws_stepfunctions_tasks/__init__.py +127 -21
  27. aws_cdk/pipelines/__init__.py +2 -2
  28. {aws_cdk_lib-2.178.1.dist-info → aws_cdk_lib-2.179.0.dist-info}/METADATA +1 -2
  29. {aws_cdk_lib-2.178.1.dist-info → aws_cdk_lib-2.179.0.dist-info}/RECORD +33 -34
  30. aws_cdk/lambda_layer_kubectl/__init__.py +0 -107
  31. {aws_cdk_lib-2.178.1.dist-info → aws_cdk_lib-2.179.0.dist-info}/LICENSE +0 -0
  32. {aws_cdk_lib-2.178.1.dist-info → aws_cdk_lib-2.179.0.dist-info}/NOTICE +0 -0
  33. {aws_cdk_lib-2.178.1.dist-info → aws_cdk_lib-2.179.0.dist-info}/WHEEL +0 -0
  34. {aws_cdk_lib-2.178.1.dist-info → aws_cdk_lib-2.179.0.dist-info}/top_level.txt +0 -0
aws_cdk/__init__.py CHANGED
@@ -12975,17 +12975,16 @@ class Duration(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.Duration"):
12975
12975
  schedule=events.Schedule.rate(cdk.Duration.hours(1))
12976
12976
  )
12977
12977
 
12978
- rule.add_target(
12979
- targets.EcsTask(
12980
- cluster=cluster,
12981
- task_definition=task_definition,
12982
- propagate_tags=ecs.PropagatedTagSource.TASK_DEFINITION,
12983
- tags=[targets.Tag(
12984
- key="my-tag",
12985
- value="my-tag-value"
12986
- )
12987
- ]
12988
- ))
12978
+ rule.add_target(targets.EcsTask(
12979
+ cluster=cluster,
12980
+ task_definition=task_definition,
12981
+ task_count=1,
12982
+ container_overrides=[targets.ContainerOverride(
12983
+ container_name="TheContainer",
12984
+ command=["echo", events.EventField.from_path("$.detail.event")]
12985
+ )],
12986
+ enable_execute_command=True
12987
+ ))
12989
12988
  '''
12990
12989
 
12991
12990
  @jsii.member(jsii_name="days")
@@ -13386,6 +13385,34 @@ class Errors(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.Errors"):
13386
13385
  def __init__(self) -> None:
13387
13386
  jsii.create(self.__class__, self, [])
13388
13387
 
13388
+ @jsii.member(jsii_name="isAssertionError")
13389
+ @builtins.classmethod
13390
+ def is_assertion_error(cls, x: typing.Any) -> builtins.bool:
13391
+ '''Test whether the given error is a AssertionError.
13392
+
13393
+ An AssertionError is thrown when an assertion fails.
13394
+
13395
+ :param x: -
13396
+ '''
13397
+ if __debug__:
13398
+ type_hints = typing.get_type_hints(_typecheckingstub__4b06766267738419297aaf93a2368e0c38c274adc14053ce29fd653d61c4cef4)
13399
+ check_type(argname="argument x", value=x, expected_type=type_hints["x"])
13400
+ return typing.cast(builtins.bool, jsii.sinvoke(cls, "isAssertionError", [x]))
13401
+
13402
+ @jsii.member(jsii_name="isCloudAssemblyError")
13403
+ @builtins.classmethod
13404
+ def is_cloud_assembly_error(cls, x: typing.Any) -> builtins.bool:
13405
+ '''Test whether the given error is a CloudAssemblyError.
13406
+
13407
+ A CloudAssemblyError is thrown for unexpected problems with the synthesized assembly.
13408
+
13409
+ :param x: -
13410
+ '''
13411
+ if __debug__:
13412
+ type_hints = typing.get_type_hints(_typecheckingstub__1cadecf7c75d3f55ff2fcddf8a0d000d9f8e54b48218f1336d97358901d38c0b)
13413
+ check_type(argname="argument x", value=x, expected_type=type_hints["x"])
13414
+ return typing.cast(builtins.bool, jsii.sinvoke(cls, "isCloudAssemblyError", [x]))
13415
+
13389
13416
  @jsii.member(jsii_name="isConstructError")
13390
13417
  @builtins.classmethod
13391
13418
  def is_construct_error(cls, x: typing.Any) -> builtins.bool:
@@ -20389,27 +20416,24 @@ class Size(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.Size"):
20389
20416
 
20390
20417
  Example::
20391
20418
 
20392
- multi_node_job = batch.MultiNodeJobDefinition(self, "JobDefinition",
20393
- instance_type=ec2.InstanceType.of(ec2.InstanceClass.R4, ec2.InstanceSize.LARGE), # optional, omit to let Batch choose the type for you
20394
- containers=[batch.MultiNodeContainer(
20395
- container=batch.EcsEc2ContainerDefinition(self, "mainMPIContainer",
20396
- image=ecs.ContainerImage.from_registry("yourregsitry.com/yourMPIImage:latest"),
20397
- cpu=256,
20398
- memory=cdk.Size.mebibytes(2048)
20399
- ),
20400
- start_node=0,
20401
- end_node=5
20402
- )]
20419
+ # bucket: s3.Bucket
20420
+ # Provide a Lambda function that will transform records before delivery, with custom
20421
+ # buffering and retry configuration
20422
+ lambda_function = lambda_.Function(self, "Processor",
20423
+ runtime=lambda_.Runtime.NODEJS_LATEST,
20424
+ handler="index.handler",
20425
+ code=lambda_.Code.from_asset(path.join(__dirname, "process-records"))
20403
20426
  )
20404
- # convenience method
20405
- multi_node_job.add_container(
20406
- start_node=6,
20407
- end_node=10,
20408
- container=batch.EcsEc2ContainerDefinition(self, "multiContainer",
20409
- image=ecs.ContainerImage.from_registry("amazon/amazon-ecs-sample"),
20410
- cpu=256,
20411
- memory=cdk.Size.mebibytes(2048)
20412
- )
20427
+ lambda_processor = firehose.LambdaFunctionProcessor(lambda_function,
20428
+ buffer_interval=Duration.minutes(5),
20429
+ buffer_size=Size.mebibytes(5),
20430
+ retries=5
20431
+ )
20432
+ s3_destination = firehose.S3Bucket(bucket,
20433
+ processor=lambda_processor
20434
+ )
20435
+ firehose.DeliveryStream(self, "Delivery Stream",
20436
+ destination=s3_destination
20413
20437
  )
20414
20438
  '''
20415
20439
 
@@ -21221,9 +21245,9 @@ class Stack(
21221
21245
  check that it is a concrete value an not an unresolved token. If this
21222
21246
  value is an unresolved token (``Token.isUnresolved(stack.account)`` returns
21223
21247
  ``true``), this implies that the user wishes that this stack will synthesize
21224
- into a **account-agnostic template**. In this case, your code should either
21248
+ into an **account-agnostic template**. In this case, your code should either
21225
21249
  fail (throw an error, emit a synth error using ``Annotations.of(construct).addError()``) or
21226
- implement some other region-agnostic behavior.
21250
+ implement some other account-agnostic behavior.
21227
21251
  '''
21228
21252
  return typing.cast(builtins.str, jsii.get(self, "account"))
21229
21253
 
@@ -36548,7 +36572,6 @@ __all__ = [
36548
36572
  "custom_resources",
36549
36573
  "cx_api",
36550
36574
  "lambda_layer_awscli",
36551
- "lambda_layer_kubectl",
36552
36575
  "lambda_layer_node_proxy_agent",
36553
36576
  "pipelines",
36554
36577
  "region_info",
@@ -36842,7 +36865,6 @@ from . import cloudformation_include
36842
36865
  from . import custom_resources
36843
36866
  from . import cx_api
36844
36867
  from . import lambda_layer_awscli
36845
- from . import lambda_layer_kubectl
36846
36868
  from . import lambda_layer_node_proxy_agent
36847
36869
  from . import pipelines
36848
36870
  from . import region_info
@@ -38174,6 +38196,18 @@ def _typecheckingstub__779551ef0a4b144070fd2c3e88ff076e32ad12d30facdc65a940b7a87
38174
38196
  """Type checking stubs"""
38175
38197
  pass
38176
38198
 
38199
+ def _typecheckingstub__4b06766267738419297aaf93a2368e0c38c274adc14053ce29fd653d61c4cef4(
38200
+ x: typing.Any,
38201
+ ) -> None:
38202
+ """Type checking stubs"""
38203
+ pass
38204
+
38205
+ def _typecheckingstub__1cadecf7c75d3f55ff2fcddf8a0d000d9f8e54b48218f1336d97358901d38c0b(
38206
+ x: typing.Any,
38207
+ ) -> None:
38208
+ """Type checking stubs"""
38209
+ pass
38210
+
38177
38211
  def _typecheckingstub__0c62bc5a6fe032556ae3c32e105ddaad3f4ca89286fd26884af6347d3364c5ae(
38178
38212
  x: typing.Any,
38179
38213
  ) -> None:
aws_cdk/_jsii/__init__.py CHANGED
@@ -29,13 +29,12 @@ def check_type(argname: str, value: object, expected_type: typing.Any) -> typing
29
29
  typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore
30
30
 
31
31
  import aws_cdk.asset_awscli_v1._jsii
32
- import aws_cdk.asset_kubectl_v20._jsii
33
32
  import aws_cdk.asset_node_proxy_agent_v6._jsii
34
33
  import aws_cdk.cloud_assembly_schema._jsii
35
34
  import constructs._jsii
36
35
 
37
36
  __jsii_assembly__ = jsii.JSIIAssembly.load(
38
- "aws-cdk-lib", "2.178.1", __name__[0:-6], "aws-cdk-lib@2.178.1.jsii.tgz"
37
+ "aws-cdk-lib", "2.179.0", __name__[0:-6], "aws-cdk-lib@2.179.0.jsii.tgz"
39
38
  )
40
39
 
41
40
  __all__ = [
@@ -591,7 +591,7 @@ The following example shows how to use a rate limited api key :
591
591
 
592
592
  key = apigateway.RateLimitedApiKey(self, "rate-limited-api-key",
593
593
  customer_id="hello-customer",
594
- stages=[api.deployment_stage],
594
+ api_stages=[apigateway.UsagePlanPerApiStage(stage=api.deployment_stage)],
595
595
  quota=apigateway.QuotaSettings(
596
596
  limit=10000,
597
597
  period=apigateway.Period.MONTH
@@ -1684,6 +1684,21 @@ By performing this association, we can invoke the API gateway using the followin
1684
1684
  https://{rest-api-id}-{vpce-id}.execute-api.{region}.amazonaws.com/{stage}
1685
1685
  ```
1686
1686
 
1687
+ To restrict access to the API Gateway to only the VPC endpoint, you can use the `grantInvokeFromVpcEndpointsOnly` method to [add resource policies](https://docs.aws.amazon.com/apigateway/latest/developerguide/private-api-tutorial.html#private-api-tutorial-attach-resource-policy) to the API Gateway:
1688
+
1689
+ ```python
1690
+ # api_gw_vpc_endpoint: ec2.IVpcEndpoint
1691
+
1692
+
1693
+ api = apigateway.RestApi(self, "PrivateApi",
1694
+ endpoint_configuration=apigateway.EndpointConfiguration(
1695
+ types=[apigateway.EndpointType.PRIVATE],
1696
+ vpc_endpoints=[api_gw_vpc_endpoint]
1697
+ )
1698
+ )
1699
+ api.grant_invoke_from_vpc_endpoints_only([api_gw_vpc_endpoint])
1700
+ ```
1701
+
1687
1702
  ## Private Integrations
1688
1703
 
1689
1704
  A private integration makes it simple to expose HTTP/HTTPS resources behind an
@@ -1912,10 +1927,13 @@ from ..aws_elasticloadbalancingv2 import (
1912
1927
  INetworkLoadBalancer as _INetworkLoadBalancer_96e17101
1913
1928
  )
1914
1929
  from ..aws_iam import (
1930
+ AddToResourcePolicyResult as _AddToResourcePolicyResult_1d0a53ad,
1915
1931
  Grant as _Grant_a7ae64f8,
1916
1932
  IGrantable as _IGrantable_71c4f5de,
1933
+ IResourceWithPolicy as _IResourceWithPolicy_720d64fc,
1917
1934
  IRole as _IRole_235f5d8e,
1918
1935
  PolicyDocument as _PolicyDocument_3ac34393,
1936
+ PolicyStatement as _PolicyStatement_0fe33853,
1919
1937
  )
1920
1938
  from ..aws_kinesisfirehose import CfnDeliveryStream as _CfnDeliveryStream_8f3b1735
1921
1939
  from ..aws_kms import IKey as _IKey_5f11635f
@@ -15664,9 +15682,13 @@ class EndpointConfiguration:
15664
15682
 
15665
15683
  Example::
15666
15684
 
15685
+ # some_endpoint: ec2.IVpcEndpoint
15686
+
15687
+
15667
15688
  api = apigateway.RestApi(self, "api",
15668
15689
  endpoint_configuration=apigateway.EndpointConfiguration(
15669
- types=[apigateway.EndpointType.EDGE]
15690
+ types=[apigateway.EndpointType.PRIVATE],
15691
+ vpc_endpoints=[some_endpoint]
15670
15692
  )
15671
15693
  )
15672
15694
  '''
@@ -15718,12 +15740,14 @@ class EndpointType(enum.Enum):
15718
15740
 
15719
15741
  Example::
15720
15742
 
15721
- # api_definition: apigateway.ApiDefinition
15743
+ # some_endpoint: ec2.IVpcEndpoint
15722
15744
 
15723
15745
 
15724
- api = apigateway.SpecRestApi(self, "ExampleRestApi",
15725
- api_definition=api_definition,
15726
- endpoint_types=[apigateway.EndpointType.PRIVATE]
15746
+ api = apigateway.RestApi(self, "api",
15747
+ endpoint_configuration=apigateway.EndpointConfiguration(
15748
+ types=[apigateway.EndpointType.PRIVATE],
15749
+ vpc_endpoints=[some_endpoint]
15750
+ )
15727
15751
  )
15728
15752
  '''
15729
15753
 
@@ -21470,7 +21494,7 @@ class Period(enum.Enum):
21470
21494
 
21471
21495
  key = apigateway.RateLimitedApiKey(self, "rate-limited-api-key",
21472
21496
  customer_id="hello-customer",
21473
- stages=[api.deployment_stage],
21497
+ api_stages=[apigateway.UsagePlanPerApiStage(stage=api.deployment_stage)],
21474
21498
  quota=apigateway.QuotaSettings(
21475
21499
  limit=10000,
21476
21500
  period=apigateway.Period.MONTH
@@ -21511,7 +21535,7 @@ class QuotaSettings:
21511
21535
 
21512
21536
  key = apigateway.RateLimitedApiKey(self, "rate-limited-api-key",
21513
21537
  customer_id="hello-customer",
21514
- stages=[api.deployment_stage],
21538
+ api_stages=[apigateway.UsagePlanPerApiStage(stage=api.deployment_stage)],
21515
21539
  quota=apigateway.QuotaSettings(
21516
21540
  limit=10000,
21517
21541
  period=apigateway.Period.MONTH
@@ -21588,7 +21612,7 @@ class RateLimitedApiKey(
21588
21612
 
21589
21613
  key = apigateway.RateLimitedApiKey(self, "rate-limited-api-key",
21590
21614
  customer_id="hello-customer",
21591
- stages=[api.deployment_stage],
21615
+ api_stages=[apigateway.UsagePlanPerApiStage(stage=api.deployment_stage)],
21592
21616
  quota=apigateway.QuotaSettings(
21593
21617
  limit=10000,
21594
21618
  period=apigateway.Period.MONTH
@@ -21619,7 +21643,7 @@ class RateLimitedApiKey(
21619
21643
  '''
21620
21644
  :param scope: -
21621
21645
  :param id: -
21622
- :param api_stages: API Stages to be associated with the RateLimitedApiKey. Default: none
21646
+ :param api_stages: API Stages to be associated with the RateLimitedApiKey. If you already prepared UsagePlan resource explicitly, you should use ``stages`` property. If you prefer to prepare UsagePlan resource implicitly via RateLimitedApiKey, or you should specify throttle settings at each stage individually, you should use ``apiStages`` property. Default: none
21623
21647
  :param quota: Number of requests clients can make in a given time period. Default: none
21624
21648
  :param throttle: Overall throttle settings for the API. Default: none
21625
21649
  :param customer_id: An AWS Marketplace customer identifier to use when integrating with the AWS SaaS Marketplace. Default: none
@@ -23534,7 +23558,7 @@ class RestApiAttributes:
23534
23558
  )
23535
23559
 
23536
23560
 
23537
- @jsii.implements(IRestApi)
23561
+ @jsii.implements(IRestApi, _IResourceWithPolicy_720d64fc)
23538
23562
  class RestApiBase(
23539
23563
  _Resource_45bc6135,
23540
23564
  metaclass=jsii.JSIIAbstractClass,
@@ -23716,6 +23740,18 @@ class RestApiBase(
23716
23740
 
23717
23741
  return typing.cast("GatewayResponse", jsii.invoke(self, "addGatewayResponse", [id, options]))
23718
23742
 
23743
+ @jsii.member(jsii_name="addToResourcePolicy")
23744
+ @abc.abstractmethod
23745
+ def add_to_resource_policy(
23746
+ self,
23747
+ statement: _PolicyStatement_0fe33853,
23748
+ ) -> _AddToResourcePolicyResult_1d0a53ad:
23749
+ '''Add a statement to the resource's resource policy.
23750
+
23751
+ :param statement: -
23752
+ '''
23753
+ ...
23754
+
23719
23755
  @jsii.member(jsii_name="addUsagePlan")
23720
23756
  def add_usage_plan(
23721
23757
  self,
@@ -23769,6 +23805,22 @@ class RestApiBase(
23769
23805
  check_type(argname="argument stage", value=stage, expected_type=type_hints["stage"])
23770
23806
  return typing.cast(builtins.str, jsii.invoke(self, "arnForExecuteApi", [method, path, stage]))
23771
23807
 
23808
+ @jsii.member(jsii_name="grantInvokeFromVpcEndpointsOnly")
23809
+ def grant_invoke_from_vpc_endpoints_only(
23810
+ self,
23811
+ vpc_endpoints: typing.Sequence[_IVpcEndpoint_d8ea9bc3],
23812
+ ) -> None:
23813
+ '''Add a resource policy that only allows API execution from a VPC Endpoint to create a private API.
23814
+
23815
+ :param vpc_endpoints: the interface VPC endpoints to grant access to.
23816
+
23817
+ :see: https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-resource-policies-examples.html#apigateway-resource-policies-source-vpc-example
23818
+ '''
23819
+ if __debug__:
23820
+ type_hints = typing.get_type_hints(_typecheckingstub__d9c72e763e6fd8bee0fdc38b4c6d9a51728ddb7d71c8f2cc4723eeecc90240d6)
23821
+ check_type(argname="argument vpc_endpoints", value=vpc_endpoints, expected_type=type_hints["vpc_endpoints"])
23822
+ return typing.cast(None, jsii.invoke(self, "grantInvokeFromVpcEndpointsOnly", [vpc_endpoints]))
23823
+
23772
23824
  @jsii.member(jsii_name="metric")
23773
23825
  def metric(
23774
23826
  self,
@@ -24236,11 +24288,40 @@ class RestApiBase(
24236
24288
  check_type(argname="argument value", value=value, expected_type=type_hints["value"])
24237
24289
  jsii.set(self, "cloudWatchAccount", value) # pyright: ignore[reportArgumentType]
24238
24290
 
24291
+ @builtins.property
24292
+ @jsii.member(jsii_name="resourcePolicy")
24293
+ def _resource_policy(self) -> typing.Optional[_PolicyDocument_3ac34393]:
24294
+ return typing.cast(typing.Optional[_PolicyDocument_3ac34393], jsii.get(self, "resourcePolicy"))
24295
+
24296
+ @_resource_policy.setter
24297
+ def _resource_policy(
24298
+ self,
24299
+ value: typing.Optional[_PolicyDocument_3ac34393],
24300
+ ) -> None:
24301
+ if __debug__:
24302
+ type_hints = typing.get_type_hints(_typecheckingstub__055b7d6b7f5983f0cbe73bf5302adcab621abc6451932928f4fc669ed6ce3182)
24303
+ check_type(argname="argument value", value=value, expected_type=type_hints["value"])
24304
+ jsii.set(self, "resourcePolicy", value) # pyright: ignore[reportArgumentType]
24305
+
24239
24306
 
24240
24307
  class _RestApiBaseProxy(
24241
24308
  RestApiBase,
24242
24309
  jsii.proxy_for(_Resource_45bc6135), # type: ignore[misc]
24243
24310
  ):
24311
+ @jsii.member(jsii_name="addToResourcePolicy")
24312
+ def add_to_resource_policy(
24313
+ self,
24314
+ statement: _PolicyStatement_0fe33853,
24315
+ ) -> _AddToResourcePolicyResult_1d0a53ad:
24316
+ '''Add a statement to the resource's resource policy.
24317
+
24318
+ :param statement: -
24319
+ '''
24320
+ if __debug__:
24321
+ type_hints = typing.get_type_hints(_typecheckingstub__e5b96ed4eaeba0605aea131fd9bd60ab19b56a3504a62607ee5eff63a4b41ae8)
24322
+ check_type(argname="argument statement", value=statement, expected_type=type_hints["statement"])
24323
+ return typing.cast(_AddToResourcePolicyResult_1d0a53ad, jsii.invoke(self, "addToResourcePolicy", [statement]))
24324
+
24244
24325
  @builtins.property
24245
24326
  @jsii.member(jsii_name="restApiId")
24246
24327
  def rest_api_id(self) -> builtins.str:
@@ -24721,25 +24802,15 @@ class RestApiProps(ResourceOptions, RestApiBaseProps):
24721
24802
 
24722
24803
  Example::
24723
24804
 
24724
- destination_bucket = s3.Bucket(self, "Bucket")
24725
- delivery_stream_role = iam.Role(self, "Role",
24726
- assumed_by=iam.ServicePrincipal("firehose.amazonaws.com")
24727
- )
24728
-
24729
- stream = firehose.CfnDeliveryStream(self, "MyStream",
24730
- delivery_stream_name="amazon-apigateway-delivery-stream",
24731
- s3_destination_configuration=firehose.CfnDeliveryStream.S3DestinationConfigurationProperty(
24732
- bucket_arn=destination_bucket.bucket_arn,
24733
- role_arn=delivery_stream_role.role_arn
24734
- )
24805
+ state_machine = stepfunctions.StateMachine(self, "MyStateMachine",
24806
+ state_machine_type=stepfunctions.StateMachineType.EXPRESS,
24807
+ definition=stepfunctions.Chain.start(stepfunctions.Pass(self, "Pass"))
24735
24808
  )
24736
24809
 
24737
- api = apigateway.RestApi(self, "books",
24738
- deploy_options=apigateway.StageOptions(
24739
- access_log_destination=apigateway.FirehoseLogDestination(stream),
24740
- access_log_format=apigateway.AccessLogFormat.json_with_standard_fields()
24741
- )
24810
+ api = apigateway.RestApi(self, "Api",
24811
+ rest_api_name="MyApi"
24742
24812
  )
24813
+ api.root.add_method("GET", apigateway.StepFunctionsIntegration.start_execution(state_machine))
24743
24814
  '''
24744
24815
  if isinstance(default_cors_preflight_options, dict):
24745
24816
  default_cors_preflight_options = CorsOptions(**default_cors_preflight_options)
@@ -25565,6 +25636,24 @@ class SpecRestApi(
25565
25636
 
25566
25637
  jsii.create(self.__class__, self, [scope, id, props])
25567
25638
 
25639
+ @jsii.member(jsii_name="addToResourcePolicy")
25640
+ def add_to_resource_policy(
25641
+ self,
25642
+ statement: _PolicyStatement_0fe33853,
25643
+ ) -> _AddToResourcePolicyResult_1d0a53ad:
25644
+ '''Adds a statement to the resource policy associated with this rest api.
25645
+
25646
+ A resource policy will be automatically created upon the first call to ``addToResourcePolicy``.
25647
+
25648
+ Note that this does not work with imported rest api.
25649
+
25650
+ :param statement: The policy statement to add.
25651
+ '''
25652
+ if __debug__:
25653
+ type_hints = typing.get_type_hints(_typecheckingstub__a598fa29dde7454edf374298a15d782fc9a7cfb24aea9c673988425532fdfaa8)
25654
+ check_type(argname="argument statement", value=statement, expected_type=type_hints["statement"])
25655
+ return typing.cast(_AddToResourcePolicyResult_1d0a53ad, jsii.invoke(self, "addToResourcePolicy", [statement]))
25656
+
25568
25657
  @builtins.property
25569
25658
  @jsii.member(jsii_name="restApiId")
25570
25659
  def rest_api_id(self) -> builtins.str:
@@ -31391,7 +31480,7 @@ class RateLimitedApiKeyProps(ApiKeyProps):
31391
31480
  :param generate_distinct_id: Specifies whether the key identifier is distinct from the created API key value. Default: false
31392
31481
  :param resources: (deprecated) A list of resources this api key is associated with. Default: none
31393
31482
  :param stages: A list of Stages this api key is associated with. Default: - the api key is not associated with any stages
31394
- :param api_stages: API Stages to be associated with the RateLimitedApiKey. Default: none
31483
+ :param api_stages: API Stages to be associated with the RateLimitedApiKey. If you already prepared UsagePlan resource explicitly, you should use ``stages`` property. If you prefer to prepare UsagePlan resource implicitly via RateLimitedApiKey, or you should specify throttle settings at each stage individually, you should use ``apiStages`` property. Default: none
31395
31484
  :param quota: Number of requests clients can make in a given time period. Default: none
31396
31485
  :param throttle: Overall throttle settings for the API. Default: none
31397
31486
 
@@ -31404,7 +31493,7 @@ class RateLimitedApiKeyProps(ApiKeyProps):
31404
31493
 
31405
31494
  key = apigateway.RateLimitedApiKey(self, "rate-limited-api-key",
31406
31495
  customer_id="hello-customer",
31407
- stages=[api.deployment_stage],
31496
+ api_stages=[apigateway.UsagePlanPerApiStage(stage=api.deployment_stage)],
31408
31497
  quota=apigateway.QuotaSettings(
31409
31498
  limit=10000,
31410
31499
  period=apigateway.Period.MONTH
@@ -31590,6 +31679,10 @@ class RateLimitedApiKeyProps(ApiKeyProps):
31590
31679
  def api_stages(self) -> typing.Optional[typing.List[UsagePlanPerApiStage]]:
31591
31680
  '''API Stages to be associated with the RateLimitedApiKey.
31592
31681
 
31682
+ If you already prepared UsagePlan resource explicitly, you should use ``stages`` property.
31683
+ If you prefer to prepare UsagePlan resource implicitly via RateLimitedApiKey,
31684
+ or you should specify throttle settings at each stage individually, you should use ``apiStages`` property.
31685
+
31593
31686
  :default: none
31594
31687
  '''
31595
31688
  result = self._values.get("api_stages")
@@ -32115,6 +32208,24 @@ class RestApi(
32115
32208
 
32116
32209
  return typing.cast(RequestValidator, jsii.invoke(self, "addRequestValidator", [id, props]))
32117
32210
 
32211
+ @jsii.member(jsii_name="addToResourcePolicy")
32212
+ def add_to_resource_policy(
32213
+ self,
32214
+ statement: _PolicyStatement_0fe33853,
32215
+ ) -> _AddToResourcePolicyResult_1d0a53ad:
32216
+ '''Adds a statement to the resource policy associated with this rest api.
32217
+
32218
+ A resource policy will be automatically created upon the first call to ``addToResourcePolicy``.
32219
+
32220
+ Note that this does not work with imported rest api.
32221
+
32222
+ :param statement: The policy statement to add.
32223
+ '''
32224
+ if __debug__:
32225
+ type_hints = typing.get_type_hints(_typecheckingstub__52663697f28f1fd364df71313e30a1c7fde152016b3381ce552603f8a5dfc54f)
32226
+ check_type(argname="argument statement", value=statement, expected_type=type_hints["statement"])
32227
+ return typing.cast(_AddToResourcePolicyResult_1d0a53ad, jsii.invoke(self, "addToResourcePolicy", [statement]))
32228
+
32118
32229
  @builtins.property
32119
32230
  @jsii.member(jsii_name="methods")
32120
32231
  def methods(self) -> typing.List[Method]:
@@ -36046,6 +36157,12 @@ def _typecheckingstub__8ee391044c8afeacec6635a772559caff651608cf2a1be322b25e001d
36046
36157
  """Type checking stubs"""
36047
36158
  pass
36048
36159
 
36160
+ def _typecheckingstub__d9c72e763e6fd8bee0fdc38b4c6d9a51728ddb7d71c8f2cc4723eeecc90240d6(
36161
+ vpc_endpoints: typing.Sequence[_IVpcEndpoint_d8ea9bc3],
36162
+ ) -> None:
36163
+ """Type checking stubs"""
36164
+ pass
36165
+
36049
36166
  def _typecheckingstub__83e0007c5bc1aeac14243c8f05dab576ffb55853642cfe1f4a1352b59dda08cf(
36050
36167
  metric_name: builtins.str,
36051
36168
  *,
@@ -36081,6 +36198,18 @@ def _typecheckingstub__7f2c768d74b0b943c1a251d6140ff29b65485077acf73526ebf83da3d
36081
36198
  """Type checking stubs"""
36082
36199
  pass
36083
36200
 
36201
+ def _typecheckingstub__055b7d6b7f5983f0cbe73bf5302adcab621abc6451932928f4fc669ed6ce3182(
36202
+ value: typing.Optional[_PolicyDocument_3ac34393],
36203
+ ) -> None:
36204
+ """Type checking stubs"""
36205
+ pass
36206
+
36207
+ def _typecheckingstub__e5b96ed4eaeba0605aea131fd9bd60ab19b56a3504a62607ee5eff63a4b41ae8(
36208
+ statement: _PolicyStatement_0fe33853,
36209
+ ) -> None:
36210
+ """Type checking stubs"""
36211
+ pass
36212
+
36084
36213
  def _typecheckingstub__f8db41d1cbb038cc89af89c87ca398274183966ac93d18298a50a87996e9aab5(
36085
36214
  *,
36086
36215
  cloud_watch_role: typing.Optional[builtins.bool] = None,
@@ -36186,6 +36315,12 @@ def _typecheckingstub__4722b635be09e87466169ef31b6610061f0fa16d1cff99382f0584fde
36186
36315
  """Type checking stubs"""
36187
36316
  pass
36188
36317
 
36318
+ def _typecheckingstub__a598fa29dde7454edf374298a15d782fc9a7cfb24aea9c673988425532fdfaa8(
36319
+ statement: _PolicyStatement_0fe33853,
36320
+ ) -> None:
36321
+ """Type checking stubs"""
36322
+ pass
36323
+
36189
36324
  def _typecheckingstub__4506705cb637aa3098ad358d76fa29dd7a218f7542020d2e9dbfe8182f9cc797(
36190
36325
  *,
36191
36326
  cloud_watch_role: typing.Optional[builtins.bool] = None,
@@ -36921,6 +37056,12 @@ def _typecheckingstub__c7e66eb05224fabb309270e01184adec5effecc24f4bae236c407a527
36921
37056
  """Type checking stubs"""
36922
37057
  pass
36923
37058
 
37059
+ def _typecheckingstub__52663697f28f1fd364df71313e30a1c7fde152016b3381ce552603f8a5dfc54f(
37060
+ statement: _PolicyStatement_0fe33853,
37061
+ ) -> None:
37062
+ """Type checking stubs"""
37063
+ pass
37064
+
36924
37065
  def _typecheckingstub__d2e28fbc4cf23b8af8415c85c3b3fef473c187c8b6a1d16ed48d739acfa4bbed(
36925
37066
  endpoint: _IEndpoint_58fe201a,
36926
37067
  *,