aws-cdk-lib 2.189.1__py3-none-any.whl → 2.191.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 (57) hide show
  1. aws_cdk/_jsii/__init__.py +1 -1
  2. aws_cdk/_jsii/{aws-cdk-lib@2.189.1.jsii.tgz → aws-cdk-lib@2.191.0.jsii.tgz} +0 -0
  3. aws_cdk/aws_acmpca/__init__.py +6 -6
  4. aws_cdk/aws_apigateway/__init__.py +18 -1
  5. aws_cdk/aws_apigatewayv2/__init__.py +374 -6
  6. aws_cdk/aws_applicationautoscaling/__init__.py +16 -10
  7. aws_cdk/aws_applicationsignals/__init__.py +204 -31
  8. aws_cdk/aws_aps/__init__.py +383 -2
  9. aws_cdk/aws_backup/__init__.py +0 -41
  10. aws_cdk/aws_batch/__init__.py +242 -5
  11. aws_cdk/aws_bedrock/__init__.py +963 -41
  12. aws_cdk/aws_cleanrooms/__init__.py +1392 -78
  13. aws_cdk/aws_cloudfront/__init__.py +1 -0
  14. aws_cdk/aws_cloudtrail/__init__.py +24 -26
  15. aws_cdk/aws_codebuild/__init__.py +107 -7
  16. aws_cdk/aws_datazone/__init__.py +23 -1
  17. aws_cdk/aws_dms/__init__.py +43 -0
  18. aws_cdk/aws_ec2/__init__.py +364 -30
  19. aws_cdk/aws_ecs/__init__.py +36 -5
  20. aws_cdk/aws_eks/__init__.py +2 -100
  21. aws_cdk/aws_elasticache/__init__.py +6 -11
  22. aws_cdk/aws_elasticloadbalancingv2/__init__.py +341 -0
  23. aws_cdk/aws_events/__init__.py +106 -13
  24. aws_cdk/aws_fsx/__init__.py +9 -21
  25. aws_cdk/aws_iam/__init__.py +1 -1
  26. aws_cdk/aws_iot/__init__.py +6 -6
  27. aws_cdk/aws_kafkaconnect/__init__.py +2 -2
  28. aws_cdk/aws_kinesis/__init__.py +44 -0
  29. aws_cdk/aws_launchwizard/__init__.py +49 -49
  30. aws_cdk/aws_lex/__init__.py +615 -39
  31. aws_cdk/aws_location/__init__.py +4 -4
  32. aws_cdk/aws_macie/__init__.py +14 -3
  33. aws_cdk/aws_memorydb/__init__.py +87 -0
  34. aws_cdk/aws_msk/__init__.py +226 -127
  35. aws_cdk/aws_neptune/__init__.py +0 -24
  36. aws_cdk/aws_opensearchservice/__init__.py +64 -56
  37. aws_cdk/aws_paymentcryptography/__init__.py +41 -0
  38. aws_cdk/aws_qbusiness/__init__.py +175 -3
  39. aws_cdk/aws_quicksight/__init__.py +393 -0
  40. aws_cdk/aws_rds/__init__.py +149 -120
  41. aws_cdk/aws_redshiftserverless/__init__.py +4 -14
  42. aws_cdk/aws_route53resolver/__init__.py +60 -9
  43. aws_cdk/aws_s3/__init__.py +34 -1
  44. aws_cdk/aws_s3_deployment/__init__.py +202 -5
  45. aws_cdk/aws_s3tables/__init__.py +142 -1
  46. aws_cdk/aws_sagemaker/__init__.py +40 -40
  47. aws_cdk/aws_ses/__init__.py +643 -18
  48. aws_cdk/aws_ssmquicksetup/__init__.py +3 -3
  49. aws_cdk/aws_stepfunctions/__init__.py +720 -45
  50. aws_cdk/aws_transfer/__init__.py +55 -2
  51. aws_cdk/pipelines/__init__.py +1 -2
  52. {aws_cdk_lib-2.189.1.dist-info → aws_cdk_lib-2.191.0.dist-info}/METADATA +1 -1
  53. {aws_cdk_lib-2.189.1.dist-info → aws_cdk_lib-2.191.0.dist-info}/RECORD +57 -57
  54. {aws_cdk_lib-2.189.1.dist-info → aws_cdk_lib-2.191.0.dist-info}/LICENSE +0 -0
  55. {aws_cdk_lib-2.189.1.dist-info → aws_cdk_lib-2.191.0.dist-info}/NOTICE +0 -0
  56. {aws_cdk_lib-2.189.1.dist-info → aws_cdk_lib-2.191.0.dist-info}/WHEEL +0 -0
  57. {aws_cdk_lib-2.189.1.dist-info → aws_cdk_lib-2.191.0.dist-info}/top_level.txt +0 -0
