"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.FirewallRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * A single firewall rule that is evaluated against incoming traffic
 * and provides an action to take on matched requests.
 *
 * To get more information about FirewallRule, see:
 *
 * * [API documentation](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.firewall.ingressRules)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/appengine/docs/standard/python/creating-firewalls#creating_firewall_rules)
 *
 * ## Example Usage
 *
 * ### App Engine Firewall Rule Basic
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 *
 * const myProject = new gcp.organizations.Project("my_project", {
 *     name: "tf-test-project",
 *     projectId: "ae-project",
 *     orgId: "123456789",
 *     billingAccount: "000000-0000000-0000000-000000",
 *     deletionPolicy: "DELETE",
 * });
 * const app = new gcp.appengine.Application("app", {
 *     project: myProject.projectId,
 *     locationId: "us-central",
 * });
 * const rule = new gcp.appengine.FirewallRule("rule", {
 *     project: app.project,
 *     priority: 1000,
 *     action: "ALLOW",
 *     sourceRange: "*",
 * });
 * ```
 *
 * ## Import
 *
 * FirewallRule can be imported using any of these accepted formats:
 *
 * * `apps/{{project}}/firewall/ingressRules/{{priority}}`
 *
 * * `{{project}}/{{priority}}`
 *
 * * `{{priority}}`
 *
 * When using the `pulumi import` command, FirewallRule can be imported using one of the formats above. For example:
 *
 * ```sh
 * $ pulumi import gcp:appengine/firewallRule:FirewallRule default apps/{{project}}/firewall/ingressRules/{{priority}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:appengine/firewallRule:FirewallRule default {{project}}/{{priority}}
 * ```
 *
 * ```sh
 * $ pulumi import gcp:appengine/firewallRule:FirewallRule default {{priority}}
 * ```
 */
class FirewallRule extends pulumi.CustomResource {
    /**
     * Get an existing FirewallRule 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 FirewallRule(name, state, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of FirewallRule.  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'] === FirewallRule.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["action"] = state?.action;
            resourceInputs["description"] = state?.description;
            resourceInputs["priority"] = state?.priority;
            resourceInputs["project"] = state?.project;
            resourceInputs["sourceRange"] = state?.sourceRange;
        }
        else {
            const args = argsOrState;
            if (args?.action === undefined && !opts.urn) {
                throw new Error("Missing required property 'action'");
            }
            if (args?.sourceRange === undefined && !opts.urn) {
                throw new Error("Missing required property 'sourceRange'");
            }
            resourceInputs["action"] = args?.action;
            resourceInputs["description"] = args?.description;
            resourceInputs["priority"] = args?.priority;
            resourceInputs["project"] = args?.project;
            resourceInputs["sourceRange"] = args?.sourceRange;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(FirewallRule.__pulumiType, name, resourceInputs, opts);
    }
}
exports.FirewallRule = FirewallRule;
/** @internal */
FirewallRule.__pulumiType = 'gcp:appengine/firewallRule:FirewallRule';
//# sourceMappingURL=firewallRule.js.map