"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ManagedZone = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A zone is a subtree of the DNS namespace under one administrative
 * responsibility. A ManagedZone is a resource that represents a DNS zone
 * hosted by the Cloud DNS service.
 *
 * To get more information about ManagedZone, see:
 *
 * * [API documentation](https://cloud.google.com/dns/api/v1/managedZones)
 * * How-to Guides
 *     * [Managing Zones](https://cloud.google.com/dns/zones/)
 *
 * ## Example Usage
 *
 * ### Dns Managed Zone Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const example_zone = new gcp.dns.ManagedZone("example-zone", {
 *     name: "example-zone",
 *     dnsName: "my-domain.com.",
 *     description: "Example DNS zone",
 *     labels: {
 *         foo: "bar",
 *     },
 * });
 * ```
 * ### Dns Managed Zone Private
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const network_1 = new gcp.compute.Network("network-1", {
 *     name: "network-1",
 *     autoCreateSubnetworks: false,
 * });
 * const network_2 = new gcp.compute.Network("network-2", {
 *     name: "network-2",
 *     autoCreateSubnetworks: false,
 * });
 * const private_zone = new gcp.dns.ManagedZone("private-zone", {
 *     name: "private-zone",
 *     dnsName: "private.example.com.",
 *     description: "Example private DNS zone",
 *     labels: {
 *         foo: "bar",
 *     },
 *     visibility: "private",
 *     privateVisibilityConfig: {
 *         networks: [
 *             {
 *                 networkUrl: network_1.id,
 *             },
 *             {
 *                 networkUrl: network_2.id,
 *             },
 *         ],
 *     },
 * });
 * ```
 * ### Dns Managed Zone Private Forwarding
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const network_1 = new gcp.compute.Network("network-1", {
 *     name: "network-1",
 *     autoCreateSubnetworks: false,
 * });
 * const network_2 = new gcp.compute.Network("network-2", {
 *     name: "network-2",
 *     autoCreateSubnetworks: false,
 * });
 * const private_zone = new gcp.dns.ManagedZone("private-zone", {
 *     name: "private-zone",
 *     dnsName: "private.example.com.",
 *     description: "Example private DNS zone",
 *     labels: {
 *         foo: "bar",
 *     },
 *     visibility: "private",
 *     privateVisibilityConfig: {
 *         networks: [
 *             {
 *                 networkUrl: network_1.id,
 *             },
 *             {
 *                 networkUrl: network_2.id,
 *             },
 *         ],
 *     },
 *     forwardingConfig: {
 *         targetNameServers: [
 *             {
 *                 ipv4Address: "172.16.1.10",
 *             },
 *             {
 *                 ipv4Address: "172.16.1.20",
 *             },
 *         ],
 *     },
 * });
 * ```
 * ### Dns Managed Zone Private Gke
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const network_1 = new gcp.compute.Network("network-1", {
 *     name: "network-1",
 *     autoCreateSubnetworks: false,
 * });
 * const subnetwork_1 = new gcp.compute.Subnetwork("subnetwork-1", {
 *     name: network_1.name,
 *     network: network_1.name,
 *     ipCidrRange: "10.0.36.0/24",
 *     region: "us-central1",
 *     privateIpGoogleAccess: true,
 *     secondaryIpRanges: [
 *         {
 *             rangeName: "pod",
 *             ipCidrRange: "10.0.0.0/19",
 *         },
 *         {
 *             rangeName: "svc",
 *             ipCidrRange: "10.0.32.0/22",
 *         },
 *     ],
 * });
 * const cluster_1 = new gcp.container.Cluster("cluster-1", {
 *     name: "cluster-1",
 *     location: "us-central1-c",
 *     initialNodeCount: 1,
 *     networkingMode: "VPC_NATIVE",
 *     defaultSnatStatus: {
 *         disabled: true,
 *     },
 *     network: network_1.name,
 *     subnetwork: subnetwork_1.name,
 *     privateClusterConfig: {
 *         enablePrivateEndpoint: true,
 *         enablePrivateNodes: true,
 *         masterIpv4CidrBlock: "10.42.0.0/28",
 *         masterGlobalAccessConfig: {
 *             enabled: true,
 *         },
 *     },
 *     masterAuthorizedNetworksConfig: {},
 *     ipAllocationPolicy: {
 *         clusterSecondaryRangeName: subnetwork_1.secondaryIpRanges.apply(secondaryIpRanges => secondaryIpRanges[0].rangeName),
 *         servicesSecondaryRangeName: subnetwork_1.secondaryIpRanges.apply(secondaryIpRanges => secondaryIpRanges[1].rangeName),
 *     },
 *     deletionProtection: true,
 * });
 * const private_zone_gke = new gcp.dns.ManagedZone("private-zone-gke", {
 *     name: "private-zone",
 *     dnsName: "private.example.com.",
 *     description: "Example private DNS zone",
 *     labels: {
 *         foo: "bar",
 *     },
 *     visibility: "private",
 *     privateVisibilityConfig: {
 *         gkeClusters: [{
 *             gkeClusterName: cluster_1.id,
 *         }],
 *     },
 * });
 * ```
 * ### Dns Managed Zone Private Peering
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const network_source = new gcp.compute.Network("network-source", {
 *     name: "network-source",
 *     autoCreateSubnetworks: false,
 * });
 * const network_target = new gcp.compute.Network("network-target", {
 *     name: "network-target",
 *     autoCreateSubnetworks: false,
 * });
 * const peering_zone = new gcp.dns.ManagedZone("peering-zone", {
 *     name: "peering-zone",
 *     dnsName: "peering.example.com.",
 *     description: "Example private DNS peering zone",
 *     visibility: "private",
 *     privateVisibilityConfig: {
 *         networks: [{
 *             networkUrl: network_source.id,
 *         }],
 *     },
 *     peeringConfig: {
 *         targetNetwork: {
 *             networkUrl: network_target.id,
 *         },
 *     },
 * });
 * ```
 * ### Dns Managed Zone Service Directory
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const example = new gcp.servicedirectory.Namespace("example", {
 *     namespaceId: "example",
 *     location: "us-central1",
 * });
 * const sd_zone = new gcp.dns.ManagedZone("sd-zone", {
 *     name: "peering-zone",
 *     dnsName: "services.example.com.",
 *     description: "Example private DNS Service Directory zone",
 *     visibility: "private",
 *     serviceDirectoryConfig: {
 *         namespace: {
 *             namespaceUrl: example.id,
 *         },
 *     },
 * });
 * const network = new gcp.compute.Network("network", {
 *     name: "network",
 *     autoCreateSubnetworks: false,
 * });
 * ```
 * ### Dns Managed Zone Cloud Logging
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const cloud_logging_enabled_zone = new gcp.dns.ManagedZone("cloud-logging-enabled-zone", {
 *     name: "cloud-logging-enabled-zone",
 *     dnsName: "services.example.com.",
 *     description: "Example cloud logging enabled DNS zone",
 *     labels: {
 *         foo: "bar",
 *     },
 *     cloudLoggingConfig: {
 *         enableLogging: true,
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * ManagedZone can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/managedZones/{{name}}`
 *
 * * `{{project}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, ManagedZone can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:dns/managedZone:ManagedZone default projects/{{project}}/managedZones/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dns/managedZone:ManagedZone default {{project}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dns/managedZone:ManagedZone default {{name}}
 * ```
 */
class ManagedZone extends pulumi.CustomResource {
    /**
     * Get an existing ManagedZone resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new ManagedZone(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ManagedZone.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === ManagedZone.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["cloudLoggingConfig"] = state?.cloudLoggingConfig;
            resourceInputs["creationTime"] = state?.creationTime;
            resourceInputs["description"] = state?.description;
            resourceInputs["dnsName"] = state?.dnsName;
            resourceInputs["dnssecConfig"] = state?.dnssecConfig;
            resourceInputs["effectiveLabels"] = state?.effectiveLabels;
            resourceInputs["forceDestroy"] = state?.forceDestroy;
            resourceInputs["forwardingConfig"] = state?.forwardingConfig;
            resourceInputs["labels"] = state?.labels;
            resourceInputs["managedZoneId"] = state?.managedZoneId;
            resourceInputs["name"] = state?.name;
            resourceInputs["nameServers"] = state?.nameServers;
            resourceInputs["peeringConfig"] = state?.peeringConfig;
            resourceInputs["privateVisibilityConfig"] = state?.privateVisibilityConfig;
            resourceInputs["project"] = state?.project;
            resourceInputs["pulumiLabels"] = state?.pulumiLabels;
            resourceInputs["reverseLookup"] = state?.reverseLookup;
            resourceInputs["serviceDirectoryConfig"] = state?.serviceDirectoryConfig;
            resourceInputs["visibility"] = state?.visibility;
        }
        else {
            const args = argsOrState;
            if (args?.dnsName === undefined && !opts.urn) {
                throw new Error("Missing required property 'dnsName'");
            }
            resourceInputs["cloudLoggingConfig"] = args?.cloudLoggingConfig;
            resourceInputs["description"] = (args?.description) ?? "Managed by Pulumi";
            resourceInputs["dnsName"] = args?.dnsName;
            resourceInputs["dnssecConfig"] = args?.dnssecConfig;
            resourceInputs["forceDestroy"] = args?.forceDestroy;
            resourceInputs["forwardingConfig"] = args?.forwardingConfig;
            resourceInputs["labels"] = args?.labels;
            resourceInputs["name"] = args?.name;
            resourceInputs["peeringConfig"] = args?.peeringConfig;
            resourceInputs["privateVisibilityConfig"] = args?.privateVisibilityConfig;
            resourceInputs["project"] = args?.project;
            resourceInputs["reverseLookup"] = args?.reverseLookup;
            resourceInputs["serviceDirectoryConfig"] = args?.serviceDirectoryConfig;
            resourceInputs["visibility"] = args?.visibility;
            resourceInputs["creationTime"] = undefined /*out*/;
            resourceInputs["effectiveLabels"] = undefined /*out*/;
            resourceInputs["managedZoneId"] = undefined /*out*/;
            resourceInputs["nameServers"] = undefined /*out*/;
            resourceInputs["pulumiLabels"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const secretOpts = { additionalSecretOutputs: ["effectiveLabels", "pulumiLabels"] };
        opts = pulumi.mergeOptions(opts, secretOpts);
        super(ManagedZone.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ManagedZone = ManagedZone;
/** @internal */
ManagedZone.__pulumiType = 'gcp:dns/managedZone:ManagedZone';
//# sourceMappingURL=managedZone.js.map