aws-cdk-lib 2.137.0__py3-none-any.whl → 2.139.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 (73) hide show
  1. aws_cdk/__init__.py +8 -0
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.137.0.jsii.tgz → aws-cdk-lib@2.139.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_amplify/__init__.py +29 -113
  5. aws_cdk/aws_apigateway/__init__.py +29 -16
  6. aws_cdk/aws_appconfig/__init__.py +315 -77
  7. aws_cdk/aws_appintegrations/__init__.py +55 -6
  8. aws_cdk/aws_apprunner/__init__.py +5 -2
  9. aws_cdk/aws_appsync/__init__.py +400 -13
  10. aws_cdk/aws_aps/__init__.py +64 -47
  11. aws_cdk/aws_autoscaling/__init__.py +62 -60
  12. aws_cdk/aws_b2bi/__init__.py +2 -6
  13. aws_cdk/aws_backup/__init__.py +53 -57
  14. aws_cdk/aws_batch/__init__.py +109 -0
  15. aws_cdk/aws_bcmdataexports/__init__.py +1114 -0
  16. aws_cdk/aws_bedrock/__init__.py +4144 -0
  17. aws_cdk/aws_chatbot/__init__.py +6 -4
  18. aws_cdk/aws_cleanrooms/__init__.py +526 -3
  19. aws_cdk/aws_cleanroomsml/__init__.py +960 -0
  20. aws_cdk/aws_cloudtrail/__init__.py +10 -10
  21. aws_cdk/aws_cloudwatch/__init__.py +244 -8
  22. aws_cdk/aws_codebuild/__init__.py +27 -22
  23. aws_cdk/aws_codeconnections/__init__.py +435 -0
  24. aws_cdk/aws_cognito/__init__.py +175 -79
  25. aws_cdk/aws_datazone/__init__.py +22 -0
  26. aws_cdk/aws_deadline/__init__.py +5394 -0
  27. aws_cdk/aws_dms/__init__.py +2 -4
  28. aws_cdk/aws_ec2/__init__.py +402 -247
  29. aws_cdk/aws_ecr/__init__.py +630 -0
  30. aws_cdk/aws_ecs/__init__.py +361 -20
  31. aws_cdk/aws_efs/__init__.py +594 -2
  32. aws_cdk/aws_elasticache/__init__.py +86 -32
  33. aws_cdk/aws_elasticloadbalancingv2/__init__.py +75 -10
  34. aws_cdk/aws_emr/__init__.py +2 -2
  35. aws_cdk/aws_entityresolution/__init__.py +1982 -773
  36. aws_cdk/aws_events_targets/__init__.py +17 -4
  37. aws_cdk/aws_globalaccelerator/__init__.py +443 -0
  38. aws_cdk/aws_iam/__init__.py +1 -2
  39. aws_cdk/aws_internetmonitor/__init__.py +14 -6
  40. aws_cdk/aws_ivs/__init__.py +1273 -71
  41. aws_cdk/aws_kms/__init__.py +44 -0
  42. aws_cdk/aws_lambda/__init__.py +9 -0
  43. aws_cdk/aws_mediatailor/__init__.py +41 -0
  44. aws_cdk/aws_oam/__init__.py +204 -0
  45. aws_cdk/aws_personalize/__init__.py +8 -6
  46. aws_cdk/aws_pinpoint/__init__.py +5 -3
  47. aws_cdk/aws_pipes/__init__.py +5 -1
  48. aws_cdk/aws_quicksight/__init__.py +12 -6
  49. aws_cdk/aws_rds/__init__.py +370 -96
  50. aws_cdk/aws_redshiftserverless/__init__.py +157 -0
  51. aws_cdk/aws_route53/__init__.py +587 -14
  52. aws_cdk/aws_sagemaker/__init__.py +233 -2
  53. aws_cdk/aws_securityhub/__init__.py +4940 -102
  54. aws_cdk/aws_securitylake/__init__.py +1326 -89
  55. aws_cdk/aws_ses_actions/__init__.py +155 -0
  56. aws_cdk/aws_sns/__init__.py +61 -4
  57. aws_cdk/aws_ssm/__init__.py +5 -2
  58. aws_cdk/aws_ssmcontacts/__init__.py +11 -4
  59. aws_cdk/aws_stepfunctions/__init__.py +8 -16
  60. aws_cdk/aws_stepfunctions_tasks/__init__.py +676 -1
  61. aws_cdk/aws_timestream/__init__.py +1045 -0
  62. aws_cdk/aws_transfer/__init__.py +19 -10
  63. aws_cdk/aws_verifiedpermissions/__init__.py +114 -37
  64. aws_cdk/aws_wisdom/__init__.py +2 -2
  65. aws_cdk/aws_workspacesthinclient/__init__.py +8 -8
  66. aws_cdk/custom_resources/__init__.py +688 -26
  67. aws_cdk/cx_api/__init__.py +17 -0
  68. {aws_cdk_lib-2.137.0.dist-info → aws_cdk_lib-2.139.0.dist-info}/METADATA +3 -3
  69. {aws_cdk_lib-2.137.0.dist-info → aws_cdk_lib-2.139.0.dist-info}/RECORD +73 -69
  70. {aws_cdk_lib-2.137.0.dist-info → aws_cdk_lib-2.139.0.dist-info}/LICENSE +0 -0
  71. {aws_cdk_lib-2.137.0.dist-info → aws_cdk_lib-2.139.0.dist-info}/NOTICE +0 -0
  72. {aws_cdk_lib-2.137.0.dist-info → aws_cdk_lib-2.139.0.dist-info}/WHEEL +0 -0
  73. {aws_cdk_lib-2.137.0.dist-info → aws_cdk_lib-2.139.0.dist-info}/top_level.txt +0 -0
