aws-cdk-lib 2.91.0__py3-none-any.whl → 2.92.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 (32) hide show
  1. aws_cdk/_jsii/__init__.py +2 -2
  2. aws_cdk/_jsii/{aws-cdk-lib@2.91.0.jsii.tgz → aws-cdk-lib@2.92.0.jsii.tgz} +0 -0
  3. aws_cdk/aws_appstream/__init__.py +29 -21
  4. aws_cdk/aws_batch/__init__.py +22 -10
  5. aws_cdk/aws_billingconductor/__init__.py +14 -11
  6. aws_cdk/aws_cloudwatch/__init__.py +3 -3
  7. aws_cdk/aws_dms/__init__.py +117 -58
  8. aws_cdk/aws_ec2/__init__.py +12 -14
  9. aws_cdk/aws_ecs/__init__.py +24 -12
  10. aws_cdk/aws_evidently/__init__.py +3 -3
  11. aws_cdk/aws_fsx/__init__.py +6 -5
  12. aws_cdk/aws_guardduty/__init__.py +60 -17
  13. aws_cdk/aws_iam/__init__.py +6 -8
  14. aws_cdk/aws_internetmonitor/__init__.py +43 -20
  15. aws_cdk/aws_kms/__init__.py +95 -47
  16. aws_cdk/aws_mwaa/__init__.py +13 -8
  17. aws_cdk/aws_neptune/__init__.py +5 -2
  18. aws_cdk/aws_omics/__init__.py +5 -3
  19. aws_cdk/aws_opensearchservice/__init__.py +247 -14
  20. aws_cdk/aws_organizations/__init__.py +17 -17
  21. aws_cdk/aws_route53/__init__.py +3 -1
  22. aws_cdk/aws_sns/__init__.py +8 -8
  23. aws_cdk/aws_sqs/__init__.py +13 -9
  24. aws_cdk/aws_transfer/__init__.py +40 -12
  25. aws_cdk/aws_vpclattice/__init__.py +10 -6
  26. aws_cdk/aws_wafv2/__init__.py +118 -84
  27. {aws_cdk_lib-2.91.0.dist-info → aws_cdk_lib-2.92.0.dist-info}/METADATA +3 -3
  28. {aws_cdk_lib-2.91.0.dist-info → aws_cdk_lib-2.92.0.dist-info}/RECORD +32 -32
  29. {aws_cdk_lib-2.91.0.dist-info → aws_cdk_lib-2.92.0.dist-info}/LICENSE +0 -0
  30. {aws_cdk_lib-2.91.0.dist-info → aws_cdk_lib-2.92.0.dist-info}/NOTICE +0 -0
  31. {aws_cdk_lib-2.91.0.dist-info → aws_cdk_lib-2.92.0.dist-info}/WHEEL +0 -0
  32. {aws_cdk_lib-2.91.0.dist-info → aws_cdk_lib-2.92.0.dist-info}/top_level.txt +0 -0
