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

com.pulumi.azure.lb.kotlin.ProbeArgs.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.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.lb.kotlin

import com.pulumi.azure.lb.ProbeArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages a LoadBalancer Probe Resource.
 * > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "LoadBalancerRG",
 *     location: "West Europe",
 * });
 * const examplePublicIp = new azure.network.PublicIp("example", {
 *     name: "PublicIPForLB",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     allocationMethod: "Static",
 * });
 * const exampleLoadBalancer = new azure.lb.LoadBalancer("example", {
 *     name: "TestLoadBalancer",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     frontendIpConfigurations: [{
 *         name: "PublicIPAddress",
 *         publicIpAddressId: examplePublicIp.id,
 *     }],
 * });
 * const exampleProbe = new azure.lb.Probe("example", {
 *     loadbalancerId: exampleLoadBalancer.id,
 *     name: "ssh-running-probe",
 *     port: 22,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="LoadBalancerRG",
 *     location="West Europe")
 * example_public_ip = azure.network.PublicIp("example",
 *     name="PublicIPForLB",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     allocation_method="Static")
 * example_load_balancer = azure.lb.LoadBalancer("example",
 *     name="TestLoadBalancer",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     frontend_ip_configurations=[{
 *         "name": "PublicIPAddress",
 *         "public_ip_address_id": example_public_ip.id,
 *     }])
 * example_probe = azure.lb.Probe("example",
 *     loadbalancer_id=example_load_balancer.id,
 *     name="ssh-running-probe",
 *     port=22)
 * ```
 * ```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 = "LoadBalancerRG",
 *         Location = "West Europe",
 *     });
 *     var examplePublicIp = new Azure.Network.PublicIp("example", new()
 *     {
 *         Name = "PublicIPForLB",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         AllocationMethod = "Static",
 *     });
 *     var exampleLoadBalancer = new Azure.Lb.LoadBalancer("example", new()
 *     {
 *         Name = "TestLoadBalancer",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         FrontendIpConfigurations = new[]
 *         {
 *             new Azure.Lb.Inputs.LoadBalancerFrontendIpConfigurationArgs
 *             {
 *                 Name = "PublicIPAddress",
 *                 PublicIpAddressId = examplePublicIp.Id,
 *             },
 *         },
 *     });
 *     var exampleProbe = new Azure.Lb.Probe("example", new()
 *     {
 *         LoadbalancerId = exampleLoadBalancer.Id,
 *         Name = "ssh-running-probe",
 *         Port = 22,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lb"
 * 	"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("LoadBalancerRG"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		examplePublicIp, err := network.NewPublicIp(ctx, "example", &network.PublicIpArgs{
 * 			Name:              pulumi.String("PublicIPForLB"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			AllocationMethod:  pulumi.String("Static"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleLoadBalancer, err := lb.NewLoadBalancer(ctx, "example", &lb.LoadBalancerArgs{
 * 			Name:              pulumi.String("TestLoadBalancer"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			FrontendIpConfigurations: lb.LoadBalancerFrontendIpConfigurationArray{
 * 				&lb.LoadBalancerFrontendIpConfigurationArgs{
 * 					Name:              pulumi.String("PublicIPAddress"),
 * 					PublicIpAddressId: examplePublicIp.ID(),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = lb.NewProbe(ctx, "example", &lb.ProbeArgs{
 * 			LoadbalancerId: exampleLoadBalancer.ID(),
 * 			Name:           pulumi.String("ssh-running-probe"),
 * 			Port:           pulumi.Int(22),
 * 		})
 * 		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.PublicIp;
 * import com.pulumi.azure.network.PublicIpArgs;
 * import com.pulumi.azure.lb.LoadBalancer;
 * import com.pulumi.azure.lb.LoadBalancerArgs;
 * import com.pulumi.azure.lb.inputs.LoadBalancerFrontendIpConfigurationArgs;
 * import com.pulumi.azure.lb.Probe;
 * import com.pulumi.azure.lb.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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("LoadBalancerRG")
 *             .location("West Europe")
 *             .build());
 *         var examplePublicIp = new PublicIp("examplePublicIp", PublicIpArgs.builder()
 *             .name("PublicIPForLB")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .allocationMethod("Static")
 *             .build());
 *         var exampleLoadBalancer = new LoadBalancer("exampleLoadBalancer", LoadBalancerArgs.builder()
 *             .name("TestLoadBalancer")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .frontendIpConfigurations(LoadBalancerFrontendIpConfigurationArgs.builder()
 *                 .name("PublicIPAddress")
 *                 .publicIpAddressId(examplePublicIp.id())
 *                 .build())
 *             .build());
 *         var exampleProbe = new Probe("exampleProbe", ProbeArgs.builder()
 *             .loadbalancerId(exampleLoadBalancer.id())
 *             .name("ssh-running-probe")
 *             .port(22)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: LoadBalancerRG
 *       location: West Europe
 *   examplePublicIp:
 *     type: azure:network:PublicIp
 *     name: example
 *     properties:
 *       name: PublicIPForLB
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       allocationMethod: Static
 *   exampleLoadBalancer:
 *     type: azure:lb:LoadBalancer
 *     name: example
 *     properties:
 *       name: TestLoadBalancer
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       frontendIpConfigurations:
 *         - name: PublicIPAddress
 *           publicIpAddressId: ${examplePublicIp.id}
 *   exampleProbe:
 *     type: azure:lb:Probe
 *     name: example
 *     properties:
 *       loadbalancerId: ${exampleLoadBalancer.id}
 *       name: ssh-running-probe
 *       port: 22
 * ```
 * 
 * ## Import
 * Load Balancer Probes can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:lb/probe:Probe example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/loadBalancers/lb1/probes/probe1
 * ```
 * @property intervalInSeconds The interval, in seconds between probes to the backend endpoint for health status. The default value is 15, the minimum value is 5.
 * @property loadbalancerId The ID of the LoadBalancer in which to create the Probe. Changing this forces a new resource to be created.
 * @property name Specifies the name of the Probe. Changing this forces a new resource to be created.
 * @property numberOfProbes The number of failed probe attempts after which the backend endpoint is removed from rotation. Default to `2`. NumberOfProbes multiplied by intervalInSeconds value must be greater or equal to 10.Endpoints are returned to rotation when at least one probe is successful.
 * @property port Port on which the Probe queries the backend endpoint. Possible values range from 1 to 65535, inclusive.
 * @property probeThreshold The number of consecutive successful or failed probes that allow or deny traffic to this endpoint. Possible values range from `1` to `100`. The default value is `1`.
 * @property protocol Specifies the protocol of the end point. Possible values are `Http`, `Https` or `Tcp`. If TCP is specified, a received ACK is required for the probe to be successful. If HTTP is specified, a 200 OK response from the specified URI is required for the probe to be successful. Defaults to `Tcp`.
 * @property requestPath The URI used for requesting health status from the backend endpoint. Required if protocol is set to `Http` or `Https`. Otherwise, it is not allowed.
 */
public data class ProbeArgs(
    public val intervalInSeconds: Output? = null,
    public val loadbalancerId: Output? = null,
    public val name: Output? = null,
    public val numberOfProbes: Output? = null,
    public val port: Output? = null,
    public val probeThreshold: Output? = null,
    public val protocol: Output? = null,
    public val requestPath: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.lb.ProbeArgs = com.pulumi.azure.lb.ProbeArgs.builder()
        .intervalInSeconds(intervalInSeconds?.applyValue({ args0 -> args0 }))
        .loadbalancerId(loadbalancerId?.applyValue({ args0 -> args0 }))
        .name(name?.applyValue({ args0 -> args0 }))
        .numberOfProbes(numberOfProbes?.applyValue({ args0 -> args0 }))
        .port(port?.applyValue({ args0 -> args0 }))
        .probeThreshold(probeThreshold?.applyValue({ args0 -> args0 }))
        .protocol(protocol?.applyValue({ args0 -> args0 }))
        .requestPath(requestPath?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ProbeArgs].
 */
@PulumiTagMarker
public class ProbeArgsBuilder internal constructor() {
    private var intervalInSeconds: Output? = null

    private var loadbalancerId: Output? = null

    private var name: Output? = null

    private var numberOfProbes: Output? = null

    private var port: Output? = null

    private var probeThreshold: Output? = null

    private var protocol: Output? = null

    private var requestPath: Output? = null

    /**
     * @param value The interval, in seconds between probes to the backend endpoint for health status. The default value is 15, the minimum value is 5.
     */
    @JvmName("ejxfldatffhydhfi")
    public suspend fun intervalInSeconds(`value`: Output) {
        this.intervalInSeconds = value
    }

    /**
     * @param value The ID of the LoadBalancer in which to create the Probe. Changing this forces a new resource to be created.
     */
    @JvmName("svrdixutanyqgokc")
    public suspend fun loadbalancerId(`value`: Output) {
        this.loadbalancerId = value
    }

    /**
     * @param value Specifies the name of the Probe. Changing this forces a new resource to be created.
     */
    @JvmName("rpkhhvjpqrklldqj")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The number of failed probe attempts after which the backend endpoint is removed from rotation. Default to `2`. NumberOfProbes multiplied by intervalInSeconds value must be greater or equal to 10.Endpoints are returned to rotation when at least one probe is successful.
     */
    @JvmName("xhygevomngglntav")
    public suspend fun numberOfProbes(`value`: Output) {
        this.numberOfProbes = value
    }

    /**
     * @param value Port on which the Probe queries the backend endpoint. Possible values range from 1 to 65535, inclusive.
     */
    @JvmName("igtesbxfdyqlekky")
    public suspend fun port(`value`: Output) {
        this.port = value
    }

    /**
     * @param value The number of consecutive successful or failed probes that allow or deny traffic to this endpoint. Possible values range from `1` to `100`. The default value is `1`.
     */
    @JvmName("eclysybvdadvpqcb")
    public suspend fun probeThreshold(`value`: Output) {
        this.probeThreshold = value
    }

    /**
     * @param value Specifies the protocol of the end point. Possible values are `Http`, `Https` or `Tcp`. If TCP is specified, a received ACK is required for the probe to be successful. If HTTP is specified, a 200 OK response from the specified URI is required for the probe to be successful. Defaults to `Tcp`.
     */
    @JvmName("ocqtbtmaviopwggf")
    public suspend fun protocol(`value`: Output) {
        this.protocol = value
    }

    /**
     * @param value The URI used for requesting health status from the backend endpoint. Required if protocol is set to `Http` or `Https`. Otherwise, it is not allowed.
     */
    @JvmName("ofjjlaiwyybwvgif")
    public suspend fun requestPath(`value`: Output) {
        this.requestPath = value
    }

    /**
     * @param value The interval, in seconds between probes to the backend endpoint for health status. The default value is 15, the minimum value is 5.
     */
    @JvmName("bdlffyoighmlbavy")
    public suspend fun intervalInSeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.intervalInSeconds = mapped
    }

    /**
     * @param value The ID of the LoadBalancer in which to create the Probe. Changing this forces a new resource to be created.
     */
    @JvmName("ybucnlvccyhldamq")
    public suspend fun loadbalancerId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.loadbalancerId = mapped
    }

    /**
     * @param value Specifies the name of the Probe. Changing this forces a new resource to be created.
     */
    @JvmName("gsckvlwnsmqhkhcj")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The number of failed probe attempts after which the backend endpoint is removed from rotation. Default to `2`. NumberOfProbes multiplied by intervalInSeconds value must be greater or equal to 10.Endpoints are returned to rotation when at least one probe is successful.
     */
    @JvmName("nnmikkhtlntfnruj")
    public suspend fun numberOfProbes(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.numberOfProbes = mapped
    }

    /**
     * @param value Port on which the Probe queries the backend endpoint. Possible values range from 1 to 65535, inclusive.
     */
    @JvmName("dswineqqumewuuee")
    public suspend fun port(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.port = mapped
    }

    /**
     * @param value The number of consecutive successful or failed probes that allow or deny traffic to this endpoint. Possible values range from `1` to `100`. The default value is `1`.
     */
    @JvmName("mnlrnucapxbhnoke")
    public suspend fun probeThreshold(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.probeThreshold = mapped
    }

    /**
     * @param value Specifies the protocol of the end point. Possible values are `Http`, `Https` or `Tcp`. If TCP is specified, a received ACK is required for the probe to be successful. If HTTP is specified, a 200 OK response from the specified URI is required for the probe to be successful. Defaults to `Tcp`.
     */
    @JvmName("vxbqxharvcqelyrm")
    public suspend fun protocol(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.protocol = mapped
    }

    /**
     * @param value The URI used for requesting health status from the backend endpoint. Required if protocol is set to `Http` or `Https`. Otherwise, it is not allowed.
     */
    @JvmName("lmysvynnvavoqxoh")
    public suspend fun requestPath(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestPath = mapped
    }

    internal fun build(): ProbeArgs = ProbeArgs(
        intervalInSeconds = intervalInSeconds,
        loadbalancerId = loadbalancerId,
        name = name,
        numberOfProbes = numberOfProbes,
        port = port,
        probeThreshold = probeThreshold,
        protocol = protocol,
        requestPath = requestPath,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy