com.pulumi.azurenative.network.LoadBalancer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azurenative.network;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.network.LoadBalancerArgs;
import com.pulumi.azurenative.network.outputs.BackendAddressPoolResponse;
import com.pulumi.azurenative.network.outputs.ExtendedLocationResponse;
import com.pulumi.azurenative.network.outputs.FrontendIPConfigurationResponse;
import com.pulumi.azurenative.network.outputs.InboundNatPoolResponse;
import com.pulumi.azurenative.network.outputs.InboundNatRuleResponse;
import com.pulumi.azurenative.network.outputs.LoadBalancerSkuResponse;
import com.pulumi.azurenative.network.outputs.LoadBalancingRuleResponse;
import com.pulumi.azurenative.network.outputs.OutboundRuleResponse;
import com.pulumi.azurenative.network.outputs.ProbeResponse;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* LoadBalancer resource.
* Azure REST API version: 2023-02-01. Prior API version in Azure Native 1.x: 2020-11-01.
*
* Other available API versions: 2015-05-01-preview, 2018-06-01, 2019-06-01, 2019-08-01, 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01, 2024-03-01.
*
* ## Example Usage
* ### Create load balancer
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.network.LoadBalancer;
* import com.pulumi.azurenative.network.LoadBalancerArgs;
* import com.pulumi.azurenative.network.inputs.BackendAddressPoolArgs;
* import com.pulumi.azurenative.network.inputs.FrontendIPConfigurationArgs;
* import com.pulumi.azurenative.network.inputs.SubnetArgs;
* import com.pulumi.azurenative.network.inputs.InboundNatRuleArgs;
* import com.pulumi.azurenative.network.inputs.SubResourceArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancingRuleArgs;
* import com.pulumi.azurenative.network.inputs.ProbeArgs;
* 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 loadBalancer = new LoadBalancer("loadBalancer", LoadBalancerArgs.builder()
* .backendAddressPools(BackendAddressPoolArgs.builder()
* .name("be-lb")
* .build())
* .frontendIPConfigurations(FrontendIPConfigurationArgs.builder()
* .name("fe-lb")
* .subnet(SubnetArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")
* .build())
* .build())
* .inboundNatPools()
* .inboundNatRules(InboundNatRuleArgs.builder()
* .backendPort(3389)
* .enableFloatingIP(true)
* .enableTcpReset(false)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .frontendPort(3389)
* .idleTimeoutInMinutes(15)
* .name("in-nat-rule")
* .protocol("Tcp")
* .build())
* .loadBalancerName("lb")
* .loadBalancingRules(LoadBalancingRuleArgs.builder()
* .backendAddressPool(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")
* .build())
* .backendPort(80)
* .enableFloatingIP(true)
* .enableTcpReset(false)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .frontendPort(80)
* .idleTimeoutInMinutes(15)
* .loadDistribution("Default")
* .name("rulelb")
* .probe(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")
* .build())
* .protocol("Tcp")
* .build())
* .location("eastus")
* .probes(ProbeArgs.builder()
* .intervalInSeconds(15)
* .name("probe-lb")
* .numberOfProbes(2)
* .port(80)
* .probeThreshold(1)
* .protocol("Http")
* .requestPath("healthcheck.aspx")
* .build())
* .resourceGroupName("rg1")
* .build());
*
* }
* }
*
* }
*
* ### Create load balancer with Frontend IP in Zone 1
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.network.LoadBalancer;
* import com.pulumi.azurenative.network.LoadBalancerArgs;
* import com.pulumi.azurenative.network.inputs.BackendAddressPoolArgs;
* import com.pulumi.azurenative.network.inputs.FrontendIPConfigurationArgs;
* import com.pulumi.azurenative.network.inputs.SubnetArgs;
* import com.pulumi.azurenative.network.inputs.InboundNatRuleArgs;
* import com.pulumi.azurenative.network.inputs.SubResourceArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancingRuleArgs;
* import com.pulumi.azurenative.network.inputs.ProbeArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancerSkuArgs;
* 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 loadBalancer = new LoadBalancer("loadBalancer", LoadBalancerArgs.builder()
* .backendAddressPools(BackendAddressPoolArgs.builder()
* .name("be-lb")
* .build())
* .frontendIPConfigurations(FrontendIPConfigurationArgs.builder()
* .name("fe-lb")
* .subnet(SubnetArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")
* .build())
* .zones("1")
* .build())
* .inboundNatPools()
* .inboundNatRules(InboundNatRuleArgs.builder()
* .backendPort(3389)
* .enableFloatingIP(true)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .frontendPort(3389)
* .idleTimeoutInMinutes(15)
* .name("in-nat-rule")
* .protocol("Tcp")
* .build())
* .loadBalancerName("lb")
* .loadBalancingRules(LoadBalancingRuleArgs.builder()
* .backendAddressPool(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")
* .build())
* .backendPort(80)
* .enableFloatingIP(true)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .frontendPort(80)
* .idleTimeoutInMinutes(15)
* .loadDistribution("Default")
* .name("rulelb")
* .probe(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")
* .build())
* .protocol("Tcp")
* .build())
* .location("eastus")
* .outboundRules()
* .probes(ProbeArgs.builder()
* .intervalInSeconds(15)
* .name("probe-lb")
* .numberOfProbes(2)
* .port(80)
* .probeThreshold(1)
* .protocol("Http")
* .requestPath("healthcheck.aspx")
* .build())
* .resourceGroupName("rg1")
* .sku(LoadBalancerSkuArgs.builder()
* .name("Standard")
* .build())
* .build());
*
* }
* }
*
* }
*
* ### Create load balancer with Gateway Load Balancer Consumer configured
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.network.LoadBalancer;
* import com.pulumi.azurenative.network.LoadBalancerArgs;
* import com.pulumi.azurenative.network.inputs.BackendAddressPoolArgs;
* import com.pulumi.azurenative.network.inputs.FrontendIPConfigurationArgs;
* import com.pulumi.azurenative.network.inputs.SubResourceArgs;
* import com.pulumi.azurenative.network.inputs.SubnetArgs;
* import com.pulumi.azurenative.network.inputs.InboundNatRuleArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancingRuleArgs;
* import com.pulumi.azurenative.network.inputs.ProbeArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancerSkuArgs;
* 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 loadBalancer = new LoadBalancer("loadBalancer", LoadBalancerArgs.builder()
* .backendAddressPools(BackendAddressPoolArgs.builder()
* .name("be-lb")
* .build())
* .frontendIPConfigurations(FrontendIPConfigurationArgs.builder()
* .gatewayLoadBalancer(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb-provider")
* .build())
* .name("fe-lb")
* .subnet(SubnetArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")
* .build())
* .build())
* .inboundNatPools()
* .inboundNatRules(InboundNatRuleArgs.builder()
* .backendPort(3389)
* .enableFloatingIP(true)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .frontendPort(3389)
* .idleTimeoutInMinutes(15)
* .name("in-nat-rule")
* .protocol("Tcp")
* .build())
* .loadBalancerName("lb")
* .loadBalancingRules(LoadBalancingRuleArgs.builder()
* .backendAddressPool(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")
* .build())
* .backendPort(80)
* .enableFloatingIP(true)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .frontendPort(80)
* .idleTimeoutInMinutes(15)
* .loadDistribution("Default")
* .name("rulelb")
* .probe(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")
* .build())
* .protocol("Tcp")
* .build())
* .location("eastus")
* .outboundRules()
* .probes(ProbeArgs.builder()
* .intervalInSeconds(15)
* .name("probe-lb")
* .numberOfProbes(2)
* .port(80)
* .probeThreshold(1)
* .protocol("Http")
* .requestPath("healthcheck.aspx")
* .build())
* .resourceGroupName("rg1")
* .sku(LoadBalancerSkuArgs.builder()
* .name("Standard")
* .build())
* .build());
*
* }
* }
*
* }
*
* ### Create load balancer with Gateway Load Balancer Provider configured with one Backend Pool
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.network.LoadBalancer;
* import com.pulumi.azurenative.network.LoadBalancerArgs;
* import com.pulumi.azurenative.network.inputs.BackendAddressPoolArgs;
* import com.pulumi.azurenative.network.inputs.FrontendIPConfigurationArgs;
* import com.pulumi.azurenative.network.inputs.SubnetArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancingRuleArgs;
* import com.pulumi.azurenative.network.inputs.SubResourceArgs;
* import com.pulumi.azurenative.network.inputs.ProbeArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancerSkuArgs;
* 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 loadBalancer = new LoadBalancer("loadBalancer", LoadBalancerArgs.builder()
* .backendAddressPools(BackendAddressPoolArgs.builder()
* .name("be-lb")
* .tunnelInterfaces(
* GatewayLoadBalancerTunnelInterfaceArgs.builder()
* .identifier(900)
* .port(15000)
* .protocol("VXLAN")
* .type("Internal")
* .build(),
* GatewayLoadBalancerTunnelInterfaceArgs.builder()
* .identifier(901)
* .port(15001)
* .protocol("VXLAN")
* .type("Internal")
* .build())
* .build())
* .frontendIPConfigurations(FrontendIPConfigurationArgs.builder()
* .name("fe-lb")
* .subnet(SubnetArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")
* .build())
* .build())
* .inboundNatPools()
* .loadBalancerName("lb")
* .loadBalancingRules(LoadBalancingRuleArgs.builder()
* .backendAddressPools(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")
* .build())
* .backendPort(0)
* .enableFloatingIP(true)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .frontendPort(0)
* .idleTimeoutInMinutes(15)
* .loadDistribution("Default")
* .name("rulelb")
* .probe(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")
* .build())
* .protocol("All")
* .build())
* .location("eastus")
* .outboundRules()
* .probes(ProbeArgs.builder()
* .intervalInSeconds(15)
* .name("probe-lb")
* .numberOfProbes(2)
* .port(80)
* .probeThreshold(1)
* .protocol("Http")
* .requestPath("healthcheck.aspx")
* .build())
* .resourceGroupName("rg1")
* .sku(LoadBalancerSkuArgs.builder()
* .name("Premium")
* .build())
* .build());
*
* }
* }
*
* }
*
* ### Create load balancer with Gateway Load Balancer Provider configured with two Backend Pool
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.network.LoadBalancer;
* import com.pulumi.azurenative.network.LoadBalancerArgs;
* import com.pulumi.azurenative.network.inputs.BackendAddressPoolArgs;
* import com.pulumi.azurenative.network.inputs.FrontendIPConfigurationArgs;
* import com.pulumi.azurenative.network.inputs.SubnetArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancingRuleArgs;
* import com.pulumi.azurenative.network.inputs.SubResourceArgs;
* import com.pulumi.azurenative.network.inputs.ProbeArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancerSkuArgs;
* 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 loadBalancer = new LoadBalancer("loadBalancer", LoadBalancerArgs.builder()
* .backendAddressPools(
* BackendAddressPoolArgs.builder()
* .name("be-lb1")
* .build(),
* BackendAddressPoolArgs.builder()
* .name("be-lb2")
* .build())
* .frontendIPConfigurations(FrontendIPConfigurationArgs.builder()
* .name("fe-lb")
* .subnet(SubnetArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")
* .build())
* .build())
* .inboundNatPools()
* .loadBalancerName("lb")
* .loadBalancingRules(LoadBalancingRuleArgs.builder()
* .backendAddressPool()
* .backendAddressPools(
* SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb1")
* .build(),
* SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb2")
* .build())
* .backendPort(0)
* .enableFloatingIP(true)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .frontendPort(0)
* .idleTimeoutInMinutes(15)
* .loadDistribution("Default")
* .name("rulelb")
* .probe(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")
* .build())
* .protocol("All")
* .build())
* .location("eastus")
* .outboundRules()
* .probes(ProbeArgs.builder()
* .intervalInSeconds(15)
* .name("probe-lb")
* .numberOfProbes(2)
* .port(80)
* .probeThreshold(1)
* .protocol("Http")
* .requestPath("healthcheck.aspx")
* .build())
* .resourceGroupName("rg1")
* .sku(LoadBalancerSkuArgs.builder()
* .name("Premium")
* .build())
* .build());
*
* }
* }
*
* }
*
* ### Create load balancer with Global Tier and one regional load balancer in its backend pool
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.network.LoadBalancer;
* import com.pulumi.azurenative.network.LoadBalancerArgs;
* import com.pulumi.azurenative.network.inputs.BackendAddressPoolArgs;
* import com.pulumi.azurenative.network.inputs.FrontendIPConfigurationArgs;
* import com.pulumi.azurenative.network.inputs.SubnetArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancingRuleArgs;
* import com.pulumi.azurenative.network.inputs.SubResourceArgs;
* import com.pulumi.azurenative.network.inputs.ProbeArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancerSkuArgs;
* 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 loadBalancer = new LoadBalancer("loadBalancer", LoadBalancerArgs.builder()
* .backendAddressPools(BackendAddressPoolArgs.builder()
* .loadBalancerBackendAddresses(LoadBalancerBackendAddressArgs.builder()
* .loadBalancerFrontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/regional-lb-rg1/providers/Microsoft.Network/loadBalancers/regional-lb/frontendIPConfigurations/fe-rlb")
* .build())
* .name("regional-lb1-address")
* .build())
* .name("be-lb")
* .build())
* .frontendIPConfigurations(FrontendIPConfigurationArgs.builder()
* .name("fe-lb")
* .subnet(SubnetArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")
* .build())
* .build())
* .loadBalancerName("lb")
* .loadBalancingRules(LoadBalancingRuleArgs.builder()
* .backendAddressPool(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")
* .build())
* .backendPort(80)
* .enableFloatingIP(false)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .frontendPort(80)
* .idleTimeoutInMinutes(15)
* .loadDistribution("Default")
* .name("rulelb")
* .probe(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")
* .build())
* .protocol("Tcp")
* .build())
* .location("eastus")
* .probes(ProbeArgs.builder()
* .intervalInSeconds(15)
* .name("probe-lb")
* .numberOfProbes(2)
* .port(80)
* .probeThreshold(1)
* .protocol("Http")
* .requestPath("healthcheck.aspx")
* .build())
* .resourceGroupName("rg1")
* .sku(LoadBalancerSkuArgs.builder()
* .name("Standard")
* .tier("Global")
* .build())
* .build());
*
* }
* }
*
* }
*
* ### Create load balancer with Standard SKU
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.network.LoadBalancer;
* import com.pulumi.azurenative.network.LoadBalancerArgs;
* import com.pulumi.azurenative.network.inputs.BackendAddressPoolArgs;
* import com.pulumi.azurenative.network.inputs.FrontendIPConfigurationArgs;
* import com.pulumi.azurenative.network.inputs.SubnetArgs;
* import com.pulumi.azurenative.network.inputs.InboundNatRuleArgs;
* import com.pulumi.azurenative.network.inputs.SubResourceArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancingRuleArgs;
* import com.pulumi.azurenative.network.inputs.ProbeArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancerSkuArgs;
* 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 loadBalancer = new LoadBalancer("loadBalancer", LoadBalancerArgs.builder()
* .backendAddressPools(BackendAddressPoolArgs.builder()
* .name("be-lb")
* .build())
* .frontendIPConfigurations(FrontendIPConfigurationArgs.builder()
* .name("fe-lb")
* .subnet(SubnetArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/vnetlb/subnets/subnetlb")
* .build())
* .build())
* .inboundNatPools()
* .inboundNatRules(InboundNatRuleArgs.builder()
* .backendPort(3389)
* .enableFloatingIP(true)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .frontendPort(3389)
* .idleTimeoutInMinutes(15)
* .name("in-nat-rule")
* .protocol("Tcp")
* .build())
* .loadBalancerName("lb")
* .loadBalancingRules(LoadBalancingRuleArgs.builder()
* .backendAddressPool(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")
* .build())
* .backendPort(80)
* .enableFloatingIP(true)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .frontendPort(80)
* .idleTimeoutInMinutes(15)
* .loadDistribution("Default")
* .name("rulelb")
* .probe(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")
* .build())
* .protocol("Tcp")
* .build())
* .location("eastus")
* .outboundRules()
* .probes(ProbeArgs.builder()
* .intervalInSeconds(15)
* .name("probe-lb")
* .numberOfProbes(2)
* .port(80)
* .probeThreshold(1)
* .protocol("Http")
* .requestPath("healthcheck.aspx")
* .build())
* .resourceGroupName("rg1")
* .sku(LoadBalancerSkuArgs.builder()
* .name("Standard")
* .build())
* .build());
*
* }
* }
*
* }
*
* ### Create load balancer with inbound nat pool
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.network.LoadBalancer;
* import com.pulumi.azurenative.network.LoadBalancerArgs;
* import com.pulumi.azurenative.network.inputs.FrontendIPConfigurationArgs;
* import com.pulumi.azurenative.network.inputs.SubnetArgs;
* import com.pulumi.azurenative.network.inputs.InboundNatPoolArgs;
* import com.pulumi.azurenative.network.inputs.SubResourceArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancerSkuArgs;
* 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 loadBalancer = new LoadBalancer("loadBalancer", LoadBalancerArgs.builder()
* .backendAddressPools()
* .frontendIPConfigurations(FrontendIPConfigurationArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test")
* .name("test")
* .privateIPAllocationMethod("Dynamic")
* .subnet(SubnetArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/lbvnet/subnets/lbsubnet")
* .build())
* .zones()
* .build())
* .inboundNatPools(InboundNatPoolArgs.builder()
* .backendPort(8888)
* .enableFloatingIP(true)
* .enableTcpReset(true)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/test")
* .build())
* .frontendPortRangeEnd(8085)
* .frontendPortRangeStart(8080)
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/inboundNatPools/test")
* .idleTimeoutInMinutes(10)
* .name("test")
* .protocol("Tcp")
* .build())
* .inboundNatRules()
* .loadBalancerName("lb")
* .loadBalancingRules()
* .location("eastus")
* .outboundRules()
* .probes()
* .resourceGroupName("rg1")
* .sku(LoadBalancerSkuArgs.builder()
* .name("Standard")
* .build())
* .build());
*
* }
* }
*
* }
*
* ### Create load balancer with outbound rules
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.network.LoadBalancer;
* import com.pulumi.azurenative.network.LoadBalancerArgs;
* import com.pulumi.azurenative.network.inputs.BackendAddressPoolArgs;
* import com.pulumi.azurenative.network.inputs.FrontendIPConfigurationArgs;
* import com.pulumi.azurenative.network.inputs.PublicIPAddressArgs;
* import com.pulumi.azurenative.network.inputs.InboundNatRuleArgs;
* import com.pulumi.azurenative.network.inputs.SubResourceArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancingRuleArgs;
* import com.pulumi.azurenative.network.inputs.OutboundRuleArgs;
* import com.pulumi.azurenative.network.inputs.ProbeArgs;
* import com.pulumi.azurenative.network.inputs.LoadBalancerSkuArgs;
* 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 loadBalancer = new LoadBalancer("loadBalancer", LoadBalancerArgs.builder()
* .backendAddressPools(BackendAddressPoolArgs.builder()
* .name("be-lb")
* .build())
* .frontendIPConfigurations(FrontendIPConfigurationArgs.builder()
* .name("fe-lb")
* .publicIPAddress(PublicIPAddressArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/publicIPAddresses/pip")
* .build())
* .build())
* .inboundNatPools()
* .inboundNatRules(InboundNatRuleArgs.builder()
* .backendPort(3389)
* .enableFloatingIP(true)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .frontendPort(3389)
* .idleTimeoutInMinutes(15)
* .name("in-nat-rule")
* .protocol("Tcp")
* .build())
* .loadBalancerName("lb")
* .loadBalancingRules(LoadBalancingRuleArgs.builder()
* .backendAddressPool(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")
* .build())
* .backendPort(80)
* .disableOutboundSnat(true)
* .enableFloatingIP(true)
* .frontendIPConfiguration(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .frontendPort(80)
* .idleTimeoutInMinutes(15)
* .loadDistribution("Default")
* .name("rulelb")
* .probe(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/probes/probe-lb")
* .build())
* .protocol("Tcp")
* .build())
* .location("eastus")
* .outboundRules(OutboundRuleArgs.builder()
* .backendAddressPool(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/backendAddressPools/be-lb")
* .build())
* .frontendIPConfigurations(SubResourceArgs.builder()
* .id("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/loadBalancers/lb/frontendIPConfigurations/fe-lb")
* .build())
* .name("rule1")
* .protocol("All")
* .build())
* .probes(ProbeArgs.builder()
* .intervalInSeconds(15)
* .name("probe-lb")
* .numberOfProbes(2)
* .port(80)
* .probeThreshold(1)
* .protocol("Http")
* .requestPath("healthcheck.aspx")
* .build())
* .resourceGroupName("rg1")
* .sku(LoadBalancerSkuArgs.builder()
* .name("Standard")
* .build())
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:network:LoadBalancer lb /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}
* ```
*
*/
@ResourceType(type="azure-native:network:LoadBalancer")
public class LoadBalancer extends com.pulumi.resources.CustomResource {
/**
* Collection of backend address pools used by a load balancer.
*
*/
@Export(name="backendAddressPools", refs={List.class,BackendAddressPoolResponse.class}, tree="[0,1]")
private Output* @Nullable */ List> backendAddressPools;
/**
* @return Collection of backend address pools used by a load balancer.
*
*/
public Output>> backendAddressPools() {
return Codegen.optional(this.backendAddressPools);
}
/**
* A unique read-only string that changes whenever the resource is updated.
*
*/
@Export(name="etag", refs={String.class}, tree="[0]")
private Output etag;
/**
* @return A unique read-only string that changes whenever the resource is updated.
*
*/
public Output etag() {
return this.etag;
}
/**
* The extended location of the load balancer.
*
*/
@Export(name="extendedLocation", refs={ExtendedLocationResponse.class}, tree="[0]")
private Output* @Nullable */ ExtendedLocationResponse> extendedLocation;
/**
* @return The extended location of the load balancer.
*
*/
public Output> extendedLocation() {
return Codegen.optional(this.extendedLocation);
}
/**
* Object representing the frontend IPs to be used for the load balancer.
*
*/
@Export(name="frontendIPConfigurations", refs={List.class,FrontendIPConfigurationResponse.class}, tree="[0,1]")
private Output* @Nullable */ List> frontendIPConfigurations;
/**
* @return Object representing the frontend IPs to be used for the load balancer.
*
*/
public Output>> frontendIPConfigurations() {
return Codegen.optional(this.frontendIPConfigurations);
}
/**
* Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound NAT rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules.
*
*/
@Export(name="inboundNatPools", refs={List.class,InboundNatPoolResponse.class}, tree="[0,1]")
private Output* @Nullable */ List> inboundNatPools;
/**
* @return Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound NAT rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules.
*
*/
public Output>> inboundNatPools() {
return Codegen.optional(this.inboundNatPools);
}
/**
* Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules.
*
*/
@Export(name="inboundNatRules", refs={List.class,InboundNatRuleResponse.class}, tree="[0,1]")
private Output* @Nullable */ List> inboundNatRules;
/**
* @return Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules.
*
*/
public Output>> inboundNatRules() {
return Codegen.optional(this.inboundNatRules);
}
/**
* Object collection representing the load balancing rules Gets the provisioning.
*
*/
@Export(name="loadBalancingRules", refs={List.class,LoadBalancingRuleResponse.class}, tree="[0,1]")
private Output* @Nullable */ List> loadBalancingRules;
/**
* @return Object collection representing the load balancing rules Gets the provisioning.
*
*/
public Output>> loadBalancingRules() {
return Codegen.optional(this.loadBalancingRules);
}
/**
* Resource location.
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> location;
/**
* @return Resource location.
*
*/
public Output> location() {
return Codegen.optional(this.location);
}
/**
* Resource name.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return Resource name.
*
*/
public Output name() {
return this.name;
}
/**
* The outbound rules.
*
*/
@Export(name="outboundRules", refs={List.class,OutboundRuleResponse.class}, tree="[0,1]")
private Output* @Nullable */ List> outboundRules;
/**
* @return The outbound rules.
*
*/
public Output>> outboundRules() {
return Codegen.optional(this.outboundRules);
}
/**
* Collection of probe objects used in the load balancer.
*
*/
@Export(name="probes", refs={List.class,ProbeResponse.class}, tree="[0,1]")
private Output* @Nullable */ List> probes;
/**
* @return Collection of probe objects used in the load balancer.
*
*/
public Output>> probes() {
return Codegen.optional(this.probes);
}
/**
* The provisioning state of the load balancer resource.
*
*/
@Export(name="provisioningState", refs={String.class}, tree="[0]")
private Output provisioningState;
/**
* @return The provisioning state of the load balancer resource.
*
*/
public Output provisioningState() {
return this.provisioningState;
}
/**
* The resource GUID property of the load balancer resource.
*
*/
@Export(name="resourceGuid", refs={String.class}, tree="[0]")
private Output resourceGuid;
/**
* @return The resource GUID property of the load balancer resource.
*
*/
public Output resourceGuid() {
return this.resourceGuid;
}
/**
* The load balancer SKU.
*
*/
@Export(name="sku", refs={LoadBalancerSkuResponse.class}, tree="[0]")
private Output* @Nullable */ LoadBalancerSkuResponse> sku;
/**
* @return The load balancer SKU.
*
*/
public Output> sku() {
return Codegen.optional(this.sku);
}
/**
* Resource tags.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return Resource tags.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* Resource type.
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return Resource type.
*
*/
public Output type() {
return this.type;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public LoadBalancer(java.lang.String name) {
this(name, LoadBalancerArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public LoadBalancer(java.lang.String name, LoadBalancerArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public LoadBalancer(java.lang.String name, LoadBalancerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:network:LoadBalancer", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private LoadBalancer(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:network:LoadBalancer", name, null, makeResourceOptions(options, id), false);
}
private static LoadBalancerArgs makeArgs(LoadBalancerArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? LoadBalancerArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.aliases(List.of(
Output.of(Alias.builder().type("azure-native:network/v20150501preview:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20150615:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20160330:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20160601:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20160901:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20161201:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20170301:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20170601:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20170801:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20170901:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20171001:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20171101:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20180101:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20180201:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20180401:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20180601:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20180701:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20180801:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20181001:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20181101:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20181201:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20190201:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20190401:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20190601:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20190701:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20190801:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20190901:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20191101:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20191201:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20200301:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20200401:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20200501:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20200601:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20200701:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20200801:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20201101:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20210201:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20210301:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20210501:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20210801:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20220101:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20220501:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20220701:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20220901:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20221101:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20230201:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20230401:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20230501:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20230601:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20230901:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20231101:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20240101:LoadBalancer").build()),
Output.of(Alias.builder().type("azure-native:network/v20240301:LoadBalancer").build())
))
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host 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 options Optional settings to control the behavior of the CustomResource.
*/
public static LoadBalancer get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new LoadBalancer(name, id, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy