@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
164 lines (163 loc) • 4.86 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* 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);
* ```
*/
export declare function getKeyPair(args?: GetKeyPairArgs, opts?: pulumi.InvokeOptions): Promise<GetKeyPairResult>;
/**
* A collection of arguments for invoking getKeyPair.
*/
export interface GetKeyPairArgs {
/**
* Custom filter block as described below.
*
* The arguments of this data source act as filters for querying the available
* Key Pairs. The given filters must match exactly one Key Pair
* whose data will be exported as attributes.
*/
filters?: inputs.ec2.GetKeyPairFilter[];
/**
* Whether to include the public key material in the response.
*/
includePublicKey?: boolean;
/**
* Key Pair name.
*/
keyName?: string;
/**
* Key Pair ID.
*/
keyPairId?: 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;
/**
* Any tags assigned to the Key Pair.
*/
tags?: {
[key: string]: string;
};
}
/**
* A collection of values returned by getKeyPair.
*/
export interface GetKeyPairResult {
/**
* ARN of the Key Pair.
*/
readonly arn: string;
/**
* Timestamp for when the key pair was created in ISO 8601 format.
*/
readonly createTime: string;
readonly filters?: outputs.ec2.GetKeyPairFilter[];
/**
* SHA-1 digest of the DER encoded private key.
*/
readonly fingerprint: string;
/**
* The provider-assigned unique ID for this managed resource.
*/
readonly id: string;
readonly includePublicKey?: boolean;
readonly keyName?: string;
readonly keyPairId?: string;
/**
* Type of key pair.
*/
readonly keyType: string;
/**
* Public key material.
*/
readonly publicKey: string;
readonly region: string;
/**
* Any tags assigned to the Key Pair.
*/
readonly tags: {
[key: string]: string;
};
}
/**
* 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);
* ```
*/
export declare function getKeyPairOutput(args?: GetKeyPairOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetKeyPairResult>;
/**
* A collection of arguments for invoking getKeyPair.
*/
export interface GetKeyPairOutputArgs {
/**
* Custom filter block as described below.
*
* The arguments of this data source act as filters for querying the available
* Key Pairs. The given filters must match exactly one Key Pair
* whose data will be exported as attributes.
*/
filters?: pulumi.Input<pulumi.Input<inputs.ec2.GetKeyPairFilterArgs>[]>;
/**
* Whether to include the public key material in the response.
*/
includePublicKey?: pulumi.Input<boolean>;
/**
* Key Pair name.
*/
keyName?: pulumi.Input<string>;
/**
* Key Pair ID.
*/
keyPairId?: pulumi.Input<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?: pulumi.Input<string>;
/**
* Any tags assigned to the Key Pair.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
}