  def CreateKMSKey(self) -> str:
    """Create a KMS key.

    Returns:
      str: The KMS key ID for the key that was created.

    Raises:
      ResourceCreationError: If the key could not be created.
    """

    client = self.aws_account.ClientApi(common.KMS_SERVICE)
    try:
      kms_key = client.create_key()
    except client.exceptions.ClientError as exception:
      raise errors.ResourceCreationError(
          'Could not create KMS key: {0!s}'.format(
              exception), __name__) from exception

    # The response contains the key ID
    key_id = kms_key['KeyMetadata']['KeyId']  # type: str
    return key_id
Create a KMS key.

Returns:
str: The KMS key ID for the key that was created.

Raises:
ResourceCreationError: If the key could not be created.
libcloudforensics/providers/aws/internal/kms.py