@@ -16,6 +16,7 @@ r'''
16
16
  * [VPC Link](#vpc-link)
17
17
  * [Private Integration](#private-integration)
18
18
  * [Generating ARN for Execute API](#generating-arn-for-execute-api)
19
+ * [Access Logging](#access-logging)
19
20
  * [WebSocket API](#websocket-api)
20
21
 
21
22
  * [Manage Connections Permission](#manage-connections-permission)
@@ -366,6 +367,66 @@ arn = api.arn_for_execute_api("GET", "/myApiPath", "dev")
366
367
  * The 'ANY' method can be used for matching any HTTP methods not explicitly defined.
367
368
  * The function gracefully handles undefined parameters by using wildcards, making it flexible for various API configurations.
368
369
 
370
+ ## Access Logging
371
+
372
+ You can turn on logging to write logs to CloudWatch Logs.
373
+ Read more at [Configure logging for HTTP APIs in API Gateway](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-logging.html)
374
+
375
+ ```python
376
+ import aws_cdk.aws_logs as logs
377
+
378
+ # api: apigwv2.HttpApi
379
+ # log_group: logs.LogGroup
380
+
381
+
382
+ stage = apigwv2.HttpStage(self, "Stage",
383
+ http_api=api,
384
+ access_log_settings={
385
+ "destination": apigwv2.LogGroupLogDestination(log_group)
386
+ }
387
+ )
388
+ ```
389
+
390
+ The following code will generate the access log in the [CLF format](https://en.wikipedia.org/wiki/Common_Log_Format).
391
+
392
+ ```python
393
+ import aws_cdk.aws_apigateway as apigw
394
+ import aws_cdk.aws_logs as logs
395
+
396
+ # api: apigwv2.HttpApi
397
+ # log_group: logs.LogGroup
398
+
399
+
400
+ stage = apigwv2.HttpStage(self, "Stage",
401
+ http_api=api,
402
+ access_log_settings={
403
+ "destination": apigwv2.LogGroupLogDestination(log_group),
404
+ "format": apigw.AccessLogFormat.clf()
405
+ }
406
+ )
407
+ ```
408
+
409
+ You can also configure your own access log format by using the `AccessLogFormat.custom()` API.
410
+ `AccessLogField` provides commonly used fields. The following code configures access log to contain.
411
+
412
+ ```python
413
+ import aws_cdk.aws_apigateway as apigw
414
+ import aws_cdk.aws_logs as logs
415
+
416
+ # api: apigwv2.HttpApi
417
+ # log_group: logs.LogGroup
418
+
419
+
420
+ stage = apigwv2.HttpStage(self, "Stage",
421
+ http_api=api,
422
+ access_log_settings={
423
+ "destination": apigwv2.LogGroupLogDestination(log_group),
424
+ "format": apigw.AccessLogFormat.custom(f"""{apigw.AccessLogField.contextRequestId()} {apigw.AccessLogField.contextErrorMessage()} {apigw.AccessLogField.contextErrorMessageString()}
425
+ {apigw.AccessLogField.contextAuthorizerError()} {apigw.AccessLogField.contextAuthorizerIntegrationStatus()}""")
426
+ }
427
+ )
428
+ ```
429
+
369
430
  ## WebSocket API
370
431
 
371
432
  A WebSocket API in API Gateway is a collection of WebSocket routes that are integrated with backend HTTP endpoints,
@@ -572,6 +633,7 @@ from .. import (
572
633
  TagManager as _TagManager_0a598cb3,
573
634
  TreeInspector as _TreeInspector_488e0dd5,
574
635
  )
636
+ from ..aws_apigateway import AccessLogFormat as _AccessLogFormat_07733b91
575
637
  from ..aws_certificatemanager import ICertificate as _ICertificate_c194c70b
576
638
  from ..aws_cloudwatch import (
577
639
  Metric as _Metric_e396a4dc,
@@ -589,9 +651,59 @@ from ..aws_iam import (
589
651
  IGrantable as _IGrantable_71c4f5de,
590
652
  IRole as _IRole_235f5d8e,
591
653
  )
654
+ from ..aws_logs import ILogGroup as _ILogGroup_3c4fa718
592
655
  from ..aws_s3 import IBucket as _IBucket_42e086fd
593
656
 
594
657
 
658
+ @jsii.data_type(
659
+ jsii_type="aws-cdk-lib.aws_apigatewayv2.AccessLogDestinationConfig",
660
+ jsii_struct_bases=[],
661
+ name_mapping={"destination_arn": "destinationArn"},
662
+ )
663
+ class AccessLogDestinationConfig:
664
+ def __init__(self, *, destination_arn: builtins.str) -> None:
665
+ '''Options when binding a log destination to a HttpApi Stage.
666
+
667
+ :param destination_arn: The Amazon Resource Name (ARN) of the destination resource.
668
+
669
+ :exampleMetadata: fixture=_generated
670
+
671
+ Example::
672
+
673
+ # The code below shows an example of how to instantiate this type.
674
+ # The values are placeholders you should change.
675
+ from aws_cdk import aws_apigatewayv2 as apigatewayv2
676
+
677
+ access_log_destination_config = apigatewayv2.AccessLogDestinationConfig(
678
+ destination_arn="destinationArn"
679
+ )
680
+ '''
681
+ if __debug__:
682
+ type_hints = typing.get_type_hints(_typecheckingstub__8b68ef5fb39547463ffa4e3d85b867bf69e399a3812672f092c1af8a4605f33b)
683
+ check_type(argname="argument destination_arn", value=destination_arn, expected_type=type_hints["destination_arn"])
684
+ self._values: typing.Dict[builtins.str, typing.Any] = {
685
+ "destination_arn": destination_arn,
686
+ }
687
+
688
+ @builtins.property
689
+ def destination_arn(self) -> builtins.str:
690
+ '''The Amazon Resource Name (ARN) of the destination resource.'''
691
+ result = self._values.get("destination_arn")
692
+ assert result is not None, "Required property 'destination_arn' is missing"
693
+ return typing.cast(builtins.str, result)
694
+
695
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
696
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
697
+
698
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
699
+ return not (rhs == self)
700
+
701
+ def __repr__(self) -> str:
702
+ return "AccessLogDestinationConfig(%s)" % ", ".join(
703
+ k + "=" + repr(v) for k, v in self._values.items()
704
+ )
705
+
706
+
595
707
  @jsii.data_type(
596
708
  jsii_type="aws-cdk-lib.aws_apigatewayv2.ApiMappingAttributes",
597
709
  jsii_struct_bases=[],
@@ -10746,6 +10858,99 @@ class HttpRouteProps(BatchHttpRouteOptions):
10746
10858
  )
10747
10859
 
10748
10860
 
10861
+ @jsii.interface(jsii_type="aws-cdk-lib.aws_apigatewayv2.IAccessLogDestination")
10862
+ class IAccessLogDestination(typing_extensions.Protocol):
10863
+ '''Access log destination for a HttpApi Stage.'''
10864
+
10865
+ @jsii.member(jsii_name="bind")
10866
+ def bind(self, stage: "IStage") -> AccessLogDestinationConfig:
10867
+ '''Binds this destination to the HttpApi Stage.
10868
+
10869
+ :param stage: -
10870
+ '''
10871
+ ...
10872
+
10873
+
10874
+ class _IAccessLogDestinationProxy:
10875
+ '''Access log destination for a HttpApi Stage.'''
10876
+
10877
+ __jsii_type__: typing.ClassVar[str] = "aws-cdk-lib.aws_apigatewayv2.IAccessLogDestination"
10878
+
10879
+ @jsii.member(jsii_name="bind")
10880
+ def bind(self, stage: "IStage") -> AccessLogDestinationConfig:
10881
+ '''Binds this destination to the HttpApi Stage.
10882
+
10883
+ :param stage: -
10884
+ '''
10885
+ if __debug__:
10886
+ type_hints = typing.get_type_hints(_typecheckingstub__534fc78204353b3af484df3c3dbcbe29516f616aa5df0e356e600f12ba8ac536)
10887
+ check_type(argname="argument stage", value=stage, expected_type=type_hints["stage"])
10888
+ return typing.cast(AccessLogDestinationConfig, jsii.invoke(self, "bind", [stage]))
10889
+
10890
+ # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
10891
+ typing.cast(typing.Any, IAccessLogDestination).__jsii_proxy_class__ = lambda : _IAccessLogDestinationProxy
10892
+
10893
+
10894
+ @jsii.interface(jsii_type="aws-cdk-lib.aws_apigatewayv2.IAccessLogSettings")
10895
+ class IAccessLogSettings(typing_extensions.Protocol):
10896
+ '''Settings for access logging.'''
10897
+
10898
+ @builtins.property
10899
+ @jsii.member(jsii_name="destination")
10900
+ def destination(self) -> IAccessLogDestination:
10901
+ '''The destination where to write access logs.
10902
+
10903
+ :default: - No destination
10904
+ '''
10905
+ ...
10906
+
10907
+ @builtins.property
10908
+ @jsii.member(jsii_name="format")
10909
+ def format(self) -> typing.Optional[_AccessLogFormat_07733b91]:
10910
+ '''A single line format of access logs of data, as specified by selected $context variables.
10911
+
10912
+ The format must include either ``AccessLogFormat.contextRequestId()``
10913
+ or ``AccessLogFormat.contextExtendedRequestId()``.
10914
+
10915
+ :default: - Common Log Format
10916
+
10917
+ :see: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-logging-variables.html
10918
+ '''
10919
+ ...
10920
+
10921
+
10922
+ class _IAccessLogSettingsProxy:
10923
+ '''Settings for access logging.'''
10924
+
10925
+ __jsii_type__: typing.ClassVar[str] = "aws-cdk-lib.aws_apigatewayv2.IAccessLogSettings"
10926
+
10927
+ @builtins.property
10928
+ @jsii.member(jsii_name="destination")
10929
+ def destination(self) -> IAccessLogDestination:
10930
+ '''The destination where to write access logs.
10931
+
10932
+ :default: - No destination
10933
+ '''
10934
+ return typing.cast(IAccessLogDestination, jsii.get(self, "destination"))
10935
+
10936
+ @builtins.property
10937
+ @jsii.member(jsii_name="format")
10938
+ def format(self) -> typing.Optional[_AccessLogFormat_07733b91]:
10939
+ '''A single line format of access logs of data, as specified by selected $context variables.
10940
+
10941
+ The format must include either ``AccessLogFormat.contextRequestId()``
10942
+ or ``AccessLogFormat.contextExtendedRequestId()``.
10943
+
10944
+ :default: - Common Log Format
10945
+
10946
+ :see: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-logging-variables.html
10947
+ '''
10948
+ return typing.cast(typing.Optional[_AccessLogFormat_07733b91], jsii.get(self, "format"))
10949
+
10950
+ # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface
10951
+ typing.cast(typing.Any, IAccessLogSettings).__jsii_proxy_class__ = lambda : _IAccessLogSettingsProxy
10952
+
10953
+
10749
10954
  @jsii.interface(jsii_type="aws-cdk-lib.aws_apigatewayv2.IApi")
10750
10955
  class IApi(_IResource_c80c4260, typing_extensions.Protocol):
10751
10956
  '''Represents a API Gateway HTTP/WebSocket API.'''
@@ -12308,6 +12513,54 @@ class IpAddressType(enum.Enum):
12308
12513
  '''IPv4 and IPv6 address type.'''
12309
12514
 
12310
12515
 
12516
+ @jsii.implements(IAccessLogDestination)
12517
+ class LogGroupLogDestination(
12518
+ metaclass=jsii.JSIIMeta,
12519
+ jsii_type="aws-cdk-lib.aws_apigatewayv2.LogGroupLogDestination",
12520
+ ):
12521
+ '''Use CloudWatch Logs as a custom access log destination for API Gateway.
12522
+
12523
+ :exampleMetadata: infused
12524
+
12525
+ Example::
12526
+
12527
+ import aws_cdk.aws_apigateway as apigw
12528
+ import aws_cdk.aws_logs as logs
12529
+
12530
+ # api: apigwv2.HttpApi
12531
+ # log_group: logs.LogGroup
12532
+
12533
+
12534
+ stage = apigwv2.HttpStage(self, "Stage",
12535
+ http_api=api,
12536
+ access_log_settings={
12537
+ "destination": apigwv2.LogGroupLogDestination(log_group),
12538
+ "format": apigw.AccessLogFormat.clf()
12539
+ }
12540
+ )
12541
+ '''
12542
+
12543
+ def __init__(self, log_group: _ILogGroup_3c4fa718) -> None:
12544
+ '''
12545
+ :param log_group: -
12546
+ '''
12547
+ if __debug__:
12548
+ type_hints = typing.get_type_hints(_typecheckingstub__673df4a47de472e4a214f42838d3f75aa1fbd64c7cfebf6aabca85f720757892)
12549
+ check_type(argname="argument log_group", value=log_group, expected_type=type_hints["log_group"])
12550
+ jsii.create(self.__class__, self, [log_group])
12551
+
12552
+ @jsii.member(jsii_name="bind")
12553
+ def bind(self, _stage: IStage) -> AccessLogDestinationConfig:
12554
+ '''Binds this destination to the CloudWatch Logs.
12555
+
12556
+ :param _stage: -
12557
+ '''
12558
+ if __debug__:
12559
+ type_hints = typing.get_type_hints(_typecheckingstub__24adabd8038382382256c380e34d36079494808b554f1161a31a58eb7a2d3f08)
12560
+ check_type(argname="argument _stage", value=_stage, expected_type=type_hints["_stage"])
12561
+ return typing.cast(AccessLogDestinationConfig, jsii.invoke(self, "bind", [_stage]))
12562
+
12563
+
12311
12564
  @jsii.data_type(
12312
12565
  jsii_type="aws-cdk-lib.aws_apigatewayv2.MTLSConfig",
12313
12566
  jsii_struct_bases=[],
@@ -12832,6 +13085,7 @@ class StageAttributes:
12832
13085
  jsii_type="aws-cdk-lib.aws_apigatewayv2.StageOptions",
12833
13086
  jsii_struct_bases=[],
12834
13087
  name_mapping={
13088
+ "access_log_settings": "accessLogSettings",
12835
13089
  "auto_deploy": "autoDeploy",
12836
13090
  "description": "description",
12837
13091
  "detailed_metrics_enabled": "detailedMetricsEnabled",
@@ -12843,6 +13097,7 @@ class StageOptions:
12843
13097
  def __init__(
12844
13098
  self,
12845
13099
  *,
13100
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
12846
13101
  auto_deploy: typing.Optional[builtins.bool] = None,
12847
13102
  description: typing.Optional[builtins.str] = None,
12848
13103
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,
@@ -12853,6 +13108,7 @@ class StageOptions:
12853
13108
 
12854
13109
  Options that are common between HTTP and Websocket APIs.
12855
13110
 
13111
+ :param access_log_settings: Settings for access logging. Default: - No access logging
12856
13112
  :param auto_deploy: Whether updates to an API automatically trigger a new deployment. Default: false
12857
13113
  :param description: The description for the API stage. Default: - no description
12858
13114
  :param detailed_metrics_enabled: Specifies whether detailed metrics are enabled. Default: false
@@ -12867,9 +13123,11 @@ class StageOptions:
12867
13123
  # The values are placeholders you should change.
12868
13124
  from aws_cdk import aws_apigatewayv2 as apigatewayv2
12869
13125
 
13126
+ # access_log_settings: apigatewayv2.IAccessLogSettings
12870
13127
  # domain_name: apigatewayv2.DomainName
12871
13128
 
12872
13129
  stage_options = apigatewayv2.StageOptions(
13130
+ access_log_settings=access_log_settings,
12873
13131
  auto_deploy=False,
12874
13132
  description="description",
12875
13133
  detailed_metrics_enabled=False,
@@ -12891,12 +13149,15 @@ class StageOptions:
12891
13149
  throttle = ThrottleSettings(**throttle)
12892
13150
  if __debug__:
12893
13151
  type_hints = typing.get_type_hints(_typecheckingstub__7d1ab9a2efdde27ab3aff279b986e4a558573396d5100c22c5a48bcbee4f320a)
13152
+ check_type(argname="argument access_log_settings", value=access_log_settings, expected_type=type_hints["access_log_settings"])
12894
13153
  check_type(argname="argument auto_deploy", value=auto_deploy, expected_type=type_hints["auto_deploy"])
12895
13154
  check_type(argname="argument description", value=description, expected_type=type_hints["description"])
12896
13155
  check_type(argname="argument detailed_metrics_enabled", value=detailed_metrics_enabled, expected_type=type_hints["detailed_metrics_enabled"])
12897
13156
  check_type(argname="argument domain_mapping", value=domain_mapping, expected_type=type_hints["domain_mapping"])
12898
13157
  check_type(argname="argument throttle", value=throttle, expected_type=type_hints["throttle"])
12899
13158
  self._values: typing.Dict[builtins.str, typing.Any] = {}
13159
+ if access_log_settings is not None:
13160
+ self._values["access_log_settings"] = access_log_settings
12900
13161
  if auto_deploy is not None:
12901
13162
  self._values["auto_deploy"] = auto_deploy
12902
13163
  if description is not None:
@@ -12908,6 +13169,15 @@ class StageOptions:
12908
13169
  if throttle is not None:
12909
13170
  self._values["throttle"] = throttle
12910
13171
 
13172
+ @builtins.property
13173
+ def access_log_settings(self) -> typing.Optional[IAccessLogSettings]:
13174
+ '''Settings for access logging.
13175
+
13176
+ :default: - No access logging
13177
+ '''
13178
+ result = self._values.get("access_log_settings")
13179
+ return typing.cast(typing.Optional[IAccessLogSettings], result)
13180
+
12911
13181
  @builtins.property
12912
13182
  def auto_deploy(self) -> typing.Optional[builtins.bool]:
12913
13183
  '''Whether updates to an API automatically trigger a new deployment.
