"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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RulesEngine = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * !> **Note:** This deploys an Azure Front Door (classic) resource which has been deprecated and will receive security updates only. Please migrate your existing Azure Front Door (classic) deployments to the new Azure Front Door (standard/premium) resources. For your convenience, the service team has exposed a `Front Door Classic` to `Front Door Standard/Premium` [migration tool](https://learn.microsoft.com/azure/frontdoor/tier-migration) to allow you to migrate your existing `Front Door Classic` instances to the new `Front Door Standard/Premium` product tiers.
 *
 * !> **Note:** The creation of new Azure Front Door (classic) resources is no longer supported following its deprecation on `April 1, 2025`. However, modifications to existing Azure Front Door (classic) resources will continue to be supported until the API reaches full retirement on `March 31, 2027`.
 *
 * Manages an Azure Front Door (classic) Rules Engine configuration and rules.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-rg",
 *     location: "West Europe",
 * });
 * const exampleFrontdoor = new azure.frontdoor.Frontdoor("example", {
 *     name: "example",
 *     resourceGroupName: example.name,
 *     backendPools: [{
 *         name: "exampleBackendBing",
 *         loadBalancingName: "exampleLoadBalancingSettings1",
 *         healthProbeName: "exampleHealthProbeSetting1",
 *         backends: [{
 *             hostHeader: "www.bing.com",
 *             address: "www.bing.com",
 *             httpPort: 80,
 *             httpsPort: 443,
 *         }],
 *     }],
 *     backendPoolHealthProbes: [{
 *         name: "exampleHealthProbeSetting1",
 *     }],
 *     backendPoolLoadBalancings: [{
 *         name: "exampleLoadBalancingSettings1",
 *     }],
 *     frontendEndpoints: [{
 *         name: "exampleFrontendEndpoint1",
 *         hostName: "example-FrontDoor.azurefd.net",
 *     }],
 *     routingRules: [{
 *         name: "exampleRoutingRule1",
 *         acceptedProtocols: [
 *             "Http",
 *             "Https",
 *         ],
 *         patternsToMatches: ["/*"],
 *         frontendEndpoints: ["exampleFrontendEndpoint1"],
 *     }],
 * });
 * const exampleRulesEngine = new azure.frontdoor.RulesEngine("example_rules_engine", {
 *     name: "exampleRulesEngineConfig1",
 *     frontdoorName: exampleFrontdoor.name,
 *     resourceGroupName: exampleFrontdoor.resourceGroupName,
 *     rules: [
 *         {
 *             name: "debuggingoutput",
 *             priority: 1,
 *             action: {
 *                 responseHeaders: [{
 *                     headerActionType: "Append",
 *                     headerName: "X-TEST-HEADER",
 *                     value: "Append Header Rule",
 *                 }],
 *             },
 *         },
 *         {
 *             name: "overwriteorigin",
 *             priority: 2,
 *             matchConditions: [{
 *                 variable: "RequestMethod",
 *                 operator: "Equal",
 *                 values: [
 *                     "GET",
 *                     "POST",
 *                 ],
 *             }],
 *             action: {
 *                 responseHeaders: [
 *                     {
 *                         headerActionType: "Overwrite",
 *                         headerName: "Access-Control-Allow-Origin",
 *                         value: "*",
 *                     },
 *                     {
 *                         headerActionType: "Overwrite",
 *                         headerName: "Access-Control-Allow-Credentials",
 *                         value: "true",
 *                     },
 *                 ],
 *             },
 *         },
 *     ],
 * });
 * ```
 *
 * ## Import
 *
 * Azure Front Door Rules Engine's can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:frontdoor/rulesEngine:RulesEngine example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.Network/frontdoors/frontdoor1/rulesEngines/rule1
 * ```
 */
class RulesEngine extends pulumi.CustomResource {
    /**
     * Get an existing RulesEngine 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 RulesEngine(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:frontdoor/rulesEngine:RulesEngine';
    /**
     * Returns true if the given object is an instance of RulesEngine.  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'] === RulesEngine.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["enabled"] = state?.enabled;
            resourceInputs["frontdoorName"] = state?.frontdoorName;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["rules"] = state?.rules;
        }
        else {
            const args = argsOrState;
            if (args?.frontdoorName === undefined && !opts.urn) {
                throw new Error("Missing required property 'frontdoorName'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            resourceInputs["enabled"] = args?.enabled;
            resourceInputs["frontdoorName"] = args?.frontdoorName;
            resourceInputs["name"] = args?.name;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["rules"] = args?.rules;
            resourceInputs["location"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(RulesEngine.__pulumiType, name, resourceInputs, opts);
    }
}
exports.RulesEngine = RulesEngine;
//# sourceMappingURL=rulesEngine.js.map