"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.Frontdoor = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * !> **IMPORTANT** 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.
 *
 * Manages an Azure Front Door (classic) instance.
 *
 * Azure Front Door Service is Microsoft's highly available and scalable web application acceleration platform and global HTTP(S) load balancer. It provides built-in DDoS protection and application layer security and caching. Front Door enables you to build applications that maximize and automate high-availability and performance for your end-users. Use Front Door with Azure services including Web/Mobile Apps, Cloud Services and Virtual Machines – or combine it with on-premises services for hybrid deployments and smooth cloud migration.
 *
 * Below are some of the key scenarios that Azure Front Door Service addresses:
 *
 * * Use Front Door to improve application scale and availability with instant multi-region failover
 * * Use Front Door to improve application performance with SSL offload and routing requests to the fastest available application backend.
 * * Use Front Door for application layer security and DDoS protection for your application.
 *
 * !> **Note:** The `customHttpsProvisioningEnabled` field and the `customHttpsConfiguration` block have been removed from the `azure.frontdoor.Frontdoor` resource in the `v2.58.0` provider due to changes made by the service team. If you wish to enable the custom HTTPS configuration functionality within your `azure.frontdoor.Frontdoor` resource moving forward you will need to define a separate `azure.frontdoor.CustomHttpsConfiguration` block in your configuration file.
 *
 * !> **Note:** With the release of the `v2.58.0` provider, if you run the `apply` command against an existing Front Door resource it **will not** apply the detected changes. Instead it will persist the `explicitResourceOrder` mapping structure to the state file. Once this operation has completed the resource will resume functioning normally.This change in behavior in Terraform is due to an issue where the underlying service teams API is now returning the response JSON out of order from the way it was sent to the resource via Terraform causing unexpected discrepancies in the `plan` after the resource has been provisioned. If your pre-existing Front Door instance contains `customHttpsConfiguration` blocks there are additional steps that will need to be completed to successfully migrate your Front Door onto the `v2.58.0` provider which can be found in this guide.
 *
 * !> **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`.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "FrontDoorExampleResourceGroup",
 *     location: "West Europe",
 * });
 * const exampleFrontdoor = new azure.frontdoor.Frontdoor("example", {
 *     name: "example-FrontDoor",
 *     resourceGroupName: example.name,
 *     routingRules: [{
 *         name: "exampleRoutingRule1",
 *         acceptedProtocols: [
 *             "Http",
 *             "Https",
 *         ],
 *         patternsToMatches: ["/*"],
 *         frontendEndpoints: ["exampleFrontendEndpoint1"],
 *         forwardingConfiguration: {
 *             forwardingProtocol: "MatchRequest",
 *             backendPoolName: "exampleBackendBing",
 *         },
 *     }],
 *     backendPoolLoadBalancings: [{
 *         name: "exampleLoadBalancingSettings1",
 *     }],
 *     backendPoolHealthProbes: [{
 *         name: "exampleHealthProbeSetting1",
 *     }],
 *     backendPools: [{
 *         name: "exampleBackendBing",
 *         backends: [{
 *             hostHeader: "www.bing.com",
 *             address: "www.bing.com",
 *             httpPort: 80,
 *             httpsPort: 443,
 *         }],
 *         loadBalancingName: "exampleLoadBalancingSettings1",
 *         healthProbeName: "exampleHealthProbeSetting1",
 *     }],
 *     frontendEndpoints: [{
 *         name: "exampleFrontendEndpoint1",
 *         hostName: "example-FrontDoor.azurefd.net",
 *     }],
 * });
 * ```
 *
 * ## Import
 *
 * Front Doors can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:frontdoor/frontdoor:Frontdoor example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/frontDoors/frontdoor1
 * ```
 */
class Frontdoor extends pulumi.CustomResource {
    /**
     * Get an existing Frontdoor 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 Frontdoor(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:frontdoor/frontdoor:Frontdoor';
    /**
     * Returns true if the given object is an instance of Frontdoor.  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'] === Frontdoor.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["backendPoolHealthProbes"] = state?.backendPoolHealthProbes;
            resourceInputs["backendPoolHealthProbesMap"] = state?.backendPoolHealthProbesMap;
            resourceInputs["backendPoolLoadBalancingSettingsMap"] = state?.backendPoolLoadBalancingSettingsMap;
            resourceInputs["backendPoolLoadBalancings"] = state?.backendPoolLoadBalancings;
            resourceInputs["backendPoolSettings"] = state?.backendPoolSettings;
            resourceInputs["backendPools"] = state?.backendPools;
            resourceInputs["backendPoolsMap"] = state?.backendPoolsMap;
            resourceInputs["cname"] = state?.cname;
            resourceInputs["explicitResourceOrders"] = state?.explicitResourceOrders;
            resourceInputs["friendlyName"] = state?.friendlyName;
            resourceInputs["frontendEndpoints"] = state?.frontendEndpoints;
            resourceInputs["frontendEndpointsMap"] = state?.frontendEndpointsMap;
            resourceInputs["headerFrontdoorId"] = state?.headerFrontdoorId;
            resourceInputs["loadBalancerEnabled"] = state?.loadBalancerEnabled;
            resourceInputs["name"] = state?.name;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["routingRules"] = state?.routingRules;
            resourceInputs["routingRulesMap"] = state?.routingRulesMap;
            resourceInputs["tags"] = state?.tags;
        }
        else {
            const args = argsOrState;
            if (args?.backendPoolHealthProbes === undefined && !opts.urn) {
                throw new Error("Missing required property 'backendPoolHealthProbes'");
            }
            if (args?.backendPoolLoadBalancings === undefined && !opts.urn) {
                throw new Error("Missing required property 'backendPoolLoadBalancings'");
            }
            if (args?.backendPools === undefined && !opts.urn) {
                throw new Error("Missing required property 'backendPools'");
            }
            if (args?.frontendEndpoints === undefined && !opts.urn) {
                throw new Error("Missing required property 'frontendEndpoints'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.routingRules === undefined && !opts.urn) {
                throw new Error("Missing required property 'routingRules'");
            }
            resourceInputs["backendPoolHealthProbes"] = args?.backendPoolHealthProbes;
            resourceInputs["backendPoolLoadBalancings"] = args?.backendPoolLoadBalancings;
            resourceInputs["backendPoolSettings"] = args?.backendPoolSettings;
            resourceInputs["backendPools"] = args?.backendPools;
            resourceInputs["friendlyName"] = args?.friendlyName;
            resourceInputs["frontendEndpoints"] = args?.frontendEndpoints;
            resourceInputs["loadBalancerEnabled"] = args?.loadBalancerEnabled;
            resourceInputs["name"] = args?.name;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["routingRules"] = args?.routingRules;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["backendPoolHealthProbesMap"] = undefined /*out*/;
            resourceInputs["backendPoolLoadBalancingSettingsMap"] = undefined /*out*/;
            resourceInputs["backendPoolsMap"] = undefined /*out*/;
            resourceInputs["cname"] = undefined /*out*/;
            resourceInputs["explicitResourceOrders"] = undefined /*out*/;
            resourceInputs["frontendEndpointsMap"] = undefined /*out*/;
            resourceInputs["headerFrontdoorId"] = undefined /*out*/;
            resourceInputs["routingRulesMap"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(Frontdoor.__pulumiType, name, resourceInputs, opts);
    }
}
exports.Frontdoor = Frontdoor;
//# sourceMappingURL=frontdoor.js.map