PaymentCryptographyControlPlane / Client / create_alias

create_alias#

PaymentCryptographyControlPlane.Client.create_alias(**kwargs)#

Creates an alias, or a friendly name, for an Amazon Web Services Payment Cryptography key. You can use an alias to identify a key in the console and when you call cryptographic operations such as EncryptData or DecryptData.

You can associate the alias with any key in the same Amazon Web Services Region. Each alias is associated with only one key at a time, but a key can have multiple aliases. You can’t create an alias without a key. The alias must be unique in the account and Amazon Web Services Region, but you can create another alias with the same name in a different Amazon Web Services Region.

To change the key that’s associated with the alias, call UpdateAlias. To delete the alias, call DeleteAlias. These operations don’t affect the underlying key. To get the alias that you created, call ListAliases.

Cross-account use: This operation can’t be used across different Amazon Web Services accounts.

Related operations:

See also: AWS API Documentation

Request Syntax

response = client.create_alias(
    AliasName='string',
    KeyArn='string'
)
Parameters:
  • AliasName (string) –

    [REQUIRED]

    A friendly name that you can use to refer to a key. An alias must begin with alias/ followed by a name, for example alias/ExampleAlias. It can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-).

    Warning

    Don’t include personal, confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

  • KeyArn (string) – The KeyARN of the key to associate with the alias.

Return type:

dict

Returns:

Response Syntax

{
    'Alias': {
        'AliasName': 'string',
        'KeyArn': 'string'
    }
}

Response Structure

  • (dict) –

    • Alias (dict) –

      The alias for the key.

      • AliasName (string) –

        A friendly name that you can use to refer to a key. The value must begin with alias/.

        Warning

        Do not include confidential or sensitive information in this field. This field may be displayed in plaintext in CloudTrail logs and other output.

      • KeyArn (string) –

        The KeyARN of the key associated with the alias.

Exceptions

  • PaymentCryptographyControlPlane.Client.exceptions.ServiceQuotaExceededException

  • PaymentCryptographyControlPlane.Client.exceptions.ServiceUnavailableException

  • PaymentCryptographyControlPlane.Client.exceptions.ValidationException

  • PaymentCryptographyControlPlane.Client.exceptions.ConflictException

  • PaymentCryptographyControlPlane.Client.exceptions.AccessDeniedException

  • PaymentCryptographyControlPlane.Client.exceptions.ResourceNotFoundException

  • PaymentCryptographyControlPlane.Client.exceptions.ThrottlingException

  • PaymentCryptographyControlPlane.Client.exceptions.InternalServerException