# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from . import _utilities, _tables
from . import outputs
from ._inputs import *

__all__ = ['Zone']


class Zone(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 additional_primaries: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 autogenerate_ns_record: Optional[pulumi.Input[bool]] = None,
                 dnssec: Optional[pulumi.Input[bool]] = None,
                 expiry: Optional[pulumi.Input[int]] = None,
                 link: Optional[pulumi.Input[str]] = None,
                 networks: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
                 nx_ttl: Optional[pulumi.Input[int]] = None,
                 primary: Optional[pulumi.Input[str]] = None,
                 refresh: Optional[pulumi.Input[int]] = None,
                 retry: Optional[pulumi.Input[int]] = None,
                 secondaries: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ZoneSecondaryArgs']]]]] = None,
                 ttl: Optional[pulumi.Input[int]] = None,
                 zone: Optional[pulumi.Input[str]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        ## Import

        ```sh
         $ pulumi import ns1:index/zone:Zone <name> <zone>`
        ```

         So for the example above

        ```sh
         $ pulumi import ns1:index/zone:Zone example terraform.example.io`
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] additional_primaries: List of additional IPv4 addresses for the primary
               zone. Conflicts with `secondaries`.
        :param pulumi.Input[bool] dnssec: Whether or not DNSSEC is enabled for the zone.
               Note that DNSSEC must be enabled on the account by support for this to be set
               to `true`.
        :param pulumi.Input[int] expiry: The SOA Expiry. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[str] link: The target zone(domain name) to link to.
        :param pulumi.Input[Sequence[pulumi.Input[int]]] networks: - List of network IDs (`int`) for which the zone
               should be made available. Default is network 0, the primary NSONE Global
               Network. Normally, you should not have to worry about this.
        :param pulumi.Input[int] nx_ttl: The SOA NX TTL. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[str] primary: The primary zones' IPv4 address. This makes the zone a
               secondary. Conflicts with `secondaries`.
        :param pulumi.Input[int] refresh: The SOA Refresh. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[int] retry: The SOA Retry. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ZoneSecondaryArgs']]]] secondaries: List of secondary servers. This makes the zone a
               primary. Conflicts with `primary` and `additional_primaries`.
               Secondaries is documented below.
        :param pulumi.Input[int] ttl: The SOA TTL.
        :param pulumi.Input[str] zone: The domain name of the zone.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        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__ = dict()

            __props__['additional_primaries'] = additional_primaries
            __props__['autogenerate_ns_record'] = autogenerate_ns_record
            __props__['dnssec'] = dnssec
            __props__['expiry'] = expiry
            __props__['link'] = link
            __props__['networks'] = networks
            __props__['nx_ttl'] = nx_ttl
            __props__['primary'] = primary
            __props__['refresh'] = refresh
            __props__['retry'] = retry
            __props__['secondaries'] = secondaries
            __props__['ttl'] = ttl
            if zone is None and not opts.urn:
                raise TypeError("Missing required property 'zone'")
            __props__['zone'] = zone
            __props__['dns_servers'] = None
            __props__['hostmaster'] = None
        super(Zone, __self__).__init__(
            'ns1:index/zone:Zone',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            additional_primaries: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            autogenerate_ns_record: Optional[pulumi.Input[bool]] = None,
            dns_servers: Optional[pulumi.Input[str]] = None,
            dnssec: Optional[pulumi.Input[bool]] = None,
            expiry: Optional[pulumi.Input[int]] = None,
            hostmaster: Optional[pulumi.Input[str]] = None,
            link: Optional[pulumi.Input[str]] = None,
            networks: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
            nx_ttl: Optional[pulumi.Input[int]] = None,
            primary: Optional[pulumi.Input[str]] = None,
            refresh: Optional[pulumi.Input[int]] = None,
            retry: Optional[pulumi.Input[int]] = None,
            secondaries: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ZoneSecondaryArgs']]]]] = None,
            ttl: Optional[pulumi.Input[int]] = None,
            zone: Optional[pulumi.Input[str]] = None) -> 'Zone':
        """
        Get an existing Zone 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[Sequence[pulumi.Input[str]]] additional_primaries: List of additional IPv4 addresses for the primary
               zone. Conflicts with `secondaries`.
        :param pulumi.Input[str] dns_servers: (Computed) Authoritative Name Servers.
        :param pulumi.Input[bool] dnssec: Whether or not DNSSEC is enabled for the zone.
               Note that DNSSEC must be enabled on the account by support for this to be set
               to `true`.
        :param pulumi.Input[int] expiry: The SOA Expiry. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[str] hostmaster: (Computed) The SOA Hostmaster.
        :param pulumi.Input[str] link: The target zone(domain name) to link to.
        :param pulumi.Input[Sequence[pulumi.Input[int]]] networks: - List of network IDs (`int`) for which the zone
               should be made available. Default is network 0, the primary NSONE Global
               Network. Normally, you should not have to worry about this.
        :param pulumi.Input[int] nx_ttl: The SOA NX TTL. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[str] primary: The primary zones' IPv4 address. This makes the zone a
               secondary. Conflicts with `secondaries`.
        :param pulumi.Input[int] refresh: The SOA Refresh. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[int] retry: The SOA Retry. Conflicts with `primary` and
               `additional_primaries` (default must be accepted).
        :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ZoneSecondaryArgs']]]] secondaries: List of secondary servers. This makes the zone a
               primary. Conflicts with `primary` and `additional_primaries`.
               Secondaries is documented below.
        :param pulumi.Input[int] ttl: The SOA TTL.
        :param pulumi.Input[str] zone: The domain name of the zone.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["additional_primaries"] = additional_primaries
        __props__["autogenerate_ns_record"] = autogenerate_ns_record
        __props__["dns_servers"] = dns_servers
        __props__["dnssec"] = dnssec
        __props__["expiry"] = expiry
        __props__["hostmaster"] = hostmaster
        __props__["link"] = link
        __props__["networks"] = networks
        __props__["nx_ttl"] = nx_ttl
        __props__["primary"] = primary
        __props__["refresh"] = refresh
        __props__["retry"] = retry
        __props__["secondaries"] = secondaries
        __props__["ttl"] = ttl
        __props__["zone"] = zone
        return Zone(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="additionalPrimaries")
    def additional_primaries(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        List of additional IPv4 addresses for the primary
        zone. Conflicts with `secondaries`.
        """
        return pulumi.get(self, "additional_primaries")

    @property
    @pulumi.getter(name="autogenerateNsRecord")
    def autogenerate_ns_record(self) -> pulumi.Output[Optional[bool]]:
        return pulumi.get(self, "autogenerate_ns_record")

    @property
    @pulumi.getter(name="dnsServers")
    def dns_servers(self) -> pulumi.Output[str]:
        """
        (Computed) Authoritative Name Servers.
        """
        return pulumi.get(self, "dns_servers")

    @property
    @pulumi.getter
    def dnssec(self) -> pulumi.Output[bool]:
        """
        Whether or not DNSSEC is enabled for the zone.
        Note that DNSSEC must be enabled on the account by support for this to be set
        to `true`.
        """
        return pulumi.get(self, "dnssec")

    @property
    @pulumi.getter
    def expiry(self) -> pulumi.Output[int]:
        """
        The SOA Expiry. Conflicts with `primary` and
        `additional_primaries` (default must be accepted).
        """
        return pulumi.get(self, "expiry")

    @property
    @pulumi.getter
    def hostmaster(self) -> pulumi.Output[str]:
        """
        (Computed) The SOA Hostmaster.
        """
        return pulumi.get(self, "hostmaster")

    @property
    @pulumi.getter
    def link(self) -> pulumi.Output[Optional[str]]:
        """
        The target zone(domain name) to link to.
        """
        return pulumi.get(self, "link")

    @property
    @pulumi.getter
    def networks(self) -> pulumi.Output[Sequence[int]]:
        """
        - List of network IDs (`int`) for which the zone
        should be made available. Default is network 0, the primary NSONE Global
        Network. Normally, you should not have to worry about this.
        """
        return pulumi.get(self, "networks")

    @property
    @pulumi.getter(name="nxTtl")
    def nx_ttl(self) -> pulumi.Output[int]:
        """
        The SOA NX TTL. Conflicts with `primary` and
        `additional_primaries` (default must be accepted).
        """
        return pulumi.get(self, "nx_ttl")

    @property
    @pulumi.getter
    def primary(self) -> pulumi.Output[Optional[str]]:
        """
        The primary zones' IPv4 address. This makes the zone a
        secondary. Conflicts with `secondaries`.
        """
        return pulumi.get(self, "primary")

    @property
    @pulumi.getter
    def refresh(self) -> pulumi.Output[int]:
        """
        The SOA Refresh. Conflicts with `primary` and
        `additional_primaries` (default must be accepted).
        """
        return pulumi.get(self, "refresh")

    @property
    @pulumi.getter
    def retry(self) -> pulumi.Output[int]:
        """
        The SOA Retry. Conflicts with `primary` and
        `additional_primaries` (default must be accepted).
        """
        return pulumi.get(self, "retry")

    @property
    @pulumi.getter
    def secondaries(self) -> pulumi.Output[Optional[Sequence['outputs.ZoneSecondary']]]:
        """
        List of secondary servers. This makes the zone a
        primary. Conflicts with `primary` and `additional_primaries`.
        Secondaries is documented below.
        """
        return pulumi.get(self, "secondaries")

    @property
    @pulumi.getter
    def ttl(self) -> pulumi.Output[int]:
        """
        The SOA TTL.
        """
        return pulumi.get(self, "ttl")

    @property
    @pulumi.getter
    def zone(self) -> pulumi.Output[str]:
        """
        The domain name of the zone.
        """
        return pulumi.get(self, "zone")

    def translate_output_property(self, prop):
        return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

