aws-cdk-lib 2.149.0__py3-none-any.whl → 2.151.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 (48) hide show
  1. aws_cdk/__init__.py +6 -16
  2. aws_cdk/_jsii/__init__.py +1 -1
  3. aws_cdk/_jsii/{aws-cdk-lib@2.149.0.jsii.tgz → aws-cdk-lib@2.151.0.jsii.tgz} +0 -0
  4. aws_cdk/aws_apigatewayv2/__init__.py +94 -21
  5. aws_cdk/aws_appconfig/__init__.py +3 -3
  6. aws_cdk/aws_backup/__init__.py +3 -3
  7. aws_cdk/aws_bedrock/__init__.py +58 -46
  8. aws_cdk/aws_cleanrooms/__init__.py +5 -5
  9. aws_cdk/aws_cloudformation/__init__.py +4 -8
  10. aws_cdk/aws_cloudfront/__init__.py +102 -32
  11. aws_cdk/aws_cloudtrail/__init__.py +34 -558
  12. aws_cdk/aws_cloudwatch/__init__.py +1 -1
  13. aws_cdk/aws_codepipeline/__init__.py +11 -5
  14. aws_cdk/aws_cognito/__init__.py +1 -2
  15. aws_cdk/aws_ec2/__init__.py +263 -7
  16. aws_cdk/aws_ecs/__init__.py +16 -10
  17. aws_cdk/aws_eks/__init__.py +26 -20
  18. aws_cdk/aws_elasticloadbalancingv2/__init__.py +106 -11
  19. aws_cdk/aws_emr/__init__.py +18 -20
  20. aws_cdk/aws_entityresolution/__init__.py +27 -21
  21. aws_cdk/aws_events/__init__.py +83 -16
  22. aws_cdk/aws_fsx/__init__.py +25 -23
  23. aws_cdk/aws_glue/__init__.py +3 -3
  24. aws_cdk/aws_guardduty/__init__.py +6 -4
  25. aws_cdk/aws_iam/__init__.py +19 -29
  26. aws_cdk/aws_iotsitewise/__init__.py +8 -8
  27. aws_cdk/aws_lambda/__init__.py +21 -2
  28. aws_cdk/aws_logs/__init__.py +9 -0
  29. aws_cdk/aws_mwaa/__init__.py +3 -3
  30. aws_cdk/aws_pipes/__init__.py +2 -2
  31. aws_cdk/aws_qbusiness/__init__.py +21 -7
  32. aws_cdk/aws_rds/__init__.py +252 -206
  33. aws_cdk/aws_s3/__init__.py +8 -2
  34. aws_cdk/aws_sagemaker/__init__.py +10 -10
  35. aws_cdk/aws_ses/__init__.py +3 -3
  36. aws_cdk/aws_sns/__init__.py +5 -2
  37. aws_cdk/aws_stepfunctions/__init__.py +5 -2
  38. aws_cdk/aws_stepfunctions_tasks/__init__.py +23 -8
  39. aws_cdk/aws_synthetics/__init__.py +174 -22
  40. aws_cdk/custom_resources/__init__.py +91 -23
  41. aws_cdk/pipelines/__init__.py +1 -1
  42. aws_cdk/region_info/__init__.py +32 -12
  43. {aws_cdk_lib-2.149.0.dist-info → aws_cdk_lib-2.151.0.dist-info}/METADATA +1 -1
  44. {aws_cdk_lib-2.149.0.dist-info → aws_cdk_lib-2.151.0.dist-info}/RECORD +48 -48
  45. {aws_cdk_lib-2.149.0.dist-info → aws_cdk_lib-2.151.0.dist-info}/LICENSE +0 -0
  46. {aws_cdk_lib-2.149.0.dist-info → aws_cdk_lib-2.151.0.dist-info}/NOTICE +0 -0
  47. {aws_cdk_lib-2.149.0.dist-info → aws_cdk_lib-2.151.0.dist-info}/WHEEL +0 -0
  48. {aws_cdk_lib-2.149.0.dist-info → aws_cdk_lib-2.151.0.dist-info}/top_level.txt +0 -0
