# 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 sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities

__all__ = [
    'GetComputeInstanceResult',
    'AwaitableGetComputeInstanceResult',
    'get_compute_instance',
    'get_compute_instance_output',
]

@pulumi.output_type
class GetComputeInstanceResult:
    """
    A collection of values returned by getComputeInstance.
    """
    def __init__(__self__, anti_affinity_group_ids=None, created_at=None, deploy_target_id=None, disk_size=None, elastic_ip_ids=None, id=None, ipv6=None, ipv6_address=None, labels=None, manager_id=None, manager_type=None, name=None, private_network_ids=None, public_ip_address=None, reverse_dns=None, security_group_ids=None, ssh_key=None, state=None, template_id=None, type=None, user_data=None, zone=None):
        if anti_affinity_group_ids and not isinstance(anti_affinity_group_ids, list):
            raise TypeError("Expected argument 'anti_affinity_group_ids' to be a list")
        pulumi.set(__self__, "anti_affinity_group_ids", anti_affinity_group_ids)
        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 deploy_target_id and not isinstance(deploy_target_id, str):
            raise TypeError("Expected argument 'deploy_target_id' to be a str")
        pulumi.set(__self__, "deploy_target_id", deploy_target_id)
        if disk_size and not isinstance(disk_size, int):
            raise TypeError("Expected argument 'disk_size' to be a int")
        pulumi.set(__self__, "disk_size", disk_size)
        if elastic_ip_ids and not isinstance(elastic_ip_ids, list):
            raise TypeError("Expected argument 'elastic_ip_ids' to be a list")
        pulumi.set(__self__, "elastic_ip_ids", elastic_ip_ids)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if ipv6 and not isinstance(ipv6, bool):
            raise TypeError("Expected argument 'ipv6' to be a bool")
        pulumi.set(__self__, "ipv6", ipv6)
        if ipv6_address and not isinstance(ipv6_address, str):
            raise TypeError("Expected argument 'ipv6_address' to be a str")
        pulumi.set(__self__, "ipv6_address", ipv6_address)
        if labels and not isinstance(labels, dict):
            raise TypeError("Expected argument 'labels' to be a dict")
        pulumi.set(__self__, "labels", labels)
        if manager_id and not isinstance(manager_id, str):
            raise TypeError("Expected argument 'manager_id' to be a str")
        pulumi.set(__self__, "manager_id", manager_id)
        if manager_type and not isinstance(manager_type, str):
            raise TypeError("Expected argument 'manager_type' to be a str")
        pulumi.set(__self__, "manager_type", manager_type)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if private_network_ids and not isinstance(private_network_ids, list):
            raise TypeError("Expected argument 'private_network_ids' to be a list")
        pulumi.set(__self__, "private_network_ids", private_network_ids)
        if public_ip_address and not isinstance(public_ip_address, str):
            raise TypeError("Expected argument 'public_ip_address' to be a str")
        pulumi.set(__self__, "public_ip_address", public_ip_address)
        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 security_group_ids and not isinstance(security_group_ids, list):
            raise TypeError("Expected argument 'security_group_ids' to be a list")
        pulumi.set(__self__, "security_group_ids", security_group_ids)
        if ssh_key and not isinstance(ssh_key, str):
            raise TypeError("Expected argument 'ssh_key' to be a str")
        pulumi.set(__self__, "ssh_key", ssh_key)
        if state and not isinstance(state, str):
            raise TypeError("Expected argument 'state' to be a str")
        pulumi.set(__self__, "state", state)
        if template_id and not isinstance(template_id, str):
            raise TypeError("Expected argument 'template_id' to be a str")
        pulumi.set(__self__, "template_id", template_id)
        if type and not isinstance(type, str):
            raise TypeError("Expected argument 'type' to be a str")
        pulumi.set(__self__, "type", type)
        if user_data and not isinstance(user_data, str):
            raise TypeError("Expected argument 'user_data' to be a str")
        pulumi.set(__self__, "user_data", user_data)
        if zone and not isinstance(zone, str):
            raise TypeError("Expected argument 'zone' to be a str")
        pulumi.set(__self__, "zone", zone)

    @property
    @pulumi.getter(name="antiAffinityGroupIds")
    def anti_affinity_group_ids(self) -> Sequence[str]:
        """
        The list of attached exoscale*anti*affinity_group (IDs).
        """
        return pulumi.get(self, "anti_affinity_group_ids")

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

    @property
    @pulumi.getter(name="deployTargetId")
    def deploy_target_id(self) -> str:
        """
        A deploy target ID.
        """
        return pulumi.get(self, "deploy_target_id")

    @property
    @pulumi.getter(name="diskSize")
    def disk_size(self) -> int:
        """
        The instance disk size (GiB).
        """
        return pulumi.get(self, "disk_size")

    @property
    @pulumi.getter(name="elasticIpIds")
    def elastic_ip_ids(self) -> Sequence[str]:
        """
        The list of attached exoscale*elastic*ip (IDs).
        """
        return pulumi.get(self, "elastic_ip_ids")

    @property
    @pulumi.getter
    def id(self) -> Optional[str]:
        """
        The compute instance ID to match (conflicts with `name`).
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def ipv6(self) -> bool:
        """
        Whether IPv6 is enabled on the instance.
        """
        return pulumi.get(self, "ipv6")

    @property
    @pulumi.getter(name="ipv6Address")
    def ipv6_address(self) -> str:
        """
        The instance (main network interface) IPv6 address (if enabled).
        """
        return pulumi.get(self, "ipv6_address")

    @property
    @pulumi.getter
    def labels(self) -> Mapping[str, str]:
        """
        A map of key/value labels.
        """
        return pulumi.get(self, "labels")

    @property
    @pulumi.getter(name="managerId")
    def manager_id(self) -> str:
        """
        The instance manager ID, if any.
        """
        return pulumi.get(self, "manager_id")

    @property
    @pulumi.getter(name="managerType")
    def manager_type(self) -> str:
        """
        The instance manager type (instance pool, SKS node pool, etc.), if any.
        """
        return pulumi.get(self, "manager_type")

    @property
    @pulumi.getter
    def name(self) -> Optional[str]:
        """
        The instance name to match (conflicts with `id`).
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="privateNetworkIds")
    def private_network_ids(self) -> Sequence[str]:
        """
        The list of attached exoscale*private*network (IDs).
        """
        return pulumi.get(self, "private_network_ids")

    @property
    @pulumi.getter(name="publicIpAddress")
    def public_ip_address(self) -> str:
        """
        The instance (main network interface) IPv4 address.
        """
        return pulumi.get(self, "public_ip_address")

    @property
    @pulumi.getter(name="reverseDns")
    def reverse_dns(self) -> str:
        """
        Domain name for reverse DNS record.
        """
        return pulumi.get(self, "reverse_dns")

    @property
    @pulumi.getter(name="securityGroupIds")
    def security_group_ids(self) -> Sequence[str]:
        """
        The list of attached exoscale*security*group (IDs).
        """
        return pulumi.get(self, "security_group_ids")

    @property
    @pulumi.getter(name="sshKey")
    def ssh_key(self) -> str:
        """
        The exoscale*ssh*key (name) authorized on the instance.
        """
        return pulumi.get(self, "ssh_key")

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

    @property
    @pulumi.getter(name="templateId")
    def template_id(self) -> str:
        """
        The instance get_template ID.
        """
        return pulumi.get(self, "template_id")

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

    @property
    @pulumi.getter(name="userData")
    def user_data(self) -> str:
        """
        The instance [cloud-init](http://cloudinit.readthedocs.io/en/latest/) configuration.
        """
        return pulumi.get(self, "user_data")

    @property
    @pulumi.getter
    def zone(self) -> str:
        """
        The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
        """
        return pulumi.get(self, "zone")


