All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.network.kotlin.ApplicationGateway.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.21.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.network.kotlin

import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayAuthenticationCertificate
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayAutoscaleConfiguration
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayBackendAddressPool
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayBackendHttpSetting
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayCustomErrorConfiguration
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayFrontendIpConfiguration
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayFrontendPort
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayGatewayIpConfiguration
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayGlobal
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayHttpListener
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayIdentity
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayPrivateEndpointConnection
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayPrivateLinkConfiguration
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayProbe
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayRedirectConfiguration
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayRequestRoutingRule
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayRewriteRuleSet
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewaySku
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewaySslCertificate
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewaySslPolicy
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewaySslProfile
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayTrustedClientCertificate
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayTrustedRootCertificate
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayUrlPathMap
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayWafConfiguration
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayAuthenticationCertificate.Companion.toKotlin as applicationGatewayAuthenticationCertificateToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayAutoscaleConfiguration.Companion.toKotlin as applicationGatewayAutoscaleConfigurationToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayBackendAddressPool.Companion.toKotlin as applicationGatewayBackendAddressPoolToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayBackendHttpSetting.Companion.toKotlin as applicationGatewayBackendHttpSettingToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayCustomErrorConfiguration.Companion.toKotlin as applicationGatewayCustomErrorConfigurationToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayFrontendIpConfiguration.Companion.toKotlin as applicationGatewayFrontendIpConfigurationToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayFrontendPort.Companion.toKotlin as applicationGatewayFrontendPortToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayGatewayIpConfiguration.Companion.toKotlin as applicationGatewayGatewayIpConfigurationToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayGlobal.Companion.toKotlin as applicationGatewayGlobalToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayHttpListener.Companion.toKotlin as applicationGatewayHttpListenerToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayIdentity.Companion.toKotlin as applicationGatewayIdentityToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayPrivateEndpointConnection.Companion.toKotlin as applicationGatewayPrivateEndpointConnectionToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayPrivateLinkConfiguration.Companion.toKotlin as applicationGatewayPrivateLinkConfigurationToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayProbe.Companion.toKotlin as applicationGatewayProbeToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayRedirectConfiguration.Companion.toKotlin as applicationGatewayRedirectConfigurationToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayRequestRoutingRule.Companion.toKotlin as applicationGatewayRequestRoutingRuleToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayRewriteRuleSet.Companion.toKotlin as applicationGatewayRewriteRuleSetToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewaySku.Companion.toKotlin as applicationGatewaySkuToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewaySslCertificate.Companion.toKotlin as applicationGatewaySslCertificateToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewaySslPolicy.Companion.toKotlin as applicationGatewaySslPolicyToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewaySslProfile.Companion.toKotlin as applicationGatewaySslProfileToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayTrustedClientCertificate.Companion.toKotlin as applicationGatewayTrustedClientCertificateToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayTrustedRootCertificate.Companion.toKotlin as applicationGatewayTrustedRootCertificateToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayUrlPathMap.Companion.toKotlin as applicationGatewayUrlPathMapToKotlin
import com.pulumi.azure.network.kotlin.outputs.ApplicationGatewayWafConfiguration.Companion.toKotlin as applicationGatewayWafConfigurationToKotlin

/**
 * Builder for [ApplicationGateway].
 */
@PulumiTagMarker
public class ApplicationGatewayResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ApplicationGatewayArgs = ApplicationGatewayArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend ApplicationGatewayArgsBuilder.() -> Unit) {
        val builder = ApplicationGatewayArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): ApplicationGateway {
        val builtJavaResource = com.pulumi.azure.network.ApplicationGateway(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return ApplicationGateway(builtJavaResource)
    }
}

