aws-cdk-lib 2.141.0__py3-none-any.whl → 2.142.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.

@@ -18,6 +18,7 @@ Currently supported are:
18
18
  * [Queue a Batch job](#queue-a-batch-job)
19
19
  * [Invoke an API Gateway REST API](#invoke-an-api-gateway-rest-api)
20
20
  * [Invoke an API Destination](#invoke-an-api-destination)
21
+ * [Invoke an AppSync GraphQL API](#invoke-an-appsync-graphql-api)
21
22
  * [Put an event on an EventBridge bus](#put-an-event-on-an-eventbridge-bus)
22
23
  * [Run an ECS Task](#run-an-ecs-task)
23
24
 
@@ -362,6 +363,67 @@ rule = events.Rule(self, "OtherRule",
362
363
  )
363
364
  ```
364
365
 
366
+ ## Invoke an AppSync GraphQL API
367
+
368
+ Use the `AppSync` target to trigger an AppSync GraphQL API. You need to
369
+ create an `AppSync.GraphqlApi` configured with `AWS_IAM` authorization mode.
370
+
371
+ The code snippet below creates an AppSync GraphQL API target that is invoked every hour, calling the `publish` mutation.
372
+
373
+ ```python
374
+ import aws_cdk.aws_appsync as appsync
375
+
376
+
377
+ api = appsync.GraphqlApi(self, "api",
378
+ name="api",
379
+ definition=appsync.Definition.from_file("schema.graphql"),
380
+ authorization_config=appsync.AuthorizationConfig(
381
+ default_authorization=appsync.AuthorizationMode(authorization_type=appsync.AuthorizationType.IAM)
382
+ )
383
+ )
384
+
385
+ rule = events.Rule(self, "Rule",
386
+ schedule=events.Schedule.rate(cdk.Duration.hours(1))
387
+ )
388
+
389
+ rule.add_target(targets.AppSync(api,
390
+ graph_qLOperation="mutation Publish($message: String!){ publish(message: $message) { message } }",
391
+ variables=events.RuleTargetInput.from_object({
392
+ "message": "hello world"
393
+ })
394
+ ))
395
+ ```
396
+
397
+ You can pass an existing role with the proper permissions to be used for the target when the rule is triggered. The code snippet below uses an existing role and grants permissions to use the publish Mutation on the GraphQL API.
398
+
399
+ ```python
400
+ import aws_cdk.aws_iam as iam
401
+ import aws_cdk.aws_appsync as appsync
402
+
403
+
404
+ api = appsync.GraphqlApi.from_graphql_api_attributes(self, "ImportedAPI",
405
+ graphql_api_id="<api-id>",
406
+ graphql_api_arn="<api-arn>",
407
+ graph_qLEndpoint_arn="<api-endpoint-arn>",
408
+ visibility=appsync.Visibility.GLOBAL,
409
+ modes=[appsync.AuthorizationType.IAM]
410
+ )
411
+
412
+ rule = events.Rule(self, "Rule", schedule=events.Schedule.rate(cdk.Duration.minutes(1)))
413
+ role = iam.Role(self, "Role", assumed_by=iam.ServicePrincipal("events.amazonaws.com"))
414
+
415
+ # allow EventBridge to use the `publish` mutation
416
+ api.grant_mutation(role, "publish")
417
+
418
+ rule.add_target(targets.AppSync(api,
419
+ graph_qLOperation="mutation Publish($message: String!){ publish(message: $message) { message } }",
420
+ variables=events.RuleTargetInput.from_object({
421
+ "message": "hello world"
422
+ }),
423
+ event_role=role
424
+ ))
425
+ ```
426
+
365
427
  ## Put an event on an EventBridge bus
366
428
 
367
429
  Use the `EventBus` target to route event to a different EventBus.
@@ -517,6 +579,7 @@ from .. import Duration as _Duration_4839e8c3
517
579
  from ..aws_apigateway import (
518
580
  IRestApi as _IRestApi_1f02523d, RestApi as _RestApi_777c8238
519
581
  )
582
+ from ..aws_appsync import IGraphqlApi as _IGraphqlApi_ed8270f3
520
583
  from ..aws_codebuild import IProject as _IProject_aafae30a
521
584
  from ..aws_codepipeline import IPipeline as _IPipeline_0931f838
522
585
  from ..aws_ec2 import (
@@ -767,6 +830,92 @@ class ApiGateway(
767
830
  return typing.cast(_RestApi_777c8238, jsii.get(self, "restApi"))
768
831
 
769
832
 
833
+ @jsii.implements(_IRuleTarget_7a91f454)
834
+ class AppSync(
835
+ metaclass=jsii.JSIIMeta,
836
+ jsii_type="aws-cdk-lib.aws_events_targets.AppSync",
837
+ ):
838
+ '''Use an AppSync GraphQL API as a target for Amazon EventBridge rules.
839
+
840
+ :exampleMetadata: infused
841
+
842
+ Example::
843
+
844
+ import aws_cdk.aws_appsync as appsync
845
+
846
+
847
+ api = appsync.GraphqlApi(self, "api",
848
+ name="api",
849
+ definition=appsync.Definition.from_file("schema.graphql"),
850
+ authorization_config=appsync.AuthorizationConfig(
851
+ default_authorization=appsync.AuthorizationMode(authorization_type=appsync.AuthorizationType.IAM)
852
+ )
853
+ )
854
+
855
+ rule = events.Rule(self, "Rule",
856
+ schedule=events.Schedule.rate(cdk.Duration.hours(1))
857
+ )
858
+
859
+ rule.add_target(targets.AppSync(api,
860
+ graph_qLOperation="mutation Publish($message: String!){ publish(message: $message) { message } }",
861
+ variables=events.RuleTargetInput.from_object({
862
+ "message": "hello world"
863
+ })
864
+ ))
865
+ '''
866
+
867
+ def __init__(
868
+ self,
869
+ appsync_api: _IGraphqlApi_ed8270f3,
870
+ *,
871
+ graph_ql_operation: builtins.str,
872
+ event_role: typing.Optional[_IRole_235f5d8e] = None,
873
+ variables: typing.Optional[_RuleTargetInput_6beca786] = None,
874
+ dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
875
+ max_event_age: typing.Optional[_Duration_4839e8c3] = None,
876
+ retry_attempts: typing.Optional[jsii.Number] = None,
877
+ ) -> None:
878
+ '''
879
+ :param appsync_api: -
880
+ :param graph_ql_operation: The GraphQL operation; that is, the query, mutation, or subscription to be parsed and executed by the GraphQL service.
881
+ :param event_role: The role to assume before invoking the target (i.e., the pipeline) when the given rule is triggered. Default: - a new role with permissions to access mutations will be created
882
+ :param variables: The variables that are include in the GraphQL operation. Default: - The entire event is used
883
+ :param dead_letter_queue: The SQS queue to be used as deadLetterQueue. Check out the `considerations for using a dead-letter queue <https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html#dlq-considerations>`_. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
884
+ :param max_event_age: The maximum age of a request that Lambda sends to a function for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
885
+ :param retry_attempts: The maximum number of times to retry when the function returns an error. Minimum value of 0. Maximum value of 185. Default: 185
886
+ '''
887
+ if __debug__:
888
+ type_hints = typing.get_type_hints(_typecheckingstub__56a99cbd83a0d7a956b68eb6ee5cedd89a2b1c37754c2dc7f5a5ea2ccffb1c7f)
889
+ check_type(argname="argument appsync_api", value=appsync_api, expected_type=type_hints["appsync_api"])
890
+ props = AppSyncGraphQLApiProps(
891
+ graph_ql_operation=graph_ql_operation,
892
+ event_role=event_role,
893
+ variables=variables,
894
+ dead_letter_queue=dead_letter_queue,
895
+ max_event_age=max_event_age,
896
+ retry_attempts=retry_attempts,
897
+ )
898
+
899
+ jsii.create(self.__class__, self, [appsync_api, props])
900
+
901
+ @jsii.member(jsii_name="bind")
902
+ def bind(
903
+ self,
904
+ rule: _IRule_af9e3d28,
905
+ _id: typing.Optional[builtins.str] = None,
906
+ ) -> _RuleTargetConfig_4e70fe03:
907
+ '''Returns a RuleTarget that can be used to trigger this AppSync GraphQL API as a result from an EventBridge event.
908
+
909
+ :param rule: -
910
+ :param _id: -
911
+ '''
912
+ if __debug__:
913
+ type_hints = typing.get_type_hints(_typecheckingstub__6b1999a517525e35ef54e6129e3396c11b46ecb394388d3f908c6d627c051c4f)
914
+ check_type(argname="argument rule", value=rule, expected_type=type_hints["rule"])
915
+ check_type(argname="argument _id", value=_id, expected_type=type_hints["_id"])
916
+ return typing.cast(_RuleTargetConfig_4e70fe03, jsii.invoke(self, "bind", [rule, _id]))
917
+
918
+
770
919
  @jsii.implements(_IRuleTarget_7a91f454)
771
920
  class AwsApi(
772
921
  metaclass=jsii.JSIIMeta,
@@ -3277,6 +3426,164 @@ class ApiGatewayProps(TargetBaseProps):
3277
3426
  )
3278
3427
 
3279
3428
 
3429
+ @jsii.data_type(
3430
+ jsii_type="aws-cdk-lib.aws_events_targets.AppSyncGraphQLApiProps",
3431
+ jsii_struct_bases=[TargetBaseProps],
3432
+ name_mapping={
3433
+ "dead_letter_queue": "deadLetterQueue",
3434
+ "max_event_age": "maxEventAge",
3435
+ "retry_attempts": "retryAttempts",
3436
+ "graph_ql_operation": "graphQLOperation",
3437
+ "event_role": "eventRole",
3438
+ "variables": "variables",
3439
+ },
3440
+ )
3441
+ class AppSyncGraphQLApiProps(TargetBaseProps):
3442
+ def __init__(
3443
+ self,
3444
+ *,
3445
+ dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
3446
+ max_event_age: typing.Optional[_Duration_4839e8c3] = None,
3447
+ retry_attempts: typing.Optional[jsii.Number] = None,
3448
+ graph_ql_operation: builtins.str,
3449
+ event_role: typing.Optional[_IRole_235f5d8e] = None,
3450
+ variables: typing.Optional[_RuleTargetInput_6beca786] = None,
3451
+ ) -> None:
3452
+ '''Customize the AppSync GraphQL API target.
3453
+
3454
+ :param dead_letter_queue: The SQS queue to be used as deadLetterQueue. Check out the `considerations for using a dead-letter queue <https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html#dlq-considerations>`_. The events not successfully delivered are automatically retried for a specified period of time, depending on the retry policy of the target. If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue. Default: - no dead-letter queue
3455
+ :param max_event_age: The maximum age of a request that Lambda sends to a function for processing. Minimum value of 60. Maximum value of 86400. Default: Duration.hours(24)
3456
+ :param retry_attempts: The maximum number of times to retry when the function returns an error. Minimum value of 0. Maximum value of 185. Default: 185
3457
+ :param graph_ql_operation: The GraphQL operation; that is, the query, mutation, or subscription to be parsed and executed by the GraphQL service.
3458
+ :param event_role: The role to assume before invoking the target (i.e., the pipeline) when the given rule is triggered. Default: - a new role with permissions to access mutations will be created
3459
+ :param variables: The variables that are include in the GraphQL operation. Default: - The entire event is used
3460
+
3461
+ :exampleMetadata: infused
3462
+
3463
+ Example::
3464
+
3465
+ import aws_cdk.aws_appsync as appsync
3466
+
3467
+
3468
+ api = appsync.GraphqlApi(self, "api",
3469
+ name="api",
3470
+ definition=appsync.Definition.from_file("schema.graphql"),
3471
+ authorization_config=appsync.AuthorizationConfig(
3472
+ default_authorization=appsync.AuthorizationMode(authorization_type=appsync.AuthorizationType.IAM)
3473
+ )
3474
+ )
3475
+
3476
+ rule = events.Rule(self, "Rule",
3477
+ schedule=events.Schedule.rate(cdk.Duration.hours(1))
3478
+ )
3479
+
3480
+ rule.add_target(targets.AppSync(api,
3481
+ graph_qLOperation="mutation Publish($message: String!){ publish(message: $message) { message } }",
3482
+ variables=events.RuleTargetInput.from_object({
3483
+ "message": "hello world"
3484
+ })
3485
+ ))
3486
+ '''
3487
+ if __debug__:
3488
+ type_hints = typing.get_type_hints(_typecheckingstub__aea6c33be1be64052595742c1fdd00fb0f53185ebe3c9f93ceacd92d82655d1d)
3489
+ check_type(argname="argument dead_letter_queue", value=dead_letter_queue, expected_type=type_hints["dead_letter_queue"])
3490
+ check_type(argname="argument max_event_age", value=max_event_age, expected_type=type_hints["max_event_age"])
3491
+ check_type(argname="argument retry_attempts", value=retry_attempts, expected_type=type_hints["retry_attempts"])
3492
+ check_type(argname="argument graph_ql_operation", value=graph_ql_operation, expected_type=type_hints["graph_ql_operation"])
3493
+ check_type(argname="argument event_role", value=event_role, expected_type=type_hints["event_role"])
3494
+ check_type(argname="argument variables", value=variables, expected_type=type_hints["variables"])
3495
+ self._values: typing.Dict[builtins.str, typing.Any] = {
3496
+ "graph_ql_operation": graph_ql_operation,
3497
+ }
3498
+ if dead_letter_queue is not None:
3499
+ self._values["dead_letter_queue"] = dead_letter_queue
3500
+ if max_event_age is not None:
3501
+ self._values["max_event_age"] = max_event_age
3502
+ if retry_attempts is not None:
3503
+ self._values["retry_attempts"] = retry_attempts
3504
+ if event_role is not None:
3505
+ self._values["event_role"] = event_role
3506
+ if variables is not None:
3507
+ self._values["variables"] = variables
3508
+
3509
+ @builtins.property
3510
+ def dead_letter_queue(self) -> typing.Optional[_IQueue_7ed6f679]:
3511
+ '''The SQS queue to be used as deadLetterQueue. Check out the `considerations for using a dead-letter queue <https://docs.aws.amazon.com/eventbridge/latest/userguide/rule-dlq.html#dlq-considerations>`_.
3512
+
3513
+ The events not successfully delivered are automatically retried for a specified period of time,
3514
+ depending on the retry policy of the target.
3515
+ If an event is not delivered before all retry attempts are exhausted, it will be sent to the dead letter queue.
3516
+
3517
+ :default: - no dead-letter queue
3518
+ '''
3519
+ result = self._values.get("dead_letter_queue")
3520
+ return typing.cast(typing.Optional[_IQueue_7ed6f679], result)
3521
+
3522
+ @builtins.property
3523
+ def max_event_age(self) -> typing.Optional[_Duration_4839e8c3]:
3524
+ '''The maximum age of a request that Lambda sends to a function for processing.
3525
+
3526
+ Minimum value of 60.
3527
+ Maximum value of 86400.
3528
+
3529
+ :default: Duration.hours(24)
3530
+ '''
3531
+ result = self._values.get("max_event_age")
3532
+ return typing.cast(typing.Optional[_Duration_4839e8c3], result)
3533
+
3534
+ @builtins.property
3535
+ def retry_attempts(self) -> typing.Optional[jsii.Number]:
3536
+ '''The maximum number of times to retry when the function returns an error.
3537
+
3538
+ Minimum value of 0.
3539
+ Maximum value of 185.
3540
+
3541
+ :default: 185
3542
+ '''
3543
+ result = self._values.get("retry_attempts")
3544
+ return typing.cast(typing.Optional[jsii.Number], result)
3545
+
3546
+ @builtins.property
3547
+ def graph_ql_operation(self) -> builtins.str:
3548
+ '''The GraphQL operation;
3549
+
3550
+ that is, the query, mutation, or subscription
3551
+ to be parsed and executed by the GraphQL service.
3552
+ '''
3553
+ result = self._values.get("graph_ql_operation")
3554
+ assert result is not None, "Required property 'graph_ql_operation' is missing"
3555
+ return typing.cast(builtins.str, result)
3556
+
3557
+ @builtins.property
3558
+ def event_role(self) -> typing.Optional[_IRole_235f5d8e]:
3559
+ '''The role to assume before invoking the target (i.e., the pipeline) when the given rule is triggered.
3560
+
3561
+ :default: - a new role with permissions to access mutations will be created
3562
+ '''
3563
+ result = self._values.get("event_role")
3564
+ return typing.cast(typing.Optional[_IRole_235f5d8e], result)
3565
+
3566
+ @builtins.property
3567
+ def variables(self) -> typing.Optional[_RuleTargetInput_6beca786]:
3568
+ '''The variables that are include in the GraphQL operation.
3569
+
3570
+ :default: - The entire event is used
3571
+ '''
3572
+ result = self._values.get("variables")
3573
+ return typing.cast(typing.Optional[_RuleTargetInput_6beca786], result)
3574
+
3575
+ def __eq__(self, rhs: typing.Any) -> builtins.bool:
3576
+ return isinstance(rhs, self.__class__) and rhs._values == self._values
3577
+
3578
+ def __ne__(self, rhs: typing.Any) -> builtins.bool:
3579
+ return not (rhs == self)
3580
+
3581
+ def __repr__(self) -> str:
3582
+ return "AppSyncGraphQLApiProps(%s)" % ", ".join(
3583
+ k + "=" + repr(v) for k, v in self._values.items()
3584
+ )
3585
+
3586
+
3280
3587
  @jsii.data_type(
3281
3588
  jsii_type="aws-cdk-lib.aws_events_targets.BatchJobProps",
3282
3589
  jsii_struct_bases=[TargetBaseProps],
@@ -4742,6 +5049,8 @@ __all__ = [
4742
5049
  "ApiDestinationProps",
4743
5050
  "ApiGateway",
4744
5051
  "ApiGatewayProps",
5052
+ "AppSync",
5053
+ "AppSyncGraphQLApiProps",
4745
5054
  "AwsApi",
4746
5055
  "AwsApiInput",
4747
5056
  "AwsApiProps",
@@ -4826,6 +5135,26 @@ def _typecheckingstub__f34d8ba93048cf243454dc97d2236199033c050fc0bbc6ff84e18fa60
4826
5135
  """Type checking stubs"""
4827
5136
  pass
4828
5137
 
5138
+ def _typecheckingstub__56a99cbd83a0d7a956b68eb6ee5cedd89a2b1c37754c2dc7f5a5ea2ccffb1c7f(
5139
+ appsync_api: _IGraphqlApi_ed8270f3,
5140
+ *,
5141
+ graph_ql_operation: builtins.str,
5142
+ event_role: typing.Optional[_IRole_235f5d8e] = None,
5143
+ variables: typing.Optional[_RuleTargetInput_6beca786] = None,
5144
+ dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
5145
+ max_event_age: typing.Optional[_Duration_4839e8c3] = None,
5146
+ retry_attempts: typing.Optional[jsii.Number] = None,
5147
+ ) -> None:
5148
+ """Type checking stubs"""
5149
+ pass
5150
+
5151
+ def _typecheckingstub__6b1999a517525e35ef54e6129e3396c11b46ecb394388d3f908c6d627c051c4f(
5152
+ rule: _IRule_af9e3d28,
5153
+ _id: typing.Optional[builtins.str] = None,
5154
+ ) -> None:
5155
+ """Type checking stubs"""
5156
+ pass
5157
+
4829
5158
  def _typecheckingstub__a41bcbfd7e37d2d2cf83a8f636d325a2a328da0a83ef4d994f0be12782f7d357(
4830
5159
  rule: _IRule_af9e3d28,
4831
5160
  id: typing.Optional[builtins.str] = None,
@@ -5170,6 +5499,18 @@ def _typecheckingstub__ed5e368611ecca03be97333615df4f6727992e87138462a27cc1f9a4c
5170
5499
  """Type checking stubs"""
5171
5500
  pass
5172
5501
 
5502
+ def _typecheckingstub__aea6c33be1be64052595742c1fdd00fb0f53185ebe3c9f93ceacd92d82655d1d(
5503
+ *,
5504
+ dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
5505
+ max_event_age: typing.Optional[_Duration_4839e8c3] = None,
5506
+ retry_attempts: typing.Optional[jsii.Number] = None,
5507
+ graph_ql_operation: builtins.str,
5508
+ event_role: typing.Optional[_IRole_235f5d8e] = None,
5509
+ variables: typing.Optional[_RuleTargetInput_6beca786] = None,
5510
+ ) -> None:
5511
+ """Type checking stubs"""
5512
+ pass
5513
+
5173
5514
  def _typecheckingstub__91b263189af78d46fd5bf421034197688036a7347fbaee9bef843d928f9bb43f(
5174
5515
  *,
5175
5516
  dead_letter_queue: typing.Optional[_IQueue_7ed6f679] = None,
@@ -10723,16 +10723,21 @@ class RoleProps:
10723
10723
 
10724
10724
  Example::
10725
10725
 
10726
- # definition: sfn.IChainable
10727
- role = iam.Role(self, "Role",
10728
- assumed_by=iam.ServicePrincipal("lambda.amazonaws.com")
10729
- )
10730
- state_machine = sfn.StateMachine(self, "StateMachine",
10731
- definition_body=sfn.DefinitionBody.from_chainable(definition)
10726
+ # Option 3: Create a new role that allows the account root principal to assume. Add this role in the `system:masters` and witch to this role from the AWS console.
10727
+ # cluster: eks.Cluster
10728
+
10729
+
10730
+ console_read_only_role = iam.Role(self, "ConsoleReadOnlyRole",
10731
+ assumed_by=iam.ArnPrincipal("arn_for_trusted_principal")
10732
10732
  )
10733
+ console_read_only_role.add_to_policy(iam.PolicyStatement(
10734
+ actions=["eks:AccessKubernetesApi", "eks:Describe*", "eks:List*"
10735
+ ],
10736
+ resources=[cluster.cluster_arn]
10737
+ ))
10733
10738
 
10734
- # Give role permission to get execution history of ALL executions for the state machine
10735
- state_machine.grant_execution(role, "states:GetExecutionHistory")
10739
+ # Add this role to system:masters RBAC group
10740
+ cluster.aws_auth.add_masters_role(console_read_only_role)
10736
10741
  '''
10737
10742
  if __debug__:
10738
10743
  type_hints = typing.get_type_hints(_typecheckingstub__9c9223cb9fa6dff45ee4fd7013629ab18542c2499a83f542c5405968fad2287c)
@@ -157,6 +157,9 @@ environment.
157
157
  When passing a runtime that is known to include a version of the aws sdk, it will be excluded by default. For example, when
158
158
  passing `NODEJS_16_X`, `aws-sdk` is excluded. When passing `NODEJS_18_X`, all `@aws-sdk/*` packages are excluded.
159
159
 
160
+ > [!WARNING]
161
+ > The NodeJS runtime of Node 16 will be deprecated by Lambda on June 12, 2024. Lambda runtimes Node 18 and higher include SDKv3 and not SDKv2. Updating your Lambda runtime from <=Node 16 to any newer version will require bundling the SDK with your handler code, or updating all SDK calls in your handler code to use SDKv3 (which is not a trivial update). Please account for this added complexity and update as soon as possible.
162
+
160
163
  This can be configured by specifying `bundling.externalModules`:
161
164
 
162
165
  ```python
@@ -69,7 +69,7 @@ log_group = logs.LogGroup(self, "LogGroup")
69
69
  log_group.grant_write(iam.ServicePrincipal("es.amazonaws.com"))
70
70
  ```
71
71
 
72
- Similarily, read permissions can be granted to the log group as follows.
72
+ Similarly, read permissions can be granted to the log group as follows.
73
73
 
74
74
  ```python
75
75
  log_group = logs.LogGroup(self, "LogGroup")
@@ -6018,7 +6018,7 @@ class LogGroup(
6018
6018
  :param scope: -
6019
6019
  :param id: -
6020
6020
  :param data_protection_policy: Data Protection Policy for this log group. Default: - no data protection policy
6021
- :param encryption_key: The KMS customer managed key to encrypt the log group with. Default: Server-side encrpytion managed by the CloudWatch Logs service
6021
+ :param encryption_key: The KMS customer managed key to encrypt the log group with. Default: Server-side encryption managed by the CloudWatch Logs service
6022
6022
  :param log_group_class: The class of the log group. Possible values are: STANDARD and INFREQUENT_ACCESS. INFREQUENT_ACCESS class provides customers a cost-effective way to consolidate logs which supports querying using Logs Insights. The logGroupClass property cannot be changed once the log group is created. Default: LogGroupClass.STANDARD
6023
6023
  :param log_group_name: Name of the log group. Default: Automatically generated
6024
6024
  :param removal_policy: Determine the removal policy of this log group. Normally you want to retain the log group so you can diagnose issues from logs even after a deployment that no longer includes the log group. In that case, use the normal date-based retention policy to age out your logs. Default: RemovalPolicy.Retain
@@ -6312,7 +6312,7 @@ class LogGroupProps:
6312
6312
  '''Properties for a LogGroup.
6313
6313
 
6314
6314
  :param data_protection_policy: Data Protection Policy for this log group. Default: - no data protection policy
6315
- :param encryption_key: The KMS customer managed key to encrypt the log group with. Default: Server-side encrpytion managed by the CloudWatch Logs service
6315
+ :param encryption_key: The KMS customer managed key to encrypt the log group with. Default: Server-side encryption managed by the CloudWatch Logs service
6316
6316
  :param log_group_class: The class of the log group. Possible values are: STANDARD and INFREQUENT_ACCESS. INFREQUENT_ACCESS class provides customers a cost-effective way to consolidate logs which supports querying using Logs Insights. The logGroupClass property cannot be changed once the log group is created. Default: LogGroupClass.STANDARD
6317
6317
  :param log_group_name: Name of the log group. Default: Automatically generated
6318
6318
  :param removal_policy: Determine the removal policy of this log group. Normally you want to retain the log group so you can diagnose issues from logs even after a deployment that no longer includes the log group. In that case, use the normal date-based retention policy to age out your logs. Default: RemovalPolicy.Retain
@@ -6386,7 +6386,7 @@ class LogGroupProps:
6386
6386
  def encryption_key(self) -> typing.Optional[_IKey_5f11635f]:
6387
6387
  '''The KMS customer managed key to encrypt the log group with.
6388
6388
 
6389
- :default: Server-side encrpytion managed by the CloudWatch Logs service
6389
+ :default: Server-side encryption managed by the CloudWatch Logs service
6390
6390
  '''
6391
6391
  result = self._values.get("encryption_key")
6392
6392
  return typing.cast(typing.Optional[_IKey_5f11635f], result)
@@ -8701,7 +8701,7 @@ class CustomDataIdentifier(
8701
8701
  '''Create a custom data identifier.
8702
8702
 
8703
8703
  :param name: - the name of the custom data identifier. This cannot share the same name as a managed data identifier.
8704
- :param regex: - the regular expresssion to detect and mask log events for.
8704
+ :param regex: - the regular expression to detect and mask log events for.
8705
8705
  '''
8706
8706
  if __debug__:
8707
8707
  type_hints = typing.get_type_hints(_typecheckingstub__8962f986463b4e81629495838f26c8990feeca56061597cb66e94771b4cfb79d)
@@ -8729,7 +8729,7 @@ class CustomDataIdentifier(
8729
8729
  @builtins.property
8730
8730
  @jsii.member(jsii_name="regex")
8731
8731
  def regex(self) -> builtins.str:
8732
- '''- the regular expresssion to detect and mask log events for.'''
8732
+ '''- the regular expression to detect and mask log events for.'''
8733
8733
  return typing.cast(builtins.str, jsii.get(self, "regex"))
8734
8734
 
8735
8735
 
@@ -323,7 +323,7 @@ to use for a cluster instances:
323
323
  cluster = rds.DatabaseCluster(self, "Database",
324
324
  engine=rds.DatabaseClusterEngine.aurora_mysql(version=rds.AuroraMysqlEngineVersion.VER_3_01_0),
325
325
  writer=rds.ClusterInstance.provisioned("writer",
326
- ca_certificate=rds.CaCertificate.RDS_CA_RDS2048_G1
326
+ ca_certificate=rds.CaCertificate.RDS_CA_RSA2048_G1
327
327
  ),
328
328
  readers=[
329
329
  rds.ClusterInstance.serverless_v2("reader",
@@ -696,7 +696,7 @@ to use for the instance:
696
696
  rds.DatabaseInstance(self, "Instance",
697
697
  engine=rds.DatabaseInstanceEngine.mysql(version=rds.MysqlEngineVersion.VER_8_0_30),
698
698
  vpc=vpc,
699
- ca_certificate=rds.CaCertificate.RDS_CA_RDS2048_G1
699
+ ca_certificate=rds.CaCertificate.RDS_CA_RSA2048_G1
700
700
  )
701
701
  ```
702
702
 
@@ -3440,6 +3440,12 @@ class AuroraPostgresEngineVersion(
3440
3440
  '''Version "16.1".'''
3441
3441
  return typing.cast("AuroraPostgresEngineVersion", jsii.sget(cls, "VER_16_1"))
3442
3442
 
3443
+ @jsii.python.classproperty
3444
+ @jsii.member(jsii_name="VER_16_2")
3445
+ def VER_16_2(cls) -> "AuroraPostgresEngineVersion":
3446
+ '''Version "16.2".'''
3447
+ return typing.cast("AuroraPostgresEngineVersion", jsii.sget(cls, "VER_16_2"))
3448
+
3443
3449
  @jsii.python.classproperty
3444
3450
  @jsii.member(jsii_name="VER_9_6_11")
3445
3451
  def VER_9_6_11(cls) -> "AuroraPostgresEngineVersion":
@@ -3652,10 +3658,16 @@ class CaCertificate(
3652
3658
  # vpc: ec2.Vpc
3653
3659
 
3654
3660
 
3655
- rds.DatabaseInstance(self, "Instance",
3656
- engine=rds.DatabaseInstanceEngine.mysql(version=rds.MysqlEngineVersion.VER_8_0_30),
3661
+ cluster = docdb.DatabaseCluster(self, "Database",
3662
+ master_user=docdb.Login(
3663
+ username="myuser"
3664
+ ),
3665
+ instance_type=ec2.InstanceType.of(ec2.InstanceClass.MEMORY5, ec2.InstanceSize.LARGE),
3666
+ vpc_subnets=ec2.SubnetSelection(
3667
+ subnet_type=ec2.SubnetType.PUBLIC
3668
+ ),
3657
3669
  vpc=vpc,
3658
- ca_certificate=rds.CaCertificate.of("future-rds-ca")
3670
+ ca_certificate=docdb.CaCertificate.RDS_CA_RSA4096_G1
3659
3671
  )
3660
3672
  '''
3661
3673
 
@@ -3691,15 +3703,37 @@ class CaCertificate(
3691
3703
  @jsii.python.classproperty
3692
3704
  @jsii.member(jsii_name="RDS_CA_RDS2048_G1")
3693
3705
  def RDS_CA_RDS2048_G1(cls) -> "CaCertificate":
3694
- '''rds-ca-rsa2048-g1 certificate authority.'''
3706
+ '''(deprecated) rds-ca-rsa2048-g1 certificate authority.
3707
+
3708
+ :deprecated: use RDS_CA_RSA2048_G1 (slight misspelling)
3709
+
3710
+ :stability: deprecated
3711
+ '''
3695
3712
  return typing.cast("CaCertificate", jsii.sget(cls, "RDS_CA_RDS2048_G1"))
3696
3713
 
3697
3714
  @jsii.python.classproperty
3698
3715
  @jsii.member(jsii_name="RDS_CA_RDS4096_G1")
3699
3716
  def RDS_CA_RDS4096_G1(cls) -> "CaCertificate":
3700
- '''rds-ca-rsa4096-g1 certificate authority.'''
3717
+ '''(deprecated) rds-ca-rsa4096-g1 certificate authority.
3718
+
3719
+ :deprecated: use RDS_CA_RSA4096_G1 (slight misspelling)
3720
+
3721
+ :stability: deprecated
3722
+ '''
3701
3723
  return typing.cast("CaCertificate", jsii.sget(cls, "RDS_CA_RDS4096_G1"))
3702
3724
 
3725
+ @jsii.python.classproperty
3726
+ @jsii.member(jsii_name="RDS_CA_RSA2048_G1")
3727
+ def RDS_CA_RSA2048_G1(cls) -> "CaCertificate":
3728
+ '''rds-ca-rsa2048-g1 certificate authority.'''
3729
+ return typing.cast("CaCertificate", jsii.sget(cls, "RDS_CA_RSA2048_G1"))
3730
+
3731
+ @jsii.python.classproperty
3732
+ @jsii.member(jsii_name="RDS_CA_RSA4096_G1")
3733
+ def RDS_CA_RSA4096_G1(cls) -> "CaCertificate":
3734
+ '''rds-ca-rsa4096-g1 certificate authority.'''
3735
+ return typing.cast("CaCertificate", jsii.sget(cls, "RDS_CA_RSA4096_G1"))
3736
+
3703
3737
 
3704
3738
  @jsii.implements(_IInspectable_c2943556, _ITaggableV2_4e6798f8)
3705
3739
  class CfnCustomDBEngineVersion(
@@ -35591,7 +35625,7 @@ class ServerlessV2ClusterInstanceProps(ClusterInstanceOptions):
35591
35625
  cluster = rds.DatabaseCluster(self, "Database",
35592
35626
  engine=rds.DatabaseClusterEngine.aurora_mysql(version=rds.AuroraMysqlEngineVersion.VER_3_01_0),
35593
35627
  writer=rds.ClusterInstance.provisioned("writer",
35594
- ca_certificate=rds.CaCertificate.RDS_CA_RDS2048_G1
35628
+ ca_certificate=rds.CaCertificate.RDS_CA_RSA2048_G1
35595
35629
  ),
35596
35630
  readers=[
35597
35631
  rds.ClusterInstance.serverless_v2("reader",
@@ -597,6 +597,8 @@ as it does not contain any objects.
597
597
  To override this and force all objects to get deleted during bucket deletion,
598
598
  enable the`autoDeleteObjects` option.
599
599
 
600
+ When `autoDeleteObjects` is enabled, `s3:PutBucketPolicy` is added to the bucket policy. This is done to allow the custom resource this feature is built on to add a deny policy for `s3:PutObject` to the bucket policy when a delete stack event occurs. Adding this deny policy prevents new objects from being written to the bucket. Doing this prevents race conditions with external bucket writers during the deletion process.
601
+
600
602
  ```python
601
603
  bucket = s3.Bucket(self, "MyTempFileBucket",
602
604
  removal_policy=cdk.RemovalPolicy.DESTROY,
@@ -1752,7 +1754,7 @@ class BucketProps:
1752
1754
  ) -> None:
1753
1755
  '''
1754
1756
  :param access_control: Specifies a canned ACL that grants predefined permissions to the bucket. Default: BucketAccessControl.PRIVATE
1755
- :param auto_delete_objects: Whether all objects should be automatically deleted when the bucket is removed from the stack or when the stack is deleted. Requires the ``removalPolicy`` to be set to ``RemovalPolicy.DESTROY``. **Warning** if you have deployed a bucket with ``autoDeleteObjects: true``, switching this to ``false`` in a CDK version *before* ``1.126.0`` will lead to all objects in the bucket being deleted. Be sure to update your bucket resources by deploying with CDK version ``1.126.0`` or later **before** switching this value to ``false``. Default: false
1757
+ :param auto_delete_objects: Whether all objects should be automatically deleted when the bucket is removed from the stack or when the stack is deleted. Requires the ``removalPolicy`` to be set to ``RemovalPolicy.DESTROY``. **Warning** if you have deployed a bucket with ``autoDeleteObjects: true``, switching this to ``false`` in a CDK version *before* ``1.126.0`` will lead to all objects in the bucket being deleted. Be sure to update your bucket resources by deploying with CDK version ``1.126.0`` or later **before** switching this value to ``false``. Setting ``autoDeleteObjects`` to true on a bucket will add ``s3:PutBucketPolicy`` to the bucket policy. This is because during bucket deletion, the custom resource provider needs to update the bucket policy by adding a deny policy for ``s3:PutObject`` to prevent race conditions with external bucket writers. Default: false
1756
1758
  :param block_public_access: The block public access configuration of this bucket. Default: - CloudFormation defaults will apply. New buckets and objects don't allow public access, but users can modify bucket policies or object permissions to allow public access
1757
1759
  :param bucket_key_enabled: Whether Amazon S3 should use its own intermediary key to generate data keys. Only relevant when using KMS for encryption. - If not enabled, every object GET and PUT will cause an API call to KMS (with the attendant cost implications of that). - If enabled, S3 will use its own time-limited key instead. Only relevant, when Encryption is set to ``BucketEncryption.KMS`` or ``BucketEncryption.KMS_MANAGED``. Default: - false
1758
1760
  :param bucket_name: Physical name of this bucket. Default: - Assigned by CloudFormation (recommended).
@@ -1919,6 +1921,11 @@ class BucketProps:
1919
1921
  all objects in the bucket being deleted. Be sure to update your bucket resources
1920
1922
  by deploying with CDK version ``1.126.0`` or later **before** switching this value to ``false``.
1921
1923
 
1924
+ Setting ``autoDeleteObjects`` to true on a bucket will add ``s3:PutBucketPolicy`` to the
1925
+ bucket policy. This is because during bucket deletion, the custom resource provider
1926
+ needs to update the bucket policy by adding a deny policy for ``s3:PutObject`` to
1927
+ prevent race conditions with external bucket writers.
1928
+
1922
1929
  :default: false
1923
1930
  '''
1924
1931
  result = self._values.get("auto_delete_objects")
@@ -19361,7 +19368,7 @@ class Bucket(
19361
19368
  :param scope: -
19362
19369
  :param id: -
19363
19370
  :param access_control: Specifies a canned ACL that grants predefined permissions to the bucket. Default: BucketAccessControl.PRIVATE
19364
- :param auto_delete_objects: Whether all objects should be automatically deleted when the bucket is removed from the stack or when the stack is deleted. Requires the ``removalPolicy`` to be set to ``RemovalPolicy.DESTROY``. **Warning** if you have deployed a bucket with ``autoDeleteObjects: true``, switching this to ``false`` in a CDK version *before* ``1.126.0`` will lead to all objects in the bucket being deleted. Be sure to update your bucket resources by deploying with CDK version ``1.126.0`` or later **before** switching this value to ``false``. Default: false
19371
+ :param auto_delete_objects: Whether all objects should be automatically deleted when the bucket is removed from the stack or when the stack is deleted. Requires the ``removalPolicy`` to be set to ``RemovalPolicy.DESTROY``. **Warning** if you have deployed a bucket with ``autoDeleteObjects: true``, switching this to ``false`` in a CDK version *before* ``1.126.0`` will lead to all objects in the bucket being deleted. Be sure to update your bucket resources by deploying with CDK version ``1.126.0`` or later **before** switching this value to ``false``. Setting ``autoDeleteObjects`` to true on a bucket will add ``s3:PutBucketPolicy`` to the bucket policy. This is because during bucket deletion, the custom resource provider needs to update the bucket policy by adding a deny policy for ``s3:PutObject`` to prevent race conditions with external bucket writers. Default: false
19365
19372
  :param block_public_access: The block public access configuration of this bucket. Default: - CloudFormation defaults will apply. New buckets and objects don't allow public access, but users can modify bucket policies or object permissions to allow public access
19366
19373
  :param bucket_key_enabled: Whether Amazon S3 should use its own intermediary key to generate data keys. Only relevant when using KMS for encryption. - If not enabled, every object GET and PUT will cause an API call to KMS (with the attendant cost implications of that). - If enabled, S3 will use its own time-limited key instead. Only relevant, when Encryption is set to ``BucketEncryption.KMS`` or ``BucketEncryption.KMS_MANAGED``. Default: - false
19367
19374
  :param bucket_name: Physical name of this bucket. Default: - Assigned by CloudFormation (recommended).