# Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.

from . import AWSObject, Tags
from .compat import policytypes
from .validators import boolean, integer_range, key_usage_type


class Alias(AWSObject):
    resource_type = "AWS::KMS::Alias"

    props = {"AliasName": (str, True), "TargetKeyId": (str, True)}


class Key(AWSObject):
    resource_type = "AWS::KMS::Key"

    props = {
        "Description": (str, False),
        "EnableKeyRotation": (boolean, False),
        "Enabled": (boolean, False),
        "KeyPolicy": (policytypes, True),
        "KeySpec": (str, False),
        "KeyUsage": (key_usage_type, False),
        "PendingWindowInDays": (integer_range(7, 30), False),
        "Tags": ((Tags, list), False),
    }

@@ -203,16 +203,25 @@
 boolean,
+ integer,
  integer
@@ -798,8 +798,330 @@
 ,%0A    %7D%0A
+%0A%0Aclass ReplicaKey(AWSObject):%0A    resource_type = %22AWS::KMS::ReplicaKey%22%0A%0A    props = %7B%0A        %22Description%22: (str, False),%0A        %22Enabled%22: (boolean, False),%0A        %22KeyPolicy%22: (dict, True),%0A        %22PendingWindowInDays%22: (integer, False),%0A        %22PrimaryKeyArn%22: (str, True),%0A        %22Tags%22: (Tags, False),%0A    %7D%0A

Update KMS per 2021-06-17 changes