class AwaitableGetComputeInstanceResult(GetComputeInstanceResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetComputeInstanceResult(
            anti_affinity_group_ids=self.anti_affinity_group_ids,
            created_at=self.created_at,
            deploy_target_id=self.deploy_target_id,
            disk_size=self.disk_size,
            elastic_ip_ids=self.elastic_ip_ids,
            id=self.id,
            ipv6=self.ipv6,
            ipv6_address=self.ipv6_address,
            labels=self.labels,
            manager_id=self.manager_id,
            manager_type=self.manager_type,
            name=self.name,
            private_network_ids=self.private_network_ids,
            public_ip_address=self.public_ip_address,
            reverse_dns=self.reverse_dns,
            security_group_ids=self.security_group_ids,
            ssh_key=self.ssh_key,
            state=self.state,
            template_id=self.template_id,
            type=self.type,
            user_data=self.user_data,
            zone=self.zone)


def get_compute_instance(id: Optional[str] = None,
                         name: Optional[str] = None,
                         zone: Optional[str] = None,
                         opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetComputeInstanceResult:
    """
    Fetch Exoscale [Compute Instances](https://community.exoscale.com/documentation/compute/) data.

    Corresponding resource: exoscale_compute_instance.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_exoscale as exoscale

    my_instance = exoscale.get_compute_instance(zone="ch-gva-2",
        name="my-instance")
    pulumi.export("myInstanceId", my_instance.id)
    ```

    Please refer to the examples
    directory for complete configuration examples.


    :param str id: The compute instance ID to match (conflicts with `name`).
    :param str name: The instance name to match (conflicts with `id`).
    :param str zone: The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['name'] = name
    __args__['zone'] = zone
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('exoscale:index/getComputeInstance:getComputeInstance', __args__, opts=opts, typ=GetComputeInstanceResult).value

    return AwaitableGetComputeInstanceResult(
        anti_affinity_group_ids=pulumi.get(__ret__, 'anti_affinity_group_ids'),
        created_at=pulumi.get(__ret__, 'created_at'),
        deploy_target_id=pulumi.get(__ret__, 'deploy_target_id'),
        disk_size=pulumi.get(__ret__, 'disk_size'),
        elastic_ip_ids=pulumi.get(__ret__, 'elastic_ip_ids'),
        id=pulumi.get(__ret__, 'id'),
        ipv6=pulumi.get(__ret__, 'ipv6'),
        ipv6_address=pulumi.get(__ret__, 'ipv6_address'),
        labels=pulumi.get(__ret__, 'labels'),
        manager_id=pulumi.get(__ret__, 'manager_id'),
        manager_type=pulumi.get(__ret__, 'manager_type'),
        name=pulumi.get(__ret__, 'name'),
        private_network_ids=pulumi.get(__ret__, 'private_network_ids'),
        public_ip_address=pulumi.get(__ret__, 'public_ip_address'),
        reverse_dns=pulumi.get(__ret__, 'reverse_dns'),
        security_group_ids=pulumi.get(__ret__, 'security_group_ids'),
        ssh_key=pulumi.get(__ret__, 'ssh_key'),
        state=pulumi.get(__ret__, 'state'),
        template_id=pulumi.get(__ret__, 'template_id'),
        type=pulumi.get(__ret__, 'type'),
        user_data=pulumi.get(__ret__, 'user_data'),
        zone=pulumi.get(__ret__, 'zone'))
def get_compute_instance_output(id: Optional[pulumi.Input[Optional[str]]] = None,
                                name: Optional[pulumi.Input[Optional[str]]] = None,
                                zone: Optional[pulumi.Input[str]] = None,
                                opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetComputeInstanceResult]:
    """
    Fetch Exoscale [Compute Instances](https://community.exoscale.com/documentation/compute/) data.

    Corresponding resource: exoscale_compute_instance.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_exoscale as exoscale

    my_instance = exoscale.get_compute_instance(zone="ch-gva-2",
        name="my-instance")
    pulumi.export("myInstanceId", my_instance.id)
    ```

    Please refer to the examples
    directory for complete configuration examples.


    :param str id: The compute instance ID to match (conflicts with `name`).
    :param str name: The instance name to match (conflicts with `id`).
    :param str zone: The Exoscale [Zone](https://www.exoscale.com/datacenters/) name.
    """
    __args__ = dict()
    __args__['id'] = id
    __args__['name'] = name
    __args__['zone'] = zone
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('exoscale:index/getComputeInstance:getComputeInstance', __args__, opts=opts, typ=GetComputeInstanceResult)
    return __ret__.apply(lambda __response__: GetComputeInstanceResult(
        anti_affinity_group_ids=pulumi.get(__response__, 'anti_affinity_group_ids'),
        created_at=pulumi.get(__response__, 'created_at'),
        deploy_target_id=pulumi.get(__response__, 'deploy_target_id'),
        disk_size=pulumi.get(__response__, 'disk_size'),
        elastic_ip_ids=pulumi.get(__response__, 'elastic_ip_ids'),
        id=pulumi.get(__response__, 'id'),
        ipv6=pulumi.get(__response__, 'ipv6'),
        ipv6_address=pulumi.get(__response__, 'ipv6_address'),
        labels=pulumi.get(__response__, 'labels'),
        manager_id=pulumi.get(__response__, 'manager_id'),
        manager_type=pulumi.get(__response__, 'manager_type'),
        name=pulumi.get(__response__, 'name'),
        private_network_ids=pulumi.get(__response__, 'private_network_ids'),
        public_ip_address=pulumi.get(__response__, 'public_ip_address'),
        reverse_dns=pulumi.get(__response__, 'reverse_dns'),
        security_group_ids=pulumi.get(__response__, 'security_group_ids'),
        ssh_key=pulumi.get(__response__, 'ssh_key'),
        state=pulumi.get(__response__, 'state'),
        template_id=pulumi.get(__response__, 'template_id'),
        type=pulumi.get(__response__, 'type'),
        user_data=pulumi.get(__response__, 'user_data'),
        zone=pulumi.get(__response__, 'zone')))
