"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.RegionNetworkFirewallPolicyAssociation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * The Compute NetworkFirewallPolicyAssociation resource
 *
 * To get more information about RegionNetworkFirewallPolicyAssociation, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/regionNetworkFirewallPolicies/addAssociation)
 *
 * ## Example Usage
 *
 * ### Region Network Firewall Policy Association
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const policy = new gcp.compute.RegionNetworkFirewallPolicy("policy", {
 *     name: "my-policy",
 *     project: "my-project-name",
 *     description: "Sample global network firewall policy",
 *     region: "us-west1",
 * });
 * const network = new gcp.compute.Network("network", {
 *     name: "my-network",
 *     autoCreateSubnetworks: false,
 * });
 * const _default = new gcp.compute.RegionNetworkFirewallPolicyAssociation("default", {
 *     name: "my-association",
 *     project: "my-project-name",
 *     attachmentTarget: network.id,
 *     firewallPolicy: policy.id,
 *     region: "us-west1",
 * });
 * ```
 *
 * ## Import
 *
 * RegionNetworkFirewallPolicyAssociation can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/associations/{{name}}`
 *
 * * `{{project}}/{{region}}/{{firewall_policy}}/{{name}}`
 *
 * * `{{region}}/{{firewall_policy}}/{{name}}`
 *
 * * `{{project}}/{{firewall_policy}}/{{name}}`
 *
 * * `{{firewall_policy}}/{{name}}`
 *
 * When using the `pulumi import` command, RegionNetworkFirewallPolicyAssociation can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation default projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/associations/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation default {{project}}/{{region}}/{{firewall_policy}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation default {{region}}/{{firewall_policy}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation default {{project}}/{{firewall_policy}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation default {{firewall_policy}}/{{name}}
 * ```
 */
class RegionNetworkFirewallPolicyAssociation extends pulumi.CustomResource {
    /**
     * Get an existing RegionNetworkFirewallPolicyAssociation 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 RegionNetworkFirewallPolicyAssociation(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of RegionNetworkFirewallPolicyAssociation.  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'] === RegionNetworkFirewallPolicyAssociation.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["attachmentTarget"] = state?.attachmentTarget;
            resourceInputs["firewallPolicy"] = state?.firewallPolicy;
            resourceInputs["name"] = state?.name;
            resourceInputs["project"] = state?.project;
            resourceInputs["region"] = state?.region;
            resourceInputs["shortName"] = state?.shortName;
        }
        else {
            const args = argsOrState;
            if (args?.attachmentTarget === undefined && !opts.urn) {
                throw new Error("Missing required property 'attachmentTarget'");
            }
            if (args?.firewallPolicy === undefined && !opts.urn) {
                throw new Error("Missing required property 'firewallPolicy'");
            }
            resourceInputs["attachmentTarget"] = args?.attachmentTarget;
            resourceInputs["firewallPolicy"] = args?.firewallPolicy;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["shortName"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RegionNetworkFirewallPolicyAssociation.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RegionNetworkFirewallPolicyAssociation = RegionNetworkFirewallPolicyAssociation;
/** @internal */
RegionNetworkFirewallPolicyAssociation.__pulumiType = 'gcp:compute/regionNetworkFirewallPolicyAssociation:RegionNetworkFirewallPolicyAssociation';
//# sourceMappingURL=regionNetworkFirewallPolicyAssociation.js.map