Skip to content
GitHubXDiscordRSS

Alias

Learn how to create, update, and manage AWS PaymentCryptography Aliases using Alchemy Cloud Control.

The Alias resource allows you to manage AWS PaymentCryptography Aliases for your cryptographic keys. Aliases are friendly names that provide a way to refer to a cryptographic key.

Create a basic alias with required properties and one optional property.

import AWS from "alchemy/aws/control";
const paymentCryptographyAlias = await AWS.PaymentCryptography.Alias("myAlias", {
AliasName: "MyPrimaryKeyAlias",
KeyArn: "arn:aws:payment-cryptography:us-east-1:123456789012:key/my-key-id"
});

Create an alias that adopts an existing resource instead of failing if it already exists.

const existingAlias = await AWS.PaymentCryptography.Alias("existingAlias", {
AliasName: "MyExistingKeyAlias",
KeyArn: "arn:aws:payment-cryptography:us-east-1:123456789012:key/existing-key-id",
adopt: true
});

Create an alias with a specific key ARN to manage your cryptographic keys effectively.

const keyManagementAlias = await AWS.PaymentCryptography.Alias("keyManagementAlias", {
AliasName: "KeyForTransactions",
KeyArn: "arn:aws:payment-cryptography:us-east-1:123456789012:key/transaction-key-id"
});

Create an alias and inspect its creation time and ARN as additional properties.

const detailedAlias = await AWS.PaymentCryptography.Alias("detailedAlias", {
AliasName: "DetailedTransactionKeyAlias",
KeyArn: "arn:aws:payment-cryptography:us-east-1:123456789012:key/detailed-key-id"
});
// Accessing additional properties
console.log("Alias ARN:", detailedAlias.Arn);
console.log("Creation Time:", detailedAlias.CreationTime);