@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
82 lines • 2.8 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.getKeyPairOutput = exports.getKeyPair = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Use this data source to get information about a specific EC2 Key Pair.
*
* ## Example Usage
*
* The following example shows how to get a EC2 Key Pair including the public key material from its name.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = aws.ec2.getKeyPair({
* keyName: "test",
* includePublicKey: true,
* filters: [{
* name: "tag:Component",
* values: ["web"],
* }],
* });
* export const fingerprint = example.then(example => example.fingerprint);
* export const name = example.then(example => example.keyName);
* export const id = example.then(example => example.id);
* ```
*/
function getKeyPair(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invoke("aws:ec2/getKeyPair:getKeyPair", {
"filters": args.filters,
"includePublicKey": args.includePublicKey,
"keyName": args.keyName,
"keyPairId": args.keyPairId,
"region": args.region,
"tags": args.tags,
}, opts);
}
exports.getKeyPair = getKeyPair;
/**
* Use this data source to get information about a specific EC2 Key Pair.
*
* ## Example Usage
*
* The following example shows how to get a EC2 Key Pair including the public key material from its name.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = aws.ec2.getKeyPair({
* keyName: "test",
* includePublicKey: true,
* filters: [{
* name: "tag:Component",
* values: ["web"],
* }],
* });
* export const fingerprint = example.then(example => example.fingerprint);
* export const name = example.then(example => example.keyName);
* export const id = example.then(example => example.id);
* ```
*/
function getKeyPairOutput(args, opts) {
args = args || {};
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts || {});
return pulumi.runtime.invokeOutput("aws:ec2/getKeyPair:getKeyPair", {
"filters": args.filters,
"includePublicKey": args.includePublicKey,
"keyName": args.keyName,
"keyPairId": args.keyPairId,
"region": args.region,
"tags": args.tags,
}, opts);
}
exports.getKeyPairOutput = getKeyPairOutput;
//# sourceMappingURL=getKeyPair.js.map