"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.RegionNetworkFirewallPolicyRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a rule that describes one or more match conditions along with the action to be taken when traffic matches this condition (allow or deny).
 *
 * To get more information about RegionNetworkFirewallPolicyRule, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/regionNetworkFirewallPolicies/addRule)
 *
 * ## Example Usage
 *
 * ### Region Network Firewall Policy Rule
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const basicRegionalNetworksecurityAddressGroup = new gcp.networksecurity.AddressGroup("basic_regional_networksecurity_address_group", {
 *     name: "address-group",
 *     parent: "projects/my-project-name",
 *     description: "Sample regional networksecurity_address_group",
 *     location: "us-west1",
 *     items: ["208.80.154.224/32"],
 *     type: "IPV4",
 *     capacity: 100,
 * });
 * const basicRegionalNetworkFirewallPolicy = new gcp.compute.RegionNetworkFirewallPolicy("basic_regional_network_firewall_policy", {
 *     name: "fw-policy",
 *     description: "Sample regional network firewall policy",
 *     project: "my-project-name",
 *     region: "us-west1",
 * });
 * const basicNetwork = new gcp.compute.Network("basic_network", {name: "network"});
 * const basicKey = new gcp.tags.TagKey("basic_key", {
 *     description: "For keyname resources.",
 *     parent: "organizations/123456789",
 *     purpose: "GCE_FIREWALL",
 *     shortName: "tag-key",
 *     purposeData: {
 *         network: pulumi.interpolate`my-project-name/${basicNetwork.name}`,
 *     },
 * });
 * const basicValue = new gcp.tags.TagValue("basic_value", {
 *     description: "For valuename resources.",
 *     parent: basicKey.id,
 *     shortName: "tag-value",
 * });
 * const primary = new gcp.compute.RegionNetworkFirewallPolicyRule("primary", {
 *     action: "allow",
 *     description: "This is a simple rule description",
 *     direction: "INGRESS",
 *     disabled: false,
 *     enableLogging: true,
 *     firewallPolicy: basicRegionalNetworkFirewallPolicy.name,
 *     priority: 1000,
 *     region: "us-west1",
 *     ruleName: "test-rule",
 *     targetServiceAccounts: ["my@service-account.com"],
 *     match: {
 *         srcAddressGroups: [basicRegionalNetworksecurityAddressGroup.id],
 *         srcIpRanges: ["10.100.0.1/32"],
 *         srcFqdns: ["example.com"],
 *         srcRegionCodes: ["US"],
 *         srcThreatIntelligences: ["iplist-known-malicious-ips"],
 *         layer4Configs: [{
 *             ipProtocol: "all",
 *         }],
 *         srcSecureTags: [{
 *             name: basicValue.id,
 *         }],
 *     },
 * });
 * ```
 * ### Region Network Firewall Policy Rule Network Scope Egress
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const basicRegionalNetworkFirewallPolicy = new gcp.compute.RegionNetworkFirewallPolicy("basic_regional_network_firewall_policy", {
 *     name: "fw-policy",
 *     description: "Sample regional network firewall policy",
 *     project: "my-project-name",
 *     region: "us-west1",
 * });
 * const primary = new gcp.compute.RegionNetworkFirewallPolicyRule("primary", {
 *     action: "allow",
 *     description: "This is a simple rule description",
 *     direction: "EGRESS",
 *     disabled: false,
 *     enableLogging: true,
 *     firewallPolicy: basicRegionalNetworkFirewallPolicy.name,
 *     priority: 1000,
 *     region: "us-west1",
 *     ruleName: "test-rule",
 *     match: {
 *         destIpRanges: ["10.100.0.1/32"],
 *         destNetworkScope: "INTERNET",
 *         layer4Configs: [{
 *             ipProtocol: "all",
 *         }],
 *     },
 * });
 * ```
 * ### Region Network Firewall Policy Rule Network Scope Ingress
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const basicRegionalNetworkFirewallPolicy = new gcp.compute.RegionNetworkFirewallPolicy("basic_regional_network_firewall_policy", {
 *     name: "fw-policy",
 *     description: "Sample regional network firewall policy",
 *     project: "my-project-name",
 *     region: "us-west1",
 * });
 * const network = new gcp.compute.Network("network", {name: "network"});
 * const primary = new gcp.compute.RegionNetworkFirewallPolicyRule("primary", {
 *     action: "allow",
 *     description: "This is a simple rule description",
 *     direction: "INGRESS",
 *     disabled: false,
 *     enableLogging: true,
 *     firewallPolicy: basicRegionalNetworkFirewallPolicy.name,
 *     priority: 1000,
 *     region: "us-west1",
 *     ruleName: "test-rule",
 *     match: {
 *         srcIpRanges: ["10.100.0.1/32"],
 *         srcNetworkScope: "VPC_NETWORKS",
 *         srcNetworks: [network.id],
 *         layer4Configs: [{
 *             ipProtocol: "all",
 *         }],
 *     },
 * });
 * ```
 *
 * ## Import
 *
 * RegionNetworkFirewallPolicyRule can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/{{priority}}`
 *
 * * `{{project}}/{{region}}/{{firewall_policy}}/{{priority}}`
 *
 * * `{{region}}/{{firewall_policy}}/{{priority}}`
 *
 * * `{{firewall_policy}}/{{priority}}`
 *
 * When using the `pulumi import` command, RegionNetworkFirewallPolicyRule can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule default projects/{{project}}/regions/{{region}}/firewallPolicies/{{firewall_policy}}/{{priority}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule default {{project}}/{{region}}/{{firewall_policy}}/{{priority}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule default {{region}}/{{firewall_policy}}/{{priority}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule default {{firewall_policy}}/{{priority}}
 * ```
 */
class RegionNetworkFirewallPolicyRule extends pulumi.CustomResource {
    /**
     * Get an existing RegionNetworkFirewallPolicyRule 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 RegionNetworkFirewallPolicyRule(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of RegionNetworkFirewallPolicyRule.  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'] === RegionNetworkFirewallPolicyRule.__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["enableLogging"] = state?.enableLogging;
            resourceInputs["firewallPolicy"] = state?.firewallPolicy;
            resourceInputs["kind"] = state?.kind;
            resourceInputs["match"] = state?.match;
            resourceInputs["priority"] = state?.priority;
            resourceInputs["project"] = state?.project;
            resourceInputs["region"] = state?.region;
            resourceInputs["ruleName"] = state?.ruleName;
            resourceInputs["ruleTupleCount"] = state?.ruleTupleCount;
            resourceInputs["securityProfileGroup"] = state?.securityProfileGroup;
            resourceInputs["targetSecureTags"] = state?.targetSecureTags;
            resourceInputs["targetServiceAccounts"] = state?.targetServiceAccounts;
            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["enableLogging"] = args?.enableLogging;
            resourceInputs["firewallPolicy"] = args?.firewallPolicy;
            resourceInputs["match"] = args?.match;
            resourceInputs["priority"] = args?.priority;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["ruleName"] = args?.ruleName;
            resourceInputs["securityProfileGroup"] = args?.securityProfileGroup;
            resourceInputs["targetSecureTags"] = args?.targetSecureTags;
            resourceInputs["targetServiceAccounts"] = args?.targetServiceAccounts;
            resourceInputs["tlsInspect"] = args?.tlsInspect;
            resourceInputs["creationTimestamp"] = undefined /*out*/;
            resourceInputs["kind"] = undefined /*out*/;
            resourceInputs["ruleTupleCount"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RegionNetworkFirewallPolicyRule.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RegionNetworkFirewallPolicyRule = RegionNetworkFirewallPolicyRule;
/** @internal */
RegionNetworkFirewallPolicyRule.__pulumiType = 'gcp:compute/regionNetworkFirewallPolicyRule:RegionNetworkFirewallPolicyRule';
//# sourceMappingURL=regionNetworkFirewallPolicyRule.js.map