"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.PeeredDnsDomain = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Allows management of a single peered DNS domain for an existing Google Cloud Platform project.
 *
 * When using Google Cloud DNS to manage internal DNS, create peered DNS domains to make your DNS available to services like Google Cloud Build.
 *
 * For more information see [the API](https://cloud.google.com/service-infrastructure/docs/service-networking/reference/rest/v1/services.projects.global.networks.peeredDnsDomains)
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const name = new gcp.servicenetworking.PeeredDnsDomain("name", {
 *     project: "10000000",
 *     name: "example-com",
 *     network: "default",
 *     dnsSuffix: "example.com.",
 *     service: "peering-service",
 * });
 * ```
 *
 * ## Import
 *
 * Project peered DNS domains can be imported using the `service`, `project`, `network` and `name`, where:
 *
 * - `service` is the service connection, defaults to `servicenetworking.googleapis.com`.
 *
 * - `project` is the producer project name.
 *
 * - `network` is the consumer network name.
 *
 * - `name` is the name of your peered DNS domain.
 *
 * * `services/{service}/projects/{project}/global/networks/{network}/peeredDnsDomains/{name}`
 *
 * When using the `pulumi import` command, project peered DNS domains can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:servicenetworking/peeredDnsDomain:PeeredDnsDomain default services/{service}/projects/{project}/global/networks/{network}/peeredDnsDomains/{name}
 * ```
 */
class PeeredDnsDomain extends pulumi.CustomResource {
    /**
     * Get an existing PeeredDnsDomain 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 PeeredDnsDomain(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of PeeredDnsDomain.  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'] === PeeredDnsDomain.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["dnsSuffix"] = state?.dnsSuffix;
            resourceInputs["name"] = state?.name;
            resourceInputs["network"] = state?.network;
            resourceInputs["parent"] = state?.parent;
            resourceInputs["project"] = state?.project;
            resourceInputs["service"] = state?.service;
        }
        else {
            const args = argsOrState;
            if (args?.dnsSuffix === undefined && !opts.urn) {
                throw new Error("Missing required property 'dnsSuffix'");
            }
            if (args?.network === undefined && !opts.urn) {
                throw new Error("Missing required property 'network'");
            }
            resourceInputs["dnsSuffix"] = args?.dnsSuffix;
            resourceInputs["name"] = args?.name;
            resourceInputs["network"] = args?.network;
            resourceInputs["project"] = args?.project;
            resourceInputs["service"] = args?.service;
            resourceInputs["parent"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(PeeredDnsDomain.__pulumiType, name, resourceInputs, opts);
    }
}
exports.PeeredDnsDomain = PeeredDnsDomain;
/** @internal */
PeeredDnsDomain.__pulumiType = 'gcp:servicenetworking/peeredDnsDomain:PeeredDnsDomain';
//# sourceMappingURL=peeredDnsDomain.js.map