AWS Native is in preview. AWS Classic is fully supported.
aws-native.ec2.getKeyPair
Explore with Pulumi AI
AWS Native is in preview. AWS Classic is fully supported.
Specifies a key pair for use with an EC2long instance as follows:
- To import an existing key pair, include the
PublicKeyMaterial
property. - To create a new key pair, omit the
PublicKeyMaterial
property.
When you import an existing key pair, you specify the public key material for the key. We assume that you have the private key material for the key. CFNlong does not create or return the private key material when you import a key pair.
When you create a new key pair, the private key is saved to SYSlong Parameter Store, using a parameter with the following name: /ec2/keypair/{key_pair_id}
. For more information about retrieving private key, and the required permissions, see Create a key pair using in the User Guide.
When CFN deletes a key pair that was created or imported by a stack, it also deletes the parameter that was used to store the private key material in Parameter Store.
Using getKeyPair
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getKeyPair(args: GetKeyPairArgs, opts?: InvokeOptions): Promise<GetKeyPairResult>
function getKeyPairOutput(args: GetKeyPairOutputArgs, opts?: InvokeOptions): Output<GetKeyPairResult>
def get_key_pair(key_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetKeyPairResult
def get_key_pair_output(key_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetKeyPairResult]
func LookupKeyPair(ctx *Context, args *LookupKeyPairArgs, opts ...InvokeOption) (*LookupKeyPairResult, error)
func LookupKeyPairOutput(ctx *Context, args *LookupKeyPairOutputArgs, opts ...InvokeOption) LookupKeyPairResultOutput
> Note: This function is named LookupKeyPair
in the Go SDK.
public static class GetKeyPair
{
public static Task<GetKeyPairResult> InvokeAsync(GetKeyPairArgs args, InvokeOptions? opts = null)
public static Output<GetKeyPairResult> Invoke(GetKeyPairInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetKeyPairResult> getKeyPair(GetKeyPairArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws-native:ec2:getKeyPair
arguments:
# arguments dictionary
The following arguments are supported:
- Key
Name string - A unique name for the key pair. Constraints: Up to 255 ASCII characters
- Key
Name string - A unique name for the key pair. Constraints: Up to 255 ASCII characters
- key
Name String - A unique name for the key pair. Constraints: Up to 255 ASCII characters
- key
Name string - A unique name for the key pair. Constraints: Up to 255 ASCII characters
- key_
name str - A unique name for the key pair. Constraints: Up to 255 ASCII characters
- key
Name String - A unique name for the key pair. Constraints: Up to 255 ASCII characters
getKeyPair Result
The following output properties are available:
- Key
Fingerprint string If you created the key pair using Amazon EC2:
- For RSA key pairs, the key fingerprint is the SHA-1 digest of the DER encoded private key.
- For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8 .
If you imported the key pair to Amazon EC2:
- For RSA key pairs, the key fingerprint is the MD5 public key fingerprint as specified in section 4 of RFC 4716.
- For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8 .
- Key
Pair stringId - The ID of the key pair.
- Key
Fingerprint string If you created the key pair using Amazon EC2:
- For RSA key pairs, the key fingerprint is the SHA-1 digest of the DER encoded private key.
- For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8 .
If you imported the key pair to Amazon EC2:
- For RSA key pairs, the key fingerprint is the MD5 public key fingerprint as specified in section 4 of RFC 4716.
- For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8 .
- Key
Pair stringId - The ID of the key pair.
- key
Fingerprint String If you created the key pair using Amazon EC2:
- For RSA key pairs, the key fingerprint is the SHA-1 digest of the DER encoded private key.
- For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8 .
If you imported the key pair to Amazon EC2:
- For RSA key pairs, the key fingerprint is the MD5 public key fingerprint as specified in section 4 of RFC 4716.
- For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8 .
- key
Pair StringId - The ID of the key pair.
- key
Fingerprint string If you created the key pair using Amazon EC2:
- For RSA key pairs, the key fingerprint is the SHA-1 digest of the DER encoded private key.
- For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8 .
If you imported the key pair to Amazon EC2:
- For RSA key pairs, the key fingerprint is the MD5 public key fingerprint as specified in section 4 of RFC 4716.
- For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8 .
- key
Pair stringId - The ID of the key pair.
- key_
fingerprint str If you created the key pair using Amazon EC2:
- For RSA key pairs, the key fingerprint is the SHA-1 digest of the DER encoded private key.
- For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8 .
If you imported the key pair to Amazon EC2:
- For RSA key pairs, the key fingerprint is the MD5 public key fingerprint as specified in section 4 of RFC 4716.
- For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8 .
- key_
pair_ strid - The ID of the key pair.
- key
Fingerprint String If you created the key pair using Amazon EC2:
- For RSA key pairs, the key fingerprint is the SHA-1 digest of the DER encoded private key.
- For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8 .
If you imported the key pair to Amazon EC2:
- For RSA key pairs, the key fingerprint is the MD5 public key fingerprint as specified in section 4 of RFC 4716.
- For ED25519 key pairs, the key fingerprint is the base64-encoded SHA-256 digest, which is the default for OpenSSH, starting with OpenSSH 6.8 .
- key
Pair StringId - The ID of the key pair.
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
AWS Native is in preview. AWS Classic is fully supported.