LoadBalancerArgs

data class LoadBalancerArgs(val addresses: Output<List<String>>? = null, val advertiseMode: Output<Either<String, AdvertiseMode>>? = null, val bgpPeers: Output<List<String>>? = null, val loadBalancerName: Output<String>? = null, val resourceUri: Output<String>? = null, val serviceSelector: Output<Map<String, String>>? = null) : ConvertibleToJava<LoadBalancerArgs>

A LoadBalancer resource for an Arc connected cluster (Microsoft.Kubernetes/connectedClusters) Uses Azure REST API version 2024-03-01. In version 2.x of the Azure Native provider, it used API version 2024-03-01.

Example Usage

LoadBalancers_CreateOrUpdate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var loadBalancer = new AzureNative.KubernetesRuntime.LoadBalancer("loadBalancer", new()
{
Addresses = new[]
{
"192.168.50.1/24",
"192.168.51.2-192.168.51.10",
},
AdvertiseMode = AzureNative.KubernetesRuntime.AdvertiseMode.ARP,
LoadBalancerName = "testlb",
ResourceUri = "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1",
ServiceSelector =
{
{ "app", "frontend" },
},
});
});
package main
import (
kubernetesruntime "github.com/pulumi/pulumi-azure-native-sdk/kubernetesruntime/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := kubernetesruntime.NewLoadBalancer(ctx, "loadBalancer", &kubernetesruntime.LoadBalancerArgs{
Addresses: pulumi.StringArray{
pulumi.String("192.168.50.1/24"),
pulumi.String("192.168.51.2-192.168.51.10"),
},
AdvertiseMode: pulumi.String(kubernetesruntime.AdvertiseModeARP),
LoadBalancerName: pulumi.String("testlb"),
ResourceUri: pulumi.String("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1"),
ServiceSelector: pulumi.StringMap{
"app": pulumi.String("frontend"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.kubernetesruntime.LoadBalancer;
import com.pulumi.azurenative.kubernetesruntime.LoadBalancerArgs;
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()
.addresses(
"192.168.50.1/24",
"192.168.51.2-192.168.51.10")
.advertiseMode("ARP")
.loadBalancerName("testlb")
.resourceUri("subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/example/providers/Microsoft.Kubernetes/connectedClusters/cluster1")
.serviceSelector(Map.of("app", "frontend"))
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:kubernetesruntime:LoadBalancer testlb /{resourceUri}/providers/Microsoft.KubernetesRuntime/loadBalancers/{loadBalancerName}

Constructors

Link copied to clipboard
constructor(addresses: Output<List<String>>? = null, advertiseMode: Output<Either<String, AdvertiseMode>>? = null, bgpPeers: Output<List<String>>? = null, loadBalancerName: Output<String>? = null, resourceUri: Output<String>? = null, serviceSelector: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard
val addresses: Output<List<String>>? = null

IP Range

Link copied to clipboard
val advertiseMode: Output<Either<String, AdvertiseMode>>? = null

Advertise Mode

Link copied to clipboard
val bgpPeers: Output<List<String>>? = null

The list of BGP peers it should advertise to. Null or empty means to advertise to all peers.

Link copied to clipboard
val loadBalancerName: Output<String>? = null

The name of the LoadBalancer

Link copied to clipboard
val resourceUri: Output<String>? = null

The fully qualified Azure Resource manager identifier of the resource.

Link copied to clipboard
val serviceSelector: Output<Map<String, String>>? = null

A dynamic label mapping to select related services. For instance, if you want to create a load balancer only for services with label "a=b", then please specify {"a": "b"} in the field.

Functions

Link copied to clipboard
open override fun toJava(): LoadBalancerArgs