"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.ApplicationGateway = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages an Application Gateway.
 *
 * > **Note:** The `backendAddressPool`, `backendHttpSettings`, `httpListener`, `privateLinkConfiguration`, `requestRoutingRule`, `redirectConfiguration`, `probe`, `sslCertificate`,
 * and `frontendPort` properties are Sets as the service API returns these lists of objects in a different order from how the provider sends them. As Sets are stored using a hash, if one
 * value is added or removed from the Set, Terraform considers the entire list of objects changed and the plan shows that it is removing every value in the list and re-adding it with the
 * new information. Though Terraform is showing all the values being removed and re-added, we are not actually removing anything unless the user specifies a removal in the configfile.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "example-network",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     addressSpaces: ["10.254.0.0/16"],
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "example",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.254.0.0/24"],
 * });
 * const examplePublicIp = new azure.network.PublicIp("example", {
 *     name: "example-pip",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     allocationMethod: "Static",
 * });
 * const backendAddressPoolName = pulumi.interpolate`${exampleVirtualNetwork.name}-beap`;
 * const frontendPortName = pulumi.interpolate`${exampleVirtualNetwork.name}-feport`;
 * const frontendIpConfigurationName = pulumi.interpolate`${exampleVirtualNetwork.name}-feip`;
 * const httpSettingName = pulumi.interpolate`${exampleVirtualNetwork.name}-be-htst`;
 * const listenerName = pulumi.interpolate`${exampleVirtualNetwork.name}-httplstn`;
 * const requestRoutingRuleName = pulumi.interpolate`${exampleVirtualNetwork.name}-rqrt`;
 * const redirectConfigurationName = pulumi.interpolate`${exampleVirtualNetwork.name}-rdrcfg`;
 * const network = new azure.network.ApplicationGateway("network", {
 *     name: "example-appgateway",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     sku: {
 *         name: "Standard_v2",
 *         tier: "Standard_v2",
 *         capacity: 2,
 *     },
 *     gatewayIpConfigurations: [{
 *         name: "my-gateway-ip-configuration",
 *         subnetId: exampleSubnet.id,
 *     }],
 *     frontendPorts: [{
 *         name: frontendPortName,
 *         port: 80,
 *     }],
 *     frontendIpConfigurations: [{
 *         name: frontendIpConfigurationName,
 *         publicIpAddressId: examplePublicIp.id,
 *     }],
 *     backendAddressPools: [{
 *         name: backendAddressPoolName,
 *     }],
 *     backendHttpSettings: [{
 *         name: httpSettingName,
 *         cookieBasedAffinity: "Disabled",
 *         path: "/path1/",
 *         port: 80,
 *         protocol: "Http",
 *         requestTimeout: 60,
 *     }],
 *     httpListeners: [{
 *         name: listenerName,
 *         frontendIpConfigurationName: frontendIpConfigurationName,
 *         frontendPortName: frontendPortName,
 *         protocol: "Http",
 *     }],
 *     requestRoutingRules: [{
 *         name: requestRoutingRuleName,
 *         priority: 9,
 *         ruleType: "Basic",
 *         httpListenerName: listenerName,
 *         backendAddressPoolName: backendAddressPoolName,
 *         backendHttpSettingsName: httpSettingName,
 *     }],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Network` - 2025-01-01
 *
 * ## Import
 *
 * An Application Gateway can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:network/applicationGateway:ApplicationGateway example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/applicationGateways/myGateway1
 * ```
 */
class ApplicationGateway extends pulumi.CustomResource {
    /**
     * Get an existing ApplicationGateway 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 ApplicationGateway(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:network/applicationGateway:ApplicationGateway';
    /**
     * Returns true if the given object is an instance of ApplicationGateway.  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'] === ApplicationGateway.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["authenticationCertificates"] = state?.authenticationCertificates;
            resourceInputs["autoscaleConfiguration"] = state?.autoscaleConfiguration;
            resourceInputs["backendAddressPools"] = state?.backendAddressPools;
            resourceInputs["backendHttpSettings"] = state?.backendHttpSettings;
            resourceInputs["backends"] = state?.backends;
            resourceInputs["customErrorConfigurations"] = state?.customErrorConfigurations;
            resourceInputs["enableHttp2"] = state?.enableHttp2;
            resourceInputs["fipsEnabled"] = state?.fipsEnabled;
            resourceInputs["firewallPolicyId"] = state?.firewallPolicyId;
            resourceInputs["forceFirewallPolicyAssociation"] = state?.forceFirewallPolicyAssociation;
            resourceInputs["frontendIpConfigurations"] = state?.frontendIpConfigurations;
            resourceInputs["frontendPorts"] = state?.frontendPorts;
            resourceInputs["gatewayIpConfigurations"] = state?.gatewayIpConfigurations;
            resourceInputs["global"] = state?.global;
            resourceInputs["http2Enabled"] = state?.http2Enabled;
            resourceInputs["httpListeners"] = state?.httpListeners;
            resourceInputs["identity"] = state?.identity;
            resourceInputs["listeners"] = state?.listeners;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["privateEndpointConnections"] = state?.privateEndpointConnections;
            resourceInputs["privateLinkConfigurations"] = state?.privateLinkConfigurations;
            resourceInputs["probes"] = state?.probes;
            resourceInputs["redirectConfigurations"] = state?.redirectConfigurations;
            resourceInputs["requestRoutingRules"] = state?.requestRoutingRules;
            resourceInputs["resourceGroupName"] = state?.resourceGroupName;
            resourceInputs["rewriteRuleSets"] = state?.rewriteRuleSets;
            resourceInputs["routingRules"] = state?.routingRules;
            resourceInputs["sku"] = state?.sku;
            resourceInputs["sslCertificates"] = state?.sslCertificates;
            resourceInputs["sslPolicy"] = state?.sslPolicy;
            resourceInputs["sslProfiles"] = state?.sslProfiles;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["trustedClientCertificates"] = state?.trustedClientCertificates;
            resourceInputs["trustedRootCertificates"] = state?.trustedRootCertificates;
            resourceInputs["urlPathMaps"] = state?.urlPathMaps;
            resourceInputs["wafConfiguration"] = state?.wafConfiguration;
            resourceInputs["zones"] = state?.zones;
        }
        else {
            const args = argsOrState;
            if (args?.backendAddressPools === undefined && !opts.urn) {
                throw new Error("Missing required property 'backendAddressPools'");
            }
            if (args?.frontendIpConfigurations === undefined && !opts.urn) {
                throw new Error("Missing required property 'frontendIpConfigurations'");
            }
            if (args?.frontendPorts === undefined && !opts.urn) {
                throw new Error("Missing required property 'frontendPorts'");
            }
            if (args?.gatewayIpConfigurations === undefined && !opts.urn) {
                throw new Error("Missing required property 'gatewayIpConfigurations'");
            }
            if (args?.resourceGroupName === undefined && !opts.urn) {
                throw new Error("Missing required property 'resourceGroupName'");
            }
            if (args?.sku === undefined && !opts.urn) {
                throw new Error("Missing required property 'sku'");
            }
            resourceInputs["authenticationCertificates"] = args?.authenticationCertificates;
            resourceInputs["autoscaleConfiguration"] = args?.autoscaleConfiguration;
            resourceInputs["backendAddressPools"] = args?.backendAddressPools;
            resourceInputs["backendHttpSettings"] = args?.backendHttpSettings;
            resourceInputs["backends"] = args?.backends;
            resourceInputs["customErrorConfigurations"] = args?.customErrorConfigurations;
            resourceInputs["enableHttp2"] = args?.enableHttp2;
            resourceInputs["fipsEnabled"] = args?.fipsEnabled;
            resourceInputs["firewallPolicyId"] = args?.firewallPolicyId;
            resourceInputs["forceFirewallPolicyAssociation"] = args?.forceFirewallPolicyAssociation;
            resourceInputs["frontendIpConfigurations"] = args?.frontendIpConfigurations;
            resourceInputs["frontendPorts"] = args?.frontendPorts;
            resourceInputs["gatewayIpConfigurations"] = args?.gatewayIpConfigurations;
            resourceInputs["global"] = args?.global;
            resourceInputs["http2Enabled"] = args?.http2Enabled;
            resourceInputs["httpListeners"] = args?.httpListeners;
            resourceInputs["identity"] = args?.identity;
            resourceInputs["listeners"] = args?.listeners;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["privateLinkConfigurations"] = args?.privateLinkConfigurations;
            resourceInputs["probes"] = args?.probes;
            resourceInputs["redirectConfigurations"] = args?.redirectConfigurations;
            resourceInputs["requestRoutingRules"] = args?.requestRoutingRules;
            resourceInputs["resourceGroupName"] = args?.resourceGroupName;
            resourceInputs["rewriteRuleSets"] = args?.rewriteRuleSets;
            resourceInputs["routingRules"] = args?.routingRules;
            resourceInputs["sku"] = args?.sku;
            resourceInputs["sslCertificates"] = args?.sslCertificates;
            resourceInputs["sslPolicy"] = args?.sslPolicy;
            resourceInputs["sslProfiles"] = args?.sslProfiles;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["trustedClientCertificates"] = args?.trustedClientCertificates;
            resourceInputs["trustedRootCertificates"] = args?.trustedRootCertificates;
            resourceInputs["urlPathMaps"] = args?.urlPathMaps;
            resourceInputs["wafConfiguration"] = args?.wafConfiguration;
            resourceInputs["zones"] = args?.zones;
            resourceInputs["privateEndpointConnections"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ApplicationGateway.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ApplicationGateway = ApplicationGateway;
//# sourceMappingURL=applicationGateway.js.map