/**
 * ## 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: "Dynamic",
 * });
 * 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,
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_virtual_network = azure.network.VirtualNetwork("example",
 *     name="example-network",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     address_spaces=["10.254.0.0/16"])
 * example_subnet = azure.network.Subnet("example",
 *     name="example",
 *     resource_group_name=example.name,
 *     virtual_network_name=example_virtual_network.name,
 *     address_prefixes=["10.254.0.0/24"])
 * example_public_ip = azure.network.PublicIp("example",
 *     name="example-pip",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     allocation_method="Dynamic")
 * backend_address_pool_name = example_virtual_network.name.apply(lambda name: f"{name}-beap")
 * frontend_port_name = example_virtual_network.name.apply(lambda name: f"{name}-feport")
 * frontend_ip_configuration_name = example_virtual_network.name.apply(lambda name: f"{name}-feip")
 * http_setting_name = example_virtual_network.name.apply(lambda name: f"{name}-be-htst")
 * listener_name = example_virtual_network.name.apply(lambda name: f"{name}-httplstn")
 * request_routing_rule_name = example_virtual_network.name.apply(lambda name: f"{name}-rqrt")
 * redirect_configuration_name = example_virtual_network.name.apply(lambda name: f"{name}-rdrcfg")
 * network = azure.network.ApplicationGateway("network",
 *     name="example-appgateway",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     sku={
 *         "name": "Standard_v2",
 *         "tier": "Standard_v2",
 *         "capacity": 2,
 *     },
 *     gateway_ip_configurations=[{
 *         "name": "my-gateway-ip-configuration",
 *         "subnet_id": example_subnet.id,
 *     }],
 *     frontend_ports=[{
 *         "name": frontend_port_name,
 *         "port": 80,
 *     }],
 *     frontend_ip_configurations=[{
 *         "name": frontend_ip_configuration_name,
 *         "public_ip_address_id": example_public_ip.id,
 *     }],
 *     backend_address_pools=[{
 *         "name": backend_address_pool_name,
 *     }],
 *     backend_http_settings=[{
 *         "name": http_setting_name,
 *         "cookie_based_affinity": "Disabled",
 *         "path": "/path1/",
 *         "port": 80,
 *         "protocol": "Http",
 *         "request_timeout": 60,
 *     }],
 *     http_listeners=[{
 *         "name": listener_name,
 *         "frontend_ip_configuration_name": frontend_ip_configuration_name,
 *         "frontend_port_name": frontend_port_name,
 *         "protocol": "Http",
 *     }],
 *     request_routing_rules=[{
 *         "name": request_routing_rule_name,
 *         "priority": 9,
 *         "rule_type": "Basic",
 *         "http_listener_name": listener_name,
 *         "backend_address_pool_name": backend_address_pool_name,
 *         "backend_http_settings_name": http_setting_name,
 *     }])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
 *     {
 *         Name = "example-network",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AddressSpaces = new[]
 *         {
 *             "10.254.0.0/16",
 *         },
 *     });
 *     var exampleSubnet = new Azure.Network.Subnet("example", new()
 *     {
 *         Name = "example",
 *         ResourceGroupName = example.Name,
 *         VirtualNetworkName = exampleVirtualNetwork.Name,
 *         AddressPrefixes = new[]
 *         {
 *             "10.254.0.0/24",
 *         },
 *     });
 *     var examplePublicIp = new Azure.Network.PublicIp("example", new()
 *     {
 *         Name = "example-pip",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AllocationMethod = "Dynamic",
 *     });
 *     var backendAddressPoolName = exampleVirtualNetwork.Name.Apply(name => $"{name}-beap");
 *     var frontendPortName = exampleVirtualNetwork.Name.Apply(name => $"{name}-feport");
 *     var frontendIpConfigurationName = exampleVirtualNetwork.Name.Apply(name => $"{name}-feip");
 *     var httpSettingName = exampleVirtualNetwork.Name.Apply(name => $"{name}-be-htst");
 *     var listenerName = exampleVirtualNetwork.Name.Apply(name => $"{name}-httplstn");
 *     var requestRoutingRuleName = exampleVirtualNetwork.Name.Apply(name => $"{name}-rqrt");
 *     var redirectConfigurationName = exampleVirtualNetwork.Name.Apply(name => $"{name}-rdrcfg");
 *     var network = new Azure.Network.ApplicationGateway("network", new()
 *     {
 *         Name = "example-appgateway",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Sku = new Azure.Network.Inputs.ApplicationGatewaySkuArgs
 *         {
 *             Name = "Standard_v2",
 *             Tier = "Standard_v2",
 *             Capacity = 2,
 *         },
 *         GatewayIpConfigurations = new[]
 *         {
 *             new Azure.Network.Inputs.ApplicationGatewayGatewayIpConfigurationArgs
 *             {
 *                 Name = "my-gateway-ip-configuration",
 *                 SubnetId = exampleSubnet.Id,
 *             },
 *         },
 *         FrontendPorts = new[]
 *         {
 *             new Azure.Network.Inputs.ApplicationGatewayFrontendPortArgs
 *             {
 *                 Name = frontendPortName,
 *                 Port = 80,
 *             },
 *         },
 *         FrontendIpConfigurations = new[]
 *         {
 *             new Azure.Network.Inputs.ApplicationGatewayFrontendIpConfigurationArgs
 *             {
 *                 Name = frontendIpConfigurationName,
 *                 PublicIpAddressId = examplePublicIp.Id,
 *             },
 *         },
 *         BackendAddressPools = new[]
 *         {
 *             new Azure.Network.Inputs.ApplicationGatewayBackendAddressPoolArgs
 *             {
 *                 Name = backendAddressPoolName,
 *             },
 *         },
 *         BackendHttpSettings = new[]
 *         {
 *             new Azure.Network.Inputs.ApplicationGatewayBackendHttpSettingArgs
 *             {
 *                 Name = httpSettingName,
 *                 CookieBasedAffinity = "Disabled",
 *                 Path = "/path1/",
 *                 Port = 80,
 *                 Protocol = "Http",
 *                 RequestTimeout = 60,
 *             },
 *         },
 *         HttpListeners = new[]
 *         {
 *             new Azure.Network.Inputs.ApplicationGatewayHttpListenerArgs
 *             {
 *                 Name = listenerName,
 *                 FrontendIpConfigurationName = frontendIpConfigurationName,
 *                 FrontendPortName = frontendPortName,
 *                 Protocol = "Http",
 *             },
 *         },
 *         RequestRoutingRules = new[]
 *         {
 *             new Azure.Network.Inputs.ApplicationGatewayRequestRoutingRuleArgs
 *             {
 *                 Name = requestRoutingRuleName,
 *                 Priority = 9,
 *                 RuleType = "Basic",
 *                 HttpListenerName = listenerName,
 *                 BackendAddressPoolName = backendAddressPoolName,
 *                 BackendHttpSettingsName = httpSettingName,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"fmt"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
 * 			Name:              pulumi.String("example-network"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			AddressSpaces: pulumi.StringArray{
 * 				pulumi.String("10.254.0.0/16"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
 * 			Name:               pulumi.String("example"),
 * 			ResourceGroupName:  example.Name,
 * 			VirtualNetworkName: exampleVirtualNetwork.Name,
 * 			AddressPrefixes: pulumi.StringArray{
 * 				pulumi.String("10.254.0.0/24"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		examplePublicIp, err := network.NewPublicIp(ctx, "example", &network.PublicIpArgs{
 * 			Name:              pulumi.String("example-pip"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			AllocationMethod:  pulumi.String("Dynamic"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		backendAddressPoolName := exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) {
 * 			return fmt.Sprintf("%v-beap", name), nil
 * 		}).(pulumi.StringOutput)
 * 		frontendPortName := exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) {
 * 			return fmt.Sprintf("%v-feport", name), nil
 * 		}).(pulumi.StringOutput)
 * 		frontendIpConfigurationName := exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) {
 * 			return fmt.Sprintf("%v-feip", name), nil
 * 		}).(pulumi.StringOutput)
 * 		httpSettingName := exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) {
 * 			return fmt.Sprintf("%v-be-htst", name), nil
 * 		}).(pulumi.StringOutput)
 * 		listenerName := exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) {
 * 			return fmt.Sprintf("%v-httplstn", name), nil
 * 		}).(pulumi.StringOutput)
 * 		requestRoutingRuleName := exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) {
 * 			return fmt.Sprintf("%v-rqrt", name), nil
 * 		}).(pulumi.StringOutput)
 * 		_ = exampleVirtualNetwork.Name.ApplyT(func(name string) (string, error) {
 * 			return fmt.Sprintf("%v-rdrcfg", name), nil
 * 		}).(pulumi.StringOutput)
 * 		_, err = network.NewApplicationGateway(ctx, "network", &network.ApplicationGatewayArgs{
 * 			Name:              pulumi.String("example-appgateway"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			Sku: &network.ApplicationGatewaySkuArgs{
 * 				Name:     pulumi.String("Standard_v2"),
 * 				Tier:     pulumi.String("Standard_v2"),
 * 				Capacity: pulumi.Int(2),
 * 			},
 * 			GatewayIpConfigurations: network.ApplicationGatewayGatewayIpConfigurationArray{
 * 				&network.ApplicationGatewayGatewayIpConfigurationArgs{
 * 					Name:     pulumi.String("my-gateway-ip-configuration"),
 * 					SubnetId: exampleSubnet.ID(),
 * 				},
 * 			},
 * 			FrontendPorts: network.ApplicationGatewayFrontendPortArray{
 * 				&network.ApplicationGatewayFrontendPortArgs{
 * 					Name: pulumi.String(frontendPortName),
 * 					Port: pulumi.Int(80),
 * 				},
 * 			},
 * 			FrontendIpConfigurations: network.ApplicationGatewayFrontendIpConfigurationArray{
 * 				&network.ApplicationGatewayFrontendIpConfigurationArgs{
 * 					Name:              pulumi.String(frontendIpConfigurationName),
 * 					PublicIpAddressId: examplePublicIp.ID(),
 * 				},
 * 			},
 * 			BackendAddressPools: network.ApplicationGatewayBackendAddressPoolArray{
 * 				&network.ApplicationGatewayBackendAddressPoolArgs{
 * 					Name: pulumi.String(backendAddressPoolName),
 * 				},
 * 			},
 * 			BackendHttpSettings: network.ApplicationGatewayBackendHttpSettingArray{
 * 				&network.ApplicationGatewayBackendHttpSettingArgs{
 * 					Name:                pulumi.String(httpSettingName),
 * 					CookieBasedAffinity: pulumi.String("Disabled"),
 * 					Path:                pulumi.String("/path1/"),
 * 					Port:                pulumi.Int(80),
 * 					Protocol:            pulumi.String("Http"),
 * 					RequestTimeout:      pulumi.Int(60),
 * 				},
 * 			},
 * 			HttpListeners: network.ApplicationGatewayHttpListenerArray{
 * 				&network.ApplicationGatewayHttpListenerArgs{
 * 					Name:                        pulumi.String(listenerName),
 * 					FrontendIpConfigurationName: pulumi.String(frontendIpConfigurationName),
 * 					FrontendPortName:            pulumi.String(frontendPortName),
 * 					Protocol:                    pulumi.String("Http"),
 * 				},
 * 			},
 * 			RequestRoutingRules: network.ApplicationGatewayRequestRoutingRuleArray{
 * 				&network.ApplicationGatewayRequestRoutingRuleArgs{
 * 					Name:                    pulumi.String(requestRoutingRuleName),
 * 					Priority:                pulumi.Int(9),
 * 					RuleType:                pulumi.String("Basic"),
 * 					HttpListenerName:        pulumi.String(listenerName),
 * 					BackendAddressPoolName:  pulumi.String(backendAddressPoolName),
 * 					BackendHttpSettingsName: pulumi.String(httpSettingName),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.network.VirtualNetwork;
 * import com.pulumi.azure.network.VirtualNetworkArgs;
 * import com.pulumi.azure.network.Subnet;
 * import com.pulumi.azure.network.SubnetArgs;
 * import com.pulumi.azure.network.PublicIp;
 * import com.pulumi.azure.network.PublicIpArgs;
 * import com.pulumi.azure.network.ApplicationGateway;
 * import com.pulumi.azure.network.ApplicationGatewayArgs;
 * import com.pulumi.azure.network.inputs.ApplicationGatewaySkuArgs;
 * import com.pulumi.azure.network.inputs.ApplicationGatewayGatewayIpConfigurationArgs;
 * import com.pulumi.azure.network.inputs.ApplicationGatewayFrontendPortArgs;
 * import com.pulumi.azure.network.inputs.ApplicationGatewayFrontendIpConfigurationArgs;
 * import com.pulumi.azure.network.inputs.ApplicationGatewayBackendAddressPoolArgs;
 * import com.pulumi.azure.network.inputs.ApplicationGatewayBackendHttpSettingArgs;
 * import com.pulumi.azure.network.inputs.ApplicationGatewayHttpListenerArgs;
 * import com.pulumi.azure.network.inputs.ApplicationGatewayRequestRoutingRuleArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
 *             .name("example-network")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .addressSpaces("10.254.0.0/16")
 *             .build());
 *         var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
 *             .name("example")
 *             .resourceGroupName(example.name())
 *             .virtualNetworkName(exampleVirtualNetwork.name())
 *             .addressPrefixes("10.254.0.0/24")
 *             .build());
 *         var examplePublicIp = new PublicIp("examplePublicIp", PublicIpArgs.builder()
 *             .name("example-pip")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .allocationMethod("Dynamic")
 *             .build());
 *         final var backendAddressPoolName = exampleVirtualNetwork.name().applyValue(name -> String.format("%s-beap", name));
 *         final var frontendPortName = exampleVirtualNetwork.name().applyValue(name -> String.format("%s-feport", name));
 *         final var frontendIpConfigurationName = exampleVirtualNetwork.name().applyValue(name -> String.format("%s-feip", name));
 *         final var httpSettingName = exampleVirtualNetwork.name().applyValue(name -> String.format("%s-be-htst", name));
 *         final var listenerName = exampleVirtualNetwork.name().applyValue(name -> String.format("%s-httplstn", name));
 *         final var requestRoutingRuleName = exampleVirtualNetwork.name().applyValue(name -> String.format("%s-rqrt", name));
 *         final var redirectConfigurationName = exampleVirtualNetwork.name().applyValue(name -> String.format("%s-rdrcfg", name));
 *         var network = new ApplicationGateway("network", ApplicationGatewayArgs.builder()
 *             .name("example-appgateway")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .sku(ApplicationGatewaySkuArgs.builder()
 *                 .name("Standard_v2")
 *                 .tier("Standard_v2")
 *                 .capacity(2)
 *                 .build())
 *             .gatewayIpConfigurations(ApplicationGatewayGatewayIpConfigurationArgs.builder()
 *                 .name("my-gateway-ip-configuration")
 *                 .subnetId(exampleSubnet.id())
 *                 .build())
 *             .frontendPorts(ApplicationGatewayFrontendPortArgs.builder()
 *                 .name(frontendPortName)
 *                 .port(80)
 *                 .build())
 *             .frontendIpConfigurations(ApplicationGatewayFrontendIpConfigurationArgs.builder()
 *                 .name(frontendIpConfigurationName)
 *                 .publicIpAddressId(examplePublicIp.id())
 *                 .build())
 *             .backendAddressPools(ApplicationGatewayBackendAddressPoolArgs.builder()
 *                 .name(backendAddressPoolName)
 *                 .build())
 *             .backendHttpSettings(ApplicationGatewayBackendHttpSettingArgs.builder()
 *                 .name(httpSettingName)
 *                 .cookieBasedAffinity("Disabled")
 *                 .path("/path1/")
 *                 .port(80)
 *                 .protocol("Http")
 *                 .requestTimeout(60)
 *                 .build())
 *             .httpListeners(ApplicationGatewayHttpListenerArgs.builder()
 *                 .name(listenerName)
 *                 .frontendIpConfigurationName(frontendIpConfigurationName)
 *                 .frontendPortName(frontendPortName)
 *                 .protocol("Http")
 *                 .build())
 *             .requestRoutingRules(ApplicationGatewayRequestRoutingRuleArgs.builder()
 *                 .name(requestRoutingRuleName)
 *                 .priority(9)
 *                 .ruleType("Basic")
 *                 .httpListenerName(listenerName)
 *                 .backendAddressPoolName(backendAddressPoolName)
 *                 .backendHttpSettingsName(httpSettingName)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleVirtualNetwork:
 *     type: azure:network:VirtualNetwork
 *     name: example
 *     properties:
 *       name: example-network
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       addressSpaces:
 *         - 10.254.0.0/16
 *   exampleSubnet:
 *     type: azure:network:Subnet
 *     name: example
 *     properties:
 *       name: example
 *       resourceGroupName: ${example.name}
 *       virtualNetworkName: ${exampleVirtualNetwork.name}
 *       addressPrefixes:
 *         - 10.254.0.0/24
 *   examplePublicIp:
 *     type: azure:network:PublicIp
 *     name: example
 *     properties:
 *       name: example-pip
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       allocationMethod: Dynamic
 *   network:
 *     type: azure:network:ApplicationGateway
 *     properties:
 *       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}
 * variables:
 *   backendAddressPoolName: ${exampleVirtualNetwork.name}-beap
 *   frontendPortName: ${exampleVirtualNetwork.name}-feport
 *   frontendIpConfigurationName: ${exampleVirtualNetwork.name}-feip
 *   httpSettingName: ${exampleVirtualNetwork.name}-be-htst
 *   listenerName: ${exampleVirtualNetwork.name}-httplstn
 *   requestRoutingRuleName: ${exampleVirtualNetwork.name}-rqrt
 *   redirectConfigurationName: ${exampleVirtualNetwork.name}-rdrcfg
 * ```
 * 
 * ## Import
 * Application Gateway's 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
 * ```
 */
