# 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 copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities

__all__ = [
    'GetInstanceResult',
    'AwaitableGetInstanceResult',
    'get_instance',
    'get_instance_output',
]

@pulumi.output_type
class GetInstanceResult:
    """
    A collection of values returned by getInstance.
    """
    def __init__(__self__, cpu_cores=None, created_at=None, disk_gb=None, firewall_id=None, hostname=None, id=None, initial_password=None, initial_user=None, network_id=None, notes=None, private_ip=None, pseudo_ip=None, public_ip=None, ram_mb=None, region=None, reverse_dns=None, script=None, size=None, sshkey_id=None, status=None, tags=None, template=None):
        if cpu_cores and not isinstance(cpu_cores, int):
            raise TypeError("Expected argument 'cpu_cores' to be a int")
        pulumi.set(__self__, "cpu_cores", cpu_cores)
        if created_at and not isinstance(created_at, str):
            raise TypeError("Expected argument 'created_at' to be a str")
        pulumi.set(__self__, "created_at", created_at)
        if disk_gb and not isinstance(disk_gb, int):
            raise TypeError("Expected argument 'disk_gb' to be a int")
        pulumi.set(__self__, "disk_gb", disk_gb)
        if firewall_id and not isinstance(firewall_id, str):
            raise TypeError("Expected argument 'firewall_id' to be a str")
        pulumi.set(__self__, "firewall_id", firewall_id)
        if hostname and not isinstance(hostname, str):
            raise TypeError("Expected argument 'hostname' to be a str")
        pulumi.set(__self__, "hostname", hostname)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if initial_password and not isinstance(initial_password, str):
            raise TypeError("Expected argument 'initial_password' to be a str")
        pulumi.set(__self__, "initial_password", initial_password)
        if initial_user and not isinstance(initial_user, str):
            raise TypeError("Expected argument 'initial_user' to be a str")
        pulumi.set(__self__, "initial_user", initial_user)
        if network_id and not isinstance(network_id, str):
            raise TypeError("Expected argument 'network_id' to be a str")
        pulumi.set(__self__, "network_id", network_id)
        if notes and not isinstance(notes, str):
            raise TypeError("Expected argument 'notes' to be a str")
        pulumi.set(__self__, "notes", notes)
        if private_ip and not isinstance(private_ip, str):
            raise TypeError("Expected argument 'private_ip' to be a str")
        pulumi.set(__self__, "private_ip", private_ip)
        if pseudo_ip and not isinstance(pseudo_ip, str):
            raise TypeError("Expected argument 'pseudo_ip' to be a str")
        pulumi.set(__self__, "pseudo_ip", pseudo_ip)
        if public_ip and not isinstance(public_ip, str):
            raise TypeError("Expected argument 'public_ip' to be a str")
        pulumi.set(__self__, "public_ip", public_ip)
        if ram_mb and not isinstance(ram_mb, int):
            raise TypeError("Expected argument 'ram_mb' to be a int")
        pulumi.set(__self__, "ram_mb", ram_mb)
        if region and not isinstance(region, str):
            raise TypeError("Expected argument 'region' to be a str")
        pulumi.set(__self__, "region", region)
        if reverse_dns and not isinstance(reverse_dns, str):
            raise TypeError("Expected argument 'reverse_dns' to be a str")
        pulumi.set(__self__, "reverse_dns", reverse_dns)
        if script and not isinstance(script, str):
            raise TypeError("Expected argument 'script' to be a str")
        pulumi.set(__self__, "script", script)
        if size and not isinstance(size, str):
            raise TypeError("Expected argument 'size' to be a str")
        pulumi.set(__self__, "size", size)
        if sshkey_id and not isinstance(sshkey_id, str):
            raise TypeError("Expected argument 'sshkey_id' to be a str")
        pulumi.set(__self__, "sshkey_id", sshkey_id)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)
        if template and not isinstance(template, str):
            raise TypeError("Expected argument 'template' to be a str")
        pulumi.set(__self__, "template", template)

    @property
    @pulumi.getter(name="cpuCores")
    def cpu_cores(self) -> int:
        """
        Total cpu of the instance
        """
        return pulumi.get(self, "cpu_cores")

    @property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> str:
        """
        The date of creation of the instance
        """
        return pulumi.get(self, "created_at")

    @property
    @pulumi.getter(name="diskGb")
    def disk_gb(self) -> int:
        """
        The size of the disk
        """
        return pulumi.get(self, "disk_gb")

    @property
    @pulumi.getter(name="firewallId")
    def firewall_id(self) -> str:
        """
        The ID of the firewall used
        """
        return pulumi.get(self, "firewall_id")

    @property
    @pulumi.getter
    def hostname(self) -> Optional[str]:
        """
        The hostname of the Instance
        """
        return pulumi.get(self, "hostname")

    @property
    @pulumi.getter
    def id(self) -> Optional[str]:
        """
        The ID of this resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="initialPassword")
    def initial_password(self) -> str:
        """
        Instance initial password
        """
        return pulumi.get(self, "initial_password")

    @property
    @pulumi.getter(name="initialUser")
    def initial_user(self) -> str:
        """
        The name of the initial user created on the server
        """
        return pulumi.get(self, "initial_user")

    @property
    @pulumi.getter(name="networkId")
    def network_id(self) -> str:
        """
        his will be the ID of the network
        """
        return pulumi.get(self, "network_id")

    @property
    @pulumi.getter
    def notes(self) -> str:
        """
        The notes of the instance
        """
        return pulumi.get(self, "notes")

    @property
    @pulumi.getter(name="privateIp")
    def private_ip(self) -> str:
        """
        The private IP
        """
        return pulumi.get(self, "private_ip")

    @property
    @pulumi.getter(name="pseudoIp")
    def pseudo_ip(self) -> str:
        """
        Is the ip that is used to route the public ip from the internet to the instance using NAT
        """
        return pulumi.get(self, "pseudo_ip")

    @property
    @pulumi.getter(name="publicIp")
    def public_ip(self) -> str:
        """
        The public IP
        """
        return pulumi.get(self, "public_ip")

    @property
    @pulumi.getter(name="ramMb")
    def ram_mb(self) -> int:
        """
        Total ram of the instance
        """
        return pulumi.get(self, "ram_mb")

    @property
    @pulumi.getter
    def region(self) -> Optional[str]:
        """
        The region of an existing Instance
        """
        return pulumi.get(self, "region")

    @property
    @pulumi.getter(name="reverseDns")
    def reverse_dns(self) -> str:
        """
        A fully qualified domain name
        """
        return pulumi.get(self, "reverse_dns")

    @property
    @pulumi.getter
    def script(self) -> str:
        """
        The contents of a script uploaded
        """
        return pulumi.get(self, "script")

    @property
    @pulumi.getter
    def size(self) -> str:
        """
        The name of the size
        """
        return pulumi.get(self, "size")

    @property
    @pulumi.getter(name="sshkeyId")
    def sshkey_id(self) -> str:
        """
        The ID SSH key
        """
        return pulumi.get(self, "sshkey_id")

    @property
    @pulumi.getter
    def status(self) -> str:
        """
        The status of the instance
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def tags(self) -> Sequence[str]:
        """
        An optional list of tags
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter
    def template(self) -> str:
        """
        The ID for the disk image/template to used to build the instance
        """
        return pulumi.get(self, "template")


class AwaitableGetInstanceResult(GetInstanceResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetInstanceResult(
            cpu_cores=self.cpu_cores,
            created_at=self.created_at,
            disk_gb=self.disk_gb,
            firewall_id=self.firewall_id,
            hostname=self.hostname,
            id=self.id,
            initial_password=self.initial_password,
            initial_user=self.initial_user,
            network_id=self.network_id,
            notes=self.notes,
            private_ip=self.private_ip,
            pseudo_ip=self.pseudo_ip,
            public_ip=self.public_ip,
            ram_mb=self.ram_mb,
            region=self.region,
            reverse_dns=self.reverse_dns,
            script=self.script,
            size=self.size,
            sshkey_id=self.sshkey_id,
            status=self.status,
            tags=self.tags,
            template=self.template)


def get_instance(hostname: Optional[str] = None,
                 id: Optional[str] = None,
                 region: Optional[str] = None,
                 opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetInstanceResult:
    """
    Get information on an instance for use in other resources. This data source provides all of the instance's properties as configured on your Civo account.

    Note: This data source returns a single instance. When specifying a hostname, an error will be raised if more than one instances found.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_civo as civo

    myhostaname = civo.get_instance(hostname="myhostname.com")
    pulumi.export("instanceOutput", myhostaname.public_ip)
    ```


    :param str hostname: The hostname of the Instance
    :param str id: The ID of this resource.
    :param str region: The region of an existing Instance
    """
    __args__ = dict()
    __args__['hostname'] = hostname
    __args__['id'] = id
    __args__['region'] = region
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('civo:index/getInstance:getInstance', __args__, opts=opts, typ=GetInstanceResult).value

    return AwaitableGetInstanceResult(
        cpu_cores=pulumi.get(__ret__, 'cpu_cores'),
        created_at=pulumi.get(__ret__, 'created_at'),
        disk_gb=pulumi.get(__ret__, 'disk_gb'),
        firewall_id=pulumi.get(__ret__, 'firewall_id'),
        hostname=pulumi.get(__ret__, 'hostname'),
        id=pulumi.get(__ret__, 'id'),
        initial_password=pulumi.get(__ret__, 'initial_password'),
        initial_user=pulumi.get(__ret__, 'initial_user'),
        network_id=pulumi.get(__ret__, 'network_id'),
        notes=pulumi.get(__ret__, 'notes'),
        private_ip=pulumi.get(__ret__, 'private_ip'),
        pseudo_ip=pulumi.get(__ret__, 'pseudo_ip'),
        public_ip=pulumi.get(__ret__, 'public_ip'),
        ram_mb=pulumi.get(__ret__, 'ram_mb'),
        region=pulumi.get(__ret__, 'region'),
        reverse_dns=pulumi.get(__ret__, 'reverse_dns'),
        script=pulumi.get(__ret__, 'script'),
        size=pulumi.get(__ret__, 'size'),
        sshkey_id=pulumi.get(__ret__, 'sshkey_id'),
        status=pulumi.get(__ret__, 'status'),
        tags=pulumi.get(__ret__, 'tags'),
        template=pulumi.get(__ret__, 'template'))


@_utilities.lift_output_func(get_instance)
def get_instance_output(hostname: Optional[pulumi.Input[Optional[str]]] = None,
                        id: Optional[pulumi.Input[Optional[str]]] = None,
                        region: Optional[pulumi.Input[Optional[str]]] = None,
                        opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetInstanceResult]:
    """
    Get information on an instance for use in other resources. This data source provides all of the instance's properties as configured on your Civo account.

    Note: This data source returns a single instance. When specifying a hostname, an error will be raised if more than one instances found.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_civo as civo

    myhostaname = civo.get_instance(hostname="myhostname.com")
    pulumi.export("instanceOutput", myhostaname.public_ip)
    ```


    :param str hostname: The hostname of the Instance
    :param str id: The ID of this resource.
    :param str region: The region of an existing Instance
    """
    ...
