com.pulumi.azure.lb.kotlin.Probe.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.lb.kotlin
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
/**
* Builder for [Probe].
*/
@PulumiTagMarker
public class ProbeResourceBuilder internal constructor() {
public var name: String? = null
public var args: ProbeArgs = ProbeArgs()
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 ProbeArgsBuilder.() -> Unit) {
val builder = ProbeArgsBuilder()
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.opts(block)
}
internal fun build(): Probe {
val builtJavaResource = com.pulumi.azure.lb.Probe(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Probe(builtJavaResource)
}
}
/**
* Manages a LoadBalancer Probe Resource.
* > **NOTE** When using this resource, the Load Balancer needs to have a FrontEnd IP Configuration Attached
* ## Example Usage
* ```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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
* .location("West Europe")
* .build());
* var examplePublicIp = new PublicIp("examplePublicIp", PublicIpArgs.builder()
* .location(exampleResourceGroup.location())
* .resourceGroupName(exampleResourceGroup.name())
* .allocationMethod("Static")
* .build());
* var exampleLoadBalancer = new LoadBalancer("exampleLoadBalancer", LoadBalancerArgs.builder()
* .location(exampleResourceGroup.location())
* .resourceGroupName(exampleResourceGroup.name())
* .frontendIpConfigurations(LoadBalancerFrontendIpConfigurationArgs.builder()
* .name("PublicIPAddress")
* .publicIpAddressId(examplePublicIp.id())
* .build())
* .build());
* var exampleProbe = new Probe("exampleProbe", ProbeArgs.builder()
* .loadbalancerId(exampleLoadBalancer.id())
* .port(22)
* .build());
* }
* }
* ```
* ## 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
* ```
*
*/
public class Probe internal constructor(
override val javaResource: com.pulumi.azure.lb.Probe,
) : KotlinCustomResource(javaResource, ProbeMapper) {
/**
* The interval, in seconds between probes to the backend endpoint for health status. The default value is 15, the minimum value is 5.
*/
public val intervalInSeconds: Output?
get() = javaResource.intervalInSeconds().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
public val loadBalancerRules: Output>
get() = javaResource.loadBalancerRules().applyValue({ args0 -> args0.map({ args0 -> args0 }) })
/**
* The ID of the LoadBalancer in which to create the NAT Rule. Changing this forces a new resource to be created.
*/
public val loadbalancerId: Output
get() = javaResource.loadbalancerId().applyValue({ args0 -> args0 })
/**
* Specifies the name of the Probe. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The number of failed probe attempts after which the backend endpoint is removed from rotation. The default value is 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.
*/
public val numberOfProbes: Output?
get() = javaResource.numberOfProbes().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Port on which the Probe queries the backend endpoint. Possible values range from 1 to 65535, inclusive.
*/
public val port: Output
get() = javaResource.port().applyValue({ args0 -> args0 })
/**
* 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`.
*/
public val probeThreshold: Output?
get() = javaResource.probeThreshold().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* 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.
*/
public val protocol: Output
get() = javaResource.protocol().applyValue({ args0 -> args0 })
/**
* 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 val requestPath: Output?
get() = javaResource.requestPath().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object ProbeMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.lb.Probe::class == javaResource::class
override fun map(javaResource: Resource): Probe = Probe(javaResource as com.pulumi.azure.lb.Probe)
}
/**
* @see [Probe].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [Probe].
*/
public suspend fun probe(name: String, block: suspend ProbeResourceBuilder.() -> Unit): Probe {
val builder = ProbeResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [Probe].
* @param name The _unique_ name of the resulting resource.
*/
public fun probe(name: String): Probe {
val builder = ProbeResourceBuilder()
builder.name(name)
return builder.build()
}