import * as pulumi from "@pulumi/pulumi"; import * as outputs from "../types/output"; /** * Use this data source to get detailed information about * the specified KMS Key with flexible key ID input. * This can be useful to reference key alias * without having to hard code the ARN as input. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const byAlias = aws.kms.getKey({ * keyId: "alias/my-key", * }); * const byId = aws.kms.getKey({ * keyId: "1234abcd-12ab-34cd-56ef-1234567890ab", * }); * const byAliasArn = aws.kms.getKey({ * keyId: "arn:aws:kms:us-east-1:111122223333:alias/my-key", * }); * const byKeyArn = aws.kms.getKey({ * keyId: "arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", * }); * ``` */ export declare function getKey(args: GetKeyArgs, opts?: pulumi.InvokeOptions): Promise; /** * A collection of arguments for invoking getKey. */ export interface GetKeyArgs { /** * List of grant tokens. */ grantTokens?: string[]; /** * Key identifier. Can be a key ID (e.g. `1234abcd-12ab-34cd-56ef-1234567890ab`), key ARN (e.g. `arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`), alias name (e.g. `alias/my-key`), or alias ARN (e.g. `arn:aws:kms:us-east-1:111122223333:alias/my-key`). */ keyId: string; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: string; } /** * A collection of values returned by getKey. */ export interface GetKeyResult { /** * Key ARN of a primary or replica key of a multi-Region key. */ readonly arn: string; /** * Twelve-digit account ID of the AWS account that owns the key. */ readonly awsAccountId: string; /** * Cluster ID of the AWS CloudHSM cluster that contains the key material for the KMS key. */ readonly cloudHsmClusterId: string; /** * Date and time when the key was created. */ readonly creationDate: string; /** * Unique identifier for the custom key store that contains the KMS key. */ readonly customKeyStoreId: string; /** * See `keySpec`. */ readonly customerMasterKeySpec: string; /** * Date and time after which AWS KMS deletes the key. This value is present only when `keyState` is `PendingDeletion`, otherwise this value is 0. */ readonly deletionDate: string; /** * Description of the key. */ readonly description: string; /** * Whether the key is enabled. When `keyState` is `Enabled` this value is true, otherwise it is false. */ readonly enabled: boolean; /** * Whether the key's key material expires. This value is present only when `origin` is `EXTERNAL`, otherwise this value is empty. */ readonly expirationModel: string; readonly grantTokens?: string[]; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; readonly keyId: string; /** * Manager of the key. */ readonly keyManager: string; /** * Type of key material in the KMS key. */ readonly keySpec: string; /** * State of the key. */ readonly keyState: string; /** * Intended use of the key. */ readonly keyUsage: string; /** * Whether the KMS key is a multi-Region (`true`) or regional (`false`) key. */ readonly multiRegion: boolean; /** * Primary and replica keys in same multi-Region key. Present only when the value of `multiRegion` is `true`. See `multiRegionConfiguration` Block below. */ readonly multiRegionConfigurations: outputs.kms.GetKeyMultiRegionConfiguration[]; /** * Source of the key material. When this value is `AWS_KMS`, AWS KMS created the key material. When this value is `EXTERNAL`, the key material was imported from your existing key management infrastructure or the CMK lacks key material. */ readonly origin: string; /** * Waiting period before the primary key in a multi-Region key is deleted. */ readonly pendingDeletionWindowInDays: number; /** * AWS Region of a primary or replica key in a multi-Region key. */ readonly region: string; /** * Time at which the imported key material expires. This value is present only when `origin` is `EXTERNAL` and whose `expirationModel` is `KEY_MATERIAL_EXPIRES`, otherwise this value is 0. */ readonly validTo: string; /** * Information about the external key that is associated with a KMS key in an external key store. See `xksKeyConfiguration` Block below. */ readonly xksKeyConfigurations: outputs.kms.GetKeyXksKeyConfiguration[]; } /** * Use this data source to get detailed information about * the specified KMS Key with flexible key ID input. * This can be useful to reference key alias * without having to hard code the ARN as input. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const byAlias = aws.kms.getKey({ * keyId: "alias/my-key", * }); * const byId = aws.kms.getKey({ * keyId: "1234abcd-12ab-34cd-56ef-1234567890ab", * }); * const byAliasArn = aws.kms.getKey({ * keyId: "arn:aws:kms:us-east-1:111122223333:alias/my-key", * }); * const byKeyArn = aws.kms.getKey({ * keyId: "arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab", * }); * ``` */ export declare function getKeyOutput(args: GetKeyOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output; /** * A collection of arguments for invoking getKey. */ export interface GetKeyOutputArgs { /** * List of grant tokens. */ grantTokens?: pulumi.Input[] | undefined>; /** * Key identifier. Can be a key ID (e.g. `1234abcd-12ab-34cd-56ef-1234567890ab`), key ARN (e.g. `arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab`), alias name (e.g. `alias/my-key`), or alias ARN (e.g. `arn:aws:kms:us-east-1:111122223333:alias/my-key`). */ keyId: pulumi.Input; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input; } //# sourceMappingURL=getKey.d.ts.map