"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.RegionSecurityPolicy = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * Represents a Region Cloud Armor Security Policy resource.
 *
 * To get more information about RegionSecurityPolicy, see:
 *
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/regionSecurityPolicies)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/armor/docs/security-policy-concepts)
 *
 * ## Example Usage
 *
 * ### Region Security Policy Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const region_sec_policy_basic = new gcp.compute.RegionSecurityPolicy("region-sec-policy-basic", {
 *     name: "my-sec-policy-basic",
 *     description: "basic region security policy",
 *     type: "CLOUD_ARMOR",
 * });
 * ```
 * ### Region Security Policy With Ddos Protection Config
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const region_sec_policy_ddos_protection = new gcp.compute.RegionSecurityPolicy("region-sec-policy-ddos-protection", {
 *     name: "my-sec-policy-ddos-protection",
 *     description: "with ddos protection config",
 *     type: "CLOUD_ARMOR_NETWORK",
 *     ddosProtectionConfig: {
 *         ddosProtection: "ADVANCED_PREVIEW",
 *     },
 * });
 * ```
 * ### Region Security Policy With User Defined Fields
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const region_sec_policy_user_defined_fields = new gcp.compute.RegionSecurityPolicy("region-sec-policy-user-defined-fields", {
 *     name: "my-sec-policy-user-defined-fields",
 *     description: "with user defined fields",
 *     type: "CLOUD_ARMOR_NETWORK",
 *     userDefinedFields: [
 *         {
 *             name: "SIG1_AT_0",
 *             base: "UDP",
 *             offset: 8,
 *             size: 2,
 *             mask: "0x8F00",
 *         },
 *         {
 *             name: "SIG2_AT_8",
 *             base: "UDP",
 *             offset: 16,
 *             size: 4,
 *             mask: "0xFFFFFFFF",
 *         },
 *     ],
 * });
 * ```
 * ### Region Security Policy With Rules
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const region_sec_policy_with_rules = new gcp.compute.RegionSecurityPolicy("region-sec-policy-with-rules", {
 *     name: "my-sec-policy-with-rules",
 *     description: "basic region security policy with multiple rules",
 *     type: "CLOUD_ARMOR",
 *     rules: [
 *         {
 *             action: "deny",
 *             priority: 1000,
 *             match: {
 *                 expr: {
 *                     expression: "request.path.matches(\"/login.html\") && token.recaptcha_session.score < 0.2",
 *                 },
 *             },
 *         },
 *         {
 *             action: "deny",
 *             priority: 2147483647,
 *             match: {
 *                 versionedExpr: "SRC_IPS_V1",
 *                 config: {
 *                     srcIpRanges: ["*"],
 *                 },
 *             },
 *             description: "default rule",
 *         },
 *     ],
 * });
 * ```
 *
 * ## Import
 *
 * RegionSecurityPolicy can be imported using any of these accepted formats:
 *
 * * `projects/{{project}}/regions/{{region}}/securityPolicies/{{name}}`
 *
 * * `{{project}}/{{region}}/{{name}}`
 *
 * * `{{region}}/{{name}}`
 *
 * * `{{name}}`
 *
 * When using the `pulumi import` command, RegionSecurityPolicy can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:compute/regionSecurityPolicy:RegionSecurityPolicy default projects/{{project}}/regions/{{region}}/securityPolicies/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionSecurityPolicy:RegionSecurityPolicy default {{project}}/{{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionSecurityPolicy:RegionSecurityPolicy default {{region}}/{{name}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:compute/regionSecurityPolicy:RegionSecurityPolicy default {{name}}
 * ```
 */
class RegionSecurityPolicy extends pulumi.CustomResource {
    /**
     * Get an existing RegionSecurityPolicy 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 RegionSecurityPolicy(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of RegionSecurityPolicy.  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'] === RegionSecurityPolicy.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["advancedOptionsConfig"] = state?.advancedOptionsConfig;
            resourceInputs["ddosProtectionConfig"] = state?.ddosProtectionConfig;
            resourceInputs["description"] = state?.description;
            resourceInputs["fingerprint"] = state?.fingerprint;
            resourceInputs["name"] = state?.name;
            resourceInputs["policyId"] = state?.policyId;
            resourceInputs["project"] = state?.project;
            resourceInputs["region"] = state?.region;
            resourceInputs["rules"] = state?.rules;
            resourceInputs["selfLink"] = state?.selfLink;
            resourceInputs["selfLinkWithPolicyId"] = state?.selfLinkWithPolicyId;
            resourceInputs["type"] = state?.type;
            resourceInputs["userDefinedFields"] = state?.userDefinedFields;
        }
        else {
            const args = argsOrState;
            resourceInputs["advancedOptionsConfig"] = args?.advancedOptionsConfig;
            resourceInputs["ddosProtectionConfig"] = args?.ddosProtectionConfig;
            resourceInputs["description"] = args?.description;
            resourceInputs["name"] = args?.name;
            resourceInputs["project"] = args?.project;
            resourceInputs["region"] = args?.region;
            resourceInputs["rules"] = args?.rules;
            resourceInputs["type"] = args?.type;
            resourceInputs["userDefinedFields"] = args?.userDefinedFields;
            resourceInputs["fingerprint"] = undefined /*out*/;
            resourceInputs["policyId"] = undefined /*out*/;
            resourceInputs["selfLink"] = undefined /*out*/;
            resourceInputs["selfLinkWithPolicyId"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RegionSecurityPolicy.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RegionSecurityPolicy = RegionSecurityPolicy;
/** @internal */
RegionSecurityPolicy.__pulumiType = 'gcp:compute/regionSecurityPolicy:RegionSecurityPolicy';
//# sourceMappingURL=regionSecurityPolicy.js.map