"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.NetworkFirewallPolicyPacketMirroringRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a packet mirroring rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (mirror or do_not_mirror).
 *
 * To get more information about NetworkFirewallPolicyPacketMirroringRule, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/networkFirewallPolicies/addPacketMirroringRule)
 *
 * ## Example Usage
 *
 * ### Compute Network Firewall Policy Packet Mirroring Rule
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const project = gcp.organizations.getProject({});
 * const _default = new gcp.compute.Network("default", {
 *     name: "fw-network",
 *     autoCreateSubnetworks: false,
 * });
 * const basicNetworkFirewallPolicy = new gcp.compute.NetworkFirewallPolicy("basic_network_firewall_policy", {
 *     name: "fw-policy",
 *     description: "Sample global network firewall policy",
 *     project: "my-project-name",
 * });
 * const defaultMirroringDeploymentGroup = new gcp.networksecurity.MirroringDeploymentGroup("default", {
 *     mirroringDeploymentGroupId: "deployment-group",
 *     location: "global",
 *     network: _default.id,
 * });
 * const defaultMirroringEndpointGroup = new gcp.networksecurity.MirroringEndpointGroup("default", {
 *     mirroringEndpointGroupId: "endpoint-group",
 *     location: "global",
 *     mirroringDeploymentGroup: defaultMirroringDeploymentGroup.id,
 * });
 * const defaultSecurityProfile = new gcp.networksecurity.SecurityProfile("default", {
 *     name: "sec-profile",
 *     parent: "organizations/123456789",
 *     description: "my description",
 *     type: "CUSTOM_MIRRORING",
 *     customMirroringProfile: {
 *         mirroringEndpointGroup: defaultMirroringEndpointGroup.id,
 *     },
 * });
 * const securityProfileGroup1 = new gcp.networksecurity.SecurityProfileGroup("security_profile_group_1", {
 *     name: "sec-profile-group",
 *     parent: "organizations/123456789",
 *     description: "my description",
 *     customMirroringProfile: defaultSecurityProfile.id,
 * });
 * const secureTagKey1 = new gcp.tags.TagKey("secure_tag_key_1", {
 *     description: "Test tag key description",
 *     parent: "organizations/123456789",
 *     purpose: "GCE_FIREWALL",
 *     shortName: "tag-key",
 *     purposeData: {
 *         network: pulumi.interpolate`my-project-name/${_default.name}`,
 *     },
 * });
 * const secureTagValue1 = new gcp.tags.TagValue("secure_tag_value_1", {
 *     description: "Test tag value description.",
 *     parent: secureTagKey1.id,
 *     shortName: "tag-value",
 * });
 * const primary = new gcp.compute.NetworkFirewallPolicyPacketMirroringRule("primary", {
 *     action: "mirror",
 *     description: "This is a simple packet mirroring rule description",
 *     direction: "INGRESS",
 *     disabled: false,
 *     firewallPolicy: basicNetworkFirewallPolicy.name,
 *     priority: 1000,
 *     ruleName: "test-rule",
 *     match: {
 *         srcIpRanges: ["10.100.0.1/32"],
 *         layer4Configs: [{
 *             ipProtocol: "all",
 *         }],
 *     },
 *     securityProfileGroup: pulumi.interpolate`//networksecurity.googleapis.com/${securityProfileGroup1.id}`,
 *     targetSecureTags: [{
 *         name: pulumi.interpolate`tagValues/${secureTagValue1.name}`,
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * NetworkFirewallPolicyPacketMirroringRule can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/packetMirroringRules/{{priority}}`
 *
 * * `{{project}}/{{firewall_policy}}/{{priority}}`
 *
 * * `{{firewall_policy}}/{{priority}}`
 *
 * When using the `pulumi import` command, NetworkFirewallPolicyPacketMirroringRule can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/networkFirewallPolicyPacketMirroringRule:NetworkFirewallPolicyPacketMirroringRule default projects/{{project}}/global/firewallPolicies/{{firewall_policy}}/packetMirroringRules/{{priority}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/networkFirewallPolicyPacketMirroringRule:NetworkFirewallPolicyPacketMirroringRule default {{project}}/{{firewall_policy}}/{{priority}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/networkFirewallPolicyPacketMirroringRule:NetworkFirewallPolicyPacketMirroringRule default {{firewall_policy}}/{{priority}}
 * ```
 */
class NetworkFirewallPolicyPacketMirroringRule extends pulumi.CustomResource {
    /**
     * Get an existing NetworkFirewallPolicyPacketMirroringRule 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 NetworkFirewallPolicyPacketMirroringRule(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of NetworkFirewallPolicyPacketMirroringRule.  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'] === NetworkFirewallPolicyPacketMirroringRule.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["action"] = state?.action;
            resourceInputs["creationTimestamp"] = state?.creationTimestamp;
            resourceInputs["description"] = state?.description;
            resourceInputs["direction"] = state?.direction;
            resourceInputs["disabled"] = state?.disabled;
            resourceInputs["firewallPolicy"] = state?.firewallPolicy;
            resourceInputs["kind"] = state?.kind;
            resourceInputs["match"] = state?.match;
            resourceInputs["priority"] = state?.priority;
            resourceInputs["project"] = state?.project;
            resourceInputs["ruleName"] = state?.ruleName;
            resourceInputs["ruleTupleCount"] = state?.ruleTupleCount;
            resourceInputs["securityProfileGroup"] = state?.securityProfileGroup;
            resourceInputs["targetSecureTags"] = state?.targetSecureTags;
            resourceInputs["tlsInspect"] = state?.tlsInspect;
        }
        else {
            const args = argsOrState;
            if (args?.action === undefined && !opts.urn) {
                throw new Error("Missing required property 'action'");
            }
            if (args?.direction === undefined && !opts.urn) {
                throw new Error("Missing required property 'direction'");
            }
            if (args?.firewallPolicy === undefined && !opts.urn) {
                throw new Error("Missing required property 'firewallPolicy'");
            }
            if (args?.match === undefined && !opts.urn) {
                throw new Error("Missing required property 'match'");
            }
            if (args?.priority === undefined && !opts.urn) {
                throw new Error("Missing required property 'priority'");
            }
            resourceInputs["action"] = args?.action;
            resourceInputs["description"] = args?.description;
            resourceInputs["direction"] = args?.direction;
            resourceInputs["disabled"] = args?.disabled;
            resourceInputs["firewallPolicy"] = args?.firewallPolicy;
            resourceInputs["match"] = args?.match;
            resourceInputs["priority"] = args?.priority;
            resourceInputs["project"] = args?.project;
            resourceInputs["ruleName"] = args?.ruleName;
            resourceInputs["securityProfileGroup"] = args?.securityProfileGroup;
            resourceInputs["targetSecureTags"] = args?.targetSecureTags;
            resourceInputs["tlsInspect"] = args?.tlsInspect;
            resourceInputs["creationTimestamp"] = undefined /*out*/;
            resourceInputs["kind"] = undefined /*out*/;
            resourceInputs["ruleTupleCount"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(NetworkFirewallPolicyPacketMirroringRule.__pulumiType, name, resourceInputs, opts);
    }
}
exports.NetworkFirewallPolicyPacketMirroringRule = NetworkFirewallPolicyPacketMirroringRule;
/** @internal */
NetworkFirewallPolicyPacketMirroringRule.__pulumiType = 'gcp:compute/networkFirewallPolicyPacketMirroringRule:NetworkFirewallPolicyPacketMirroringRule';
//# sourceMappingURL=networkFirewallPolicyPacketMirroringRule.js.map