{
  "description": "Key is the Schema for the Keys API",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "KeySpec defines the desired state of Key.",
      "properties": {
        "bypassPolicyLockoutSafetyCheck": {
          "description": "Skips (\"bypasses\") the key policy lockout safety check. The default value\nis false.\n\nSetting this value to true increases the risk that the KMS key becomes unmanageable.\nDo not set this value to true indiscriminately.\n\nFor more information, see Default key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key)\nin the Key Management Service Developer Guide.\n\nUse this parameter only when you intend to prevent the principal that is\nmaking the request from making a subsequent PutKeyPolicy (https://docs.aws.amazon.com/kms/latest/APIReference/API_PutKeyPolicy.html)\nrequest on the KMS key.",
          "type": "boolean"
        },
        "customKeyStoreID": {
          "description": "Creates the KMS key in the specified custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html).\nThe ConnectionState of the custom key store must be CONNECTED. To find the\nCustomKeyStoreID and ConnectionState use the DescribeCustomKeyStores operation.\n\nThis parameter is valid only for symmetric encryption KMS keys in a single\nRegion. You cannot create any other type of KMS key in a custom key store.\n\nWhen you create a KMS key in an CloudHSM key store, KMS generates a non-exportable\n256-bit symmetric key in its associated CloudHSM cluster and associates it\nwith the KMS key. When you create a KMS key in an external key store, you\nmust use the XksKeyId parameter to specify an external key that serves as\nkey material for the KMS key.",
          "type": "string",
          "x-kubernetes-validations": [
            {
              "message": "Value is immutable once set",
              "rule": "self == oldSelf"
            }
          ]
        },
        "description": {
          "description": "A description of the KMS key. Use a description that helps you decide whether\nthe KMS key is appropriate for a task. The default value is an empty string\n(no description).\n\nDo not include confidential or sensitive information in this field. This\nfield may be displayed in plaintext in CloudTrail logs and other output.\n\nTo set or change the description after the key is created, use UpdateKeyDescription.",
          "type": "string",
          "x-kubernetes-validations": [
            {
              "message": "Value is immutable once set",
              "rule": "self == oldSelf"
            }
          ]
        },
        "enableKeyRotation": {
          "type": "boolean"
        },
        "keySpec": {
          "description": "Specifies the type of KMS key to create. The default value, SYMMETRIC_DEFAULT,\ncreates a KMS key with a 256-bit AES-GCM key that is used for encryption\nand decryption, except in China Regions, where it creates a 128-bit symmetric\nkey that uses SM4 encryption. For help choosing a key spec for your KMS key,\nsee Choosing a KMS key type (https://docs.aws.amazon.com/kms/latest/developerguide/key-types.html#symm-asymm-choose)\nin the Key Management Service Developer Guide .\n\nThe KeySpec determines whether the KMS key contains a symmetric key or an\nasymmetric key pair. It also determines the algorithms that the KMS key supports.\nYou can't change the KeySpec after the KMS key is created. To further restrict\nthe algorithms that can be used with the KMS key, use a condition key in\nits key policy or IAM policy. For more information, see kms:EncryptionAlgorithm\n(https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-algorithm),\nkms:MacAlgorithm (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-mac-algorithm)\nor kms:Signing Algorithm (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-signing-algorithm)\nin the Key Management Service Developer Guide .\n\nAmazon Web Services services that are integrated with KMS (http://aws.amazon.com/kms/features/#AWS_Service_Integration)\nuse symmetric encryption KMS keys to protect your data. These services do\nnot support asymmetric KMS keys or HMAC KMS keys.\n\nKMS supports the following key specs for KMS keys:\n\n  - Symmetric encryption key (default) SYMMETRIC_DEFAULT\n\n  - HMAC keys (symmetric) HMAC_224 HMAC_256 HMAC_384 HMAC_512\n\n  - Asymmetric RSA key pairs (encryption and decryption -or- signing and\n    verification) RSA_2048 RSA_3072 RSA_4096\n\n  - Asymmetric NIST-recommended elliptic curve key pairs (signing and verification\n    -or- deriving shared secrets) ECC_NIST_P256 (secp256r1) ECC_NIST_P384\n    (secp384r1) ECC_NIST_P521 (secp521r1)\n\n  - Other asymmetric elliptic curve key pairs (signing and verification)\n    ECC_SECG_P256K1 (secp256k1), commonly used for cryptocurrencies.\n\n  - SM2 key pairs (encryption and decryption -or- signing and verification\n    -or- deriving shared secrets) SM2 (China Regions only)",
          "type": "string",
          "x-kubernetes-validations": [
            {
              "message": "Value is immutable once set",
              "rule": "self == oldSelf"
            }
          ]
        },
        "keyUsage": {
          "description": "Determines the cryptographic operations (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations)\nfor which you can use the KMS key. The default value is ENCRYPT_DECRYPT.\nThis parameter is optional when you are creating a symmetric encryption KMS\nkey; otherwise, it is required. You can't change the KeyUsage value after\nthe KMS key is created.\n\nSelect only one valid value.\n\n  - For symmetric encryption KMS keys, omit the parameter or specify ENCRYPT_DECRYPT.\n\n  - For HMAC KMS keys (symmetric), specify GENERATE_VERIFY_MAC.\n\n  - For asymmetric KMS keys with RSA key pairs, specify ENCRYPT_DECRYPT\n    or SIGN_VERIFY.\n\n  - For asymmetric KMS keys with NIST-recommended elliptic curve key pairs,\n    specify SIGN_VERIFY or KEY_AGREEMENT.\n\n  - For asymmetric KMS keys with ECC_SECG_P256K1 key pairs specify SIGN_VERIFY.\n\n  - For asymmetric KMS keys with SM2 key pairs (China Regions only), specify\n    ENCRYPT_DECRYPT, SIGN_VERIFY, or KEY_AGREEMENT.",
          "type": "string",
          "x-kubernetes-validations": [
            {
              "message": "Value is immutable once set",
              "rule": "self == oldSelf"
            }
          ]
        },
        "multiRegion": {
          "description": "Creates a multi-Region primary key that you can replicate into other Amazon\nWeb Services Regions. You cannot change this value after you create the KMS\nkey.\n\nFor a multi-Region key, set this parameter to True. For a single-Region KMS\nkey, omit this parameter or set it to False. The default value is False.\n\nThis operation supports multi-Region keys, an KMS feature that lets you create\nmultiple interoperable KMS keys in different Amazon Web Services Regions.\nBecause these KMS keys have the same key ID, key material, and other metadata,\nyou can use them interchangeably to encrypt data in one Amazon Web Services\nRegion and decrypt it in a different Amazon Web Services Region without re-encrypting\nthe data or making a cross-Region call. For more information about multi-Region\nkeys, see Multi-Region keys in KMS (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html)\nin the Key Management Service Developer Guide.\n\nThis value creates a primary key, not a replica. To create a replica key,\nuse the ReplicateKey operation.\n\nYou can create a symmetric or asymmetric multi-Region key, and you can create\na multi-Region key with imported key material. However, you cannot create\na multi-Region key in a custom key store.",
          "type": "boolean",
          "x-kubernetes-validations": [
            {
              "message": "Value is immutable once set",
              "rule": "self == oldSelf"
            }
          ]
        },
        "origin": {
          "description": "The source of the key material for the KMS key. You cannot change the origin\nafter you create the KMS key. The default is AWS_KMS, which means that KMS\ncreates the key material.\n\nTo create a KMS key with no key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys-create-cmk.html)\n(for imported key material), set this value to EXTERNAL. For more information\nabout importing key material into KMS, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html)\nin the Key Management Service Developer Guide. The EXTERNAL origin value\nis valid only for symmetric KMS keys.\n\nTo create a KMS key in an CloudHSM key store (https://docs.aws.amazon.com/kms/latest/developerguide/create-cmk-keystore.html)\nand create its key material in the associated CloudHSM cluster, set this\nvalue to AWS_CLOUDHSM. You must also use the CustomKeyStoreId parameter to\nidentify the CloudHSM key store. The KeySpec value must be SYMMETRIC_DEFAULT.\n\nTo create a KMS key in an external key store (https://docs.aws.amazon.com/kms/latest/developerguide/create-xks-keys.html),\nset this value to EXTERNAL_KEY_STORE. You must also use the CustomKeyStoreId\nparameter to identify the external key store and the XksKeyId parameter to\nidentify the associated external key. The KeySpec value must be SYMMETRIC_DEFAULT.",
          "type": "string",
          "x-kubernetes-validations": [
            {
              "message": "Value is immutable once set",
              "rule": "self == oldSelf"
            }
          ]
        },
        "policy": {
          "description": "The key policy to attach to the KMS key.\n\nIf you provide a key policy, it must meet the following criteria:\n\n  - The key policy must allow the calling principal to make a subsequent\n    PutKeyPolicy request on the KMS key. This reduces the risk that the KMS\n    key becomes unmanageable. For more information, see Default key policy\n    (https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#prevent-unmanageable-key)\n    in the Key Management Service Developer Guide. (To omit this condition,\n    set BypassPolicyLockoutSafetyCheck to true.)\n\n  - Each statement in the key policy must contain one or more principals.\n    The principals in the key policy must exist and be visible to KMS. When\n    you create a new Amazon Web Services principal, you might need to enforce\n    a delay before including the new principal in a key policy because the\n    new principal might not be immediately visible to KMS. For more information,\n    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)\n    in the Amazon Web Services Identity and Access Management User Guide.\n\nIf you do not provide a key policy, KMS attaches a default key policy to\nthe KMS key. For more information, see Default key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default)\nin the Key Management Service Developer Guide.\n\nThe key policy size quota is 32 kilobytes (32768 bytes).\n\nFor help writing and formatting a JSON policy document, see the IAM JSON\nPolicy Reference (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html)\nin the Identity and Access Management User Guide .",
          "type": "string"
        },
        "tags": {
          "description": "Assigns one or more tags to the KMS key. Use this parameter to tag the KMS\nkey when it is created. To tag an existing KMS key, use the TagResource operation.\n\nDo not include confidential or sensitive information in this field. This\nfield may be displayed in plaintext in CloudTrail logs and other output.\n\nTagging or untagging a KMS key can allow or deny permission to the KMS key.\nFor details, see ABAC for KMS (https://docs.aws.amazon.com/kms/latest/developerguide/abac.html)\nin the Key Management Service Developer Guide.\n\nTo use this parameter, you must have kms:TagResource (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html)\npermission in an IAM policy.\n\nEach tag consists of a tag key and a tag value. Both the tag key and the\ntag value are required, but the tag value can be an empty (null) string.\nYou cannot have more than one tag on a KMS key with the same tag key. If\nyou specify an existing tag key with a different tag value, KMS replaces\nthe current tag value with the specified one.\n\nWhen you add tags to an Amazon Web Services resource, Amazon Web Services\ngenerates a cost allocation report with usage and costs aggregated by tags.\nTags can also be used to control access to a KMS key. For details, see Tagging\nKeys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html).",
          "items": {
            "description": "A key-value pair. A tag consists of a tag key and a tag value. Tag keys and\ntag values are both required, but tag values can be empty (null) strings.\n\nDo not include confidential or sensitive information in this field. This\nfield may be displayed in plaintext in CloudTrail logs and other output.\n\nFor information about the rules that apply to tag keys and tag values, see\nUser-Defined Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html)\nin the Amazon Web Services Billing and Cost Management User Guide.",
            "properties": {
              "tagKey": {
                "type": "string"
              },
              "tagValue": {
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "KeyStatus defines the observed state of Key",
      "properties": {
        "ackResourceMetadata": {
          "description": "All CRs managed by ACK have a common `Status.ACKResourceMetadata` member\nthat is used to contain resource sync state, account ownership,\nconstructed ARN for the resource",
          "properties": {
            "arn": {
              "description": "ARN is the Amazon Resource Name for the resource. This is a\nglobally-unique identifier and is set only by the ACK service controller\nonce the controller has orchestrated the creation of the resource OR\nwhen it has verified that an \"adopted\" resource (a resource where the\nARN annotation was set by the Kubernetes user on the CR) exists and\nmatches the supplied CR's Spec field values.\nhttps://github.com/aws/aws-controllers-k8s/issues/270",
              "type": "string"
            },
            "ownerAccountID": {
              "description": "OwnerAccountID is the AWS Account ID of the account that owns the\nbackend AWS service API resource.",
              "type": "string"
            },
            "region": {
              "description": "Region is the AWS region in which the resource exists or will exist.",
              "type": "string"
            }
          },
          "required": [
            "ownerAccountID",
            "region"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "awsAccountID": {
          "description": "The twelve-digit account ID of the Amazon Web Services account that owns\nthe KMS key.",
          "type": "string"
        },
        "cloudHsmClusterID": {
          "description": "The cluster ID of the CloudHSM cluster that contains the key material for\nthe KMS key. When you create a KMS key in an CloudHSM custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html),\nKMS creates the key material for the KMS key in the associated CloudHSM cluster.\nThis field is present only when the KMS key is created in an CloudHSM key\nstore.",
          "type": "string"
        },
        "conditions": {
          "description": "All CRs managed by ACK have a common `Status.Conditions` member that\ncontains a collection of `ackv1alpha1.Condition` objects that describe\nthe various terminal states of the CR and its backend AWS service API\nresource",
          "items": {
            "description": "Condition is the common struct used by all CRDs managed by ACK service\ncontrollers to indicate terminal states  of the CR and its backend AWS\nservice API resource",
            "properties": {
              "lastTransitionTime": {
                "description": "Last time the condition transitioned from one status to another.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "A human readable message indicating details about the transition.",
                "type": "string"
              },
              "reason": {
                "description": "The reason for the condition's last transition.",
                "type": "string"
              },
              "status": {
                "description": "Status of the condition, one of True, False, Unknown.",
                "type": "string"
              },
              "type": {
                "description": "Type is the type of the Condition",
                "type": "string"
              }
            },
            "required": [
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "creationDate": {
          "description": "The date and time when the KMS key was created.",
          "format": "date-time",
          "type": "string"
        },
        "deletionDate": {
          "description": "The date and time after which KMS deletes this KMS key. This value is present\nonly when the KMS key is scheduled for deletion, that is, when its KeyState\nis PendingDeletion.\n\nWhen the primary key in a multi-Region key is scheduled for deletion but\nstill has replica keys, its key state is PendingReplicaDeletion and the length\nof its waiting period is displayed in the PendingDeletionWindowInDays field.",
          "format": "date-time",
          "type": "string"
        },
        "enabled": {
          "description": "Specifies whether the KMS key is enabled. When KeyState is Enabled this value\nis true, otherwise it is false.",
          "type": "boolean"
        },
        "encryptionAlgorithms": {
          "description": "The encryption algorithms that the KMS key supports. You cannot use the KMS\nkey with other encryption algorithms within KMS.\n\nThis value is present only when the KeyUsage of the KMS key is ENCRYPT_DECRYPT.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "expirationModel": {
          "description": "Specifies whether the KMS key's key material expires. This value is present\nonly when Origin is EXTERNAL, otherwise this value is omitted.",
          "type": "string"
        },
        "keyID": {
          "description": "The globally unique identifier for the KMS key.",
          "type": "string"
        },
        "keyManager": {
          "description": "The manager of the KMS key. KMS keys in your Amazon Web Services account\nare either customer managed or Amazon Web Services managed. For more information\nabout the difference, see KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#kms_keys)\nin the Key Management Service Developer Guide.",
          "type": "string"
        },
        "keyState": {
          "description": "The current status of the KMS key.\n\nFor more information about how key state affects the use of a KMS key, see\nKey states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)\nin the Key Management Service Developer Guide.",
          "type": "string"
        },
        "macAlgorithms": {
          "description": "The message authentication code (MAC) algorithm that the HMAC KMS key supports.\n\nThis value is present only when the KeyUsage of the KMS key is GENERATE_VERIFY_MAC.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "multiRegionConfiguration": {
          "description": "Lists the primary and replica keys in same multi-Region key. This field is\npresent only when the value of the MultiRegion field is True.\n\nFor more information about any listed KMS key, use the DescribeKey operation.\n\n   * MultiRegionKeyType indicates whether the KMS key is a PRIMARY or REPLICA\n   key.\n\n   * PrimaryKey displays the key ARN and Region of the primary key. This\n   field displays the current KMS key if it is the primary key.\n\n   * ReplicaKeys displays the key ARNs and Regions of all replica keys. This\n   field includes the current KMS key if it is a replica key.",
          "properties": {
            "multiRegionKeyType": {
              "type": "string"
            },
            "primaryKey": {
              "description": "Describes the primary or replica key in a multi-Region key.",
              "properties": {
                "arn": {
                  "type": "string"
                },
                "region": {
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "replicaKeys": {
              "items": {
                "description": "Describes the primary or replica key in a multi-Region key.",
                "properties": {
                  "arn": {
                    "type": "string"
                  },
                  "region": {
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "pendingDeletionWindowInDays": {
          "description": "The waiting period before the primary key in a multi-Region key is deleted.\nThis waiting period begins when the last of its replica keys is deleted.\nThis value is present only when the KeyState of the KMS key is PendingReplicaDeletion.\nThat indicates that the KMS key is the primary key in a multi-Region key,\nit is scheduled for deletion, and it still has existing replica keys.\n\nWhen a single-Region KMS key or a multi-Region replica key is scheduled for\ndeletion, its deletion date is displayed in the DeletionDate field. However,\nwhen the primary key in a multi-Region key is scheduled for deletion, its\nwaiting period doesn't begin until all of its replica keys are deleted. This\nvalue displays that waiting period. When the last replica key in the multi-Region\nkey is deleted, the KeyState of the scheduled primary key changes from PendingReplicaDeletion\nto PendingDeletion and the deletion date appears in the DeletionDate field.",
          "format": "int64",
          "type": "integer"
        },
        "signingAlgorithms": {
          "description": "The signing algorithms that the KMS key supports. You cannot use the KMS\nkey with other signing algorithms within KMS.\n\nThis field appears only when the KeyUsage of the KMS key is SIGN_VERIFY.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "validTo": {
          "description": "The time at which the imported key material expires. When the key material\nexpires, KMS deletes the key material and the KMS key becomes unusable. This\nvalue is present only for KMS keys whose Origin is EXTERNAL and whose ExpirationModel\nis KEY_MATERIAL_EXPIRES, otherwise this value is omitted.",
          "format": "date-time",
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
