1. Registry
  2. Packages
  3. AWS Cloud Control
  4. API Docs
  5. lightsail
  6. getKeyPair

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.80.0
published on Monday, Sep 21, 2026 by Pulumi
aws-native logo aws-native logo

We recommend new projects start with resources from the AWS provider.

Viewing docs for AWS Cloud Control v1.80.0
published on Monday, Sep 21, 2026 by Pulumi

    Resource Type definition for AWS::Lightsail::KeyPair

    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?: InvokeOutputOptions): Output<GetKeyPairResult>
    def get_key_pair(key_pair_name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetKeyPairResult
    def get_key_pair_output(key_pair_name: pulumi.Input[Optional[str]] = None,
                     opts: Optional[InvokeOutputOptions] = 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 Output<GetKeyPairResult> Invoke(GetKeyPairInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetKeyPairResult> getKeyPair(GetKeyPairArgs args, InvokeOptions options)
    public static Output<GetKeyPairResult> getKeyPair(GetKeyPairArgs args, InvokeOptions options)
    public static Output<GetKeyPairResult> getKeyPair(GetKeyPairArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: aws-native:lightsail:getKeyPair
      arguments:
        # arguments dictionary
    data "aws-native_lightsail_get_key_pair" "name" {
        # arguments
    }

    The following arguments are supported:

    KeyPairName string
    The name of the key pair.
    KeyPairName string
    The name of the key pair.
    key_pair_name string
    The name of the key pair.
    keyPairName String
    The name of the key pair.
    keyPairName string
    The name of the key pair.
    key_pair_name str
    The name of the key pair.
    keyPairName String
    The name of the key pair.

    getKeyPair Result

    The following output properties are available:

    CreatedAt string
    The timestamp when the key pair was created.
    Fingerprint string
    The RSA fingerprint of the key pair.
    KeyPairArn string
    The Amazon Resource Name (ARN) of the key pair.
    Location Pulumi.AwsNative.Lightsail.Outputs.KeyPairResourceLocation
    ResourceType string
    The Lightsail resource type (KeyPair).
    SupportCode string
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.
    Tags List<Pulumi.AwsNative.Outputs.Tag>
    The tag keys and optional values to add to the resource during create.
    CreatedAt string
    The timestamp when the key pair was created.
    Fingerprint string
    The RSA fingerprint of the key pair.
    KeyPairArn string
    The Amazon Resource Name (ARN) of the key pair.
    Location KeyPairResourceLocation
    ResourceType string
    The Lightsail resource type (KeyPair).
    SupportCode string
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.
    Tags Tag
    The tag keys and optional values to add to the resource during create.
    created_at string
    The timestamp when the key pair was created.
    fingerprint string
    The RSA fingerprint of the key pair.
    key_pair_arn string
    The Amazon Resource Name (ARN) of the key pair.
    location object
    resource_type string
    The Lightsail resource type (KeyPair).
    support_code string
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.
    tags list(object)
    The tag keys and optional values to add to the resource during create.
    createdAt String
    The timestamp when the key pair was created.
    fingerprint String
    The RSA fingerprint of the key pair.
    keyPairArn String
    The Amazon Resource Name (ARN) of the key pair.
    location KeyPairResourceLocation
    resourceType String
    The Lightsail resource type (KeyPair).
    supportCode String
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.
    tags List<Tag>
    The tag keys and optional values to add to the resource during create.
    createdAt string
    The timestamp when the key pair was created.
    fingerprint string
    The RSA fingerprint of the key pair.
    keyPairArn string
    The Amazon Resource Name (ARN) of the key pair.
    location KeyPairResourceLocation
    resourceType string
    The Lightsail resource type (KeyPair).
    supportCode string
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.
    tags Tag[]
    The tag keys and optional values to add to the resource during create.
    created_at str
    The timestamp when the key pair was created.
    fingerprint str
    The RSA fingerprint of the key pair.
    key_pair_arn str
    The Amazon Resource Name (ARN) of the key pair.
    location KeyPairResourceLocation
    resource_type str
    The Lightsail resource type (KeyPair).
    support_code str
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.
    tags Sequence[root_Tag]
    The tag keys and optional values to add to the resource during create.
    createdAt String
    The timestamp when the key pair was created.
    fingerprint String
    The RSA fingerprint of the key pair.
    keyPairArn String
    The Amazon Resource Name (ARN) of the key pair.
    location Property Map
    resourceType String
    The Lightsail resource type (KeyPair).
    supportCode String
    The support code. Include this code in your email to support when you have questions about a key pair in Lightsail.
    tags List<Property Map>
    The tag keys and optional values to add to the resource during create.

    Supporting Types

    KeyPairResourceLocation

    AvailabilityZone string
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    RegionName string
    The AWS Region name.
    AvailabilityZone string
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    RegionName string
    The AWS Region name.
    availability_zone string
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    region_name string
    The AWS Region name.
    availabilityZone String
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    regionName String
    The AWS Region name.
    availabilityZone string
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    regionName string
    The AWS Region name.
    availability_zone str
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    region_name str
    The AWS Region name.
    availabilityZone String
    The Availability Zone. Follows the format us-east-2a (case-sensitive).
    regionName String
    The AWS Region name.

    Tag

    Key string
    The key name of the tag
    Value string
    The value of the tag
    Key string
    The key name of the tag
    Value string
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag
    key string
    The key name of the tag
    value string
    The value of the tag
    key str
    The key name of the tag
    value str
    The value of the tag
    key String
    The key name of the tag
    value String
    The value of the tag

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo aws-native logo

    We recommend new projects start with resources from the AWS provider.

    Viewing docs for AWS Cloud Control v1.80.0
    published on Monday, Sep 21, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial