"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.ResponsePolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A Response Policy is a collection of selectors that apply to queries
 * made against one or more Virtual Private Cloud networks.
 *
 * ## Example Usage
 *
 * ### Dns Response Policy Basic
 *
 * ```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 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 example_response_policy = new gcp.dns.ResponsePolicy("example-response-policy", {
 *     responsePolicyName: "example-response-policy",
 *     networks: [
 *         {
 *             networkUrl: network_1.id,
 *         },
 *         {
 *             networkUrl: network_2.id,
 *         },
 *     ],
 *     gkeClusters: [{
 *         gkeClusterName: cluster_1.id,
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * ResponsePolicy can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/responsePolicies/{{response_policy_name}}`
 *
 * * `{{project}}/{{response_policy_name}}`
 *
 * * `{{response_policy_name}}`
 *
 * When using the `pulumi import` command, ResponsePolicy can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:dns/responsePolicy:ResponsePolicy default projects/{{project}}/responsePolicies/{{response_policy_name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dns/responsePolicy:ResponsePolicy default {{project}}/{{response_policy_name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:dns/responsePolicy:ResponsePolicy default {{response_policy_name}}
 * ```
 */
class ResponsePolicy extends pulumi.CustomResource {
    /**
     * Get an existing ResponsePolicy 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 ResponsePolicy(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of ResponsePolicy.  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'] === ResponsePolicy.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["description"] = state?.description;
            resourceInputs["gkeClusters"] = state?.gkeClusters;
            resourceInputs["networks"] = state?.networks;
            resourceInputs["project"] = state?.project;
            resourceInputs["responsePolicyName"] = state?.responsePolicyName;
        }
        else {
            const args = argsOrState;
            if (args?.responsePolicyName === undefined && !opts.urn) {
                throw new Error("Missing required property 'responsePolicyName'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["gkeClusters"] = args?.gkeClusters;
            resourceInputs["networks"] = args?.networks;
            resourceInputs["project"] = args?.project;
            resourceInputs["responsePolicyName"] = args?.responsePolicyName;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ResponsePolicy.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ResponsePolicy = ResponsePolicy;
/** @internal */
ResponsePolicy.__pulumiType = 'gcp:dns/responsePolicy:ResponsePolicy';
//# sourceMappingURL=responsePolicy.js.map