import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { CreateAliasRequest } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; /** * @public * * The input for {@link CreateAliasCommand}. */ export interface CreateAliasCommandInput extends CreateAliasRequest { } /** * @public * * The output of {@link CreateAliasCommand}. */ export interface CreateAliasCommandOutput extends __MetadataBearer { } declare const CreateAliasCommand_base: { new (input: CreateAliasCommandInput): import("@smithy/core/client").CommandImpl; new (input: CreateAliasCommandInput): import("@smithy/core/client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/types").EndpointParameterInstructions; }; /** *

Creates a friendly name for a KMS key.

* *

Adding, deleting, or updating an alias can allow or deny permission to the KMS key. For details, see ABAC for KMS in the Key Management Service Developer Guide.

*
*

You can use an alias to identify a KMS key in the KMS console, in the DescribeKey operation and in cryptographic operations, such as Encrypt and * GenerateDataKey. You can also change the KMS key that's associated with * the alias (UpdateAlias) or delete the alias (DeleteAlias) * at any time. These operations don't affect the underlying KMS key.

*

You can associate the alias with any customer managed key in the same Amazon Web Services Region. Each * alias is associated with only one KMS key at a time, but a KMS key can have multiple aliases. * A valid KMS key is required. You can't create an alias without a KMS key.

*

The alias must be unique in the account and Region, but you can have aliases with the same * name in different Regions. For detailed information about aliases, see Aliases in KMS in the * Key Management Service Developer Guide.

*

This operation does not return a response. To get the alias that you created, use the * ListAliases operation.

*

The KMS key that you use for this operation must be in a compatible key state. For * details, see Key states of KMS keys in the Key Management Service Developer Guide.

*

* Cross-account use: No. You cannot perform this operation on an alias in a different Amazon Web Services account.

*

* Required permissions *

* *

For details, see Controlling access to aliases in the Key Management Service Developer Guide.

*

* Related operations: *

* *

* Eventual consistency: The KMS API follows an eventual consistency model. * For more information, see KMS eventual consistency.

* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { KMSClient, CreateAliasCommand } from "@aws-sdk/client-kms"; // ES Modules import * // const { KMSClient, CreateAliasCommand } = require("@aws-sdk/client-kms"); // CommonJS import * // import type { KMSClientConfig } from "@aws-sdk/client-kms"; * const config = {}; // type is KMSClientConfig * const client = new KMSClient(config); * const input = { // CreateAliasRequest * AliasName: "STRING_VALUE", // required * TargetKeyId: "STRING_VALUE", // required * }; * const command = new CreateAliasCommand(input); * const response = await client.send(command); * // {}; * * ``` * * @param CreateAliasCommandInput - {@link CreateAliasCommandInput} * @returns {@link CreateAliasCommandOutput} * @see {@link CreateAliasCommandInput} for command's `input` shape. * @see {@link CreateAliasCommandOutput} for command's `response` shape. * @see {@link KMSClientResolvedConfig | config} for KMSClient's `config` shape. * * @throws {@link AlreadyExistsException} (client fault) *

The request was rejected because it attempted to create a resource that already * exists.

* * @throws {@link DependencyTimeoutException} (server fault) *

The system timed out while trying to fulfill the request. You can retry the * request.

* * @throws {@link InvalidAliasNameException} (client fault) *

The request was rejected because the specified alias name is not valid.

* * @throws {@link KMSInternalException} (server fault) *

The request was rejected because an internal exception occurred. The request can be * retried.

* * @throws {@link KMSInvalidStateException} (client fault) *

The request was rejected because the state of the specified resource is not valid for this * request.

*

This exceptions means one of the following:

* * * @throws {@link LimitExceededException} (client fault) *

The request was rejected because a length constraint or quota was exceeded. For more * information, see Quotas in * the Key Management Service Developer Guide.

* * @throws {@link NotFoundException} (client fault) *

The request was rejected because the specified entity or resource could not be * found.

* * @throws {@link KMSServiceException} *

Base exception class for all service exceptions from KMS service.

* * * @example To create an alias * ```javascript * // The following example creates an alias for the specified KMS key. * const input = { * AliasName: "alias/ExampleAlias", * TargetKeyId: "1234abcd-12ab-34cd-56ef-1234567890ab" * }; * const command = new CreateAliasCommand(input); * const response = await client.send(command); * /* response is * { /* metadata only *\/ } * *\/ * ``` * * @public */ export declare class CreateAliasCommand extends CreateAliasCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: CreateAliasRequest; output: {}; }; sdk: { input: CreateAliasCommandInput; output: CreateAliasCommandOutput; }; }; }