# 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
from .. import utilities

class SSHKey(pulumi.CustomResource):
    """
    Provides a DigitalOcean SSH key resource to allow you to manage SSH
    keys for Droplet access. Keys created with this resource
    can be referenced in your droplet configuration via their ID or
    fingerprint.
    """
    def __init__(__self__, __name__, __opts__=None, name=None, public_key=None):
        """Create a SSHKey resource with the given unique name, props, and options."""
        if not __name__:
            raise TypeError('Missing resource name argument (for URN creation)')
        if not isinstance(__name__, basestring):
            raise TypeError('Expected resource name to be a string')
        if __opts__ and not isinstance(__opts__, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')

        __props__ = dict()

        if name and not isinstance(name, basestring):
            raise TypeError('Expected property name to be a basestring')
        __self__.name = name
        """
        The name of the SSH key for identification
        """
        __props__['name'] = name

        if not public_key:
            raise TypeError('Missing required property public_key')
        elif not isinstance(public_key, basestring):
            raise TypeError('Expected property public_key to be a basestring')
        __self__.public_key = public_key
        """
        The public key. If this is a file, it
        can be read using the file interpolation function
        """
        __props__['publicKey'] = public_key

        __self__.fingerprint = pulumi.runtime.UNKNOWN
        """
        The fingerprint of the SSH key
        """

        super(SSHKey, __self__).__init__(
            'do:core/sSHKey:SSHKey',
            __name__,
            __props__,
            __opts__)

    def set_outputs(self, outs):
        if 'fingerprint' in outs:
            self.fingerprint = outs['fingerprint']
        if 'name' in outs:
            self.name = outs['name']
        if 'publicKey' in outs:
            self.public_key = outs['publicKey']
