# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import pulumi
import pulumi.runtime

class GetKeypairResult(object):
    """
    A collection of values returned by getKeypair.
    """
    def __init__(__self__, public_key=None, region=None):
        if public_key and not isinstance(public_key, basestring):
            raise TypeError('Expected argument public_key to be a basestring')
        __self__.public_key = public_key
        """
        The OpenSSH-formatted public key of the keypair.
        """
        if region and not isinstance(region, basestring):
            raise TypeError('Expected argument region to be a basestring')
        __self__.region = region
        """
        See Argument Reference above.
        """

def get_keypair(name=None, region=None):
    """
    Use this data source to get the ID and public key of an OpenStack keypair.
    """
    __args__ = dict()

    __args__['name'] = name
    __args__['region'] = region
    __ret__ = pulumi.runtime.invoke('openstack:compute/getKeypair:getKeypair', __args__)

    return GetKeypairResult(
        public_key=__ret__.get('publicKey'),
        region=__ret__.get('region'))
