UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

78 lines 2.57 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.getKeyOutput = exports.getKey = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * 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", * }); * ``` */ function getKey(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invoke("aws:kms/getKey:getKey", { "grantTokens": args.grantTokens, "keyId": args.keyId, "region": args.region, }, opts); } exports.getKey = getKey; /** * 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", * }); * ``` */ function getKeyOutput(args, opts) { opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {}); return pulumi.runtime.invokeOutput("aws:kms/getKey:getKey", { "grantTokens": args.grantTokens, "keyId": args.keyId, "region": args.region, }, opts); } exports.getKeyOutput = getKeyOutput; //# sourceMappingURL=getKey.js.map