@@ -15446,6 +15716,7 @@ class WebSocketStage(
15446
15716
  *,
15447
15717
  stage_name: builtins.str,
15448
15718
  web_socket_api: IWebSocketApi,
15719
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
15449
15720
  auto_deploy: typing.Optional[builtins.bool] = None,
15450
15721
  description: typing.Optional[builtins.str] = None,
15451
15722
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,
@@ -15457,6 +15728,7 @@ class WebSocketStage(
15457
15728
  :param id: -
15458
15729
  :param stage_name: The name of the stage.
15459
15730
  :param web_socket_api: The WebSocket API to which this stage is associated.
15731
+ :param access_log_settings: Settings for access logging. Default: - No access logging
15460
15732
  :param auto_deploy: Whether updates to an API automatically trigger a new deployment. Default: false
15461
15733
  :param description: The description for the API stage. Default: - no description
15462
15734
  :param detailed_metrics_enabled: Specifies whether detailed metrics are enabled. Default: false
@@ -15470,6 +15742,7 @@ class WebSocketStage(
15470
15742
  props = WebSocketStageProps(
15471
15743
  stage_name=stage_name,
15472
15744
  web_socket_api=web_socket_api,
15745
+ access_log_settings=access_log_settings,
15473
15746
  auto_deploy=auto_deploy,
15474
15747
  description=description,
15475
15748
  detailed_metrics_enabled=detailed_metrics_enabled,
@@ -15665,6 +15938,7 @@ class WebSocketStageAttributes(StageAttributes):
15665
15938
  jsii_type="aws-cdk-lib.aws_apigatewayv2.WebSocketStageProps",
15666
15939
  jsii_struct_bases=[StageOptions],
15667
15940
  name_mapping={
15941
+ "access_log_settings": "accessLogSettings",
15668
15942
  "auto_deploy": "autoDeploy",
15669
15943
  "description": "description",
15670
15944
  "detailed_metrics_enabled": "detailedMetricsEnabled",
@@ -15678,6 +15952,7 @@ class WebSocketStageProps(StageOptions):
15678
15952
  def __init__(
15679
15953
  self,
15680
15954
  *,
15955
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
15681
15956
  auto_deploy: typing.Optional[builtins.bool] = None,
15682
15957
  description: typing.Optional[builtins.str] = None,
15683
15958
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,
@@ -15688,6 +15963,7 @@ class WebSocketStageProps(StageOptions):
15688
15963
  ) -> None:
15689
15964
  '''Properties to initialize an instance of ``WebSocketStage``.
15690
15965
 
15966
+ :param access_log_settings: Settings for access logging. Default: - No access logging
15691
15967
  :param auto_deploy: Whether updates to an API automatically trigger a new deployment. Default: false
15692
15968
  :param description: The description for the API stage. Default: - no description
15693
15969
  :param detailed_metrics_enabled: Specifies whether detailed metrics are enabled. Default: false
@@ -15721,6 +15997,7 @@ class WebSocketStageProps(StageOptions):
15721
15997
  throttle = ThrottleSettings(**throttle)
15722
15998
  if __debug__:
15723
15999
  type_hints = typing.get_type_hints(_typecheckingstub__42c328a8780899b5d1949986febb2d9e9b3f4f2f6b8e4f03561cb02e5b407e77)
16000
+ check_type(argname="argument access_log_settings", value=access_log_settings, expected_type=type_hints["access_log_settings"])
15724
16001
  check_type(argname="argument auto_deploy", value=auto_deploy, expected_type=type_hints["auto_deploy"])
15725
16002
  check_type(argname="argument description", value=description, expected_type=type_hints["description"])
15726
16003
  check_type(argname="argument detailed_metrics_enabled", value=detailed_metrics_enabled, expected_type=type_hints["detailed_metrics_enabled"])
@@ -15732,6 +16009,8 @@ class WebSocketStageProps(StageOptions):
15732
16009
  "stage_name": stage_name,
15733
16010
  "web_socket_api": web_socket_api,
15734
16011
  }
16012
+ if access_log_settings is not None:
16013
+ self._values["access_log_settings"] = access_log_settings
15735
16014
  if auto_deploy is not None:
15736
16015
  self._values["auto_deploy"] = auto_deploy
15737
16016
  if description is not None:
@@ -15743,6 +16022,15 @@ class WebSocketStageProps(StageOptions):
15743
16022
  if throttle is not None:
15744
16023
  self._values["throttle"] = throttle
15745
16024
 
16025
+ @builtins.property
16026
+ def access_log_settings(self) -> typing.Optional[IAccessLogSettings]:
16027
+ '''Settings for access logging.
16028
+
16029
+ :default: - No access logging
16030
+ '''
16031
+ result = self._values.get("access_log_settings")
16032
+ return typing.cast(typing.Optional[IAccessLogSettings], result)
16033
+
15746
16034
  @builtins.property
15747
16035
  def auto_deploy(self) -> typing.Optional[builtins.bool]:
15748
16036
  '''Whether updates to an API automatically trigger a new deployment.
@@ -16508,6 +16796,7 @@ class HttpApi(
16508
16796
  id: builtins.str,
16509
16797
  *,
16510
16798
  stage_name: typing.Optional[builtins.str] = None,
16799
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
16511
16800
  auto_deploy: typing.Optional[builtins.bool] = None,
16512
16801
  description: typing.Optional[builtins.str] = None,
16513
16802
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,
@@ -16518,6 +16807,7 @@ class HttpApi(
16518
16807
 
16519
16808
  :param id: -
16520
16809
  :param stage_name: The name of the stage. See ``StageName`` class for more details. Default: '$default' the default stage of the API. This stage will have the URL at the root of the API endpoint.
16810
+ :param access_log_settings: Settings for access logging. Default: - No access logging
16521
16811
  :param auto_deploy: Whether updates to an API automatically trigger a new deployment. Default: false
16522
16812
  :param description: The description for the API stage. Default: - no description
16523
16813
  :param detailed_metrics_enabled: Specifies whether detailed metrics are enabled. Default: false
@@ -16529,6 +16819,7 @@ class HttpApi(
16529
16819
  check_type(argname="argument id", value=id, expected_type=type_hints["id"])
16530
16820
  options = HttpStageOptions(
16531
16821
  stage_name=stage_name,
16822
+ access_log_settings=access_log_settings,
16532
16823
  auto_deploy=auto_deploy,
16533
16824
  description=description,
16534
16825
  detailed_metrics_enabled=detailed_metrics_enabled,
@@ -17225,6 +17516,7 @@ class HttpStageAttributes(StageAttributes):
17225
17516
  jsii_type="aws-cdk-lib.aws_apigatewayv2.HttpStageOptions",
17226
17517
  jsii_struct_bases=[StageOptions],
17227
17518
  name_mapping={
17519
+ "access_log_settings": "accessLogSettings",
17228
17520
  "auto_deploy": "autoDeploy",
17229
17521
  "description": "description",
17230
17522
  "detailed_metrics_enabled": "detailedMetricsEnabled",
@@ -17237,6 +17529,7 @@ class HttpStageOptions(StageOptions):
17237
17529
  def __init__(
17238
17530
  self,
17239
17531
  *,
17532
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
17240
17533
  auto_deploy: typing.Optional[builtins.bool] = None,
17241
17534
  description: typing.Optional[builtins.str] = None,
17242
17535
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,
@@ -17246,6 +17539,7 @@ class HttpStageOptions(StageOptions):
17246
17539
  ) -> None:
17247
17540
  '''The options to create a new Stage for an HTTP API.
17248
17541
 
17542
+ :param access_log_settings: Settings for access logging. Default: - No access logging
17249
17543
  :param auto_deploy: Whether updates to an API automatically trigger a new deployment. Default: false
17250
17544
  :param description: The description for the API stage. Default: - no description
17251
17545
  :param detailed_metrics_enabled: Specifies whether detailed metrics are enabled. Default: false
@@ -17277,6 +17571,7 @@ class HttpStageOptions(StageOptions):
17277
17571
  throttle = ThrottleSettings(**throttle)
17278
17572
  if __debug__:
17279
17573
  type_hints = typing.get_type_hints(_typecheckingstub__70c0bb0779b1636661ab1c2d695953c6dda7a5247d18a4bd7e045cc96d717a8a)
17574
+ check_type(argname="argument access_log_settings", value=access_log_settings, expected_type=type_hints["access_log_settings"])
17280
17575
  check_type(argname="argument auto_deploy", value=auto_deploy, expected_type=type_hints["auto_deploy"])
17281
17576
  check_type(argname="argument description", value=description, expected_type=type_hints["description"])
17282
17577
  check_type(argname="argument detailed_metrics_enabled", value=detailed_metrics_enabled, expected_type=type_hints["detailed_metrics_enabled"])
@@ -17284,6 +17579,8 @@ class HttpStageOptions(StageOptions):
17284
17579
  check_type(argname="argument throttle", value=throttle, expected_type=type_hints["throttle"])
17285
17580
  check_type(argname="argument stage_name", value=stage_name, expected_type=type_hints["stage_name"])
17286
17581
  self._values: typing.Dict[builtins.str, typing.Any] = {}
17582
+ if access_log_settings is not None:
17583
+ self._values["access_log_settings"] = access_log_settings
17287
17584
  if auto_deploy is not None:
17288
17585
  self._values["auto_deploy"] = auto_deploy
17289
17586
  if description is not None:
@@ -17297,6 +17594,15 @@ class HttpStageOptions(StageOptions):
17297
17594
  if stage_name is not None:
17298
17595
  self._values["stage_name"] = stage_name
17299
17596
 
17597
+ @builtins.property
17598
+ def access_log_settings(self) -> typing.Optional[IAccessLogSettings]:
17599
+ '''Settings for access logging.
17600
+
17601
+ :default: - No access logging
17602
+ '''
17603
+ result = self._values.get("access_log_settings")
17604
+ return typing.cast(typing.Optional[IAccessLogSettings], result)
17605
+
17300
17606
  @builtins.property
17301
17607
  def auto_deploy(self) -> typing.Optional[builtins.bool]:
17302
17608
  '''Whether updates to an API automatically trigger a new deployment.
@@ -17369,6 +17675,7 @@ class HttpStageOptions(StageOptions):
17369
17675
  jsii_type="aws-cdk-lib.aws_apigatewayv2.HttpStageProps",
17370
17676
  jsii_struct_bases=[HttpStageOptions],
17371
17677
  name_mapping={
17678
+ "access_log_settings": "accessLogSettings",
17372
17679
  "auto_deploy": "autoDeploy",
17373
17680
  "description": "description",
17374
17681
  "detailed_metrics_enabled": "detailedMetricsEnabled",
@@ -17382,6 +17689,7 @@ class HttpStageProps(HttpStageOptions):
17382
17689
  def __init__(
17383
17690
  self,
17384
17691
  *,
17692
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
17385
17693
  auto_deploy: typing.Optional[builtins.bool] = None,
17386
17694
  description: typing.Optional[builtins.str] = None,
17387
17695
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,
@@ -17392,6 +17700,7 @@ class HttpStageProps(HttpStageOptions):
17392
17700
  ) -> None:
17393
17701
  '''Properties to initialize an instance of ``HttpStage``.
17394
17702
 
17703
+ :param access_log_settings: Settings for access logging. Default: - No access logging
17395
17704
  :param auto_deploy: Whether updates to an API automatically trigger a new deployment. Default: false
17396
17705
  :param description: The description for the API stage. Default: - no description
17397
17706
  :param detailed_metrics_enabled: Specifies whether detailed metrics are enabled. Default: false
@@ -17404,13 +17713,17 @@ class HttpStageProps(HttpStageOptions):
17404
17713
 
17405
17714
  Example::
17406
17715
 
17716
+ import aws_cdk.aws_logs as logs
17717
+
17407
17718
  # api: apigwv2.HttpApi
17719
+ # log_group: logs.LogGroup
17408
17720
 
17409
17721
 
17410
- apigwv2.HttpStage(self, "Stage",
17722
+ stage = apigwv2.HttpStage(self, "Stage",
17411
17723
  http_api=api,
17412
- stage_name="beta",
17413
- description="My Stage"
17724
+ access_log_settings={
17725
+ "destination": apigwv2.LogGroupLogDestination(log_group)
17726
+ }
17414
17727
  )
17415
17728
  '''
17416
17729
  if isinstance(domain_mapping, dict):
@@ -17419,6 +17732,7 @@ class HttpStageProps(HttpStageOptions):
17419
17732
  throttle = ThrottleSettings(**throttle)
17420
17733
  if __debug__:
17421
17734
  type_hints = typing.get_type_hints(_typecheckingstub__77d8b0adbb783021a6c7e33999d2a3a80e2414824d202954599bb4ad7f291721)
17735
+ check_type(argname="argument access_log_settings", value=access_log_settings, expected_type=type_hints["access_log_settings"])
17422
17736
  check_type(argname="argument auto_deploy", value=auto_deploy, expected_type=type_hints["auto_deploy"])
17423
17737
  check_type(argname="argument description", value=description, expected_type=type_hints["description"])
17424
17738
  check_type(argname="argument detailed_metrics_enabled", value=detailed_metrics_enabled, expected_type=type_hints["detailed_metrics_enabled"])
@@ -17429,6 +17743,8 @@ class HttpStageProps(HttpStageOptions):
17429
17743
  self._values: typing.Dict[builtins.str, typing.Any] = {
17430
17744
  "http_api": http_api,
17431
17745
  }
17746
+ if access_log_settings is not None:
17747
+ self._values["access_log_settings"] = access_log_settings
17432
17748
  if auto_deploy is not None:
17433
17749
  self._values["auto_deploy"] = auto_deploy
17434
17750
  if description is not None:
@@ -17442,6 +17758,15 @@ class HttpStageProps(HttpStageOptions):
17442
17758
  if stage_name is not None:
17443
17759
  self._values["stage_name"] = stage_name
17444
17760
 
17761
+ @builtins.property
17762
+ def access_log_settings(self) -> typing.Optional[IAccessLogSettings]:
17763
+ '''Settings for access logging.
17764
+
17765
+ :default: - No access logging
17766
+ '''
17767
+ result = self._values.get("access_log_settings")
17768
+ return typing.cast(typing.Optional[IAccessLogSettings], result)
17769
+
17445
17770
  @builtins.property
17446
17771
  def auto_deploy(self) -> typing.Optional[builtins.bool]:
17447
17772
  '''Whether updates to an API automatically trigger a new deployment.
@@ -18384,13 +18709,17 @@ class HttpStage(
18384
18709
 
18385
18710
  Example::
18386
18711
 
18712
+ import aws_cdk.aws_logs as logs
18713
+
18387
18714
  # api: apigwv2.HttpApi
18715
+ # log_group: logs.LogGroup
18388
18716
 
18389
18717
 
18390
- apigwv2.HttpStage(self, "Stage",
18718
+ stage = apigwv2.HttpStage(self, "Stage",
18391
18719
  http_api=api,
18392
- stage_name="beta",
18393
- description="My Stage"
18720
+ access_log_settings={
18721
+ "destination": apigwv2.LogGroupLogDestination(log_group)
18722
+ }
18394
18723
  )
18395
18724
  '''
18396
18725
 
@@ -18401,6 +18730,7 @@ class HttpStage(
18401
18730
  *,
18402
18731
  http_api: IHttpApi,
18403
18732
  stage_name: typing.Optional[builtins.str] = None,
18733
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
18404
18734
  auto_deploy: typing.Optional[builtins.bool] = None,
18405
18735
  description: typing.Optional[builtins.str] = None,
18406
18736
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,
@@ -18412,6 +18742,7 @@ class HttpStage(
18412
18742
  :param id: -
18413
18743
  :param http_api: The HTTP API to which this stage is associated.
18414
18744
  :param stage_name: The name of the stage. See ``StageName`` class for more details. Default: '$default' the default stage of the API. This stage will have the URL at the root of the API endpoint.
18745
+ :param access_log_settings: Settings for access logging. Default: - No access logging
18415
18746
  :param auto_deploy: Whether updates to an API automatically trigger a new deployment. Default: false
18416
18747
  :param description: The description for the API stage. Default: - no description
18417
18748
  :param detailed_metrics_enabled: Specifies whether detailed metrics are enabled. Default: false
@@ -18425,6 +18756,7 @@ class HttpStage(
18425
18756
  props = HttpStageProps(
18426
18757
  http_api=http_api,
18427
18758
  stage_name=stage_name,
18759
+ access_log_settings=access_log_settings,
18428
18760
  auto_deploy=auto_deploy,
18429
18761
  description=description,
18430
18762
  detailed_metrics_enabled=detailed_metrics_enabled,
@@ -18801,6 +19133,7 @@ class HttpStage(
18801
19133
 
18802
19134
 
18803
19135
  __all__ = [
19136
+ "AccessLogDestinationConfig",
18804
19137
  "AddRoutesOptions",
18805
19138
  "ApiMapping",
18806
19139
  "ApiMappingAttributes",
@@ -18869,6 +19202,8 @@ __all__ = [
18869
19202
  "HttpStageAttributes",
18870
19203
  "HttpStageOptions",
18871
19204
  "HttpStageProps",
19205
+ "IAccessLogDestination",
19206
+ "IAccessLogSettings",
18872
19207
  "IApi",
18873
19208
  "IApiMapping",
18874
19209
  "IAuthorizer",
@@ -18892,6 +19227,7 @@ __all__ = [
18892
19227
  "IWebSocketStage",
18893
19228
  "IntegrationCredentials",
18894
19229
  "IpAddressType",
19230
+ "LogGroupLogDestination",
18895
19231
  "MTLSConfig",
18896
19232
  "MappingValue",
18897
19233
  "ParameterMapping",
@@ -18931,6 +19267,13 @@ __all__ = [
18931
19267
 
18932
19268
  publication.publish()
18933
19269
 
19270
+ def _typecheckingstub__8b68ef5fb39547463ffa4e3d85b867bf69e399a3812672f092c1af8a4605f33b(
19271
+ *,
19272
+ destination_arn: builtins.str,
19273
+ ) -> None:
19274
+ """Type checking stubs"""
19275
+ pass
19276
+
18934
19277
  def _typecheckingstub__87e51f8314eb457688965754ef962ccc6b34cd3477e30e0b5c48927231e6e450(
18935
19278
  *,
18936
19279
  api_mapping_id: builtins.str,
@@ -20501,6 +20844,12 @@ def _typecheckingstub__01a95593431af244579bfa1874fdfecb297826dc468c06ee6143c4435
20501
20844
  """Type checking stubs"""
20502
20845
  pass
20503
20846
 
20847
+ def _typecheckingstub__534fc78204353b3af484df3c3dbcbe29516f616aa5df0e356e600f12ba8ac536(
20848
+ stage: IStage,
20849
+ ) -> None:
20850
+ """Type checking stubs"""
20851
+ pass
20852
+
20504
20853
  def _typecheckingstub__c88a55b08f170ef03ef7ee65891d47150923f5d517c30630b947b1c7469a5c45(
20505
20854
  metric_name: builtins.str,
20506
20855
  *,
@@ -20549,6 +20898,18 @@ def _typecheckingstub__331fd0db1f61e3b086b38ed9cad76e580f9f7392bb87bb910e5961df8
20549
20898
  """Type checking stubs"""
20550
20899
  pass
20551
20900
 
20901
+ def _typecheckingstub__673df4a47de472e4a214f42838d3f75aa1fbd64c7cfebf6aabca85f720757892(
20902
+ log_group: _ILogGroup_3c4fa718,
20903
+ ) -> None:
20904
+ """Type checking stubs"""
20905
+ pass
20906
+
20907
+ def _typecheckingstub__24adabd8038382382256c380e34d36079494808b554f1161a31a58eb7a2d3f08(
20908
+ _stage: IStage,
20909
+ ) -> None:
20910
+ """Type checking stubs"""
20911
+ pass
20912
+
20552
20913
  def _typecheckingstub__acdcc456821493a765c0b63f8b403ae0d0c70126d944e7fb885479d1fa8ebbc1(
20553
20914
  *,
20554
20915
  bucket: _IBucket_42e086fd,
@@ -20680,6 +21041,7 @@ def _typecheckingstub__6e40657661365d1f987be571ab8023633c7e4116f50e9a7122d3a476e
20680
21041
 
20681
21042
  def _typecheckingstub__7d1ab9a2efdde27ab3aff279b986e4a558573396d5100c22c5a48bcbee4f320a(
20682
21043
  *,
21044
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
20683
21045
  auto_deploy: typing.Optional[builtins.bool] = None,
20684
21046
  description: typing.Optional[builtins.str] = None,
20685
21047
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,
@@ -21016,6 +21378,7 @@ def _typecheckingstub__64b576b4eaac9e08a38566f9968efb8de351df1daf6fe46d0fe7787da
21016
21378
  *,
21017
21379
  stage_name: builtins.str,
21018
21380
  web_socket_api: IWebSocketApi,
21381
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
21019
21382
  auto_deploy: typing.Optional[builtins.bool] = None,
21020
21383
  description: typing.Optional[builtins.str] = None,
21021
21384
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,
@@ -21068,6 +21431,7 @@ def _typecheckingstub__66ef15ad422b243bd7d761fe83ba5889c94c75b085fc8898f13f5fdbd
21068
21431
 
21069
21432
  def _typecheckingstub__42c328a8780899b5d1949986febb2d9e9b3f4f2f6b8e4f03561cb02e5b407e77(
21070
21433
  *,
21434
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
21071
21435
  auto_deploy: typing.Optional[builtins.bool] = None,
21072
21436
  description: typing.Optional[builtins.str] = None,
21073
21437
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,
@@ -21183,6 +21547,7 @@ def _typecheckingstub__f8917ad3a680cbc2c8ade65728d8549bf69f03ea4c9d0752e5dae7263
21183
21547
  id: builtins.str,
21184
21548
  *,
21185
21549
  stage_name: typing.Optional[builtins.str] = None,
21550
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
21186
21551
  auto_deploy: typing.Optional[builtins.bool] = None,
21187
21552
  description: typing.Optional[builtins.str] = None,
21188
21553
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,
@@ -21255,6 +21620,7 @@ def _typecheckingstub__14605c3383d1d699194e37511d84f3f4da8c64b724b0eacc42f7bff95
21255
21620
 
21256
21621
  def _typecheckingstub__70c0bb0779b1636661ab1c2d695953c6dda7a5247d18a4bd7e045cc96d717a8a(
21257
21622
  *,
21623
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
21258
21624
  auto_deploy: typing.Optional[builtins.bool] = None,
21259
21625
  description: typing.Optional[builtins.str] = None,
21260
21626
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,
@@ -21267,6 +21633,7 @@ def _typecheckingstub__70c0bb0779b1636661ab1c2d695953c6dda7a5247d18a4bd7e045cc96
21267
21633
 
21268
21634
  def _typecheckingstub__77d8b0adbb783021a6c7e33999d2a3a80e2414824d202954599bb4ad7f291721(
21269
21635
  *,
21636
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
21270
21637
  auto_deploy: typing.Optional[builtins.bool] = None,
21271
21638
  description: typing.Optional[builtins.str] = None,
21272
21639
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,
@@ -21333,6 +21700,7 @@ def _typecheckingstub__4573d7530f36463b1b12875197f2c49f968925d114c4ed7ac6b9ab04e
21333
21700
  *,
21334
21701
  http_api: IHttpApi,
21335
21702
  stage_name: typing.Optional[builtins.str] = None,
21703
+ access_log_settings: typing.Optional[IAccessLogSettings] = None,
21336
21704
  auto_deploy: typing.Optional[builtins.bool] = None,
21337
21705
  description: typing.Optional[builtins.str] = None,
21338
21706
  detailed_metrics_enabled: typing.Optional[builtins.bool] = None,