public class ApplicationGateway internal constructor(
    override val javaResource: com.pulumi.azure.network.ApplicationGateway,
) : KotlinCustomResource(javaResource, ApplicationGatewayMapper) {
    /**
     * One or more `authentication_certificate` blocks as defined below.
     */
    public val authenticationCertificates: Output>?
        get() = javaResource.authenticationCertificates().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        applicationGatewayAuthenticationCertificateToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * An `autoscale_configuration` block as defined below.
     */
    public val autoscaleConfiguration: Output?
        get() = javaResource.autoscaleConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    applicationGatewayAutoscaleConfigurationToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * One or more `backend_address_pool` blocks as defined below.
     */
    public val backendAddressPools: Output>
        get() = javaResource.backendAddressPools().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> applicationGatewayBackendAddressPoolToKotlin(args0) })
            })
        })

    /**
     * One or more `backend_http_settings` blocks as defined below.
     */
    public val backendHttpSettings: Output>
        get() = javaResource.backendHttpSettings().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> applicationGatewayBackendHttpSettingToKotlin(args0) })
            })
        })

    /**
     * One or more `custom_error_configuration` blocks as defined below.
     */
    public val customErrorConfigurations: Output>?
        get() = javaResource.customErrorConfigurations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        applicationGatewayCustomErrorConfigurationToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * Is HTTP2 enabled on the application gateway resource? Defaults to `false`.
     */
    public val enableHttp2: Output?
        get() = javaResource.enableHttp2().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Is FIPS enabled on the Application Gateway?
     */
    public val fipsEnabled: Output?
        get() = javaResource.fipsEnabled().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The ID of the Web Application Firewall Policy.
     */
    public val firewallPolicyId: Output?
        get() = javaResource.firewallPolicyId().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Is the Firewall Policy associated with the Application Gateway?
     */
    public val forceFirewallPolicyAssociation: Output?
        get() = javaResource.forceFirewallPolicyAssociation().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * One or more `frontend_ip_configuration` blocks as defined below.
     */
    public val frontendIpConfigurations: Output>
        get() = javaResource.frontendIpConfigurations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> applicationGatewayFrontendIpConfigurationToKotlin(args0) })
            })
        })

    /**
     * One or more `frontend_port` blocks as defined below.
     */
    public val frontendPorts: Output>
        get() = javaResource.frontendPorts().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> applicationGatewayFrontendPortToKotlin(args0) })
            })
        })

    /**
     * One or more `gateway_ip_configuration` blocks as defined below.
     */
    public val gatewayIpConfigurations: Output>
        get() = javaResource.gatewayIpConfigurations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> applicationGatewayGatewayIpConfigurationToKotlin(args0) })
            })
        })

    /**
     * A `global` block as defined below.
     */
    public val global: Output?
        get() = javaResource.global().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    applicationGatewayGlobalToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * One or more `http_listener` blocks as defined below.
     */
    public val httpListeners: Output>
        get() = javaResource.httpListeners().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> applicationGatewayHttpListenerToKotlin(args0) })
            })
        })

    /**
     * An `identity` block as defined below.
     */
    public val identity: Output?
        get() = javaResource.identity().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    applicationGatewayIdentityToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The Azure region where the Application Gateway should exist. Changing this forces a new resource to be created.
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * The name of the Application Gateway. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * A list of `private_endpoint_connection` blocks as defined below.
     */
    public val privateEndpointConnections: Output>
        get() = javaResource.privateEndpointConnections().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> applicationGatewayPrivateEndpointConnectionToKotlin(args0) })
            })
        })

    /**
     * One or more `private_link_configuration` blocks as defined below.
     */
    public val privateLinkConfigurations: Output>?
        get() = javaResource.privateLinkConfigurations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        applicationGatewayPrivateLinkConfigurationToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * One or more `probe` blocks as defined below.
     */
    public val probes: Output>?
        get() = javaResource.probes().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> applicationGatewayProbeToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * One or more `redirect_configuration` blocks as defined below.
     */
    public val redirectConfigurations: Output>?
        get() = javaResource.redirectConfigurations().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        applicationGatewayRedirectConfigurationToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * One or more `request_routing_rule` blocks as defined below.
     */
    public val requestRoutingRules: Output>
        get() = javaResource.requestRoutingRules().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> applicationGatewayRequestRoutingRuleToKotlin(args0) })
            })
        })

    /**
     * The name of the resource group in which to the Application Gateway should exist. Changing this forces a new resource to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * One or more `rewrite_rule_set` blocks as defined below. Only valid for v2 SKUs.
     */
    public val rewriteRuleSets: Output>?
        get() = javaResource.rewriteRuleSets().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        applicationGatewayRewriteRuleSetToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * A `sku` block as defined below.
     */
    public val sku: Output
        get() = javaResource.sku().applyValue({ args0 ->
            args0.let({ args0 ->
                applicationGatewaySkuToKotlin(args0)
            })
        })

    /**
     * One or more `ssl_certificate` blocks as defined below.
     */
    public val sslCertificates: Output>?
        get() = javaResource.sslCertificates().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        applicationGatewaySslCertificateToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * a `ssl_policy` block as defined below.
     */
    public val sslPolicy: Output
        get() = javaResource.sslPolicy().applyValue({ args0 ->
            args0.let({ args0 ->
                applicationGatewaySslPolicyToKotlin(args0)
            })
        })

    /**
     * One or more `ssl_profile` blocks as defined below.
     */
    public val sslProfiles: Output>?
        get() = javaResource.sslProfiles().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> applicationGatewaySslProfileToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * A mapping of tags to assign to the resource.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * One or more `trusted_client_certificate` blocks as defined below.
     */
    public val trustedClientCertificates: Output>?
        get() = javaResource.trustedClientCertificates().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        applicationGatewayTrustedClientCertificateToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * One or more `trusted_root_certificate` blocks as defined below.
     */
    public val trustedRootCertificates: Output>?
        get() = javaResource.trustedRootCertificates().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 ->
                        applicationGatewayTrustedRootCertificateToKotlin(args0)
                    })
                })
            }).orElse(null)
        })

    /**
     * One or more `url_path_map` blocks as defined below.
     */
    public val urlPathMaps: Output>?
        get() = javaResource.urlPathMaps().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.let({ args0 -> applicationGatewayUrlPathMapToKotlin(args0) })
                })
            }).orElse(null)
        })

    /**
     * A `waf_configuration` block as defined below.
     */
    public val wafConfiguration: Output?
        get() = javaResource.wafConfiguration().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> applicationGatewayWafConfigurationToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Specifies a list of Availability Zones in which this Application Gateway should be located. Changing this forces a new Application Gateway to be created.
     * > **Please Note**: Availability Zones are not supported in all regions at this time, please check the [official documentation](https://docs.microsoft.com/azure/availability-zones/az-overview) for more information. They are also only supported for [v2 SKUs](https://docs.microsoft.com/azure/application-gateway/application-gateway-autoscaling-zone-redundant)
     */
    public val zones: Output>?
        get() = javaResource.zones().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })
}

public object ApplicationGatewayMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.network.ApplicationGateway::class == javaResource::class

    override fun map(javaResource: Resource): ApplicationGateway = ApplicationGateway(
        javaResource as
            com.pulumi.azure.network.ApplicationGateway,
    )
}

/**
 * @see [ApplicationGateway].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [ApplicationGateway].
 */
public suspend fun applicationGateway(
    name: String,
    block: suspend ApplicationGatewayResourceBuilder.() -> Unit,
): ApplicationGateway {
    val builder = ApplicationGatewayResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [ApplicationGateway].
 * @param name The _unique_ name of the resulting resource.
 */
public fun applicationGateway(name: String): ApplicationGateway {
    val builder = ApplicationGatewayResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy