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

com.pulumi.azurenative.cdn.kotlin.AFDOriginGroupArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.cdn.kotlin

import com.pulumi.azurenative.cdn.AFDOriginGroupArgs.builder
import com.pulumi.azurenative.cdn.kotlin.enums.EnabledState
import com.pulumi.azurenative.cdn.kotlin.inputs.HealthProbeParametersArgs
import com.pulumi.azurenative.cdn.kotlin.inputs.HealthProbeParametersArgsBuilder
import com.pulumi.azurenative.cdn.kotlin.inputs.LoadBalancingSettingsParametersArgs
import com.pulumi.azurenative.cdn.kotlin.inputs.LoadBalancingSettingsParametersArgsBuilder
import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * AFDOrigin group comprising of origins is used for load balancing to origins when the content cannot be served from Azure Front Door.
 * Azure REST API version: 2023-05-01. Prior API version in Azure Native 1.x: 2020-09-01.
 * Other available API versions: 2020-09-01, 2023-07-01-preview, 2024-02-01, 2024-05-01-preview, 2024-06-01-preview.
 * ## Example Usage
 * ### AFDOriginGroups_Create
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var afdOriginGroup = new AzureNative.Cdn.AFDOriginGroup("afdOriginGroup", new()
 *     {
 *         HealthProbeSettings = new AzureNative.Cdn.Inputs.HealthProbeParametersArgs
 *         {
 *             ProbeIntervalInSeconds = 10,
 *             ProbePath = "/path2",
 *             ProbeProtocol = AzureNative.Cdn.ProbeProtocol.NotSet,
 *             ProbeRequestType = AzureNative.Cdn.HealthProbeRequestType.NotSet,
 *         },
 *         LoadBalancingSettings = new AzureNative.Cdn.Inputs.LoadBalancingSettingsParametersArgs
 *         {
 *             AdditionalLatencyInMilliseconds = 1000,
 *             SampleSize = 3,
 *             SuccessfulSamplesRequired = 3,
 *         },
 *         OriginGroupName = "origingroup1",
 *         ProfileName = "profile1",
 *         ResourceGroupName = "RG",
 *         TrafficRestorationTimeToHealedOrNewEndpointsInMinutes = 5,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	cdn "github.com/pulumi/pulumi-azure-native-sdk/cdn/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cdn.NewAFDOriginGroup(ctx, "afdOriginGroup", &cdn.AFDOriginGroupArgs{
 * 			HealthProbeSettings: &cdn.HealthProbeParametersArgs{
 * 				ProbeIntervalInSeconds: pulumi.Int(10),
 * 				ProbePath:              pulumi.String("/path2"),
 * 				ProbeProtocol:          cdn.ProbeProtocolNotSet,
 * 				ProbeRequestType:       cdn.HealthProbeRequestTypeNotSet,
 * 			},
 * 			LoadBalancingSettings: &cdn.LoadBalancingSettingsParametersArgs{
 * 				AdditionalLatencyInMilliseconds: pulumi.Int(1000),
 * 				SampleSize:                      pulumi.Int(3),
 * 				SuccessfulSamplesRequired:       pulumi.Int(3),
 * 			},
 * 			OriginGroupName:   pulumi.String("origingroup1"),
 * 			ProfileName:       pulumi.String("profile1"),
 * 			ResourceGroupName: pulumi.String("RG"),
 * 			TrafficRestorationTimeToHealedOrNewEndpointsInMinutes: pulumi.Int(5),
 * 		})
 * 		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.azurenative.cdn.AFDOriginGroup;
 * import com.pulumi.azurenative.cdn.AFDOriginGroupArgs;
 * import com.pulumi.azurenative.cdn.inputs.HealthProbeParametersArgs;
 * import com.pulumi.azurenative.cdn.inputs.LoadBalancingSettingsParametersArgs;
 * 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 afdOriginGroup = new AFDOriginGroup("afdOriginGroup", AFDOriginGroupArgs.builder()
 *             .healthProbeSettings(HealthProbeParametersArgs.builder()
 *                 .probeIntervalInSeconds(10)
 *                 .probePath("/path2")
 *                 .probeProtocol("NotSet")
 *                 .probeRequestType("NotSet")
 *                 .build())
 *             .loadBalancingSettings(LoadBalancingSettingsParametersArgs.builder()
 *                 .additionalLatencyInMilliseconds(1000)
 *                 .sampleSize(3)
 *                 .successfulSamplesRequired(3)
 *                 .build())
 *             .originGroupName("origingroup1")
 *             .profileName("profile1")
 *             .resourceGroupName("RG")
 *             .trafficRestorationTimeToHealedOrNewEndpointsInMinutes(5)
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:cdn:AFDOriginGroup origingroup1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/originGroups/{originGroupName}
 * ```
 * @property healthProbeSettings Health probe settings to the origin that is used to determine the health of the origin.
 * @property loadBalancingSettings Load balancing settings for a backend pool
 * @property originGroupName Name of the origin group which is unique within the endpoint.
 * @property profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
 * @property resourceGroupName Name of the Resource group within the Azure subscription.
 * @property sessionAffinityState Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'
 * @property trafficRestorationTimeToHealedOrNewEndpointsInMinutes Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported.
 */
public data class AFDOriginGroupArgs(
    public val healthProbeSettings: Output? = null,
    public val loadBalancingSettings: Output? = null,
    public val originGroupName: Output? = null,
    public val profileName: Output? = null,
    public val resourceGroupName: Output? = null,
    public val sessionAffinityState: Output>? = null,
    public val trafficRestorationTimeToHealedOrNewEndpointsInMinutes: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.cdn.AFDOriginGroupArgs =
        com.pulumi.azurenative.cdn.AFDOriginGroupArgs.builder()
            .healthProbeSettings(
                healthProbeSettings?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .loadBalancingSettings(
                loadBalancingSettings?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .originGroupName(originGroupName?.applyValue({ args0 -> args0 }))
            .profileName(profileName?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .sessionAffinityState(
                sessionAffinityState?.applyValue({ args0 ->
                    args0.transform(
                        { args0 -> args0 },
                        { args0 -> args0.let({ args0 -> args0.toJava() }) },
                    )
                }),
            )
            .trafficRestorationTimeToHealedOrNewEndpointsInMinutes(
                trafficRestorationTimeToHealedOrNewEndpointsInMinutes?.applyValue({ args0 ->
                    args0
                }),
            ).build()
}

/**
 * Builder for [AFDOriginGroupArgs].
 */
@PulumiTagMarker
public class AFDOriginGroupArgsBuilder internal constructor() {
    private var healthProbeSettings: Output? = null

    private var loadBalancingSettings: Output? = null

    private var originGroupName: Output? = null

    private var profileName: Output? = null

    private var resourceGroupName: Output? = null

    private var sessionAffinityState: Output>? = null

    private var trafficRestorationTimeToHealedOrNewEndpointsInMinutes: Output? = null

    /**
     * @param value Health probe settings to the origin that is used to determine the health of the origin.
     */
    @JvmName("ikslfhcddknnlnop")
    public suspend fun healthProbeSettings(`value`: Output) {
        this.healthProbeSettings = value
    }

    /**
     * @param value Load balancing settings for a backend pool
     */
    @JvmName("nthohpgowmvswdqg")
    public suspend fun loadBalancingSettings(`value`: Output) {
        this.loadBalancingSettings = value
    }

    /**
     * @param value Name of the origin group which is unique within the endpoint.
     */
    @JvmName("sgrjdihjbjvyvlya")
    public suspend fun originGroupName(`value`: Output) {
        this.originGroupName = value
    }

    /**
     * @param value Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
     */
    @JvmName("oaglnbxbpbvtawcf")
    public suspend fun profileName(`value`: Output) {
        this.profileName = value
    }

    /**
     * @param value Name of the Resource group within the Azure subscription.
     */
    @JvmName("vksivowqhcotdwdy")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'
     */
    @JvmName("wipnlpsyevpafndo")
    public suspend fun sessionAffinityState(`value`: Output>) {
        this.sessionAffinityState = value
    }

    /**
     * @param value Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported.
     */
    @JvmName("votdxhbknaygelqg")
    public suspend fun trafficRestorationTimeToHealedOrNewEndpointsInMinutes(`value`: Output) {
        this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes = value
    }

    /**
     * @param value Health probe settings to the origin that is used to determine the health of the origin.
     */
    @JvmName("gwmseumvnlexqltv")
    public suspend fun healthProbeSettings(`value`: HealthProbeParametersArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.healthProbeSettings = mapped
    }

    /**
     * @param argument Health probe settings to the origin that is used to determine the health of the origin.
     */
    @JvmName("ebnscunvxpdgopli")
    public suspend fun healthProbeSettings(argument: suspend HealthProbeParametersArgsBuilder.() -> Unit) {
        val toBeMapped = HealthProbeParametersArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.healthProbeSettings = mapped
    }

    /**
     * @param value Load balancing settings for a backend pool
     */
    @JvmName("qlwjbphawrttykyb")
    public suspend fun loadBalancingSettings(`value`: LoadBalancingSettingsParametersArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.loadBalancingSettings = mapped
    }

    /**
     * @param argument Load balancing settings for a backend pool
     */
    @JvmName("hlafbprkswfmoluy")
    public suspend fun loadBalancingSettings(argument: suspend LoadBalancingSettingsParametersArgsBuilder.() -> Unit) {
        val toBeMapped = LoadBalancingSettingsParametersArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.loadBalancingSettings = mapped
    }

    /**
     * @param value Name of the origin group which is unique within the endpoint.
     */
    @JvmName("vywvjviinmpxqcwl")
    public suspend fun originGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.originGroupName = mapped
    }

    /**
     * @param value Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique within the resource group.
     */
    @JvmName("rdxchthrjqnkiydy")
    public suspend fun profileName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.profileName = mapped
    }

    /**
     * @param value Name of the Resource group within the Azure subscription.
     */
    @JvmName("hvvmdhmdniffspyf")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'
     */
    @JvmName("qboeuolitcsakgfp")
    public suspend fun sessionAffinityState(`value`: Either?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sessionAffinityState = mapped
    }

    /**
     * @param value Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'
     */
    @JvmName("ittfbukanbjaqfvq")
    public fun sessionAffinityState(`value`: String) {
        val toBeMapped = Either.ofLeft(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sessionAffinityState = mapped
    }

    /**
     * @param value Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'
     */
    @JvmName("coaxuswrbrmxvfma")
    public fun sessionAffinityState(`value`: EnabledState) {
        val toBeMapped = Either.ofRight(value)
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.sessionAffinityState = mapped
    }

    /**
     * @param value Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported.
     */
    @JvmName("qvgjfreyepoqheai")
    public suspend fun trafficRestorationTimeToHealedOrNewEndpointsInMinutes(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.trafficRestorationTimeToHealedOrNewEndpointsInMinutes = mapped
    }

    internal fun build(): AFDOriginGroupArgs = AFDOriginGroupArgs(
        healthProbeSettings = healthProbeSettings,
        loadBalancingSettings = loadBalancingSettings,
        originGroupName = originGroupName,
        profileName = profileName,
        resourceGroupName = resourceGroupName,
        sessionAffinityState = sessionAffinityState,
        trafficRestorationTimeToHealedOrNewEndpointsInMinutes = trafficRestorationTimeToHealedOrNewEndpointsInMinutes,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy