@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
72 lines • 2.67 kB
JavaScript
;
// *** 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.getPublicKeyOutput = exports.getPublicKey = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Use this data source to get the public key 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.getPublicKey({
* keyId: "alias/my-key",
* });
* const byId = aws.kms.getPublicKey({
* keyId: "1234abcd-12ab-34cd-56ef-1234567890ab",
* });
* const byAliasArn = aws.kms.getPublicKey({
* keyId: "arn:aws:kms:us-east-1:111122223333:alias/my-key",
* });
* const byKeyArn = aws.kms.getPublicKey({
* keyId: "arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
* });
* ```
*/
function getPublicKey(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("aws:kms/getPublicKey:getPublicKey", {
"grantTokens": args.grantTokens,
"keyId": args.keyId,
"region": args.region,
}, opts);
}
exports.getPublicKey = getPublicKey;
/**
* Use this data source to get the public key 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.getPublicKey({
* keyId: "alias/my-key",
* });
* const byId = aws.kms.getPublicKey({
* keyId: "1234abcd-12ab-34cd-56ef-1234567890ab",
* });
* const byAliasArn = aws.kms.getPublicKey({
* keyId: "arn:aws:kms:us-east-1:111122223333:alias/my-key",
* });
* const byKeyArn = aws.kms.getPublicKey({
* keyId: "arn:aws:kms:us-east-1:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab",
* });
* ```
*/
function getPublicKeyOutput(args, opts) {
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("aws:kms/getPublicKey:getPublicKey", {
"grantTokens": args.grantTokens,
"keyId": args.keyId,
"region": args.region,
}, opts);
}
exports.getPublicKeyOutput = getPublicKeyOutput;
//# sourceMappingURL=getPublicKey.js.map