"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.NetworkPeeringRoutesConfig = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Manage a network peering's route settings without managing the peering as
 * a whole. This resource is primarily intended for use with GCP-generated
 * peerings that shouldn't otherwise be managed by other tools. Deleting this
 * resource is a no-op and the peering will not be modified.
 *
 * To get more information about NetworkPeeringRoutesConfig, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/networks/updatePeering)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/vpc/docs/vpc-peering)
 *
 * ## Example Usage
 *
 * ### Network Peering Routes Config Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const networkPrimary = new gcp.compute.Network("network_primary", {
 *     name: "primary-network",
 *     autoCreateSubnetworks: false,
 * });
 * const networkSecondary = new gcp.compute.Network("network_secondary", {
 *     name: "secondary-network",
 *     autoCreateSubnetworks: false,
 * });
 * const peeringPrimary = new gcp.compute.NetworkPeering("peering_primary", {
 *     name: "primary-peering",
 *     network: networkPrimary.id,
 *     peerNetwork: networkSecondary.id,
 *     importCustomRoutes: true,
 *     exportCustomRoutes: true,
 *     importSubnetRoutesWithPublicIp: true,
 *     exportSubnetRoutesWithPublicIp: true,
 * });
 * const peeringPrimaryRoutes = new gcp.compute.NetworkPeeringRoutesConfig("peering_primary_routes", {
 *     peering: peeringPrimary.name,
 *     network: networkPrimary.name,
 *     importCustomRoutes: true,
 *     exportCustomRoutes: true,
 *     importSubnetRoutesWithPublicIp: true,
 *     exportSubnetRoutesWithPublicIp: true,
 * });
 * const peeringSecondary = new gcp.compute.NetworkPeering("peering_secondary", {
 *     name: "secondary-peering",
 *     network: networkSecondary.id,
 *     peerNetwork: networkPrimary.id,
 * });
 * ```
 *
 * ## Import
 *
 * NetworkPeeringRoutesConfig can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/global/networks/{{network}}/networkPeerings/{{peering}}`
 *
 * * `{{project}}/{{network}}/{{peering}}`
 *
 * * `{{network}}/{{peering}}`
 *
 * When using the `pulumi import` command, NetworkPeeringRoutesConfig can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/networkPeeringRoutesConfig:NetworkPeeringRoutesConfig default projects/{{project}}/global/networks/{{network}}/networkPeerings/{{peering}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/networkPeeringRoutesConfig:NetworkPeeringRoutesConfig default {{project}}/{{network}}/{{peering}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/networkPeeringRoutesConfig:NetworkPeeringRoutesConfig default {{network}}/{{peering}}
 * ```
 */
class NetworkPeeringRoutesConfig extends pulumi.CustomResource {
    /**
     * Get an existing NetworkPeeringRoutesConfig 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 NetworkPeeringRoutesConfig(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of NetworkPeeringRoutesConfig.  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'] === NetworkPeeringRoutesConfig.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["exportCustomRoutes"] = state?.exportCustomRoutes;
            resourceInputs["exportSubnetRoutesWithPublicIp"] = state?.exportSubnetRoutesWithPublicIp;
            resourceInputs["importCustomRoutes"] = state?.importCustomRoutes;
            resourceInputs["importSubnetRoutesWithPublicIp"] = state?.importSubnetRoutesWithPublicIp;
            resourceInputs["network"] = state?.network;
            resourceInputs["peering"] = state?.peering;
            resourceInputs["project"] = state?.project;
        }
        else {
            const args = argsOrState;
            if (args?.exportCustomRoutes === undefined && !opts.urn) {
                throw new Error("Missing required property 'exportCustomRoutes'");
            }
            if (args?.importCustomRoutes === undefined && !opts.urn) {
                throw new Error("Missing required property 'importCustomRoutes'");
            }
            if (args?.network === undefined && !opts.urn) {
                throw new Error("Missing required property 'network'");
            }
            if (args?.peering === undefined && !opts.urn) {
                throw new Error("Missing required property 'peering'");
            }
            resourceInputs["exportCustomRoutes"] = args?.exportCustomRoutes;
            resourceInputs["exportSubnetRoutesWithPublicIp"] = args?.exportSubnetRoutesWithPublicIp;
            resourceInputs["importCustomRoutes"] = args?.importCustomRoutes;
            resourceInputs["importSubnetRoutesWithPublicIp"] = args?.importSubnetRoutesWithPublicIp;
            resourceInputs["network"] = args?.network;
            resourceInputs["peering"] = args?.peering;
            resourceInputs["project"] = args?.project;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(NetworkPeeringRoutesConfig.__pulumiType, name, resourceInputs, opts);
    }
}
exports.NetworkPeeringRoutesConfig = NetworkPeeringRoutesConfig;
/** @internal */
NetworkPeeringRoutesConfig.__pulumiType = 'gcp:compute/networkPeeringRoutesConfig:NetworkPeeringRoutesConfig';
//# sourceMappingURL=networkPeeringRoutesConfig.js.map