@@ -88,6 +88,64 @@ schedule = synthetics.Schedule.cron(
88
88
 
89
89
  If you want the canary to run just once upon deployment, you can use `Schedule.once()`.
90
90
 
91
+ ### Active Tracing
92
+
93
+ You can choose to enable active AWS X-Ray tracing on canaries that use the `syn-nodejs-2.0` or later runtime by setting `activeTracing` to `true`.
94
+
95
+ With tracing enabled, traces are sent for all calls made by the canary that use the browser, the AWS SDK, or HTTP or HTTPS modules.
96
+
97
+ For more information, see [Canaries and X-Ray tracing](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_tracing.html).
98
+
99
+ ```python
100
+ canary = synthetics.Canary(self, "MyCanary",
101
+ schedule=synthetics.Schedule.rate(Duration.minutes(5)),
102
+ test=synthetics.Test.custom(
103
+ code=synthetics.Code.from_asset(path.join(__dirname, "canary")),
104
+ handler="index.handler"
105
+ ),
106
+ runtime=synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2,
107
+ active_tracing=True
108
+ )
109
+ ```
110
+
111
+ ### Memory
112
+
113
+ You can set the maximum amount of memory the canary can use while running with the `memory` property.
114
+
115
+ ```python
116
+ import aws_cdk as cdk
117
+
118
+
119
+ canary = synthetics.Canary(self, "MyCanary",
120
+ schedule=synthetics.Schedule.rate(Duration.minutes(5)),
121
+ test=synthetics.Test.custom(
122
+ code=synthetics.Code.from_asset(path.join(__dirname, "canary")),
123
+ handler="index.handler"
124
+ ),
125
+ runtime=synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2,
126
+ memory=cdk.Size.mebibytes(1024)
127
+ )
128
+ ```
129
+
130
+ ### Timeout
131
+
132
+ You can set how long the canary is allowed to run before it must stop with the `timeout` property.
133
+
134
+ ```python
135
+ import aws_cdk as cdk
136
+
137
+
138
+ canary = synthetics.Canary(self, "MyCanary",
139
+ schedule=synthetics.Schedule.rate(Duration.minutes(5)),
140
+ test=synthetics.Test.custom(
141
+ code=synthetics.Code.from_asset(path.join(__dirname, "canary")),
142
+ handler="index.handler"
143
+ ),
144
+ runtime=synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2,
145
+ timeout=cdk.Duration.seconds(60)
146
+ )
147
+ ```
148
+
91
149
  ### Deleting underlying resources on canary deletion
92
150
 
93
151
  When you delete a lambda, the following underlying resources are isolated in your AWS account:
@@ -279,6 +337,7 @@ from .. import (
279
337
  ITaggable as _ITaggable_36806126,
280
338
  IgnoreMode as _IgnoreMode_655a98e8,
281
339
  Resource as _Resource_45bc6135,
340
+ Size as _Size_7b441c34,
282
341
  SymlinkFollowMode as _SymlinkFollowMode_047ec1f6,
283
342
  TagManager as _TagManager_0a598cb3,
284
343
  TreeInspector as _TreeInspector_488e0dd5,
@@ -394,6 +453,9 @@ class Canary(
394
453
 
395
454
  Example::
396
455
 
456
+ import aws_cdk as cdk
457
+
458
+
397
459
  canary = synthetics.Canary(self, "MyCanary",
398
460
  schedule=synthetics.Schedule.rate(Duration.minutes(5)),
399
461
  test=synthetics.Test.custom(
@@ -401,9 +463,7 @@ class Canary(
401
463
  handler="index.handler"
402
464
  ),
403
465
  runtime=synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2,
404
- environment_variables={
405
- "stage": "prod"
406
- }
466
+ memory=cdk.Size.mebibytes(1024)
407
467
  )
408
468
  '''
409
469
 
@@ -414,17 +474,20 @@ class Canary(
414
474
  *,
415
475
  runtime: "Runtime",
416
476
  test: "Test",
477
+ active_tracing: typing.Optional[builtins.bool] = None,
417
478
  artifacts_bucket_lifecycle_rules: typing.Optional[typing.Sequence[typing.Union[_LifecycleRule_bb74e6ff, typing.Dict[builtins.str, typing.Any]]]] = None,
418
479
  artifacts_bucket_location: typing.Optional[typing.Union[ArtifactsBucketLocation, typing.Dict[builtins.str, typing.Any]]] = None,
419
480
  canary_name: typing.Optional[builtins.str] = None,
420
481
  cleanup: typing.Optional["Cleanup"] = None,
421
482
  environment_variables: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
422
483
  failure_retention_period: typing.Optional[_Duration_4839e8c3] = None,
484
+ memory: typing.Optional[_Size_7b441c34] = None,
423
485
  role: typing.Optional[_IRole_235f5d8e] = None,
424
486
  schedule: typing.Optional["Schedule"] = None,
425
487
  security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
426
488
  start_after_creation: typing.Optional[builtins.bool] = None,
427
489
  success_retention_period: typing.Optional[_Duration_4839e8c3] = None,
490
+ timeout: typing.Optional[_Duration_4839e8c3] = None,
428
491
  time_to_live: typing.Optional[_Duration_4839e8c3] = None,
429
492
  vpc: typing.Optional[_IVpc_f30d5663] = None,
430
493
  vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
@@ -434,17 +497,20 @@ class Canary(
434
497
  :param id: -
435
498
  :param runtime: Specify the runtime version to use for the canary.
436
499
  :param test: The type of test that you want your canary to run. Use ``Test.custom()`` to specify the test to run.
500
+ :param active_tracing: Specifies whether this canary is to use active AWS X-Ray tracing when it runs. Active tracing enables this canary run to be displayed in the ServiceLens and X-Ray service maps even if the canary does not hit an endpoint that has X-Ray tracing enabled. Using X-Ray tracing incurs charges. You can enable active tracing only for canaries that use version ``syn-nodejs-2.0`` or later for their canary runtime. Default: false
437
501
  :param artifacts_bucket_lifecycle_rules: Lifecycle rules for the generated canary artifact bucket. Has no effect if a bucket is passed to ``artifactsBucketLocation``. If you pass a bucket to ``artifactsBucketLocation``, you can add lifecycle rules to the bucket itself. Default: - no rules applied to the generated bucket.
438
502
  :param artifacts_bucket_location: The s3 location that stores the data of the canary runs. Default: - A new s3 bucket will be created without a prefix.
439
503
  :param canary_name: The name of the canary. Be sure to give it a descriptive name that distinguishes it from other canaries in your account. Do not include secrets or proprietary information in your canary name. The canary name makes up part of the canary ARN, which is included in outbound calls over the internet. Default: - A unique name will be generated from the construct ID
440
504
  :param cleanup: Specify the underlying resources to be cleaned up when the canary is deleted. Using ``Cleanup.LAMBDA`` will create a Custom Resource to achieve this. Default: Cleanup.NOTHING
441
505
  :param environment_variables: Key-value pairs that the Synthetics caches and makes available for your canary scripts. Use environment variables to apply configuration changes, such as test and production environment configurations, without changing your Canary script source code. Default: - No environment variables.
442
506
  :param failure_retention_period: How many days should failed runs be retained. Default: Duration.days(31)
507
+ :param memory: The maximum amount of memory that the canary can use while running. This value must be a multiple of 64 Mib. The range is 960 MiB to 3008 MiB. Default: Size.mebibytes(1024)
443
508
  :param role: Canary execution role. This is the role that will be assumed by the canary upon execution. It controls the permissions that the canary will have. The role must be assumable by the AWS Lambda service principal. If not supplied, a role will be created with all the required permissions. If you provide a Role, you must add the required permissions. Default: - A unique role will be generated for this canary. You can add permissions to roles by calling 'addToRolePolicy'.
444
509
  :param schedule: Specify the schedule for how often the canary runs. For example, if you set ``schedule`` to ``rate(10 minutes)``, then the canary will run every 10 minutes. You can set the schedule with ``Schedule.rate(Duration)`` (recommended) or you can specify an expression using ``Schedule.expression()``. Default: 'rate(5 minutes)'
445
510
  :param security_groups: The list of security groups to associate with the canary's network interfaces. You must provide ``vpc`` when using this prop. Default: - If the canary is placed within a VPC and a security group is not specified a dedicated security group will be created for this canary.
446
511
  :param start_after_creation: Whether or not the canary should start after creation. Default: true
447
512
  :param success_retention_period: How many days should successful runs be retained. Default: Duration.days(31)
513
+ :param timeout: How long the canary is allowed to run before it must stop. You can't set this time to be longer than the frequency of the runs of this canary. The minimum allowed value is 3 seconds. The maximum allowed value is 840 seconds (14 minutes). Default: - the frequency of the canary is used as this value, up to a maximum of 900 seconds.
448
514
  :param time_to_live: How long the canary will be in a 'RUNNING' state. For example, if you set ``timeToLive`` to be 1 hour and ``schedule`` to be ``rate(10 minutes)``, your canary will run at 10 minute intervals for an hour, for a total of 6 times. Default: - no limit
449
515
  :param vpc: The VPC where this canary is run. Specify this if the canary needs to access resources in a VPC. Default: - Not in VPC
450
516
  :param vpc_subnets: Where to place the network interfaces within the VPC. You must provide ``vpc`` when using this prop. Default: - the Vpc default strategy if not specified
@@ -456,17 +522,20 @@ class Canary(
456
522
  props = CanaryProps(
457
523
  runtime=runtime,
458
524
  test=test,
525
+ active_tracing=active_tracing,
459
526
  artifacts_bucket_lifecycle_rules=artifacts_bucket_lifecycle_rules,
460
527
  artifacts_bucket_location=artifacts_bucket_location,
461
528
  canary_name=canary_name,
462
529
  cleanup=cleanup,
463
530
  environment_variables=environment_variables,
464
531
  failure_retention_period=failure_retention_period,
532
+ memory=memory,
465
533
  role=role,
466
534
  schedule=schedule,
467
535
  security_groups=security_groups,
468
536
  start_after_creation=start_after_creation,
469
537
  success_retention_period=success_retention_period,
538
+ timeout=timeout,
470
539
  time_to_live=time_to_live,
471
540
  vpc=vpc,
472
541
  vpc_subnets=vpc_subnets,
@@ -648,17 +717,20 @@ class Canary(
648
717
  name_mapping={
649
718
  "runtime": "runtime",
650
719
  "test": "test",
720
+ "active_tracing": "activeTracing",
651
721
  "artifacts_bucket_lifecycle_rules": "artifactsBucketLifecycleRules",
652
722
  "artifacts_bucket_location": "artifactsBucketLocation",
653
723
  "canary_name": "canaryName",
654
724
  "cleanup": "cleanup",
655
725
  "environment_variables": "environmentVariables",
656
726
  "failure_retention_period": "failureRetentionPeriod",
727
+ "memory": "memory",
657
728
  "role": "role",
658
729
  "schedule": "schedule",
659
730
  "security_groups": "securityGroups",
660
731
  "start_after_creation": "startAfterCreation",
661
732
  "success_retention_period": "successRetentionPeriod",
733
+ "timeout": "timeout",
662
734
  "time_to_live": "timeToLive",
663
735
  "vpc": "vpc",
664
736
  "vpc_subnets": "vpcSubnets",
@@ -670,17 +742,20 @@ class CanaryProps:
670
742
  *,
671
743
  runtime: "Runtime",
672
744
  test: "Test",
745
+ active_tracing: typing.Optional[builtins.bool] = None,
673
746
  artifacts_bucket_lifecycle_rules: typing.Optional[typing.Sequence[typing.Union[_LifecycleRule_bb74e6ff, typing.Dict[builtins.str, typing.Any]]]] = None,
674
747
  artifacts_bucket_location: typing.Optional[typing.Union[ArtifactsBucketLocation, typing.Dict[builtins.str, typing.Any]]] = None,
675
748
  canary_name: typing.Optional[builtins.str] = None,
676
749
  cleanup: typing.Optional["Cleanup"] = None,
677
750
  environment_variables: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
678
751
  failure_retention_period: typing.Optional[_Duration_4839e8c3] = None,
752
+ memory: typing.Optional[_Size_7b441c34] = None,
679
753
  role: typing.Optional[_IRole_235f5d8e] = None,
680
754
  schedule: typing.Optional["Schedule"] = None,
681
755
  security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
682
756
  start_after_creation: typing.Optional[builtins.bool] = None,
683
757
  success_retention_period: typing.Optional[_Duration_4839e8c3] = None,
758
+ timeout: typing.Optional[_Duration_4839e8c3] = None,
684
759
  time_to_live: typing.Optional[_Duration_4839e8c3] = None,
685
760
  vpc: typing.Optional[_IVpc_f30d5663] = None,
686
761
  vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
@@ -689,17 +764,20 @@ class CanaryProps:
689
764
 
690
765
  :param runtime: Specify the runtime version to use for the canary.
691
766
  :param test: The type of test that you want your canary to run. Use ``Test.custom()`` to specify the test to run.
767
+ :param active_tracing: Specifies whether this canary is to use active AWS X-Ray tracing when it runs. Active tracing enables this canary run to be displayed in the ServiceLens and X-Ray service maps even if the canary does not hit an endpoint that has X-Ray tracing enabled. Using X-Ray tracing incurs charges. You can enable active tracing only for canaries that use version ``syn-nodejs-2.0`` or later for their canary runtime. Default: false
692
768
  :param artifacts_bucket_lifecycle_rules: Lifecycle rules for the generated canary artifact bucket. Has no effect if a bucket is passed to ``artifactsBucketLocation``. If you pass a bucket to ``artifactsBucketLocation``, you can add lifecycle rules to the bucket itself. Default: - no rules applied to the generated bucket.
693
769
  :param artifacts_bucket_location: The s3 location that stores the data of the canary runs. Default: - A new s3 bucket will be created without a prefix.
694
770
  :param canary_name: The name of the canary. Be sure to give it a descriptive name that distinguishes it from other canaries in your account. Do not include secrets or proprietary information in your canary name. The canary name makes up part of the canary ARN, which is included in outbound calls over the internet. Default: - A unique name will be generated from the construct ID
695
771
  :param cleanup: Specify the underlying resources to be cleaned up when the canary is deleted. Using ``Cleanup.LAMBDA`` will create a Custom Resource to achieve this. Default: Cleanup.NOTHING
696
772
  :param environment_variables: Key-value pairs that the Synthetics caches and makes available for your canary scripts. Use environment variables to apply configuration changes, such as test and production environment configurations, without changing your Canary script source code. Default: - No environment variables.
697
773
  :param failure_retention_period: How many days should failed runs be retained. Default: Duration.days(31)
774
+ :param memory: The maximum amount of memory that the canary can use while running. This value must be a multiple of 64 Mib. The range is 960 MiB to 3008 MiB. Default: Size.mebibytes(1024)
698
775
  :param role: Canary execution role. This is the role that will be assumed by the canary upon execution. It controls the permissions that the canary will have. The role must be assumable by the AWS Lambda service principal. If not supplied, a role will be created with all the required permissions. If you provide a Role, you must add the required permissions. Default: - A unique role will be generated for this canary. You can add permissions to roles by calling 'addToRolePolicy'.
699
776
  :param schedule: Specify the schedule for how often the canary runs. For example, if you set ``schedule`` to ``rate(10 minutes)``, then the canary will run every 10 minutes. You can set the schedule with ``Schedule.rate(Duration)`` (recommended) or you can specify an expression using ``Schedule.expression()``. Default: 'rate(5 minutes)'
700
777
  :param security_groups: The list of security groups to associate with the canary's network interfaces. You must provide ``vpc`` when using this prop. Default: - If the canary is placed within a VPC and a security group is not specified a dedicated security group will be created for this canary.
701
778
  :param start_after_creation: Whether or not the canary should start after creation. Default: true
702
779
  :param success_retention_period: How many days should successful runs be retained. Default: Duration.days(31)
780
+ :param timeout: How long the canary is allowed to run before it must stop. You can't set this time to be longer than the frequency of the runs of this canary. The minimum allowed value is 3 seconds. The maximum allowed value is 840 seconds (14 minutes). Default: - the frequency of the canary is used as this value, up to a maximum of 900 seconds.
703
781
  :param time_to_live: How long the canary will be in a 'RUNNING' state. For example, if you set ``timeToLive`` to be 1 hour and ``schedule`` to be ``rate(10 minutes)``, your canary will run at 10 minute intervals for an hour, for a total of 6 times. Default: - no limit
704
782
  :param vpc: The VPC where this canary is run. Specify this if the canary needs to access resources in a VPC. Default: - Not in VPC
705
783
  :param vpc_subnets: Where to place the network interfaces within the VPC. You must provide ``vpc`` when using this prop. Default: - the Vpc default strategy if not specified
@@ -708,6 +786,9 @@ class CanaryProps:
708
786
 
709
787
  Example::
710
788
 
789
+ import aws_cdk as cdk
790
+
791
+
711
792
  canary = synthetics.Canary(self, "MyCanary",
712
793
  schedule=synthetics.Schedule.rate(Duration.minutes(5)),
713
794
  test=synthetics.Test.custom(
@@ -715,9 +796,7 @@ class CanaryProps:
715
796
  handler="index.handler"
716
797
  ),
717
798
  runtime=synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2,
718
- environment_variables={
719
- "stage": "prod"
720
- }
799
+ memory=cdk.Size.mebibytes(1024)
721
800
  )
722
801
  '''
723
802
  if isinstance(artifacts_bucket_location, dict):
@@ -728,17 +807,20 @@ class CanaryProps:
728
807
  type_hints = typing.get_type_hints(_typecheckingstub__44ec0b14d52b66927d4daebe6f97bb070f3629bb0eb86e21668ca7862bb5f5bd)
729
808
  check_type(argname="argument runtime", value=runtime, expected_type=type_hints["runtime"])
730
809
  check_type(argname="argument test", value=test, expected_type=type_hints["test"])
810
+ check_type(argname="argument active_tracing", value=active_tracing, expected_type=type_hints["active_tracing"])
731
811
  check_type(argname="argument artifacts_bucket_lifecycle_rules", value=artifacts_bucket_lifecycle_rules, expected_type=type_hints["artifacts_bucket_lifecycle_rules"])
732
812
  check_type(argname="argument artifacts_bucket_location", value=artifacts_bucket_location, expected_type=type_hints["artifacts_bucket_location"])
733
813
  check_type(argname="argument canary_name", value=canary_name, expected_type=type_hints["canary_name"])
734
814
  check_type(argname="argument cleanup", value=cleanup, expected_type=type_hints["cleanup"])
735
815
  check_type(argname="argument environment_variables", value=environment_variables, expected_type=type_hints["environment_variables"])
736
816
  check_type(argname="argument failure_retention_period", value=failure_retention_period, expected_type=type_hints["failure_retention_period"])
817
+ check_type(argname="argument memory", value=memory, expected_type=type_hints["memory"])
737
818
  check_type(argname="argument role", value=role, expected_type=type_hints["role"])
738
819
  check_type(argname="argument schedule", value=schedule, expected_type=type_hints["schedule"])
739
820
  check_type(argname="argument security_groups", value=security_groups, expected_type=type_hints["security_groups"])
740
821
  check_type(argname="argument start_after_creation", value=start_after_creation, expected_type=type_hints["start_after_creation"])
741
822
  check_type(argname="argument success_retention_period", value=success_retention_period, expected_type=type_hints["success_retention_period"])
823
+ check_type(argname="argument timeout", value=timeout, expected_type=type_hints["timeout"])
742
824
  check_type(argname="argument time_to_live", value=time_to_live, expected_type=type_hints["time_to_live"])
743
825
  check_type(argname="argument vpc", value=vpc, expected_type=type_hints["vpc"])
744
826
  check_type(argname="argument vpc_subnets", value=vpc_subnets, expected_type=type_hints["vpc_subnets"])
@@ -746,6 +828,8 @@ class CanaryProps:
746
828
  "runtime": runtime,
747
829
  "test": test,
748
830
  }
831
+ if active_tracing is not None:
832
+ self._values["active_tracing"] = active_tracing
749
833
  if artifacts_bucket_lifecycle_rules is not None:
750
834
  self._values["artifacts_bucket_lifecycle_rules"] = artifacts_bucket_lifecycle_rules
751
835
  if artifacts_bucket_location is not None:
@@ -758,6 +842,8 @@ class CanaryProps:
758
842
  self._values["environment_variables"] = environment_variables
759
843
  if failure_retention_period is not None:
760
844
  self._values["failure_retention_period"] = failure_retention_period
845
+ if memory is not None:
846
+ self._values["memory"] = memory
761
847
  if role is not None:
762
848
  self._values["role"] = role
763
849
  if schedule is not None:
@@ -768,6 +854,8 @@ class CanaryProps:
768
854
  self._values["start_after_creation"] = start_after_creation
769
855
  if success_retention_period is not None:
770
856
  self._values["success_retention_period"] = success_retention_period
857
+ if timeout is not None:
858
+ self._values["timeout"] = timeout
771
859
  if time_to_live is not None:
772
860
  self._values["time_to_live"] = time_to_live
773
861
  if vpc is not None:
@@ -795,6 +883,22 @@ class CanaryProps:
795
883
  assert result is not None, "Required property 'test' is missing"
796
884
  return typing.cast("Test", result)
797
885
 
886
+ @builtins.property
887
+ def active_tracing(self) -> typing.Optional[builtins.bool]:
888
+ '''Specifies whether this canary is to use active AWS X-Ray tracing when it runs.
889
+
890
+ Active tracing enables this canary run to be displayed in the ServiceLens and X-Ray service maps even if the
891
+ canary does not hit an endpoint that has X-Ray tracing enabled. Using X-Ray tracing incurs charges.
892
+
893
+ You can enable active tracing only for canaries that use version ``syn-nodejs-2.0`` or later for their canary runtime.
894
+
895
+ :default: false
896
+
897
+ :see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_tracing.html
898
+ '''
899
+ result = self._values.get("active_tracing")
900
+ return typing.cast(typing.Optional[builtins.bool], result)
901
+
798
902
  @builtins.property
799
903
  def artifacts_bucket_lifecycle_rules(
800
904
  self,
@@ -872,6 +976,18 @@ class CanaryProps:
872
976
  result = self._values.get("failure_retention_period")
873
977
  return typing.cast(typing.Optional[_Duration_4839e8c3], result)
874
978
 
979
+ @builtins.property
980
+ def memory(self) -> typing.Optional[_Size_7b441c34]:
981
+ '''The maximum amount of memory that the canary can use while running.
982
+
983
+ This value must be a multiple of 64 Mib.
984
+ The range is 960 MiB to 3008 MiB.
985
+
986
+ :default: Size.mebibytes(1024)
987
+ '''
988
+ result = self._values.get("memory")
989
+ return typing.cast(typing.Optional[_Size_7b441c34], result)
990
+
875
991
  @builtins.property
876
992
  def role(self) -> typing.Optional[_IRole_235f5d8e]:
877
993
  '''Canary execution role.
@@ -937,6 +1053,20 @@ class CanaryProps:
937
1053
  result = self._values.get("success_retention_period")
938
1054
  return typing.cast(typing.Optional[_Duration_4839e8c3], result)
939
1055
 
1056
+ @builtins.property
1057
+ def timeout(self) -> typing.Optional[_Duration_4839e8c3]:
1058
+ '''How long the canary is allowed to run before it must stop.
1059
+
1060
+ You can't set this time to be longer than the frequency of the runs of this canary.
1061
+
1062
+ The minimum allowed value is 3 seconds.
1063
+ The maximum allowed value is 840 seconds (14 minutes).
1064
+
1065
+ :default: - the frequency of the canary is used as this value, up to a maximum of 900 seconds.
1066
+ '''
1067
+ result = self._values.get("timeout")
1068
+ return typing.cast(typing.Optional[_Duration_4839e8c3], result)
1069
+
940
1070
  @builtins.property
941
1071
  def time_to_live(self) -> typing.Optional[_Duration_4839e8c3]:
942
1072
  '''How long the canary will be in a 'RUNNING' state.
@@ -2881,6 +3011,9 @@ class Code(
2881
3011
 
2882
3012
  Example::
2883
3013
 
3014
+ import aws_cdk as cdk
3015
+
3016
+
2884
3017
  canary = synthetics.Canary(self, "MyCanary",
2885
3018
  schedule=synthetics.Schedule.rate(Duration.minutes(5)),
2886
3019
  test=synthetics.Test.custom(
@@ -2888,9 +3021,7 @@ class Code(
2888
3021
  handler="index.handler"
2889
3022
  ),
2890
3023
  runtime=synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2,
2891
- environment_variables={
2892
- "stage": "prod"
2893
- }
3024
+ memory=cdk.Size.mebibytes(1024)
2894
3025
  )
2895
3026
  '''
2896
3027
 
@@ -3245,6 +3376,9 @@ class CustomTestOptions:
3245
3376
 
3246
3377
  Example::
3247
3378
 
3379
+ import aws_cdk as cdk
3380
+
3381
+
3248
3382
  canary = synthetics.Canary(self, "MyCanary",
3249
3383
  schedule=synthetics.Schedule.rate(Duration.minutes(5)),
3250
3384
  test=synthetics.Test.custom(
@@ -3252,9 +3386,7 @@ class CustomTestOptions:
3252
3386
  handler="index.handler"
3253
3387
  ),
3254
3388
  runtime=synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2,
3255
- environment_variables={
3256
- "stage": "prod"
3257
- }
3389
+ memory=cdk.Size.mebibytes(1024)
3258
3390
  )
3259
3391
  '''
3260
3392
  if __debug__:
@@ -3350,6 +3482,9 @@ class Runtime(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_synthetics.Run
3350
3482
 
3351
3483
  Example::
3352
3484
 
3485
+ import aws_cdk as cdk
3486
+
3487
+
3353
3488
  canary = synthetics.Canary(self, "MyCanary",
3354
3489
  schedule=synthetics.Schedule.rate(Duration.minutes(5)),
3355
3490
  test=synthetics.Test.custom(
@@ -3357,9 +3492,7 @@ class Runtime(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_synthetics.Run
3357
3492
  handler="index.handler"
3358
3493
  ),
3359
3494
  runtime=synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2,
3360
- environment_variables={
3361
- "stage": "prod"
3362
- }
3495
+ memory=cdk.Size.mebibytes(1024)
3363
3496
  )
3364
3497
  '''
3365
3498
 
@@ -3564,7 +3697,7 @@ class Runtime(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_synthetics.Run
3564
3697
  - **Ephemeral storage monitoring**: This runtime adds ephemeral storage monitoring in customer accounts.
3565
3698
  - **Bug fixes**
3566
3699
 
3567
- :see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-6.1
3700
+ :see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-6.2
3568
3701
  '''
3569
3702
  return typing.cast("Runtime", jsii.sget(cls, "SYNTHETICS_NODEJS_PUPPETEER_6_2"))
3570
3703
 
@@ -3581,6 +3714,20 @@ class Runtime(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_synthetics.Run
3581
3714
  '''
3582
3715
  return typing.cast("Runtime", jsii.sget(cls, "SYNTHETICS_NODEJS_PUPPETEER_7_0"))
3583
3716
 
3717
+ @jsii.python.classproperty
3718
+ @jsii.member(jsii_name="SYNTHETICS_NODEJS_PUPPETEER_8_0")
3719
+ def SYNTHETICS_NODEJS_PUPPETEER_8_0(cls) -> "Runtime":
3720
+ '''``syn-nodejs-puppeteer-8.0`` includes the following: - Lambda runtime Node.js 20.x - Puppeteer-core version 22.10.0 - Chromium version 125.0.6422.112.
3721
+
3722
+ New Features:
3723
+
3724
+ - **Support for two-factor authentication**
3725
+ - **Bug fixes** for situations where some service clients were losing data in Node.js SDK V3 responses.
3726
+
3727
+ :see: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-8.0
3728
+ '''
3729
+ return typing.cast("Runtime", jsii.sget(cls, "SYNTHETICS_NODEJS_PUPPETEER_8_0"))
3730
+
3584
3731
  @jsii.python.classproperty
3585
3732
  @jsii.member(jsii_name="SYNTHETICS_PYTHON_SELENIUM_1_0")
3586
3733
  def SYNTHETICS_PYTHON_SELENIUM_1_0(cls) -> "Runtime":
@@ -3794,9 +3941,7 @@ class Schedule(
3794
3941
  handler="index.handler"
3795
3942
  ),
3796
3943
  runtime=synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2,
3797
- environment_variables={
3798
- "stage": "prod"
3799
- }
3944
+ active_tracing=True
3800
3945
  )
3801
3946
  '''
3802
3947
 
@@ -3875,6 +4020,9 @@ class Test(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_synthetics.Test")
3875
4020
 
3876
4021
  Example::
3877
4022
 
4023
+ import aws_cdk as cdk
4024
+
4025
+
3878
4026
  canary = synthetics.Canary(self, "MyCanary",
3879
4027
  schedule=synthetics.Schedule.rate(Duration.minutes(5)),
3880
4028
  test=synthetics.Test.custom(
@@ -3882,9 +4030,7 @@ class Test(metaclass=jsii.JSIIMeta, jsii_type="aws-cdk-lib.aws_synthetics.Test")
3882
4030
  handler="index.handler"
3883
4031
  ),
3884
4032
  runtime=synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_2,
3885
- environment_variables={
3886
- "stage": "prod"
3887
- }
4033
+ memory=cdk.Size.mebibytes(1024)
3888
4034
  )
3889
4035
  '''
3890
4036
 
@@ -4072,17 +4218,20 @@ def _typecheckingstub__b3b6d76e5f93e31884e16cc00a9b4fc93e6782ff7db09c74aa1ef9346
4072
4218
  *,
4073
4219
  runtime: Runtime,
4074
4220
  test: Test,
4221
+ active_tracing: typing.Optional[builtins.bool] = None,
4075
4222
  artifacts_bucket_lifecycle_rules: typing.Optional[typing.Sequence[typing.Union[_LifecycleRule_bb74e6ff, typing.Dict[builtins.str, typing.Any]]]] = None,
4076
4223
  artifacts_bucket_location: typing.Optional[typing.Union[ArtifactsBucketLocation, typing.Dict[builtins.str, typing.Any]]] = None,
4077
4224
  canary_name: typing.Optional[builtins.str] = None,
4078
4225
  cleanup: typing.Optional[Cleanup] = None,
4079
4226
  environment_variables: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
4080
4227
  failure_retention_period: typing.Optional[_Duration_4839e8c3] = None,
4228
+ memory: typing.Optional[_Size_7b441c34] = None,
4081
4229
  role: typing.Optional[_IRole_235f5d8e] = None,
4082
4230
  schedule: typing.Optional[Schedule] = None,
4083
4231
  security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
4084
4232
  start_after_creation: typing.Optional[builtins.bool] = None,
4085
4233
  success_retention_period: typing.Optional[_Duration_4839e8c3] = None,
4234
+ timeout: typing.Optional[_Duration_4839e8c3] = None,
4086
4235
  time_to_live: typing.Optional[_Duration_4839e8c3] = None,
4087
4236
  vpc: typing.Optional[_IVpc_f30d5663] = None,
4088
4237
  vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
@@ -4094,17 +4243,20 @@ def _typecheckingstub__44ec0b14d52b66927d4daebe6f97bb070f3629bb0eb86e21668ca7862
4094
4243
  *,
4095
4244
  runtime: Runtime,
4096
4245
  test: Test,
4246
+ active_tracing: typing.Optional[builtins.bool] = None,
4097
4247
  artifacts_bucket_lifecycle_rules: typing.Optional[typing.Sequence[typing.Union[_LifecycleRule_bb74e6ff, typing.Dict[builtins.str, typing.Any]]]] = None,
4098
4248
  artifacts_bucket_location: typing.Optional[typing.Union[ArtifactsBucketLocation, typing.Dict[builtins.str, typing.Any]]] = None,
4099
4249
  canary_name: typing.Optional[builtins.str] = None,
4100
4250
  cleanup: typing.Optional[Cleanup] = None,
4101
4251
  environment_variables: typing.Optional[typing.Mapping[builtins.str, builtins.str]] = None,
4102
4252
  failure_retention_period: typing.Optional[_Duration_4839e8c3] = None,
4253
+ memory: typing.Optional[_Size_7b441c34] = None,
4103
4254
  role: typing.Optional[_IRole_235f5d8e] = None,
4104
4255
  schedule: typing.Optional[Schedule] = None,
4105
4256
  security_groups: typing.Optional[typing.Sequence[_ISecurityGroup_acf8a799]] = None,
4106
4257
  start_after_creation: typing.Optional[builtins.bool] = None,
4107
4258
  success_retention_period: typing.Optional[_Duration_4839e8c3] = None,
4259
+ timeout: typing.Optional[_Duration_4839e8c3] = None,
4108
4260
  time_to_live: typing.Optional[_Duration_4839e8c3] = None,
4109
4261
  vpc: typing.Optional[_IVpc_f30d5663] = None,
4110
4262
  vpc_subnets: typing.Optional[typing.Union[_SubnetSelection_e57d76df, typing.Dict[builtins.str, typing.Any]]] = None,
@@ -158,7 +158,7 @@ The return value from `onEvent` must be a JSON object with the following fields:
158
158
  | -------------------- | ------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
159
159
  | `PhysicalResourceId` | String | No | The allocated/assigned physical ID of the resource. If omitted for `Create` events, the event's `RequestId` will be used. For `Update`, the current physical ID will be used. If a different value is returned, CloudFormation will follow with a subsequent `Delete` for the previous ID (resource replacement). For `Delete`, it will always return the current physical resource ID, and if the user returns a different one, an error will occur. |
160
160
  | `Data` | JSON | No | Resource attributes, which can later be retrieved through `Fn::GetAtt` on the custom resource object. |
161
- | `NoEcho` | Boolean | No | Whether to mask the output of the custom resource when retrieved by using the `Fn::GetAtt` function. |
161
+ | `NoEcho` | Boolean | No | Whether to mask the output of the custom resource when retrieved by using the `Fn::GetAtt` function and to mask the `Data` values. |
162
162
  | *any* | *any* | No | Any other field included in the response will be passed through to `isComplete`. This can sometimes be useful to pass state between the handlers. |
163
163
 
164
164
  ### Asynchronous Providers: isComplete
@@ -215,6 +215,48 @@ must return this name in `PhysicalResourceId` and make sure to handle
215
215
  replacement properly. The `S3File` example demonstrates this
216
216
  through the `objectKey` property.
217
217
 
218
+ ### Masking the output of log statements
219
+
220
+ When using the Provider framework to create a custom resource, the request and response
221
+ objects are logged by the provider function.If secret values are returned in the custom
222
+ resource's Data object, it would be logged and exposed which possesses security threats.
223
+
224
+ To mask the output of log statements, you can utilize the `NoEcho` field in the custom
225
+ resource handler's response.
226
+
227
+ ```python
228
+ # Create custom resource handler entrypoint
229
+ handler = lambda_.Function(self, "my-handler",
230
+ runtime=lambda_.Runtime.NODEJS_20_X,
231
+ handler="index.handler",
232
+ code=lambda_.Code.from_inline("""
233
+ exports.handler = async (event, context) => {
234
+ return {
235
+ PhysicalResourceId: '1234',
236
+ NoEcho: true,
237
+ Data: {
238
+ mySecret: 'secret-value',
239
+ hello: 'world',
240
+ ghToken: 'gho_xxxxxxx',
241
+ },
242
+ };
243
+ };""")
244
+ )
245
+
246
+ # Provision a custom resource provider framework
247
+ provider = cr.Provider(self, "my-provider",
248
+ on_event_handler=handler
249
+ )
250
+
251
+ CustomResource(self, "my-cr",
252
+ service_token=provider.service_token
253
+ )
254
+ ```
255
+
256
+ When `NoEcho` field is set to `true` in the response of custom resource handler,
257
+ it will automatically mask all values in the `Data` object in the log statements
258
+ to asterisks (*****).
259
+
218
260
  ### When there are errors
219
261
 
220
262
  As mentioned above, if any of the user handlers fail (i.e. throws an exception)
@@ -2011,18 +2053,31 @@ class Provider(
2011
2053
 
2012
2054
  Example::
2013
2055
 
2014
- # on_event: lambda.Function
2015
- # is_complete: lambda.Function
2016
- # my_role: iam.Role
2056
+ # Create custom resource handler entrypoint
2057
+ handler = lambda_.Function(self, "my-handler",
2058
+ runtime=lambda_.Runtime.NODEJS_20_X,
2059
+ handler="index.handler",
2060
+ code=lambda_.Code.from_inline("""
2061
+ exports.handler = async (event, context) => {
2062
+ return {
2063
+ PhysicalResourceId: '1234',
2064
+ NoEcho: true,
2065
+ Data: {
2066
+ mySecret: 'secret-value',
2067
+ hello: 'world',
2068
+ ghToken: 'gho_xxxxxxx',
2069
+ },
2070
+ };
2071
+ };""")
2072
+ )
2017
2073
 
2018
- my_provider = cr.Provider(self, "MyProvider",
2019
- on_event_handler=on_event,
2020
- is_complete_handler=is_complete,
2021
- log_group=logs.LogGroup(self, "MyProviderLogs",
2022
- retention=logs.RetentionDays.ONE_DAY
2023
- ),
2024
- role=my_role,
2025
- provider_function_name="the-lambda-name"
2074
+ # Provision a custom resource provider framework
2075
+ provider = cr.Provider(self, "my-provider",
2076
+ on_event_handler=handler
2077
+ )
2078
+
2079
+ CustomResource(self, "my-cr",
2080
+ service_token=provider.service_token
2026
2081
  )
2027
2082
  '''
2028
2083
 
@@ -2166,18 +2221,31 @@ class ProviderProps:
2166
2221
 
2167
2222
  Example::
2168
2223
 
2169
- # on_event: lambda.Function
2170
- # is_complete: lambda.Function
2171
- # my_role: iam.Role
2224
+ # Create custom resource handler entrypoint
2225
+ handler = lambda_.Function(self, "my-handler",
2226
+ runtime=lambda_.Runtime.NODEJS_20_X,
2227
+ handler="index.handler",
2228
+ code=lambda_.Code.from_inline("""
2229
+ exports.handler = async (event, context) => {
2230
+ return {
2231
+ PhysicalResourceId: '1234',
2232
+ NoEcho: true,
2233
+ Data: {
2234
+ mySecret: 'secret-value',
2235
+ hello: 'world',
2236
+ ghToken: 'gho_xxxxxxx',
2237
+ },
2238
+ };
2239
+ };""")
2240
+ )
2241
+
2242
+ # Provision a custom resource provider framework
2243
+ provider = cr.Provider(self, "my-provider",
2244
+ on_event_handler=handler
2245
+ )
2172
2246
 
2173
- my_provider = cr.Provider(self, "MyProvider",
2174
- on_event_handler=on_event,
2175
- is_complete_handler=is_complete,
2176
- log_group=logs.LogGroup(self, "MyProviderLogs",
2177
- retention=logs.RetentionDays.ONE_DAY
2178
- ),
2179
- role=my_role,
2180
- provider_function_name="the-lambda-name"
2247
+ CustomResource(self, "my-cr",
2248
+ service_token=provider.service_token
2181
2249
  )
2182
2250
  '''
2183
2251
  if isinstance(vpc_subnets, dict):