# 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__ = ['DNSArgs', 'DNS']

@pulumi.input_type
class DNSArgs:
    def __init__(__self__, *,
                 domain: pulumi.Input[str],
                 node_name: pulumi.Input[str],
                 servers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
        """
        The set of arguments for constructing a DNS resource.
        :param pulumi.Input[str] domain: The DNS search domain.
        :param pulumi.Input[str] node_name: A node name.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] servers: The DNS servers.
        """
        pulumi.set(__self__, "domain", domain)
        pulumi.set(__self__, "node_name", node_name)
        if servers is not None:
            pulumi.set(__self__, "servers", servers)

    @property
    @pulumi.getter
    def domain(self) -> pulumi.Input[str]:
        """
        The DNS search domain.
        """
        return pulumi.get(self, "domain")

    @domain.setter
    def domain(self, value: pulumi.Input[str]):
        pulumi.set(self, "domain", value)

    @property
    @pulumi.getter(name="nodeName")
    def node_name(self) -> pulumi.Input[str]:
        """
        A node name.
        """
        return pulumi.get(self, "node_name")

    @node_name.setter
    def node_name(self, value: pulumi.Input[str]):
        pulumi.set(self, "node_name", value)

    @property
    @pulumi.getter
    def servers(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        The DNS servers.
        """
        return pulumi.get(self, "servers")

    @servers.setter
    def servers(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "servers", value)


@pulumi.input_type
class _DNSState:
    def __init__(__self__, *,
                 domain: Optional[pulumi.Input[str]] = None,
                 node_name: Optional[pulumi.Input[str]] = None,
                 servers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None):
        """
        Input properties used for looking up and filtering DNS resources.
        :param pulumi.Input[str] domain: The DNS search domain.
        :param pulumi.Input[str] node_name: A node name.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] servers: The DNS servers.
        """
        if domain is not None:
            pulumi.set(__self__, "domain", domain)
        if node_name is not None:
            pulumi.set(__self__, "node_name", node_name)
        if servers is not None:
            pulumi.set(__self__, "servers", servers)

    @property
    @pulumi.getter
    def domain(self) -> Optional[pulumi.Input[str]]:
        """
        The DNS search domain.
        """
        return pulumi.get(self, "domain")

    @domain.setter
    def domain(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "domain", value)

    @property
    @pulumi.getter(name="nodeName")
    def node_name(self) -> Optional[pulumi.Input[str]]:
        """
        A node name.
        """
        return pulumi.get(self, "node_name")

    @node_name.setter
    def node_name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "node_name", value)

    @property
    @pulumi.getter
    def servers(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        """
        The DNS servers.
        """
        return pulumi.get(self, "servers")

    @servers.setter
    def servers(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]):
        pulumi.set(self, "servers", value)


class DNS(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 domain: Optional[pulumi.Input[str]] = None,
                 node_name: Optional[pulumi.Input[str]] = None,
                 servers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 __props__=None):
        """
        Manages the DNS configuration for a specific node.

        ## Import

        Instances can be imported using the `node_name`, e.g.,

        bash

        ```sh
        $ pulumi import proxmoxve:index/dNS:DNS first_node first-node
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] domain: The DNS search domain.
        :param pulumi.Input[str] node_name: A node name.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] servers: The DNS servers.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: DNSArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages the DNS configuration for a specific node.

        ## Import

        Instances can be imported using the `node_name`, e.g.,

        bash

        ```sh
        $ pulumi import proxmoxve:index/dNS:DNS first_node first-node
        ```

        :param str resource_name: The name of the resource.
        :param DNSArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(DNSArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 domain: Optional[pulumi.Input[str]] = None,
                 node_name: Optional[pulumi.Input[str]] = None,
                 servers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = DNSArgs.__new__(DNSArgs)

            if domain is None and not opts.urn:
                raise TypeError("Missing required property 'domain'")
            __props__.__dict__["domain"] = domain
            if node_name is None and not opts.urn:
                raise TypeError("Missing required property 'node_name'")
            __props__.__dict__["node_name"] = node_name
            __props__.__dict__["servers"] = servers
        super(DNS, __self__).__init__(
            'proxmoxve:index/dNS:DNS',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            domain: Optional[pulumi.Input[str]] = None,
            node_name: Optional[pulumi.Input[str]] = None,
            servers: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None) -> 'DNS':
        """
        Get an existing DNS resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] domain: The DNS search domain.
        :param pulumi.Input[str] node_name: A node name.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] servers: The DNS servers.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _DNSState.__new__(_DNSState)

        __props__.__dict__["domain"] = domain
        __props__.__dict__["node_name"] = node_name
        __props__.__dict__["servers"] = servers
        return DNS(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def domain(self) -> pulumi.Output[str]:
        """
        The DNS search domain.
        """
        return pulumi.get(self, "domain")

    @property
    @pulumi.getter(name="nodeName")
    def node_name(self) -> pulumi.Output[str]:
        """
        A node name.
        """
        return pulumi.get(self, "node_name")

    @property
    @pulumi.getter
    def servers(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        The DNS servers.
        """
        return pulumi.get(self, "servers")