@@ -123,14 +123,14 @@ class CfnMonitor(
123
123
  :param id: Construct identifier for this resource (unique in its scope).
124
124
  :param monitor_name: The name of the monitor. A monitor name can contain only alphanumeric characters, dashes (-), periods (.), and underscores (_).
125
125
  :param health_events_config:
126
- :param internet_measurements_log_delivery:
126
+ :param internet_measurements_log_delivery: Publish internet measurements for a monitor for all city-networks (up to the 500,000 service limit) to another location, such as an Amazon S3 bucket. Measurements are also published to Amazon CloudWatch Logs for the first 500 (by traffic volume) city-networks (client locations and ASNs, typically internet service providers or ISPs).
127
127
  :param max_city_networks_to_monitor: The maximum number of city-networks to monitor for your resources. A city-network is the location (city) where clients access your application resources from and the network, such as an internet service provider, that clients access the resources through. For more information, see `Choosing a city-network maximum value <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMCityNetworksMaximum.html>`_ in *Using Amazon CloudWatch Internet Monitor* .
128
128
  :param resources: The resources that have been added for the monitor, listed by their Amazon Resource Names (ARNs).
129
129
  :param resources_to_add: The resources to add to a monitor, which you provide as a set of Amazon Resource Names (ARNs). You can add a combination of Virtual Private Clouds (VPCs) and Amazon CloudFront distributions, or you can add Amazon WorkSpaces directories. You can't add all three types of resources. .. epigraph:: If you add only VPC resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet connectivity.
130
130
  :param resources_to_remove: The resources to remove from a monitor, which you provide as a set of Amazon Resource Names (ARNs).
131
131
  :param status: The status of a monitor. The accepted values that you can specify for ``Status`` are ``ACTIVE`` and ``INACTIVE`` .
132
132
  :param tags: The tags for a monitor, listed as a set of *key:value* pairs.
133
- :param traffic_percentage_to_monitor:
133
+ :param traffic_percentage_to_monitor: The percentage of the internet-facing traffic for your application that you want to monitor. You can also, optionally, set a limit for the number of city-networks (client locations and ASNs, typically internet service providers) that Internet Monitor will monitor traffic for. The city-networks maximum limit caps the number of city-networks that Internet Monitor monitors for your application, regardless of the percentage of traffic that you choose to monitor.
134
134
  '''
135
135
  if __debug__:
136
136
  type_hints = typing.get_type_hints(_typecheckingstub__b49625d902a7236b204a8a96b68b35647ded5da14fa0241503fe8aed7ec47718)
@@ -274,6 +274,7 @@ class CfnMonitor(
274
274
  def internet_measurements_log_delivery(
275
275
  self,
276
276
  ) -> typing.Optional[typing.Union[_IResolvable_da3f097b, "CfnMonitor.InternetMeasurementsLogDeliveryProperty"]]:
277
+ '''Publish internet measurements for a monitor for all city-networks (up to the 500,000 service limit) to another location, such as an Amazon S3 bucket.'''
277
278
  return typing.cast(typing.Optional[typing.Union[_IResolvable_da3f097b, "CfnMonitor.InternetMeasurementsLogDeliveryProperty"]], jsii.get(self, "internetMeasurementsLogDelivery"))
278
279
 
279
280
  @internet_measurements_log_delivery.setter
@@ -373,6 +374,7 @@ class CfnMonitor(
373
374
  @builtins.property
374
375
  @jsii.member(jsii_name="trafficPercentageToMonitor")
375
376
  def traffic_percentage_to_monitor(self) -> typing.Optional[jsii.Number]:
377
+ '''The percentage of the internet-facing traffic for your application that you want to monitor.'''
376
378
  return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "trafficPercentageToMonitor"))
377
379
 
378
380
  @traffic_percentage_to_monitor.setter
@@ -400,9 +402,14 @@ class CfnMonitor(
400
402
  availability_score_threshold: typing.Optional[jsii.Number] = None,
401
403
  performance_score_threshold: typing.Optional[jsii.Number] = None,
402
404
  ) -> None:
403
- '''
404
- :param availability_score_threshold:
405
- :param performance_score_threshold:
405
+ '''Define the health event threshold percentages for the performance score and availability score for your application's monitor.
406
+
407
+ Amazon CloudWatch Internet Monitor creates a health event when there's an internet issue that affects your application end users where a health score percentage is at or below a set threshold.
408
+
409
+ If you don't set a health event threshold, the default value is 95%.
410
+
411
+ :param availability_score_threshold: The health event threshold percentage set for availability scores. When the global availability score is at or below this percentage, Internet Monitor creates a health event.
412
+ :param performance_score_threshold: The health event threshold percentage set for performance scores. When the global performance score is at or below this percentage, Internet Monitor creates a health event.
406
413
 
407
414
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-internetmonitor-monitor-healtheventsconfig.html
408
415
  :exampleMetadata: fixture=_generated
@@ -430,7 +437,10 @@ class CfnMonitor(
430
437
 
431
438
  @builtins.property
432
439
  def availability_score_threshold(self) -> typing.Optional[jsii.Number]:
433
- '''
440
+ '''The health event threshold percentage set for availability scores.
441
+
442
+ When the global availability score is at or below this percentage, Internet Monitor creates a health event.
443
+
434
444
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-internetmonitor-monitor-healtheventsconfig.html#cfn-internetmonitor-monitor-healtheventsconfig-availabilityscorethreshold
435
445
  '''
436
446
  result = self._values.get("availability_score_threshold")
@@ -438,7 +448,10 @@ class CfnMonitor(
438
448
 
439
449
  @builtins.property
440
450
  def performance_score_threshold(self) -> typing.Optional[jsii.Number]:
441
- '''
451
+ '''The health event threshold percentage set for performance scores.
452
+
453
+ When the global performance score is at or below this percentage, Internet Monitor creates a health event.
454
+
442
455
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-internetmonitor-monitor-healtheventsconfig.html#cfn-internetmonitor-monitor-healtheventsconfig-performancescorethreshold
443
456
  '''
444
457
  result = self._values.get("performance_score_threshold")
@@ -468,7 +481,7 @@ class CfnMonitor(
468
481
  ) -> None:
469
482
  '''Publish internet measurements to an Amazon S3 bucket in addition to CloudWatch Logs.
470
483
 
471
- :param s3_config: The Amazon S3 bucket where you publish internet measurements in addition to CloudWatch Logs.
484
+ :param s3_config: The configuration information for publishing Amazon CloudWatch Internet Monitor internet measurements to Amazon S3. The configuration includes the bucket name and (optionally) bucket prefix for the S3 bucket to store the measurements, and the delivery status. The delivery status is ``ENABLED`` if you choose to deliver internet measurements to an S3 bucket, and ``DISABLED`` otherwise.
472
485
 
473
486
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-internetmonitor-monitor-internetmeasurementslogdelivery.html
474
487
  :exampleMetadata: fixture=_generated
@@ -498,7 +511,9 @@ class CfnMonitor(
498
511
  def s3_config(
499
512
  self,
500
513
  ) -> typing.Optional[typing.Union[_IResolvable_da3f097b, "CfnMonitor.S3ConfigProperty"]]:
501
- '''The Amazon S3 bucket where you publish internet measurements in addition to CloudWatch Logs.
514
+ '''The configuration information for publishing Amazon CloudWatch Internet Monitor internet measurements to Amazon S3.
515
+
516
+ The configuration includes the bucket name and (optionally) bucket prefix for the S3 bucket to store the measurements, and the delivery status. The delivery status is ``ENABLED`` if you choose to deliver internet measurements to an S3 bucket, and ``DISABLED`` otherwise.
502
517
 
503
518
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-internetmonitor-monitor-internetmeasurementslogdelivery.html#cfn-internetmonitor-monitor-internetmeasurementslogdelivery-s3config
504
519
  '''
@@ -533,13 +548,13 @@ class CfnMonitor(
533
548
  bucket_prefix: typing.Optional[builtins.str] = None,
534
549
  log_delivery_status: typing.Optional[builtins.str] = None,
535
550
  ) -> None:
536
- '''Configuration information for other locations that you choose to publish Amazon CloudWatch Internet Monitor internet measurements to, such as Amazon S3.
551
+ '''The configuration for publishing Amazon CloudWatch Internet Monitor internet measurements to Amazon S3.
537
552
 
538
- The measurements are also published to Amazon CloudWatch Logs.
553
+ The configuration includes the bucket name and (optionally) bucket prefix for the S3 bucket to store the measurements, and the delivery status. The delivery status is ``ENABLED`` if you choose to deliver internet measurements to S3 logs, and ``DISABLED`` otherwise.
539
554
 
540
- :param bucket_name: The Amazon S3 bucket name.
541
- :param bucket_prefix: The Amazon S3 bucket prefix.
542
- :param log_delivery_status: The status of publishing Internet Monitor internet measurements to an Amazon S3 bucket.
555
+ :param bucket_name: The Amazon S3 bucket name for internet measurements publishing.
556
+ :param bucket_prefix: An optional Amazon S3 bucket prefix for internet measurements publishing.
557
+ :param log_delivery_status: The status of publishing Internet Monitor internet measurements to an Amazon S3 bucket. The delivery status is ``ENABLED`` if you choose to deliver internet measurements to an S3 bucket, and ``DISABLED`` otherwise.
543
558
 
544
559
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-internetmonitor-monitor-s3config.html
545
560
  :exampleMetadata: fixture=_generated
@@ -571,7 +586,7 @@ class CfnMonitor(
571
586
 
572
587
  @builtins.property
573
588
  def bucket_name(self) -> typing.Optional[builtins.str]:
574
- '''The Amazon S3 bucket name.
589
+ '''The Amazon S3 bucket name for internet measurements publishing.
575
590
 
576
591
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-internetmonitor-monitor-s3config.html#cfn-internetmonitor-monitor-s3config-bucketname
577
592
  '''
@@ -580,7 +595,7 @@ class CfnMonitor(
580
595
 
581
596
  @builtins.property
582
597
  def bucket_prefix(self) -> typing.Optional[builtins.str]:
583
- '''The Amazon S3 bucket prefix.
598
+ '''An optional Amazon S3 bucket prefix for internet measurements publishing.
584
599
 
585
600
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-internetmonitor-monitor-s3config.html#cfn-internetmonitor-monitor-s3config-bucketprefix
586
601
  '''
@@ -591,6 +606,8 @@ class CfnMonitor(
591
606
  def log_delivery_status(self) -> typing.Optional[builtins.str]:
592
607
  '''The status of publishing Internet Monitor internet measurements to an Amazon S3 bucket.
593
608
 
609
+ The delivery status is ``ENABLED`` if you choose to deliver internet measurements to an S3 bucket, and ``DISABLED`` otherwise.
610
+
594
611
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-internetmonitor-monitor-s3config.html#cfn-internetmonitor-monitor-s3config-logdeliverystatus
595
612
  '''
596
613
  result = self._values.get("log_delivery_status")
@@ -643,14 +660,14 @@ class CfnMonitorProps:
643
660
 
644
661
  :param monitor_name: The name of the monitor. A monitor name can contain only alphanumeric characters, dashes (-), periods (.), and underscores (_).
645
662
  :param health_events_config:
646
- :param internet_measurements_log_delivery:
663
+ :param internet_measurements_log_delivery: Publish internet measurements for a monitor for all city-networks (up to the 500,000 service limit) to another location, such as an Amazon S3 bucket. Measurements are also published to Amazon CloudWatch Logs for the first 500 (by traffic volume) city-networks (client locations and ASNs, typically internet service providers or ISPs).
647
664
  :param max_city_networks_to_monitor: The maximum number of city-networks to monitor for your resources. A city-network is the location (city) where clients access your application resources from and the network, such as an internet service provider, that clients access the resources through. For more information, see `Choosing a city-network maximum value <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/IMCityNetworksMaximum.html>`_ in *Using Amazon CloudWatch Internet Monitor* .
648
665
  :param resources: The resources that have been added for the monitor, listed by their Amazon Resource Names (ARNs).
649
666
  :param resources_to_add: The resources to add to a monitor, which you provide as a set of Amazon Resource Names (ARNs). You can add a combination of Virtual Private Clouds (VPCs) and Amazon CloudFront distributions, or you can add Amazon WorkSpaces directories. You can't add all three types of resources. .. epigraph:: If you add only VPC resources, at least one VPC must have an Internet Gateway attached to it, to make sure that it has internet connectivity.
650
667
  :param resources_to_remove: The resources to remove from a monitor, which you provide as a set of Amazon Resource Names (ARNs).
651
668
  :param status: The status of a monitor. The accepted values that you can specify for ``Status`` are ``ACTIVE`` and ``INACTIVE`` .
652
669
  :param tags: The tags for a monitor, listed as a set of *key:value* pairs.
653
- :param traffic_percentage_to_monitor:
670
+ :param traffic_percentage_to_monitor: The percentage of the internet-facing traffic for your application that you want to monitor. You can also, optionally, set a limit for the number of city-networks (client locations and ASNs, typically internet service providers) that Internet Monitor will monitor traffic for. The city-networks maximum limit caps the number of city-networks that Internet Monitor monitors for your application, regardless of the percentage of traffic that you choose to monitor.
654
671
 
655
672
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-internetmonitor-monitor.html
656
673
  :exampleMetadata: fixture=_generated
@@ -748,7 +765,10 @@ class CfnMonitorProps:
748
765
  def internet_measurements_log_delivery(
749
766
  self,
750
767
  ) -> typing.Optional[typing.Union[_IResolvable_da3f097b, CfnMonitor.InternetMeasurementsLogDeliveryProperty]]:
751
- '''
768
+ '''Publish internet measurements for a monitor for all city-networks (up to the 500,000 service limit) to another location, such as an Amazon S3 bucket.
769
+
770
+ Measurements are also published to Amazon CloudWatch Logs for the first 500 (by traffic volume) city-networks (client locations and ASNs, typically internet service providers or ISPs).
771
+
752
772
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-internetmonitor-monitor.html#cfn-internetmonitor-monitor-internetmeasurementslogdelivery
753
773
  '''
754
774
  result = self._values.get("internet_measurements_log_delivery")
@@ -821,7 +841,10 @@ class CfnMonitorProps:
821
841
 
822
842
  @builtins.property
823
843
  def traffic_percentage_to_monitor(self) -> typing.Optional[jsii.Number]:
824
- '''
844
+ '''The percentage of the internet-facing traffic for your application that you want to monitor.
845
+
846
+ You can also, optionally, set a limit for the number of city-networks (client locations and ASNs, typically internet service providers) that Internet Monitor will monitor traffic for. The city-networks maximum limit caps the number of city-networks that Internet Monitor monitors for your application, regardless of the percentage of traffic that you choose to monitor.
847
+
825
848
  :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-internetmonitor-monitor.html#cfn-internetmonitor-monitor-trafficpercentagetomonitor
826
849
  '''
827
850
  result = self._values.get("traffic_percentage_to_monitor")
@@ -711,10 +711,11 @@ class CfnKey(
711
711
  scope: _constructs_77d1e7e8.Construct,
712
712
  id: builtins.str,
713
713
  *,
714
- key_policy: typing.Any,
714
+ bypass_policy_lockout_safety_check: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
715
715
  description: typing.Optional[builtins.str] = None,
716
716
  enabled: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
717
717
  enable_key_rotation: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
718
+ key_policy: typing.Any = None,
718
719
  key_spec: typing.Optional[builtins.str] = None,
719
720
  key_usage: typing.Optional[builtins.str] = None,
720
721
  multi_region: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
@@ -725,10 +726,11 @@ class CfnKey(
725
726
  '''
726
727
  :param scope: Scope in which this resource is defined.
727
728
  :param id: Construct identifier for this resource (unique in its scope).
728
- :param key_policy: The key policy that authorizes use of the KMS key. The key policy must conform to the following rules. - The key policy must allow the caller to make a subsequent `PutKeyPolicy <https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html>`_ request on the KMS key. This reduces the risk that the KMS key becomes unmanageable. For more information, refer to the scenario in the `Default key policy <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam>`_ section of the **AWS Key Management Service Developer Guide** . - Each statement in the key policy must contain one or more principals. The principals in the key policy must exist and be visible to AWS KMS . When you create a new AWS principal (for example, an IAM user or role), you might need to enforce a delay before including the new principal in a key policy because the new principal might not be immediately visible to AWS KMS . For more information, see `Changes that I make are not always immediately visible <https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency>`_ in the *AWS Identity and Access Management User Guide* . If you are unsure of which policy to use, consider the *default key policy* . This is the key policy that AWS KMS applies to KMS keys that are created by using the CreateKey API with no specified key policy. It gives the AWS account that owns the key permission to perform all operations on the key. It also allows you write IAM policies to authorize access to the key. For details, see `Default key policy <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default>`_ in the *AWS Key Management Service Developer Guide* . A key policy document can include only the following characters: - Printable ASCII characters - Printable characters in the Basic Latin and Latin-1 Supplement character set - The tab ( ``\\u0009`` ), line feed ( ``\\u000A`` ), and carriage return ( ``\\u000D`` ) special characters *Minimum* : ``1`` *Maximum* : ``32768``
729
+ :param bypass_policy_lockout_safety_check: Skips ("bypasses") the key policy lockout safety check. The default value is false. Default: - false
729
730
  :param description: A description of the KMS key. Use a description that helps you to distinguish this KMS key from others in the account, such as its intended use.
730
731
  :param enabled: Specifies whether the KMS key is enabled. Disabled KMS keys cannot be used in cryptographic operations. When ``Enabled`` is ``true`` , the *key state* of the KMS key is ``Enabled`` . When ``Enabled`` is ``false`` , the key state of the KMS key is ``Disabled`` . The default value is ``true`` . The actual key state of the KMS key might be affected by actions taken outside of CloudFormation, such as running the `EnableKey <https://docs.aws.amazon.com/kms/latest/APIReference/API_EnableKey.html>`_ , `DisableKey <https://docs.aws.amazon.com/kms/latest/APIReference/API_DisableKey.html>`_ , or `ScheduleKeyDeletion <https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html>`_ operations. For information about the key states of a KMS key, see `Key state: Effect on your KMS key <https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html>`_ in the *AWS Key Management Service Developer Guide* .
731
732
  :param enable_key_rotation: Enables automatic rotation of the key material for the specified KMS key. By default, automatic key rotation is not enabled. AWS KMS supports automatic rotation only for symmetric encryption KMS keys ( ``KeySpec`` = ``SYMMETRIC_DEFAULT`` ). For asymmetric KMS keys and HMAC KMS keys, omit the ``EnableKeyRotation`` property or set it to ``false`` . To enable automatic key rotation of the key material for a multi-Region KMS key, set ``EnableKeyRotation`` to ``true`` on the primary key (created by using ``AWS::KMS::Key`` ). AWS KMS copies the rotation status to all replica keys. For details, see `Rotating multi-Region keys <https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate>`_ in the *AWS Key Management Service Developer Guide* . When you enable automatic rotation, AWS KMS automatically creates new key material for the KMS key one year after the enable date and every year thereafter. AWS KMS retains all key material until you delete the KMS key. For detailed information about automatic key rotation, see `Rotating KMS keys <https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html>`_ in the *AWS Key Management Service Developer Guide* .
733
+ :param key_policy: The key policy that authorizes use of the KMS key. The key policy must conform to the following rules. - The key policy must allow the caller to make a subsequent `PutKeyPolicy <https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html>`_ request on the KMS key. This reduces the risk that the KMS key becomes unmanageable. For more information, refer to the scenario in the `Default key policy <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam>`_ section of the **AWS Key Management Service Developer Guide** . - Each statement in the key policy must contain one or more principals. The principals in the key policy must exist and be visible to AWS KMS . When you create a new AWS principal (for example, an IAM user or role), you might need to enforce a delay before including the new principal in a key policy because the new principal might not be immediately visible to AWS KMS . For more information, see `Changes that I make are not always immediately visible <https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency>`_ in the *AWS Identity and Access Management User Guide* . If you are unsure of which policy to use, consider the *default key policy* . This is the key policy that AWS KMS applies to KMS keys that are created by using the CreateKey API with no specified key policy. It gives the AWS account that owns the key permission to perform all operations on the key. It also allows you write IAM policies to authorize access to the key. For details, see `Default key policy <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default>`_ in the *AWS Key Management Service Developer Guide* . A key policy document can include only the following characters: - Printable ASCII characters - Printable characters in the Basic Latin and Latin-1 Supplement character set - The tab ( ``\\u0009`` ), line feed ( ``\\u000A`` ), and carriage return ( ``\\u000D`` ) special characters *Minimum* : ``1`` *Maximum* : ``32768``
732
734
  :param key_spec: Specifies the type of KMS key to create. The default value, ``SYMMETRIC_DEFAULT`` , creates a KMS key with a 256-bit symmetric key for encryption and decryption. In China Regions, ``SYMMETRIC_DEFAULT`` creates a 128-bit symmetric key that uses SM4 encryption. You can't change the ``KeySpec`` value after the KMS key is created. For help choosing a key spec for your KMS key, see `Choosing a KMS key type <https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html>`_ in the *AWS Key Management Service Developer Guide* . The ``KeySpec`` property determines the type of key material in the KMS key and the algorithms that the KMS key supports. To further restrict the algorithms that can be used with the KMS key, use a condition key in its key policy or IAM policy. For more information, see `AWS KMS condition keys <https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms>`_ in the *AWS Key Management Service Developer Guide* . .. epigraph:: If you change the value of the ``KeySpec`` property on an existing KMS key, the update request fails, regardless of the value of the ```UpdateReplacePolicy`` attribute <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html>`_ . This prevents you from accidentally deleting a KMS key by changing an immutable property value. > `AWS services that are integrated with AWS KMS <https://docs.aws.amazon.com/kms/features/#AWS_Service_Integration>`_ use symmetric encryption KMS keys to protect your data. These services do not support encryption with asymmetric KMS keys. For help determining whether a KMS key is asymmetric, see `Identifying asymmetric KMS keys <https://docs.aws.amazon.com/kms/latest/developerguide/find-symm-asymm.html>`_ in the *AWS Key Management Service Developer Guide* . AWS KMS supports the following key specs for KMS keys: - Symmetric encryption key (default) - ``SYMMETRIC_DEFAULT`` (AES-256-GCM) - HMAC keys (symmetric) - ``HMAC_224`` - ``HMAC_256`` - ``HMAC_384`` - ``HMAC_512`` - Asymmetric RSA key pairs - ``RSA_2048`` - ``RSA_3072`` - ``RSA_4096`` - Asymmetric NIST-recommended elliptic curve key pairs - ``ECC_NIST_P256`` (secp256r1) - ``ECC_NIST_P384`` (secp384r1) - ``ECC_NIST_P521`` (secp521r1) - Other asymmetric elliptic curve key pairs - ``ECC_SECG_P256K1`` (secp256k1), commonly used for cryptocurrencies. - SM2 key pairs (China Regions only) - ``SM2`` Default: - "SYMMETRIC_DEFAULT"
733
735
  :param key_usage: Determines the `cryptographic operations <https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations>`_ for which you can use the KMS key. The default value is ``ENCRYPT_DECRYPT`` . This property is required for asymmetric KMS keys and HMAC KMS keys. You can't change the ``KeyUsage`` value after the KMS key is created. .. epigraph:: If you change the value of the ``KeyUsage`` property on an existing KMS key, the update request fails, regardless of the value of the ```UpdateReplacePolicy`` attribute <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html>`_ . This prevents you from accidentally deleting a KMS key by changing an immutable property value. Select only one valid value. - For symmetric encryption KMS keys, omit the property or specify ``ENCRYPT_DECRYPT`` . - For asymmetric KMS keys with RSA key material, specify ``ENCRYPT_DECRYPT`` or ``SIGN_VERIFY`` . - For asymmetric KMS keys with ECC key material, specify ``SIGN_VERIFY`` . - For asymmetric KMS keys with SM2 (China Regions only) key material, specify ``ENCRYPT_DECRYPT`` or ``SIGN_VERIFY`` . - For HMAC KMS keys, specify ``GENERATE_VERIFY_MAC`` . Default: - "ENCRYPT_DECRYPT"
734
736
  :param multi_region: Creates a multi-Region primary key that you can replicate in other AWS Regions . You can't change the ``MultiRegion`` value after the KMS key is created. For a list of AWS Regions in which multi-Region keys are supported, see `Multi-Region keys in AWS KMS <https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html>`_ in the ** . .. epigraph:: If you change the value of the ``MultiRegion`` property on an existing KMS key, the update request fails, regardless of the value of the ```UpdateReplacePolicy`` attribute <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html>`_ . This prevents you from accidentally deleting a KMS key by changing an immutable property value. For a multi-Region key, set to this property to ``true`` . For a single-Region key, omit this property or set it to ``false`` . The default value is ``false`` . *Multi-Region keys* are an AWS KMS feature that lets you create multiple interoperable KMS keys in different AWS Regions . Because these KMS keys have the same key ID, key material, and other metadata, you can use them to encrypt data in one AWS Region and decrypt it in a different AWS Region without making a cross-Region call or exposing the plaintext data. For more information, see `Multi-Region keys <https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html>`_ in the *AWS Key Management Service Developer Guide* . You can create a symmetric encryption, HMAC, or asymmetric multi-Region KMS key, and you can create a multi-Region key with imported key material. However, you cannot create a multi-Region key in a custom key store. To create a replica of this primary key in a different AWS Region , create an `AWS::KMS::ReplicaKey <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html>`_ resource in a CloudFormation stack in the replica Region. Specify the key ARN of this primary key. Default: - false
@@ -741,10 +743,11 @@ class CfnKey(
741
743
  check_type(argname="argument scope", value=scope, expected_type=type_hints["scope"])
742
744
  check_type(argname="argument id", value=id, expected_type=type_hints["id"])
743
745
  props = CfnKeyProps(
744
- key_policy=key_policy,
746
+ bypass_policy_lockout_safety_check=bypass_policy_lockout_safety_check,
745
747
  description=description,
746
748
  enabled=enabled,
747
749
  enable_key_rotation=enable_key_rotation,
750
+ key_policy=key_policy,
748
751
  key_spec=key_spec,
749
752
  key_usage=key_usage,
750
753
  multi_region=multi_region,
@@ -819,20 +822,22 @@ class CfnKey(
819
822
  return typing.cast(_TagManager_0a598cb3, jsii.get(self, "tags"))
820
823
 
821
824
  @builtins.property
822
- @jsii.member(jsii_name="keyPolicy")
823
- def key_policy(self) -> typing.Any:
824
- '''The key policy that authorizes use of the KMS key.
825
-
826
- The key policy must conform to the following rules.
827
- '''
828
- return typing.cast(typing.Any, jsii.get(self, "keyPolicy"))
825
+ @jsii.member(jsii_name="bypassPolicyLockoutSafetyCheck")
826
+ def bypass_policy_lockout_safety_check(
827
+ self,
828
+ ) -> typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]]:
829
+ '''Skips ("bypasses") the key policy lockout safety check.'''
830
+ return typing.cast(typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]], jsii.get(self, "bypassPolicyLockoutSafetyCheck"))
829
831
 
830
- @key_policy.setter
831
- def key_policy(self, value: typing.Any) -> None:
832
+ @bypass_policy_lockout_safety_check.setter
833
+ def bypass_policy_lockout_safety_check(
834
+ self,
835
+ value: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]],
836
+ ) -> None:
832
837
  if __debug__:
833
- type_hints = typing.get_type_hints(_typecheckingstub__cd3f4724ca140c9b1dca16904dd53ab0905d0688de411b0f60d4f538cb2ac4a2)
838
+ type_hints = typing.get_type_hints(_typecheckingstub__ba782ca88c8b210d0c18f73ecee5e7266ed06b7428c903676aca9b26b6490443)
834
839
  check_type(argname="argument value", value=value, expected_type=type_hints["value"])
835
- jsii.set(self, "keyPolicy", value)
840
+ jsii.set(self, "bypassPolicyLockoutSafetyCheck", value)
836
841
 
837
842
  @builtins.property
838
843
  @jsii.member(jsii_name="description")
@@ -886,6 +891,22 @@ class CfnKey(
886
891
  check_type(argname="argument value", value=value, expected_type=type_hints["value"])
887
892
  jsii.set(self, "enableKeyRotation", value)
888
893
 
894
+ @builtins.property
895
+ @jsii.member(jsii_name="keyPolicy")
896
+ def key_policy(self) -> typing.Any:
897
+ '''The key policy that authorizes use of the KMS key.
898
+
899
+ The key policy must conform to the following rules.
900
+ '''
901
+ return typing.cast(typing.Any, jsii.get(self, "keyPolicy"))
902
+
903
+ @key_policy.setter
904
+ def key_policy(self, value: typing.Any) -> None:
905
+ if __debug__:
906
+ type_hints = typing.get_type_hints(_typecheckingstub__cd3f4724ca140c9b1dca16904dd53ab0905d0688de411b0f60d4f538cb2ac4a2)
907
+ check_type(argname="argument value", value=value, expected_type=type_hints["value"])
908
+ jsii.set(self, "keyPolicy", value)
909
+
889
910
  @builtins.property
890
911
  @jsii.member(jsii_name="keySpec")
891
912
  def key_spec(self) -> typing.Optional[builtins.str]:
@@ -974,10 +995,11 @@ class CfnKey(
974
995
  jsii_type="aws-cdk-lib.aws_kms.CfnKeyProps",
975
996
  jsii_struct_bases=[],
976
997
  name_mapping={
977
- "key_policy": "keyPolicy",
998
+ "bypass_policy_lockout_safety_check": "bypassPolicyLockoutSafetyCheck",
978
999
  "description": "description",
979
1000
  "enabled": "enabled",
980
1001
  "enable_key_rotation": "enableKeyRotation",
1002
+ "key_policy": "keyPolicy",
981
1003
  "key_spec": "keySpec",
982
1004
  "key_usage": "keyUsage",
983
1005
  "multi_region": "multiRegion",
@@ -990,10 +1012,11 @@ class CfnKeyProps:
990
1012
  def __init__(
991
1013
  self,
992
1014
  *,
993
- key_policy: typing.Any,
1015
+ bypass_policy_lockout_safety_check: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
994
1016
  description: typing.Optional[builtins.str] = None,
995
1017
  enabled: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
996
1018
  enable_key_rotation: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
1019
+ key_policy: typing.Any = None,
997
1020
  key_spec: typing.Optional[builtins.str] = None,
998
1021
  key_usage: typing.Optional[builtins.str] = None,
999
1022
  multi_region: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
@@ -1003,10 +1026,11 @@ class CfnKeyProps:
1003
1026
  ) -> None:
1004
1027
  '''Properties for defining a ``CfnKey``.
1005
1028
 
1006
- :param key_policy: The key policy that authorizes use of the KMS key. The key policy must conform to the following rules. - The key policy must allow the caller to make a subsequent `PutKeyPolicy <https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html>`_ request on the KMS key. This reduces the risk that the KMS key becomes unmanageable. For more information, refer to the scenario in the `Default key policy <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam>`_ section of the **AWS Key Management Service Developer Guide** . - Each statement in the key policy must contain one or more principals. The principals in the key policy must exist and be visible to AWS KMS . When you create a new AWS principal (for example, an IAM user or role), you might need to enforce a delay before including the new principal in a key policy because the new principal might not be immediately visible to AWS KMS . For more information, see `Changes that I make are not always immediately visible <https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency>`_ in the *AWS Identity and Access Management User Guide* . If you are unsure of which policy to use, consider the *default key policy* . This is the key policy that AWS KMS applies to KMS keys that are created by using the CreateKey API with no specified key policy. It gives the AWS account that owns the key permission to perform all operations on the key. It also allows you write IAM policies to authorize access to the key. For details, see `Default key policy <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default>`_ in the *AWS Key Management Service Developer Guide* . A key policy document can include only the following characters: - Printable ASCII characters - Printable characters in the Basic Latin and Latin-1 Supplement character set - The tab ( ``\\u0009`` ), line feed ( ``\\u000A`` ), and carriage return ( ``\\u000D`` ) special characters *Minimum* : ``1`` *Maximum* : ``32768``
1029
+ :param bypass_policy_lockout_safety_check: Skips ("bypasses") the key policy lockout safety check. The default value is false. Default: - false
1007
1030
  :param description: A description of the KMS key. Use a description that helps you to distinguish this KMS key from others in the account, such as its intended use.
1008
1031
  :param enabled: Specifies whether the KMS key is enabled. Disabled KMS keys cannot be used in cryptographic operations. When ``Enabled`` is ``true`` , the *key state* of the KMS key is ``Enabled`` . When ``Enabled`` is ``false`` , the key state of the KMS key is ``Disabled`` . The default value is ``true`` . The actual key state of the KMS key might be affected by actions taken outside of CloudFormation, such as running the `EnableKey <https://docs.aws.amazon.com/kms/latest/APIReference/API_EnableKey.html>`_ , `DisableKey <https://docs.aws.amazon.com/kms/latest/APIReference/API_DisableKey.html>`_ , or `ScheduleKeyDeletion <https://docs.aws.amazon.com/kms/latest/APIReference/API_ScheduleKeyDeletion.html>`_ operations. For information about the key states of a KMS key, see `Key state: Effect on your KMS key <https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html>`_ in the *AWS Key Management Service Developer Guide* .
1009
1032
  :param enable_key_rotation: Enables automatic rotation of the key material for the specified KMS key. By default, automatic key rotation is not enabled. AWS KMS supports automatic rotation only for symmetric encryption KMS keys ( ``KeySpec`` = ``SYMMETRIC_DEFAULT`` ). For asymmetric KMS keys and HMAC KMS keys, omit the ``EnableKeyRotation`` property or set it to ``false`` . To enable automatic key rotation of the key material for a multi-Region KMS key, set ``EnableKeyRotation`` to ``true`` on the primary key (created by using ``AWS::KMS::Key`` ). AWS KMS copies the rotation status to all replica keys. For details, see `Rotating multi-Region keys <https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-manage.html#multi-region-rotate>`_ in the *AWS Key Management Service Developer Guide* . When you enable automatic rotation, AWS KMS automatically creates new key material for the KMS key one year after the enable date and every year thereafter. AWS KMS retains all key material until you delete the KMS key. For detailed information about automatic key rotation, see `Rotating KMS keys <https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html>`_ in the *AWS Key Management Service Developer Guide* .
1033
+ :param key_policy: The key policy that authorizes use of the KMS key. The key policy must conform to the following rules. - The key policy must allow the caller to make a subsequent `PutKeyPolicy <https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html>`_ request on the KMS key. This reduces the risk that the KMS key becomes unmanageable. For more information, refer to the scenario in the `Default key policy <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam>`_ section of the **AWS Key Management Service Developer Guide** . - Each statement in the key policy must contain one or more principals. The principals in the key policy must exist and be visible to AWS KMS . When you create a new AWS principal (for example, an IAM user or role), you might need to enforce a delay before including the new principal in a key policy because the new principal might not be immediately visible to AWS KMS . For more information, see `Changes that I make are not always immediately visible <https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency>`_ in the *AWS Identity and Access Management User Guide* . If you are unsure of which policy to use, consider the *default key policy* . This is the key policy that AWS KMS applies to KMS keys that are created by using the CreateKey API with no specified key policy. It gives the AWS account that owns the key permission to perform all operations on the key. It also allows you write IAM policies to authorize access to the key. For details, see `Default key policy <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default>`_ in the *AWS Key Management Service Developer Guide* . A key policy document can include only the following characters: - Printable ASCII characters - Printable characters in the Basic Latin and Latin-1 Supplement character set - The tab ( ``\\u0009`` ), line feed ( ``\\u000A`` ), and carriage return ( ``\\u000D`` ) special characters *Minimum* : ``1`` *Maximum* : ``32768``
1010
1034
  :param key_spec: Specifies the type of KMS key to create. The default value, ``SYMMETRIC_DEFAULT`` , creates a KMS key with a 256-bit symmetric key for encryption and decryption. In China Regions, ``SYMMETRIC_DEFAULT`` creates a 128-bit symmetric key that uses SM4 encryption. You can't change the ``KeySpec`` value after the KMS key is created. For help choosing a key spec for your KMS key, see `Choosing a KMS key type <https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html>`_ in the *AWS Key Management Service Developer Guide* . The ``KeySpec`` property determines the type of key material in the KMS key and the algorithms that the KMS key supports. To further restrict the algorithms that can be used with the KMS key, use a condition key in its key policy or IAM policy. For more information, see `AWS KMS condition keys <https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms>`_ in the *AWS Key Management Service Developer Guide* . .. epigraph:: If you change the value of the ``KeySpec`` property on an existing KMS key, the update request fails, regardless of the value of the ```UpdateReplacePolicy`` attribute <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html>`_ . This prevents you from accidentally deleting a KMS key by changing an immutable property value. > `AWS services that are integrated with AWS KMS <https://docs.aws.amazon.com/kms/features/#AWS_Service_Integration>`_ use symmetric encryption KMS keys to protect your data. These services do not support encryption with asymmetric KMS keys. For help determining whether a KMS key is asymmetric, see `Identifying asymmetric KMS keys <https://docs.aws.amazon.com/kms/latest/developerguide/find-symm-asymm.html>`_ in the *AWS Key Management Service Developer Guide* . AWS KMS supports the following key specs for KMS keys: - Symmetric encryption key (default) - ``SYMMETRIC_DEFAULT`` (AES-256-GCM) - HMAC keys (symmetric) - ``HMAC_224`` - ``HMAC_256`` - ``HMAC_384`` - ``HMAC_512`` - Asymmetric RSA key pairs - ``RSA_2048`` - ``RSA_3072`` - ``RSA_4096`` - Asymmetric NIST-recommended elliptic curve key pairs - ``ECC_NIST_P256`` (secp256r1) - ``ECC_NIST_P384`` (secp384r1) - ``ECC_NIST_P521`` (secp521r1) - Other asymmetric elliptic curve key pairs - ``ECC_SECG_P256K1`` (secp256k1), commonly used for cryptocurrencies. - SM2 key pairs (China Regions only) - ``SM2`` Default: - "SYMMETRIC_DEFAULT"
1011
1035
  :param key_usage: Determines the `cryptographic operations <https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations>`_ for which you can use the KMS key. The default value is ``ENCRYPT_DECRYPT`` . This property is required for asymmetric KMS keys and HMAC KMS keys. You can't change the ``KeyUsage`` value after the KMS key is created. .. epigraph:: If you change the value of the ``KeyUsage`` property on an existing KMS key, the update request fails, regardless of the value of the ```UpdateReplacePolicy`` attribute <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html>`_ . This prevents you from accidentally deleting a KMS key by changing an immutable property value. Select only one valid value. - For symmetric encryption KMS keys, omit the property or specify ``ENCRYPT_DECRYPT`` . - For asymmetric KMS keys with RSA key material, specify ``ENCRYPT_DECRYPT`` or ``SIGN_VERIFY`` . - For asymmetric KMS keys with ECC key material, specify ``SIGN_VERIFY`` . - For asymmetric KMS keys with SM2 (China Regions only) key material, specify ``ENCRYPT_DECRYPT`` or ``SIGN_VERIFY`` . - For HMAC KMS keys, specify ``GENERATE_VERIFY_MAC`` . Default: - "ENCRYPT_DECRYPT"
1012
1036
  :param multi_region: Creates a multi-Region primary key that you can replicate in other AWS Regions . You can't change the ``MultiRegion`` value after the KMS key is created. For a list of AWS Regions in which multi-Region keys are supported, see `Multi-Region keys in AWS KMS <https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html>`_ in the ** . .. epigraph:: If you change the value of the ``MultiRegion`` property on an existing KMS key, the update request fails, regardless of the value of the ```UpdateReplacePolicy`` attribute <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html>`_ . This prevents you from accidentally deleting a KMS key by changing an immutable property value. For a multi-Region key, set to this property to ``true`` . For a single-Region key, omit this property or set it to ``false`` . The default value is ``false`` . *Multi-Region keys* are an AWS KMS feature that lets you create multiple interoperable KMS keys in different AWS Regions . Because these KMS keys have the same key ID, key material, and other metadata, you can use them to encrypt data in one AWS Region and decrypt it in a different AWS Region without making a cross-Region call or exposing the plaintext data. For more information, see `Multi-Region keys <https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html>`_ in the *AWS Key Management Service Developer Guide* . You can create a symmetric encryption, HMAC, or asymmetric multi-Region KMS key, and you can create a multi-Region key with imported key material. However, you cannot create a multi-Region key in a custom key store. To create a replica of this primary key in a different AWS Region , create an `AWS::KMS::ReplicaKey <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-replicakey.html>`_ resource in a CloudFormation stack in the replica Region. Specify the key ARN of this primary key. Default: - false
@@ -1026,12 +1050,11 @@ class CfnKeyProps:
1026
1050
  # key_policy: Any
1027
1051
 
1028
1052
  cfn_key_props = kms.CfnKeyProps(
1029
- key_policy=key_policy,
1030
-
1031
- # the properties below are optional
1053
+ bypass_policy_lockout_safety_check=False,
1032
1054
  description="description",
1033
1055
  enabled=False,
1034
1056
  enable_key_rotation=False,
1057
+ key_policy=key_policy,
1035
1058
  key_spec="keySpec",
1036
1059
  key_usage="keyUsage",
1037
1060
  multi_region=False,
@@ -1045,25 +1068,28 @@ class CfnKeyProps:
1045
1068
  '''
1046
1069
  if __debug__:
1047
1070
  type_hints = typing.get_type_hints(_typecheckingstub__52751771c8b3e52917eaf0c78bad67c065fa3f95795e92f5eab3e92ce5051178)
1048
- check_type(argname="argument key_policy", value=key_policy, expected_type=type_hints["key_policy"])
1071
+ check_type(argname="argument bypass_policy_lockout_safety_check", value=bypass_policy_lockout_safety_check, expected_type=type_hints["bypass_policy_lockout_safety_check"])
1049
1072
  check_type(argname="argument description", value=description, expected_type=type_hints["description"])
1050
1073
  check_type(argname="argument enabled", value=enabled, expected_type=type_hints["enabled"])
1051
1074
  check_type(argname="argument enable_key_rotation", value=enable_key_rotation, expected_type=type_hints["enable_key_rotation"])
1075
+ check_type(argname="argument key_policy", value=key_policy, expected_type=type_hints["key_policy"])
1052
1076
  check_type(argname="argument key_spec", value=key_spec, expected_type=type_hints["key_spec"])
1053
1077
  check_type(argname="argument key_usage", value=key_usage, expected_type=type_hints["key_usage"])
1054
1078
  check_type(argname="argument multi_region", value=multi_region, expected_type=type_hints["multi_region"])
1055
1079
  check_type(argname="argument origin", value=origin, expected_type=type_hints["origin"])
1056
1080
  check_type(argname="argument pending_window_in_days", value=pending_window_in_days, expected_type=type_hints["pending_window_in_days"])
1057
1081
  check_type(argname="argument tags", value=tags, expected_type=type_hints["tags"])
1058
- self._values: typing.Dict[builtins.str, typing.Any] = {
1059
- "key_policy": key_policy,
1060
- }
1082
+ self._values: typing.Dict[builtins.str, typing.Any] = {}
1083
+ if bypass_policy_lockout_safety_check is not None:
1084
+ self._values["bypass_policy_lockout_safety_check"] = bypass_policy_lockout_safety_check
1061
1085
  if description is not None:
1062
1086
  self._values["description"] = description
1063
1087
  if enabled is not None:
1064
1088
  self._values["enabled"] = enabled
1065
1089
  if enable_key_rotation is not None:
1066
1090
  self._values["enable_key_rotation"] = enable_key_rotation
1091
+ if key_policy is not None:
1092
+ self._values["key_policy"] = key_policy
1067
1093
  if key_spec is not None:
1068
1094
  self._values["key_spec"] = key_spec
1069
1095
  if key_usage is not None:
@@ -1078,29 +1104,19 @@ class CfnKeyProps:
1078
1104
  self._values["tags"] = tags
1079
1105
 
1080
1106
  @builtins.property
1081
- def key_policy(self) -> typing.Any:
1082
- '''The key policy that authorizes use of the KMS key. The key policy must conform to the following rules.
1083
-
1084
- - The key policy must allow the caller to make a subsequent `PutKeyPolicy <https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html>`_ request on the KMS key. This reduces the risk that the KMS key becomes unmanageable. For more information, refer to the scenario in the `Default key policy <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam>`_ section of the **AWS Key Management Service Developer Guide** .
1085
- - Each statement in the key policy must contain one or more principals. The principals in the key policy must exist and be visible to AWS KMS . When you create a new AWS principal (for example, an IAM user or role), you might need to enforce a delay before including the new principal in a key policy because the new principal might not be immediately visible to AWS KMS . For more information, see `Changes that I make are not always immediately visible <https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency>`_ in the *AWS Identity and Access Management User Guide* .
1086
-
1087
- If you are unsure of which policy to use, consider the *default key policy* . This is the key policy that AWS KMS applies to KMS keys that are created by using the CreateKey API with no specified key policy. It gives the AWS account that owns the key permission to perform all operations on the key. It also allows you write IAM policies to authorize access to the key. For details, see `Default key policy <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default>`_ in the *AWS Key Management Service Developer Guide* .
1088
-
1089
- A key policy document can include only the following characters:
1090
-
1091
- - Printable ASCII characters
1092
- - Printable characters in the Basic Latin and Latin-1 Supplement character set
1093
- - The tab ( ``\\u0009`` ), line feed ( ``\\u000A`` ), and carriage return ( ``\\u000D`` ) special characters
1107
+ def bypass_policy_lockout_safety_check(
1108
+ self,
1109
+ ) -> typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]]:
1110
+ '''Skips ("bypasses") the key policy lockout safety check.
1094
1111
 
1095
- *Minimum* : ``1``
1112
+ The default value is false.
1096
1113
 
1097
- *Maximum* : ``32768``
1114
+ :default: - false
1098
1115
 
1099
- :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-keypolicy
1116
+ :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-bypasspolicylockoutsafetycheck
1100
1117
  '''
1101
- result = self._values.get("key_policy")
1102
- assert result is not None, "Required property 'key_policy' is missing"
1103
- return typing.cast(typing.Any, result)
1118
+ result = self._values.get("bypass_policy_lockout_safety_check")
1119
+ return typing.cast(typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]], result)
1104
1120
 
1105
1121
  @builtins.property
1106
1122
  def description(self) -> typing.Optional[builtins.str]:
@@ -1149,6 +1165,30 @@ class CfnKeyProps:
1149
1165
  result = self._values.get("enable_key_rotation")
1150
1166
  return typing.cast(typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]], result)
1151
1167
 
1168
+ @builtins.property
1169
+ def key_policy(self) -> typing.Any:
1170
+ '''The key policy that authorizes use of the KMS key. The key policy must conform to the following rules.
1171
+
1172
+ - The key policy must allow the caller to make a subsequent `PutKeyPolicy <https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html>`_ request on the KMS key. This reduces the risk that the KMS key becomes unmanageable. For more information, refer to the scenario in the `Default key policy <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default-allow-root-enable-iam>`_ section of the **AWS Key Management Service Developer Guide** .
1173
+ - Each statement in the key policy must contain one or more principals. The principals in the key policy must exist and be visible to AWS KMS . When you create a new AWS principal (for example, an IAM user or role), you might need to enforce a delay before including the new principal in a key policy because the new principal might not be immediately visible to AWS KMS . For more information, see `Changes that I make are not always immediately visible <https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency>`_ in the *AWS Identity and Access Management User Guide* .
1174
+
1175
+ If you are unsure of which policy to use, consider the *default key policy* . This is the key policy that AWS KMS applies to KMS keys that are created by using the CreateKey API with no specified key policy. It gives the AWS account that owns the key permission to perform all operations on the key. It also allows you write IAM policies to authorize access to the key. For details, see `Default key policy <https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default>`_ in the *AWS Key Management Service Developer Guide* .
1176
+
1177
+ A key policy document can include only the following characters:
1178
+
1179
+ - Printable ASCII characters
1180
+ - Printable characters in the Basic Latin and Latin-1 Supplement character set
1181
+ - The tab ( ``\\u0009`` ), line feed ( ``\\u000A`` ), and carriage return ( ``\\u000D`` ) special characters
1182
+
1183
+ *Minimum* : ``1``
1184
+
1185
+ *Maximum* : ``32768``
1186
+
1187
+ :see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kms-key.html#cfn-kms-key-keypolicy
1188
+ '''
1189
+ result = self._values.get("key_policy")
1190
+ return typing.cast(typing.Any, result)
1191
+
1152
1192
  @builtins.property
1153
1193
  def key_spec(self) -> typing.Optional[builtins.str]:
1154
1194
  '''Specifies the type of KMS key to create.
@@ -3115,10 +3155,11 @@ def _typecheckingstub__5ea678e9e5a947601d16e5bb11fec3683fbb15bba768bee0b88be7e19
3115
3155
  scope: _constructs_77d1e7e8.Construct,
3116
3156
  id: builtins.str,
3117
3157
  *,
3118
- key_policy: typing.Any,
3158
+ bypass_policy_lockout_safety_check: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
3119
3159
  description: typing.Optional[builtins.str] = None,
3120
3160
  enabled: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
3121
3161
  enable_key_rotation: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
3162
+ key_policy: typing.Any = None,
3122
3163
  key_spec: typing.Optional[builtins.str] = None,
3123
3164
  key_usage: typing.Optional[builtins.str] = None,
3124
3165
  multi_region: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
@@ -3141,8 +3182,8 @@ def _typecheckingstub__7468635e1eaf46c92748f2c14a3230215aa887e54ed03c370eee59b7e
3141
3182
  """Type checking stubs"""
3142
3183
  pass
3143
3184
 
3144
- def _typecheckingstub__cd3f4724ca140c9b1dca16904dd53ab0905d0688de411b0f60d4f538cb2ac4a2(
3145
- value: typing.Any,
3185
+ def _typecheckingstub__ba782ca88c8b210d0c18f73ecee5e7266ed06b7428c903676aca9b26b6490443(
3186
+ value: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]],
3146
3187
  ) -> None:
3147
3188
  """Type checking stubs"""
3148
3189
  pass
@@ -3165,6 +3206,12 @@ def _typecheckingstub__1949abfe35e26dd5174b35137bea94a550270331496fd2f865d63e223
3165
3206
  """Type checking stubs"""
3166
3207
  pass
3167
3208
 
3209
+ def _typecheckingstub__cd3f4724ca140c9b1dca16904dd53ab0905d0688de411b0f60d4f538cb2ac4a2(
3210
+ value: typing.Any,
3211
+ ) -> None:
3212
+ """Type checking stubs"""
3213
+ pass
3214
+
3168
3215
  def _typecheckingstub__00b8e7e0c6c26ba4d81ad2ec83a06ba02111a601de28c48a34e711a20bdb960d(
3169
3216
  value: typing.Optional[builtins.str],
3170
3217
  ) -> None:
@@ -3203,10 +3250,11 @@ def _typecheckingstub__b85648b8166c62900697e128ab3a35c1360fdab37323145ed7b7c76dd
3203
3250
 
3204
3251
  def _typecheckingstub__52751771c8b3e52917eaf0c78bad67c065fa3f95795e92f5eab3e92ce5051178(
3205
3252
  *,
3206
- key_policy: typing.Any,
3253
+ bypass_policy_lockout_safety_check: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
3207
3254
  description: typing.Optional[builtins.str] = None,
3208
3255
  enabled: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
3209
3256
  enable_key_rotation: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,
3257
+ key_policy: typing.Any = None,
3210
3258
  key_spec: typing.Optional[builtins.str] = None,
3211
3259
  key_usage: typing.Optional[builtins.str] = None,
3212
3260
  multi_region: typing.Optional[typing.Union[builtins.bool, _IResolvable_da3f097b]] = None,