@@ -613,6 +613,78 @@ cr.AwsCustomResource(self, "ListObjects",
613
613
  Note that even if you restrict the output of your custom resource you can still use any
614
614
  path in `PhysicalResourceId.fromResponse()`.
615
615
 
616
+ ### Custom Resource Logging for SDK Calls
617
+
618
+ By default, logging occurs during execution of the singleton Lambda used by a custom resource. The data being logged includes:
619
+
620
+ * The event object that is received by the Lambda handler
621
+ * The response received after making an API call
622
+ * The response object that the Lambda handler will return
623
+ * SDK versioning information
624
+ * Caught and uncaught errors
625
+
626
+ The `logging` property defined on the `AwsSdkCall` interface allows control over what data is being logged on a per SDK call basis. This is configurable via an instance of the `Logging` class. The `Logging` class exposes two options that can be used to configure logging:
627
+
628
+ 1. `Logging.all()` which enables logging of all data. This is the default `logging` configuration.
629
+ 2. `Logging.withDataHidden()` which prevents logging of all data associated with the API call response, including logging the raw API call response and the `Data` field on the Lambda handler response object. This configuration option is particularly useful for situations where the API call response may contain sensitive information.
630
+
631
+ For further context about `Logging.withDataHidden()`, consider a user who might be making an API call that is returning sensitive information that they may want to keep hidden. To do this, they would configure `logging` with `Logging.withDataHidden()`:
632
+
633
+ ```python
634
+ get_parameter = cr.AwsCustomResource(self, "GetParameter",
635
+ on_update=cr.AwsSdkCall(
636
+ service="SSM",
637
+ action="GetParameter",
638
+ parameters={
639
+ "Name": "my-parameter",
640
+ "WithDecryption": True
641
+ },
642
+ physical_resource_id=cr.PhysicalResourceId.of(Date.now().to_string()),
643
+ logging=cr.Logging.with_data_hidden()
644
+ ),
645
+ policy=cr.AwsCustomResourcePolicy.from_sdk_calls(
646
+ resources=cr.AwsCustomResourcePolicy.ANY_RESOURCE
647
+ )
648
+ )
649
+ ```
650
+
651
+ With this configuration option set, the raw API call response would not be logged and the `Data` field of the response object would be hidden:
652
+
653
+ ```
654
+ {
655
+ "Status": "SUCCESS",
656
+ "Reason": "OK",
657
+ "PhysicalResourceId": "1234567890123",
658
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/Test/043tyub2-194e-4cy2-a969-9891ghj6cd0d",
659
+ "RequestId": "a16y677a-a8b6-41a6-bf7b-7644586861a5",
660
+ "LogicalResourceId": "Sercret",
661
+ "NoEcho": false,
662
+ }
663
+ ```
664
+
665
+ For comparison, configuring `logging` with `Logging.all()` would result in the raw API call response being logged, as well as the full response object:
666
+
667
+ ```
668
+ {
669
+ "Status": "SUCCESS",
670
+ "Reason": "OK",
671
+ "PhysicalResourceId": "1234567890123",
672
+ "StackId": "arn:aws:cloudformation:us-west-2:123456789012:stack/Test/043tyub2-194e-4cy2-a969-9891ghj6cd0d",
673
+ "RequestId": "a16y677a-a8b6-41a6-bf7b-7644586861a5",
674
+ "LogicalResourceId": "Sercret",
675
+ "NoEcho": false,
676
+ "Data": {
677
+ "region": "us-west-2",
678
+ "Parameter.ARN": "arn:aws:ssm:us-west-2:123456789012:parameter/Test/Parameter",
679
+ "Parameter.DataType": "text",
680
+ "Parameter.Name": "/Test/Parameter",
681
+ "Parameter.Type": "SecureString",
682
+ "Parameter.Value": "ThisIsSecret!123",
683
+ "Parameter.Version": 1
684
+ }
685
+ }
686
+ ```
687
+
616
688
  ### Custom Resource Examples
617
689
 
618
690
  #### Get the latest version of a secure SSM parameter
@@ -748,6 +820,7 @@ from ..aws_ec2 import (
748
820
  SubnetSelection as _SubnetSelection_e57d76df,
749
821
  )
750
822
  from ..aws_iam import (
823
+ Grant as _Grant_a7ae64f8,
751
824
  IGrantable as _IGrantable_71c4f5de,
752
825
  IPrincipal as _IPrincipal_539bb2fd,
753
826
  IRole as _IRole_235f5d8e,
@@ -758,6 +831,7 @@ from ..aws_lambda import IFunction as _IFunction_6adb0ab8
758
831
  from ..aws_logs import (
759
832
  ILogGroup as _ILogGroup_3c4fa718, RetentionDays as _RetentionDays_070f99f0
760
833
  )
834
+ from ..aws_stepfunctions import LogLevel as _LogLevel_be1990fe
761
835
 
762
836
 
763
837
  @jsii.implements(_IGrantable_71c4f5de)
@@ -778,25 +852,22 @@ class AwsCustomResource(
778
852
 
779
853
  Example::
780
854
 
781
- get_parameter = cr.AwsCustomResource(self, "AssociateVPCWithHostedZone",
782
- on_create=cr.AwsSdkCall(
783
- assumed_role_arn="arn:aws:iam::OTHERACCOUNT:role/CrossAccount/ManageHostedZoneConnections",
784
- service="Route53",
785
- action="AssociateVPCWithHostedZone",
855
+ get_parameter = cr.AwsCustomResource(self, "GetParameter",
856
+ on_update=cr.AwsSdkCall( # will also be called for a CREATE event
857
+ service="SSM",
858
+ action="GetParameter",
786
859
  parameters={
787
- "HostedZoneId": "hz-123",
788
- "VPC": {
789
- "VPCId": "vpc-123",
790
- "VPCRegion": "region-for-vpc"
791
- }
860
+ "Name": "my-parameter",
861
+ "WithDecryption": True
792
862
  },
793
- physical_resource_id=cr.PhysicalResourceId.of("${vpcStack.SharedVpc.VpcId}-${vpcStack.Region}-${PrivateHostedZone.HostedZoneId}")
794
- ),
795
- # Will ignore any resource and use the assumedRoleArn as resource and 'sts:AssumeRole' for service:action
863
+ physical_resource_id=cr.PhysicalResourceId.of(Date.now().to_string())),
796
864
  policy=cr.AwsCustomResourcePolicy.from_sdk_calls(
797
865
  resources=cr.AwsCustomResourcePolicy.ANY_RESOURCE
798
866
  )
799
867
  )
868
+
869
+ # Use the value in another construct with
870
+ get_parameter.get_response_field("Parameter.Value")
800
871
  '''
801
872
 
802
873
  def __init__(
@@ -1061,25 +1132,22 @@ class AwsCustomResourceProps:
1061
1132
 
1062
1133
  Example::
1063
1134
 
1064
- get_parameter = cr.AwsCustomResource(self, "AssociateVPCWithHostedZone",
1065
- on_create=cr.AwsSdkCall(
1066
- assumed_role_arn="arn:aws:iam::OTHERACCOUNT:role/CrossAccount/ManageHostedZoneConnections",
1067
- service="Route53",
1068
- action="AssociateVPCWithHostedZone",
1135
+ get_parameter = cr.AwsCustomResource(self, "GetParameter",
1136
+ on_update=cr.AwsSdkCall( # will also be called for a CREATE event
1137
+ service="SSM",
1138
+ action="GetParameter",
1069
1139
  parameters={
1070
- "HostedZoneId": "hz-123",
1071
- "VPC": {
1072
- "VPCId": "vpc-123",
1073
- "VPCRegion": "region-for-vpc"
1074
- }
1140
+ "Name": "my-parameter",
1141
+ "WithDecryption": True
1075
1142
  },
1076
- physical_resource_id=cr.PhysicalResourceId.of("${vpcStack.SharedVpc.VpcId}-${vpcStack.Region}-${PrivateHostedZone.HostedZoneId}")
1077
- ),
1078
- # Will ignore any resource and use the assumedRoleArn as resource and 'sts:AssumeRole' for service:action
1143
+ physical_resource_id=cr.PhysicalResourceId.of(Date.now().to_string())),
1079
1144
  policy=cr.AwsCustomResourcePolicy.from_sdk_calls(
1080
1145
  resources=cr.AwsCustomResourcePolicy.ANY_RESOURCE
1081
1146
  )
1082
1147
  )
1148
+
1149
+ # Use the value in another construct with
1150
+ get_parameter.get_response_field("Parameter.Value")
1083
1151
  '''
1084
1152
  if isinstance(on_create, dict):
1085
1153
  on_create = AwsSdkCall(**on_create)
@@ -1322,6 +1390,7 @@ class AwsCustomResourceProps:
1322
1390
  "api_version": "apiVersion",
1323
1391
  "assumed_role_arn": "assumedRoleArn",
1324
1392
  "ignore_error_codes_matching": "ignoreErrorCodesMatching",
1393
+ "logging": "logging",
1325
1394
  "output_paths": "outputPaths",
1326
1395
  "parameters": "parameters",
1327
1396
  "physical_resource_id": "physicalResourceId",
@@ -1337,6 +1406,7 @@ class AwsSdkCall:
1337
1406
  api_version: typing.Optional[builtins.str] = None,
1338
1407
  assumed_role_arn: typing.Optional[builtins.str] = None,
1339
1408
  ignore_error_codes_matching: typing.Optional[builtins.str] = None,
1409
+ logging: typing.Optional["Logging"] = None,
1340
1410
  output_paths: typing.Optional[typing.Sequence[builtins.str]] = None,
1341
1411
  parameters: typing.Any = None,
1342
1412
  physical_resource_id: typing.Optional["PhysicalResourceId"] = None,
@@ -1349,6 +1419,7 @@ class AwsSdkCall:
1349
1419
  :param api_version: API version to use for the service. Default: - use latest available API version
1350
1420
  :param assumed_role_arn: Used for running the SDK calls in underlying lambda with a different role. Can be used primarily for cross-account requests to for example connect hostedzone with a shared vpc. Region controls where assumeRole call is made. Example for Route53 / associateVPCWithHostedZone Default: - run without assuming role
1351
1421
  :param ignore_error_codes_matching: The regex pattern to use to catch API errors. The ``code`` property of the ``Error`` object will be tested against this pattern. If there is a match an error will not be thrown. Default: - do not catch errors
1422
+ :param logging: A property used to configure logging during lambda function execution. Note: The default Logging configuration is all. This configuration will enable logging on all logged data in the lambda handler. This includes: - The event object that is received by the lambda handler - The response received after making a API call - The response object that the lambda handler will return - SDK versioning information - Caught and uncaught errors Default: Logging.all()
1352
1423
  :param output_paths: Restrict the data returned by the custom resource to specific paths in the API response. Use this to limit the data returned by the custom resource if working with API calls that could potentially result in custom response objects exceeding the hard limit of 4096 bytes. Example for ECS / updateService: ['service.deploymentConfiguration.maximumPercent'] Default: - return all data
1353
1424
  :param parameters: The parameters for the service action. Default: - no parameters
1354
1425
  :param physical_resource_id: The physical resource id of the custom resource for this call. Mandatory for onCreate call. In onUpdate, you can omit this to passthrough it from request. Default: - no physical resource id
@@ -1377,6 +1448,7 @@ class AwsSdkCall:
1377
1448
  check_type(argname="argument api_version", value=api_version, expected_type=type_hints["api_version"])
1378
1449
  check_type(argname="argument assumed_role_arn", value=assumed_role_arn, expected_type=type_hints["assumed_role_arn"])
1379
1450
  check_type(argname="argument ignore_error_codes_matching", value=ignore_error_codes_matching, expected_type=type_hints["ignore_error_codes_matching"])
1451
+ check_type(argname="argument logging", value=logging, expected_type=type_hints["logging"])
1380
1452
  check_type(argname="argument output_paths", value=output_paths, expected_type=type_hints["output_paths"])
1381
1453
  check_type(argname="argument parameters", value=parameters, expected_type=type_hints["parameters"])
1382
1454
  check_type(argname="argument physical_resource_id", value=physical_resource_id, expected_type=type_hints["physical_resource_id"])
@@ -1391,6 +1463,8 @@ class AwsSdkCall:
1391
1463
  self._values["assumed_role_arn"] = assumed_role_arn
1392
1464
  if ignore_error_codes_matching is not None:
1393
1465
  self._values["ignore_error_codes_matching"] = ignore_error_codes_matching
1466
+ if logging is not None:
1467
+ self._values["logging"] = logging
1394
1468
  if output_paths is not None:
1395
1469
  self._values["output_paths"] = output_paths
1396
1470
  if parameters is not None:
@@ -1472,6 +1546,24 @@ class AwsSdkCall:
1472
1546
  result = self._values.get("ignore_error_codes_matching")
1473
1547
  return typing.cast(typing.Optional[builtins.str], result)
1474
1548
 
1549
+ @builtins.property
1550
+ def logging(self) -> typing.Optional["Logging"]:
1551
+ '''A property used to configure logging during lambda function execution.
1552
+
1553
+ Note: The default Logging configuration is all. This configuration will enable logging on all logged data
1554
+ in the lambda handler. This includes:
1555
+
1556
+ - The event object that is received by the lambda handler
1557
+ - The response received after making a API call
1558
+ - The response object that the lambda handler will return
1559
+ - SDK versioning information
1560
+ - Caught and uncaught errors
1561
+
1562
+ :default: Logging.all()
1563
+ '''
1564
+ result = self._values.get("logging")
1565
+ return typing.cast(typing.Optional["Logging"], result)
1566
+
1475
1567
  @builtins.property
1476
1568
  def output_paths(self) -> typing.Optional[typing.List[builtins.str]]:
1477
1569
  '''Restrict the data returned by the custom resource to specific paths in the API response.
@@ -1534,6 +1626,221 @@ class AwsSdkCall:
1534
1626
  )
1535
1627
 
1536
1628
 
1629
+ @jsii.data_type(
1630
+ jsii_type="aws-cdk-lib.custom_resources.LogOptions",
1631
+ jsii_struct_bases=[],
1632
+ name_mapping={
1633
+ "destination": "destination",
1634
+ "include_execution_data": "includeExecutionData",
1635
+ "level": "level",
1636
+ },
1637
+ )
1638
+ class LogOptions:
1639
+ def __init__(
1640
+ self,
1641
+ *,
1642
+ destination: typing.Optional[_ILogGroup_3c4fa718] = None,
1643
+ include_execution_data: typing.Optional[builtins.bool] = None,
1644
+ level: typing.Optional[_LogLevel_be1990fe] = None,
1645
+ ) -> None:
1646
+ '''Log Options for the state machine.
1647
+
1648
+ :param destination: The log group where the execution history events will be logged. Default: - a new log group will be created
1649
+ :param include_execution_data: Determines whether execution data is included in your log. Default: - false
1650
+ :param level: Defines which category of execution history events are logged. Default: - ERROR
1651
+
1652
+ :exampleMetadata: fixture=_generated
1653
+
1654
+ Example::
1655
+
1656
+ # The code below shows an example of how to instantiate this type.
1657
+ # The values are placeholders you should change.
1658
+ from aws_cdk import aws_logs as logs
1659
+ from aws_cdk import aws_stepfunctions as stepfunctions
1660
+ from aws_cdk import custom_resources
1661
+
1662
+ # log_group: logs.LogGroup
1663
+
1664
+ log_options = custom_resources.LogOptions(
1665
+ destination=log_group,
1666
+ include_execution_data=False,
1667
+ level=stepfunctions.LogLevel.OFF
1668
+ )
1669
+ '''
1670
+ if __debug__:
1671
+ type_hints = typing.get_type_hints(_typecheckingstub__2622296f61199d2b10825c21d976c0578e9488ad1b2b7635565f604c598734b7)
1672
+ check_type(argname="argument destination", value=destination, expected_type=type_hints["destination"])
1673
+ check_type(argname="argument include_execution_data", value=include_execution_data, expected_type=type_hints["include_execution_data"])
1674
+ check_type(argname="argument level", value=level, expected_type=type_hints["level"])
1675
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
1676
+ if destination is not None:
1677
+ self._values["destination"] = destination
1678
+ if include_execution_data is not None:
1679
+ self._values["include_execution_data"] = include_execution_data
1680
+ if level is not None:
1681
+ self._values["level"] = level
1682
+
1683
+ @builtins.property
1684
+ def destination(self) -> typing.Optional[_ILogGroup_3c4fa718]:
1685
+ '''The log group where the execution history events will be logged.
1686
+
1687
+ :default: - a new log group will be created
1688
+ '''
1689
+ result = self._values.get("destination")
1690
+ return typing.cast(typing.Optional[_ILogGroup_3c4fa718], result)
1691
+
1692
+ @builtins.property
1693
+ def include_execution_data(self) -> typing.Optional[builtins.bool]:
1694
+ '''Determines whether execution data is included in your log.
1695
+
1696
+ :default: - false
1697
+ '''
1698
+ result = self._values.get("include_execution_data")
1699
+ return typing.cast(typing.Optional[builtins.bool], result)
1700
+
1701
+ @builtins.property
1702
+ def level(self) -> typing.Optional[_LogLevel_be1990fe]:
1703
+ '''Defines which category of execution history events are logged.
1704
+
1705
+ :default: - ERROR
1706
+ '''
1707
+ result = self._values.get("level")
1708
+ return typing.cast(typing.Optional[_LogLevel_be1990fe], result)
1709
+
1710
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
1711
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
1712
+
1713
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
1714
+ return not (rhs == self)
1715
+
1716
+ def __repr__(self) -> str:
1717
+ return "LogOptions(%s)" % ", ".join(
1718
+ k + "=" + repr(v) for k, v in self._values.items()
1719
+ )
1720
+
1721
+
1722
+ class Logging(
1723
+ metaclass=jsii.JSIIAbstractClass,
1724
+ jsii_type="aws-cdk-lib.custom_resources.Logging",
1725
+ ):
1726
+ '''A class used to configure Logging during AwsCustomResource SDK calls.
1727
+
1728
+ :exampleMetadata: infused
1729
+
1730
+ Example::
1731
+
1732
+ get_parameter = cr.AwsCustomResource(self, "GetParameter",
1733
+ on_update=cr.AwsSdkCall(
1734
+ service="SSM",
1735
+ action="GetParameter",
1736
+ parameters={
1737
+ "Name": "my-parameter",
1738
+ "WithDecryption": True
1739
+ },
1740
+ physical_resource_id=cr.PhysicalResourceId.of(Date.now().to_string()),
1741
+ logging=cr.Logging.with_data_hidden()
1742
+ ),
1743
+ policy=cr.AwsCustomResourcePolicy.from_sdk_calls(
1744
+ resources=cr.AwsCustomResourcePolicy.ANY_RESOURCE
1745
+ )
1746
+ )
1747
+ '''
1748
+
1749
+ def __init__(
1750
+ self,
1751
+ *,
1752
+ log_api_response_data: typing.Optional[builtins.bool] = None,
1753
+ ) -> None:
1754
+ '''
1755
+ :param log_api_response_data: Whether or not to log data associated with the API call response. Default: true
1756
+ '''
1757
+ props = LoggingProps(log_api_response_data=log_api_response_data)
1758
+
1759
+ jsii.create(self.__class__, self, [props])
1760
+
1761
+ @jsii.member(jsii_name="all")
1762
+ @builtins.classmethod
1763
+ def all(cls) -> "Logging":
1764
+ '''Enables logging of all logged data in the lambda handler.
1765
+
1766
+ This includes the event object, the API call response, all fields in the response object
1767
+ returned by the lambda, and any errors encountered.
1768
+ '''
1769
+ return typing.cast("Logging", jsii.sinvoke(cls, "all", []))
1770
+
1771
+ @jsii.member(jsii_name="withDataHidden")
1772
+ @builtins.classmethod
1773
+ def with_data_hidden(cls) -> "Logging":
1774
+ '''Hides logging of data associated with the API call response.
1775
+
1776
+ This includes hiding the raw API
1777
+ call response and the ``Data`` field associated with the lambda handler response.
1778
+ '''
1779
+ return typing.cast("Logging", jsii.sinvoke(cls, "withDataHidden", []))
1780
+
1781
+
1782
+ class _LoggingProxy(Logging):
1783
+ pass
1784
+
1785
+ # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class
1786
+ typing.cast(typing.Any, Logging).__jsii_proxy_class__ = lambda : _LoggingProxy
1787
+
1788
+
1789
+ @jsii.data_type(
1790
+ jsii_type="aws-cdk-lib.custom_resources.LoggingProps",
1791
+ jsii_struct_bases=[],
1792
+ name_mapping={"log_api_response_data": "logApiResponseData"},
1793
+ )
1794
+ class LoggingProps:
1795
+ def __init__(
1796
+ self,
1797
+ *,
1798
+ log_api_response_data: typing.Optional[builtins.bool] = None,
1799
+ ) -> None:
1800
+ '''Properties used to initialize Logging.
1801
+
1802
+ :param log_api_response_data: Whether or not to log data associated with the API call response. Default: true
1803
+
1804
+ :exampleMetadata: fixture=_generated
1805
+
1806
+ Example::
1807
+
1808
+ # The code below shows an example of how to instantiate this type.
1809
+ # The values are placeholders you should change.
1810
+ from aws_cdk import custom_resources
1811
+
1812
+ logging_props = custom_resources.LoggingProps(
1813
+ log_api_response_data=False
1814
+ )
1815
+ '''
1816
+ if __debug__:
1817
+ type_hints = typing.get_type_hints(_typecheckingstub__da0d46a1eb4b059395d06daee7dcb9417dffd0b4cf8e8942cbe0a6549f0faf4b)
1818
+ check_type(argname="argument log_api_response_data", value=log_api_response_data, expected_type=type_hints["log_api_response_data"])
1819
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
1820
+ if log_api_response_data is not None:
1821
+ self._values["log_api_response_data"] = log_api_response_data
1822
+
1823
+ @builtins.property
1824
+ def log_api_response_data(self) -> typing.Optional[builtins.bool]:
1825
+ '''Whether or not to log data associated with the API call response.
1826
+
1827
+ :default: true
1828
+ '''
1829
+ result = self._values.get("log_api_response_data")
1830
+ return typing.cast(typing.Optional[builtins.bool], result)
1831
+
1832
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
1833
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
1834
+
1835
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
1836
+ return not (rhs == self)
1837
+
1838
+ def __repr__(self) -> str:
1839
+ return "LoggingProps(%s)" % ", ".join(
1840
+ k + "=" + repr(v) for k, v in self._values.items()
1841
+ )
1842
+
1843
+
1537
1844
  class PhysicalResourceId(
1538
1845
  metaclass=jsii.JSIIMeta,
1539
1846
  jsii_type="aws-cdk-lib.custom_resources.PhysicalResourceId",
@@ -1706,6 +2013,7 @@ class Provider(
1706
2013
  id: builtins.str,
1707
2014
  *,
1708
2015
  on_event_handler: _IFunction_6adb0ab8,
2016
+ disable_waiter_state_machine_logging: typing.Optional[builtins.bool] = None,
1709
2017
  is_complete_handler: typing.Optional[_IFunction_6adb0ab8] = None,
1710
2018
  log_group: typing.Optional[_ILogGroup_3c4fa718] = None,
1711
2019
  log_retention: typing.Optional[_RetentionDays_070f99f0] = None,
@@ -1717,11 +2025,13 @@ class Provider(
1717
2025
  total_timeout: typing.Optional[_Duration_4839e8c3] = None,
1718
2026
  vpc: typing.Optional[_IVpc_f30d5663] = None,
1719
2027
  vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
2028
+ waiter_state_machine_log_options: typing.Optional[typing.Union[LogOptions, typing.Dict[builtins.str, typing.Any]]] = None,
1720
2029
  ) -> None:
1721
2030
  '''
1722
2031
  :param scope: -
1723
2032
  :param id: -
1724
2033
  :param on_event_handler: The AWS Lambda function to invoke for all resource lifecycle operations (CREATE/UPDATE/DELETE). This function is responsible to begin the requested resource operation (CREATE/UPDATE/DELETE) and return any additional properties to add to the event, which will later be passed to ``isComplete``. The ``PhysicalResourceId`` property must be included in the response.
2034
+ :param disable_waiter_state_machine_logging: Whether logging for the waiter state machine is disabled. Default: - false
1725
2035
  :param is_complete_handler: The AWS Lambda function to invoke in order to determine if the operation is complete. This function will be called immediately after ``onEvent`` and then periodically based on the configured query interval as long as it returns ``false``. If the function still returns ``false`` and the alloted timeout has passed, the operation will fail. Default: - provider is synchronous. This means that the ``onEvent`` handler is expected to finish all lifecycle operations within the initial invocation.
1726
2036
  :param log_group: The Log Group used for logging of events emitted by the custom resource's lambda function. Providing a user-controlled log group was rolled out to commercial regions on 2023-11-16. If you are deploying to another type of region, please check regional availability first. Default: - a default log group created by AWS Lambda
1727
2037
  :param log_retention: The number of days framework log events are kept in CloudWatch Logs. When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to ``INFINITE``. This is a legacy API and we strongly recommend you migrate to ``logGroup`` if you can. ``logGroup`` allows you to create a fully customizable log group and instruct the Lambda function to send logs to it. Default: logs.RetentionDays.INFINITE
@@ -1733,6 +2043,7 @@ class Provider(
1733
2043
  :param total_timeout: Total timeout for the entire operation. The maximum timeout is 1 hour (yes, it can exceed the AWS Lambda 15 minutes) Default: Duration.minutes(30)
1734
2044
  :param vpc: The vpc to provision the lambda functions in. Default: - functions are not provisioned inside a vpc.
1735
2045
  :param vpc_subnets: Which subnets from the VPC to place the lambda functions in. Only used if 'vpc' is supplied. Note: internet access for Lambdas requires a NAT gateway, so picking Public subnets is not allowed. Default: - the Vpc default strategy if not specified
2046
+ :param waiter_state_machine_log_options: Defines what execution history events of the waiter state machine are logged and where they are logged. Default: - A default log group will be created if logging for the waiter state machine is enabled.
1736
2047
  '''
1737
2048
  if __debug__:
1738
2049
  type_hints = typing.get_type_hints(_typecheckingstub__29415d7bf7977fcf110b77ce69cec309dcf0404601944735020770ddfe2b01a8)
@@ -1740,6 +2051,7 @@ class Provider(
1740
2051
  check_type(argname="argument id", value=id, expected_type=type_hints["id"])
1741
2052
  props = ProviderProps(
1742
2053
  on_event_handler=on_event_handler,
2054
+ disable_waiter_state_machine_logging=disable_waiter_state_machine_logging,
1743
2055
  is_complete_handler=is_complete_handler,
1744
2056
  log_group=log_group,
1745
2057
  log_retention=log_retention,
@@ -1751,6 +2063,7 @@ class Provider(
1751
2063
  total_timeout=total_timeout,
1752
2064
  vpc=vpc,
1753
2065
  vpc_subnets=vpc_subnets,
2066
+ waiter_state_machine_log_options=waiter_state_machine_log_options,
1754
2067
  )
1755
2068
 
1756
2069
  jsii.create(self.__class__, self, [scope, id, props])
@@ -1779,6 +2092,7 @@ class Provider(
1779
2092
  jsii_struct_bases=[],
1780
2093
  name_mapping={
1781
2094
  "on_event_handler": "onEventHandler",
2095
+ "disable_waiter_state_machine_logging": "disableWaiterStateMachineLogging",
1782
2096
  "is_complete_handler": "isCompleteHandler",
1783
2097
  "log_group": "logGroup",
1784
2098
  "log_retention": "logRetention",
@@ -1790,6 +2104,7 @@ class Provider(
1790
2104
  "total_timeout": "totalTimeout",
1791
2105
  "vpc": "vpc",
1792
2106
  "vpc_subnets": "vpcSubnets",
2107
+ "waiter_state_machine_log_options": "waiterStateMachineLogOptions",
1793
2108
  },
1794
2109
  )
1795
2110
  class ProviderProps:
@@ -1797,6 +2112,7 @@ class ProviderProps:
1797
2112
  self,
1798
2113
  *,
1799
2114
  on_event_handler: _IFunction_6adb0ab8,
2115
+ disable_waiter_state_machine_logging: typing.Optional[builtins.bool] = None,
1800
2116
  is_complete_handler: typing.Optional[_IFunction_6adb0ab8] = None,
1801
2117
  log_group: typing.Optional[_ILogGroup_3c4fa718] = None,
1802
2118
  log_retention: typing.Optional[_RetentionDays_070f99f0] = None,
@@ -1808,10 +2124,12 @@ class ProviderProps:
1808
2124
  total_timeout: typing.Optional[_Duration_4839e8c3] = None,
1809
2125
  vpc: typing.Optional[_IVpc_f30d5663] = None,
1810
2126
  vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
2127
+ waiter_state_machine_log_options: typing.Optional[typing.Union[LogOptions, typing.Dict[builtins.str, typing.Any]]] = None,
1811
2128
  ) -> None:
1812
2129
  '''Initialization properties for the ``Provider`` construct.
1813
2130
 
1814
2131
  :param on_event_handler: The AWS Lambda function to invoke for all resource lifecycle operations (CREATE/UPDATE/DELETE). This function is responsible to begin the requested resource operation (CREATE/UPDATE/DELETE) and return any additional properties to add to the event, which will later be passed to ``isComplete``. The ``PhysicalResourceId`` property must be included in the response.
2132
+ :param disable_waiter_state_machine_logging: Whether logging for the waiter state machine is disabled. Default: - false
1815
2133
  :param is_complete_handler: The AWS Lambda function to invoke in order to determine if the operation is complete. This function will be called immediately after ``onEvent`` and then periodically based on the configured query interval as long as it returns ``false``. If the function still returns ``false`` and the alloted timeout has passed, the operation will fail. Default: - provider is synchronous. This means that the ``onEvent`` handler is expected to finish all lifecycle operations within the initial invocation.
1816
2134
  :param log_group: The Log Group used for logging of events emitted by the custom resource's lambda function. Providing a user-controlled log group was rolled out to commercial regions on 2023-11-16. If you are deploying to another type of region, please check regional availability first. Default: - a default log group created by AWS Lambda
1817
2135
  :param log_retention: The number of days framework log events are kept in CloudWatch Logs. When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to ``INFINITE``. This is a legacy API and we strongly recommend you migrate to ``logGroup`` if you can. ``logGroup`` allows you to create a fully customizable log group and instruct the Lambda function to send logs to it. Default: logs.RetentionDays.INFINITE
@@ -1823,6 +2141,7 @@ class ProviderProps:
1823
2141
  :param total_timeout: Total timeout for the entire operation. The maximum timeout is 1 hour (yes, it can exceed the AWS Lambda 15 minutes) Default: Duration.minutes(30)
1824
2142
  :param vpc: The vpc to provision the lambda functions in. Default: - functions are not provisioned inside a vpc.
1825
2143
  :param vpc_subnets: Which subnets from the VPC to place the lambda functions in. Only used if 'vpc' is supplied. Note: internet access for Lambdas requires a NAT gateway, so picking Public subnets is not allowed. Default: - the Vpc default strategy if not specified
2144
+ :param waiter_state_machine_log_options: Defines what execution history events of the waiter state machine are logged and where they are logged. Default: - A default log group will be created if logging for the waiter state machine is enabled.
1826
2145
 
1827
2146
  :exampleMetadata: infused
1828
2147
 
@@ -1844,9 +2163,12 @@ class ProviderProps:
1844
2163
  '''
1845
2164
  if isinstance(vpc_subnets, dict):
1846
2165
  vpc_subnets = _SubnetSelection_e57d76df(**vpc_subnets)
2166
+ if isinstance(waiter_state_machine_log_options, dict):
2167
+ waiter_state_machine_log_options = LogOptions(**waiter_state_machine_log_options)
1847
2168
  if __debug__:
1848
2169
  type_hints = typing.get_type_hints(_typecheckingstub__32b03803ee02437d8d83814282c700ede5633030e4d9f7ebdaf3b9d075b0cbdb)
1849
2170
  check_type(argname="argument on_event_handler", value=on_event_handler, expected_type=type_hints["on_event_handler"])
2171
+ check_type(argname="argument disable_waiter_state_machine_logging", value=disable_waiter_state_machine_logging, expected_type=type_hints["disable_waiter_state_machine_logging"])
1850
2172
  check_type(argname="argument is_complete_handler", value=is_complete_handler, expected_type=type_hints["is_complete_handler"])
1851
2173
  check_type(argname="argument log_group", value=log_group, expected_type=type_hints["log_group"])
1852
2174
  check_type(argname="argument log_retention", value=log_retention, expected_type=type_hints["log_retention"])
@@ -1858,9 +2180,12 @@ class ProviderProps:
1858
2180
  check_type(argname="argument total_timeout", value=total_timeout, expected_type=type_hints["total_timeout"])
1859
2181
  check_type(argname="argument vpc", value=vpc, expected_type=type_hints["vpc"])
1860
2182
  check_type(argname="argument vpc_subnets", value=vpc_subnets, expected_type=type_hints["vpc_subnets"])
2183
+ check_type(argname="argument waiter_state_machine_log_options", value=waiter_state_machine_log_options, expected_type=type_hints["waiter_state_machine_log_options"])
1861
2184
  self._values: typing.Dict[builtins.str, typing.Any] = {
1862
2185
  "on_event_handler": on_event_handler,
1863
2186
  }
2187
+ if disable_waiter_state_machine_logging is not None:
2188
+ self._values["disable_waiter_state_machine_logging"] = disable_waiter_state_machine_logging
1864
2189
  if is_complete_handler is not None:
1865
2190
  self._values["is_complete_handler"] = is_complete_handler
1866
2191
  if log_group is not None:
@@ -1883,6 +2208,8 @@ class ProviderProps:
1883
2208
  self._values["vpc"] = vpc
1884
2209
  if vpc_subnets is not None:
1885
2210
  self._values["vpc_subnets"] = vpc_subnets
2211
+ if waiter_state_machine_log_options is not None:
2212
+ self._values["waiter_state_machine_log_options"] = waiter_state_machine_log_options
1886
2213
 
1887
2214
  @builtins.property
1888
2215
  def on_event_handler(self) -> _IFunction_6adb0ab8:
@@ -1897,6 +2224,15 @@ class ProviderProps:
1897
2224
  assert result is not None, "Required property 'on_event_handler' is missing"
1898
2225
  return typing.cast(_IFunction_6adb0ab8, result)
1899
2226
 
2227
+ @builtins.property
2228
+ def disable_waiter_state_machine_logging(self) -> typing.Optional[builtins.bool]:
2229
+ '''Whether logging for the waiter state machine is disabled.
2230
+
2231
+ :default: - false
2232
+ '''
2233
+ result = self._values.get("disable_waiter_state_machine_logging")
2234
+ return typing.cast(typing.Optional[builtins.bool], result)
2235
+
1900
2236
  @builtins.property
1901
2237
  def is_complete_handler(self) -> typing.Optional[_IFunction_6adb0ab8]:
1902
2238
  '''The AWS Lambda function to invoke in order to determine if the operation is complete.
@@ -2033,6 +2369,15 @@ class ProviderProps:
2033
2369
  result = self._values.get("vpc_subnets")
2034
2370
  return typing.cast(typing.Optional[_SubnetSelection_e57d76df], result)
2035
2371
 
2372
+ @builtins.property
2373
+ def waiter_state_machine_log_options(self) -> typing.Optional[LogOptions]:
2374
+ '''Defines what execution history events of the waiter state machine are logged and where they are logged.
2375
+
2376
+ :default: - A default log group will be created if logging for the waiter state machine is enabled.
2377
+ '''
2378
+ result = self._values.get("waiter_state_machine_log_options")
2379
+ return typing.cast(typing.Optional[LogOptions], result)
2380
+
2036
2381
  def __eq__(self, rhs: typing.Any) -> builtins.bool:
2037
2382
  return isinstance(rhs, self.__class__) and rhs._values == self._values
2038
2383
 
@@ -2110,16 +2455,278 @@ class SdkCallsPolicyOptions:
2110
2455
  )
2111
2456
 
2112
2457
 
2458
+ class WaiterStateMachine(
2459
+ _constructs_77d1e7e8.Construct,
2460
+ metaclass=jsii.JSIIMeta,
2461
+ jsii_type="aws-cdk-lib.custom_resources.WaiterStateMachine",
2462
+ ):
2463
+ '''A very simple StateMachine construct highly customized to the provider framework.
2464
+
2465
+ We previously used ``CfnResource`` instead of ``CfnStateMachine`` to avoid depending
2466
+ on ``aws-stepfunctions`` module, but now it is okay.
2467
+
2468
+ The state machine continuously calls the isCompleteHandler, until it succeeds or times out.
2469
+ The handler is called ``maxAttempts`` times with an ``interval`` duration and a ``backoffRate`` rate.
2470
+
2471
+ :exampleMetadata: fixture=_generated
2472
+
2473
+ Example::
2474
+
2475
+ # The code below shows an example of how to instantiate this type.
2476
+ # The values are placeholders you should change.
2477
+ import aws_cdk as cdk
2478
+ from aws_cdk import aws_lambda as lambda_
2479
+ from aws_cdk import aws_logs as logs
2480
+ from aws_cdk import aws_stepfunctions as stepfunctions
2481
+ from aws_cdk import custom_resources
2482
+
2483
+ # function_: lambda.Function
2484
+ # log_group: logs.LogGroup
2485
+
2486
+ waiter_state_machine = custom_resources.WaiterStateMachine(self, "MyWaiterStateMachine",
2487
+ backoff_rate=123,
2488
+ interval=cdk.Duration.minutes(30),
2489
+ is_complete_handler=function_,
2490
+ max_attempts=123,
2491
+ timeout_handler=function_,
2492
+
2493
+ # the properties below are optional
2494
+ disable_logging=False,
2495
+ log_options=custom_resources.LogOptions(
2496
+ destination=log_group,
2497
+ include_execution_data=False,
2498
+ level=stepfunctions.LogLevel.OFF
2499
+ )
2500
+ )
2501
+ '''
2502
+
2503
+ def __init__(
2504
+ self,
2505
+ scope: _constructs_77d1e7e8.Construct,
2506
+ id: builtins.str,
2507
+ *,
2508
+ backoff_rate: jsii.Number,
2509
+ interval: _Duration_4839e8c3,
2510
+ is_complete_handler: _IFunction_6adb0ab8,
2511
+ max_attempts: jsii.Number,
2512
+ timeout_handler: _IFunction_6adb0ab8,
2513
+ disable_logging: typing.Optional[builtins.bool] = None,
2514
+ log_options: typing.Optional[typing.Union[LogOptions, typing.Dict[builtins.str, typing.Any]]] = None,
2515
+ ) -> None:
2516
+ '''
2517
+ :param scope: -
2518
+ :param id: -
2519
+ :param backoff_rate: Backoff between attempts.
2520
+ :param interval: The interval to wait between attempts.
2521
+ :param is_complete_handler: The main handler that notifies if the waiter to decide 'complete' or 'incomplete'.
2522
+ :param max_attempts: Number of attempts.
2523
+ :param timeout_handler: The handler to call if the waiter times out and is incomplete.
2524
+ :param disable_logging: Whether logging for the state machine is disabled. Default: - false
2525
+ :param log_options: Defines what execution history events are logged and where they are logged. Default: - A default log group will be created if logging is enabled.
2526
+ '''
2527
+ if __debug__:
2528
+ type_hints = typing.get_type_hints(_typecheckingstub__12427b739f326cdb535d2aaf4a70f10977eec5711902d4e5e395f0b8c9bb184e)
2529
+ check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
2530
+ check_type(argname="argument id", value=id, expected_type=type_hints["id"])
2531
+ props = WaiterStateMachineProps(
2532
+ backoff_rate=backoff_rate,
2533
+ interval=interval,
2534
+ is_complete_handler=is_complete_handler,
2535
+ max_attempts=max_attempts,
2536
+ timeout_handler=timeout_handler,
2537
+ disable_logging=disable_logging,
2538
+ log_options=log_options,
2539
+ )
2540
+
2541
+ jsii.create(self.__class__, self, [scope, id, props])
2542
+
2543
+ @jsii.member(jsii_name="grantStartExecution")
2544
+ def grant_start_execution(self, identity: _IGrantable_71c4f5de) -> _Grant_a7ae64f8:
2545
+ '''Grant the given identity permissions on StartExecution of the state machine.
2546
+
2547
+ :param identity: -
2548
+ '''
2549
+ if __debug__:
2550
+ type_hints = typing.get_type_hints(_typecheckingstub__2c3d1c306ca04ebd1194ce4f97bed6aa9510a02067654b39f43a1ecef601e3db)
2551
+ check_type(argname="argument identity", value=identity, expected_type=type_hints["identity"])
2552
+ return typing.cast(_Grant_a7ae64f8, jsii.invoke(self, "grantStartExecution", [identity]))
2553
+
2554
+ @builtins.property
2555
+ @jsii.member(jsii_name="stateMachineArn")
2556
+ def state_machine_arn(self) -> builtins.str:
2557
+ '''The ARN of the state machine.'''
2558
+ return typing.cast(builtins.str, jsii.get(self, "stateMachineArn"))
2559
+
2560
+
2561
+ @jsii.data_type(
2562
+ jsii_type="aws-cdk-lib.custom_resources.WaiterStateMachineProps",
2563
+ jsii_struct_bases=[],
2564
+ name_mapping={
2565
+ "backoff_rate": "backoffRate",
2566
+ "interval": "interval",
2567
+ "is_complete_handler": "isCompleteHandler",
2568
+ "max_attempts": "maxAttempts",
2569
+ "timeout_handler": "timeoutHandler",
2570
+ "disable_logging": "disableLogging",
2571
+ "log_options": "logOptions",
2572
+ },
2573
+ )
2574
+ class WaiterStateMachineProps:
2575
+ def __init__(
2576
+ self,
2577
+ *,
2578
+ backoff_rate: jsii.Number,
2579
+ interval: _Duration_4839e8c3,
2580
+ is_complete_handler: _IFunction_6adb0ab8,
2581
+ max_attempts: jsii.Number,
2582
+ timeout_handler: _IFunction_6adb0ab8,
2583
+ disable_logging: typing.Optional[builtins.bool] = None,
2584
+ log_options: typing.Optional[typing.Union[LogOptions, typing.Dict[builtins.str, typing.Any]]] = None,
2585
+ ) -> None:
2586
+ '''Initialization properties for the ``WaiterStateMachine`` construct.
2587
+
2588
+ :param backoff_rate: Backoff between attempts.
2589
+ :param interval: The interval to wait between attempts.
2590
+ :param is_complete_handler: The main handler that notifies if the waiter to decide 'complete' or 'incomplete'.
2591
+ :param max_attempts: Number of attempts.
2592
+ :param timeout_handler: The handler to call if the waiter times out and is incomplete.
2593
+ :param disable_logging: Whether logging for the state machine is disabled. Default: - false
2594
+ :param log_options: Defines what execution history events are logged and where they are logged. Default: - A default log group will be created if logging is enabled.
2595
+
2596
+ :exampleMetadata: fixture=_generated
2597
+
2598
+ Example::
2599
+
2600
+ # The code below shows an example of how to instantiate this type.
2601
+ # The values are placeholders you should change.
2602
+ import aws_cdk as cdk
2603
+ from aws_cdk import aws_lambda as lambda_
2604
+ from aws_cdk import aws_logs as logs
2605
+ from aws_cdk import aws_stepfunctions as stepfunctions
2606
+ from aws_cdk import custom_resources
2607
+
2608
+ # function_: lambda.Function
2609
+ # log_group: logs.LogGroup
2610
+
2611
+ waiter_state_machine_props = custom_resources.WaiterStateMachineProps(
2612
+ backoff_rate=123,
2613
+ interval=cdk.Duration.minutes(30),
2614
+ is_complete_handler=function_,
2615
+ max_attempts=123,
2616
+ timeout_handler=function_,
2617
+
2618
+ # the properties below are optional
2619
+ disable_logging=False,
2620
+ log_options=custom_resources.LogOptions(
2621
+ destination=log_group,
2622
+ include_execution_data=False,
2623
+ level=stepfunctions.LogLevel.OFF
2624
+ )
2625
+ )
2626
+ '''
2627
+ if isinstance(log_options, dict):
2628
+ log_options = LogOptions(**log_options)
2629
+ if __debug__:
2630
+ type_hints = typing.get_type_hints(_typecheckingstub__569ff1333551048ad82f7261bcf43cbefe118e974cba179165c355fc9347fc13)
2631
+ check_type(argname="argument backoff_rate", value=backoff_rate, expected_type=type_hints["backoff_rate"])
2632
+ check_type(argname="argument interval", value=interval, expected_type=type_hints["interval"])
2633
+ check_type(argname="argument is_complete_handler", value=is_complete_handler, expected_type=type_hints["is_complete_handler"])
2634
+ check_type(argname="argument max_attempts", value=max_attempts, expected_type=type_hints["max_attempts"])
2635
+ check_type(argname="argument timeout_handler", value=timeout_handler, expected_type=type_hints["timeout_handler"])
2636
+ check_type(argname="argument disable_logging", value=disable_logging, expected_type=type_hints["disable_logging"])
2637
+ check_type(argname="argument log_options", value=log_options, expected_type=type_hints["log_options"])
2638
+ self._values: typing.Dict[builtins.str, typing.Any] = {
2639
+ "backoff_rate": backoff_rate,
2640
+ "interval": interval,
2641
+ "is_complete_handler": is_complete_handler,
2642
+ "max_attempts": max_attempts,
2643
+ "timeout_handler": timeout_handler,
2644
+ }
2645
+ if disable_logging is not None:
2646
+ self._values["disable_logging"] = disable_logging
2647
+ if log_options is not None:
2648
+ self._values["log_options"] = log_options
2649
+
2650
+ @builtins.property
2651
+ def backoff_rate(self) -> jsii.Number:
2652
+ '''Backoff between attempts.'''
2653
+ result = self._values.get("backoff_rate")
2654
+ assert result is not None, "Required property 'backoff_rate' is missing"
2655
+ return typing.cast(jsii.Number, result)
2656
+
2657
+ @builtins.property
2658
+ def interval(self) -> _Duration_4839e8c3:
2659
+ '''The interval to wait between attempts.'''
2660
+ result = self._values.get("interval")
2661
+ assert result is not None, "Required property 'interval' is missing"
2662
+ return typing.cast(_Duration_4839e8c3, result)
2663
+
2664
+ @builtins.property
2665
+ def is_complete_handler(self) -> _IFunction_6adb0ab8:
2666
+ '''The main handler that notifies if the waiter to decide 'complete' or 'incomplete'.'''
2667
+ result = self._values.get("is_complete_handler")
2668
+ assert result is not None, "Required property 'is_complete_handler' is missing"
2669
+ return typing.cast(_IFunction_6adb0ab8, result)
2670
+
2671
+ @builtins.property
2672
+ def max_attempts(self) -> jsii.Number:
2673
+ '''Number of attempts.'''
2674
+ result = self._values.get("max_attempts")
2675
+ assert result is not None, "Required property 'max_attempts' is missing"
2676
+ return typing.cast(jsii.Number, result)
2677
+
2678
+ @builtins.property
2679
+ def timeout_handler(self) -> _IFunction_6adb0ab8:
2680
+ '''The handler to call if the waiter times out and is incomplete.'''
2681
+ result = self._values.get("timeout_handler")
2682
+ assert result is not None, "Required property 'timeout_handler' is missing"
2683
+ return typing.cast(_IFunction_6adb0ab8, result)
2684
+
2685
+ @builtins.property
2686
+ def disable_logging(self) -> typing.Optional[builtins.bool]:
2687
+ '''Whether logging for the state machine is disabled.
2688
+
2689
+ :default: - false
2690
+ '''
2691
+ result = self._values.get("disable_logging")
2692
+ return typing.cast(typing.Optional[builtins.bool], result)
2693
+
2694
+ @builtins.property
2695
+ def log_options(self) -> typing.Optional[LogOptions]:
2696
+ '''Defines what execution history events are logged and where they are logged.
2697
+
2698
+ :default: - A default log group will be created if logging is enabled.
2699
+ '''
2700
+ result = self._values.get("log_options")
2701
+ return typing.cast(typing.Optional[LogOptions], result)
2702
+
2703
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
2704
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
2705
+
2706
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
2707
+ return not (rhs == self)
2708
+
2709
+ def __repr__(self) -> str:
2710
+ return "WaiterStateMachineProps(%s)" % ", ".join(
2711
+ k + "=" + repr(v) for k, v in self._values.items()
2712
+ )
2713
+
2714
+
2113
2715
  __all__ = [
2114
2716
  "AwsCustomResource",
2115
2717
  "AwsCustomResourcePolicy",
2116
2718
  "AwsCustomResourceProps",
2117
2719
  "AwsSdkCall",
2720
+ "LogOptions",
2721
+ "Logging",
2722
+ "LoggingProps",
2118
2723
  "PhysicalResourceId",
2119
2724
  "PhysicalResourceIdReference",
2120
2725
  "Provider",
2121
2726
  "ProviderProps",
2122
2727
  "SdkCallsPolicyOptions",
2728
+ "WaiterStateMachine",
2729
+ "WaiterStateMachineProps",
2123
2730
  ]
2124
2731
 
2125
2732
  publication.publish()
@@ -2191,6 +2798,7 @@ def _typecheckingstub__af7bb124668b93c6ce7d641df2daeabfe424e271742385a76e7e56ec9
2191
2798
  api_version: typing.Optional[builtins.str] = None,
2192
2799
  assumed_role_arn: typing.Optional[builtins.str] = None,
2193
2800
  ignore_error_codes_matching: typing.Optional[builtins.str] = None,
2801
+ logging: typing.Optional[Logging] = None,
2194
2802
  output_paths: typing.Optional[typing.Sequence[builtins.str]] = None,
2195
2803
  parameters: typing.Any = None,
2196
2804
  physical_resource_id: typing.Optional[PhysicalResourceId] = None,
@@ -2199,6 +2807,22 @@ def _typecheckingstub__af7bb124668b93c6ce7d641df2daeabfe424e271742385a76e7e56ec9
2199
2807
  """Type checking stubs"""
2200
2808
  pass
2201
2809
 
2810
+ def _typecheckingstub__2622296f61199d2b10825c21d976c0578e9488ad1b2b7635565f604c598734b7(
2811
+ *,
2812
+ destination: typing.Optional[_ILogGroup_3c4fa718] = None,
2813
+ include_execution_data: typing.Optional[builtins.bool] = None,
2814
+ level: typing.Optional[_LogLevel_be1990fe] = None,
2815
+ ) -> None:
2816
+ """Type checking stubs"""
2817
+ pass
2818
+
2819
+ def _typecheckingstub__da0d46a1eb4b059395d06daee7dcb9417dffd0b4cf8e8942cbe0a6549f0faf4b(
2820
+ *,
2821
+ log_api_response_data: typing.Optional[builtins.bool] = None,
2822
+ ) -> None:
2823
+ """Type checking stubs"""
2824
+ pass
2825
+
2202
2826
  def _typecheckingstub__6baa8764ccdf77f11bd8f80af9fafec69f56b719c1a237caae55c7f988e174b6(
2203
2827
  response_path: builtins.str,
2204
2828
  ) -> None:
@@ -2222,6 +2846,7 @@ def _typecheckingstub__29415d7bf7977fcf110b77ce69cec309dcf0404601944735020770ddf
2222
2846
  id: builtins.str,
2223
2847
  *,
2224
2848
  on_event_handler: _IFunction_6adb0ab8,
2849
+ disable_waiter_state_machine_logging: typing.Optional[builtins.bool] = None,
2225
2850
  is_complete_handler: typing.Optional[_IFunction_6adb0ab8] = None,
2226
2851
  log_group: typing.Optional[_ILogGroup_3c4fa718] = None,
2227
2852
  log_retention: typing.Optional[_RetentionDays_070f99f0] = None,
@@ -2233,6 +2858,7 @@ def _typecheckingstub__29415d7bf7977fcf110b77ce69cec309dcf0404601944735020770ddf
2233
2858
  total_timeout: typing.Optional[_Duration_4839e8c3] = None,
2234
2859
  vpc: typing.Optional[_IVpc_f30d5663] = None,
2235
2860
  vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
2861
+ waiter_state_machine_log_options: typing.Optional[typing.Union[LogOptions, typing.Dict[builtins.str, typing.Any]]] = None,
2236
2862
  ) -> None:
2237
2863
  """Type checking stubs"""
2238
2864
  pass
@@ -2240,6 +2866,7 @@ def _typecheckingstub__29415d7bf7977fcf110b77ce69cec309dcf0404601944735020770ddf
2240
2866
  def _typecheckingstub__32b03803ee02437d8d83814282c700ede5633030e4d9f7ebdaf3b9d075b0cbdb(
2241
2867
  *,
2242
2868
  on_event_handler: _IFunction_6adb0ab8,
2869
+ disable_waiter_state_machine_logging: typing.Optional[builtins.bool] = None,
2243
2870
  is_complete_handler: typing.Optional[_IFunction_6adb0ab8] = None,
2244
2871
  log_group: typing.Optional[_ILogGroup_3c4fa718] = None,
2245
2872
  log_retention: typing.Optional[_RetentionDays_070f99f0] = None,
@@ -2251,6 +2878,7 @@ def _typecheckingstub__32b03803ee02437d8d83814282c700ede5633030e4d9f7ebdaf3b9d07
2251
2878
  total_timeout: typing.Optional[_Duration_4839e8c3] = None,
2252
2879
  vpc: typing.Optional[_IVpc_f30d5663] = None,
2253
2880
  vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
2881
+ waiter_state_machine_log_options: typing.Optional[typing.Union[LogOptions, typing.Dict[builtins.str, typing.Any]]] = None,
2254
2882
  ) -> None:
2255
2883
  """Type checking stubs"""
2256
2884
  pass
@@ -2261,3 +2889,37 @@ def _typecheckingstub__0cd00e8add38e42b6c4d7db0390a899ccaf5bbe0367bfb387986125da
2261
2889
  ) -> None:
2262
2890
  """Type checking stubs"""
2263
2891
  pass
2892
+
2893
+ def _typecheckingstub__12427b739f326cdb535d2aaf4a70f10977eec5711902d4e5e395f0b8c9bb184e(
2894
+ scope: _constructs_77d1e7e8.Construct,
2895
+ id: builtins.str,
2896
+ *,
2897
+ backoff_rate: jsii.Number,
2898
+ interval: _Duration_4839e8c3,
2899
+ is_complete_handler: _IFunction_6adb0ab8,
2900
+ max_attempts: jsii.Number,
2901
+ timeout_handler: _IFunction_6adb0ab8,
2902
+ disable_logging: typing.Optional[builtins.bool] = None,
2903
+ log_options: typing.Optional[typing.Union[LogOptions, typing.Dict[builtins.str, typing.Any]]] = None,
2904
+ ) -> None:
2905
+ """Type checking stubs"""
2906
+ pass
2907
+
2908
+ def _typecheckingstub__2c3d1c306ca04ebd1194ce4f97bed6aa9510a02067654b39f43a1ecef601e3db(
2909
+ identity: _IGrantable_71c4f5de,
2910
+ ) -> None:
2911
+ """Type checking stubs"""
2912
+ pass
2913
+
2914
+ def _typecheckingstub__569ff1333551048ad82f7261bcf43cbefe118e974cba179165c355fc9347fc13(
2915
+ *,
2916
+ backoff_rate: jsii.Number,
2917
+ interval: _Duration_4839e8c3,
2918
+ is_complete_handler: _IFunction_6adb0ab8,
2919
+ max_attempts: jsii.Number,
2920
+ timeout_handler: _IFunction_6adb0ab8,
2921
+ disable_logging: typing.Optional[builtins.bool] = None,
2922
+ log_options: typing.Optional[typing.Union[LogOptions, typing.Dict[builtins.str, typing.Any]]] = None,
2923
+ ) -> None:
2924
+ """Type checking stubs"""
2925
+ pass