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

com.pulumi.azurenative.sql.kotlin.InstanceFailoverGroupArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.sql.kotlin

import com.pulumi.azurenative.sql.InstanceFailoverGroupArgs.builder
import com.pulumi.azurenative.sql.kotlin.inputs.InstanceFailoverGroupReadOnlyEndpointArgs
import com.pulumi.azurenative.sql.kotlin.inputs.InstanceFailoverGroupReadOnlyEndpointArgsBuilder
import com.pulumi.azurenative.sql.kotlin.inputs.InstanceFailoverGroupReadWriteEndpointArgs
import com.pulumi.azurenative.sql.kotlin.inputs.InstanceFailoverGroupReadWriteEndpointArgsBuilder
import com.pulumi.azurenative.sql.kotlin.inputs.ManagedInstancePairInfoArgs
import com.pulumi.azurenative.sql.kotlin.inputs.ManagedInstancePairInfoArgsBuilder
import com.pulumi.azurenative.sql.kotlin.inputs.PartnerRegionInfoArgs
import com.pulumi.azurenative.sql.kotlin.inputs.PartnerRegionInfoArgsBuilder
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * An instance failover group.
 * Azure REST API version: 2021-11-01. Prior API version in Azure Native 1.x: 2020-11-01-preview.
 * Other available API versions: 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview.
 * ## Example Usage
 * ### Create failover group
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var instanceFailoverGroup = new AzureNative.Sql.InstanceFailoverGroup("instanceFailoverGroup", new()
 *     {
 *         FailoverGroupName = "failover-group-test-3",
 *         LocationName = "Japan East",
 *         ManagedInstancePairs = new[]
 *         {
 *             new AzureNative.Sql.Inputs.ManagedInstancePairInfoArgs
 *             {
 *                 PartnerManagedInstanceId = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance",
 *                 PrimaryManagedInstanceId = "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance",
 *             },
 *         },
 *         PartnerRegions = new[]
 *         {
 *             new AzureNative.Sql.Inputs.PartnerRegionInfoArgs
 *             {
 *                 Location = "Japan West",
 *             },
 *         },
 *         ReadOnlyEndpoint = new AzureNative.Sql.Inputs.InstanceFailoverGroupReadOnlyEndpointArgs
 *         {
 *             FailoverPolicy = AzureNative.Sql.ReadOnlyEndpointFailoverPolicy.Disabled,
 *         },
 *         ReadWriteEndpoint = new AzureNative.Sql.Inputs.InstanceFailoverGroupReadWriteEndpointArgs
 *         {
 *             FailoverPolicy = AzureNative.Sql.ReadWriteEndpointFailoverPolicy.Automatic,
 *             FailoverWithDataLossGracePeriodMinutes = 480,
 *         },
 *         ResourceGroupName = "Default",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := sql.NewInstanceFailoverGroup(ctx, "instanceFailoverGroup", &sql.InstanceFailoverGroupArgs{
 * 			FailoverGroupName: pulumi.String("failover-group-test-3"),
 * 			LocationName:      pulumi.String("Japan East"),
 * 			ManagedInstancePairs: sql.ManagedInstancePairInfoArray{
 * 				&sql.ManagedInstancePairInfoArgs{
 * 					PartnerManagedInstanceId: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance"),
 * 					PrimaryManagedInstanceId: pulumi.String("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance"),
 * 				},
 * 			},
 * 			PartnerRegions: sql.PartnerRegionInfoArray{
 * 				&sql.PartnerRegionInfoArgs{
 * 					Location: pulumi.String("Japan West"),
 * 				},
 * 			},
 * 			ReadOnlyEndpoint: &sql.InstanceFailoverGroupReadOnlyEndpointArgs{
 * 				FailoverPolicy: pulumi.String(sql.ReadOnlyEndpointFailoverPolicyDisabled),
 * 			},
 * 			ReadWriteEndpoint: &sql.InstanceFailoverGroupReadWriteEndpointArgs{
 * 				FailoverPolicy:                         pulumi.String(sql.ReadWriteEndpointFailoverPolicyAutomatic),
 * 				FailoverWithDataLossGracePeriodMinutes: pulumi.Int(480),
 * 			},
 * 			ResourceGroupName: pulumi.String("Default"),
 * 		})
 * 		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.sql.InstanceFailoverGroup;
 * import com.pulumi.azurenative.sql.InstanceFailoverGroupArgs;
 * import com.pulumi.azurenative.sql.inputs.ManagedInstancePairInfoArgs;
 * import com.pulumi.azurenative.sql.inputs.PartnerRegionInfoArgs;
 * import com.pulumi.azurenative.sql.inputs.InstanceFailoverGroupReadOnlyEndpointArgs;
 * import com.pulumi.azurenative.sql.inputs.InstanceFailoverGroupReadWriteEndpointArgs;
 * 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 instanceFailoverGroup = new InstanceFailoverGroup("instanceFailoverGroup", InstanceFailoverGroupArgs.builder()
 *             .failoverGroupName("failover-group-test-3")
 *             .locationName("Japan East")
 *             .managedInstancePairs(ManagedInstancePairInfoArgs.builder()
 *                 .partnerManagedInstanceId("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance")
 *                 .primaryManagedInstanceId("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance")
 *                 .build())
 *             .partnerRegions(PartnerRegionInfoArgs.builder()
 *                 .location("Japan West")
 *                 .build())
 *             .readOnlyEndpoint(InstanceFailoverGroupReadOnlyEndpointArgs.builder()
 *                 .failoverPolicy("Disabled")
 *                 .build())
 *             .readWriteEndpoint(InstanceFailoverGroupReadWriteEndpointArgs.builder()
 *                 .failoverPolicy("Automatic")
 *                 .failoverWithDataLossGracePeriodMinutes(480)
 *                 .build())
 *             .resourceGroupName("Default")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:sql:InstanceFailoverGroup failover-group-test-3 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}
 * ```
 * @property failoverGroupName The name of the failover group.
 * @property locationName The name of the region where the resource is located.
 * @property managedInstancePairs List of managed instance pairs in the failover group.
 * @property partnerRegions Partner region information for the failover group.
 * @property readOnlyEndpoint Read-only endpoint of the failover group instance.
 * @property readWriteEndpoint Read-write endpoint of the failover group instance.
 * @property resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
 */
public data class InstanceFailoverGroupArgs(
    public val failoverGroupName: Output? = null,
    public val locationName: Output? = null,
    public val managedInstancePairs: Output>? = null,
    public val partnerRegions: Output>? = null,
    public val readOnlyEndpoint: Output? = null,
    public val readWriteEndpoint: Output? = null,
    public val resourceGroupName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.sql.InstanceFailoverGroupArgs =
        com.pulumi.azurenative.sql.InstanceFailoverGroupArgs.builder()
            .failoverGroupName(failoverGroupName?.applyValue({ args0 -> args0 }))
            .locationName(locationName?.applyValue({ args0 -> args0 }))
            .managedInstancePairs(
                managedInstancePairs?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .partnerRegions(
                partnerRegions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .readOnlyEndpoint(readOnlyEndpoint?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .readWriteEndpoint(readWriteEndpoint?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [InstanceFailoverGroupArgs].
 */
@PulumiTagMarker
public class InstanceFailoverGroupArgsBuilder internal constructor() {
    private var failoverGroupName: Output? = null

    private var locationName: Output? = null

    private var managedInstancePairs: Output>? = null

    private var partnerRegions: Output>? = null

    private var readOnlyEndpoint: Output? = null

    private var readWriteEndpoint: Output? = null

    private var resourceGroupName: Output? = null

    /**
     * @param value The name of the failover group.
     */
    @JvmName("hdqdxokbckxahrgs")
    public suspend fun failoverGroupName(`value`: Output) {
        this.failoverGroupName = value
    }

    /**
     * @param value The name of the region where the resource is located.
     */
    @JvmName("hubvmnmpkeqnlulu")
    public suspend fun locationName(`value`: Output) {
        this.locationName = value
    }

    /**
     * @param value List of managed instance pairs in the failover group.
     */
    @JvmName("ocortuugddpvmgbs")
    public suspend fun managedInstancePairs(`value`: Output>) {
        this.managedInstancePairs = value
    }

    @JvmName("rvuhemcuxhwherra")
    public suspend fun managedInstancePairs(vararg values: Output) {
        this.managedInstancePairs = Output.all(values.asList())
    }

    /**
     * @param values List of managed instance pairs in the failover group.
     */
    @JvmName("jblebvccfyeqlits")
    public suspend fun managedInstancePairs(values: List>) {
        this.managedInstancePairs = Output.all(values)
    }

    /**
     * @param value Partner region information for the failover group.
     */
    @JvmName("cvohgqmjxaunclca")
    public suspend fun partnerRegions(`value`: Output>) {
        this.partnerRegions = value
    }

    @JvmName("toiolycuikguaohb")
    public suspend fun partnerRegions(vararg values: Output) {
        this.partnerRegions = Output.all(values.asList())
    }

    /**
     * @param values Partner region information for the failover group.
     */
    @JvmName("qluquvchegvngbrb")
    public suspend fun partnerRegions(values: List>) {
        this.partnerRegions = Output.all(values)
    }

    /**
     * @param value Read-only endpoint of the failover group instance.
     */
    @JvmName("sqljlbjkpopdiwlr")
    public suspend fun readOnlyEndpoint(`value`: Output) {
        this.readOnlyEndpoint = value
    }

    /**
     * @param value Read-write endpoint of the failover group instance.
     */
    @JvmName("mtrmkigyvgrsiggp")
    public suspend fun readWriteEndpoint(`value`: Output) {
        this.readWriteEndpoint = value
    }

    /**
     * @param value The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
     */
    @JvmName("pvuobnamyabtsmjk")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The name of the failover group.
     */
    @JvmName("hjjspftjeucflhop")
    public suspend fun failoverGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.failoverGroupName = mapped
    }

    /**
     * @param value The name of the region where the resource is located.
     */
    @JvmName("oqqrdhgdsbeqhsyt")
    public suspend fun locationName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.locationName = mapped
    }

    /**
     * @param value List of managed instance pairs in the failover group.
     */
    @JvmName("opxnkcxvjutmkxbu")
    public suspend fun managedInstancePairs(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.managedInstancePairs = mapped
    }

    /**
     * @param argument List of managed instance pairs in the failover group.
     */
    @JvmName("mhycstbpfvogxaoa")
    public suspend fun managedInstancePairs(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ManagedInstancePairInfoArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.managedInstancePairs = mapped
    }

    /**
     * @param argument List of managed instance pairs in the failover group.
     */
    @JvmName("uexebvnvqcahmvuq")
    public suspend fun managedInstancePairs(vararg argument: suspend ManagedInstancePairInfoArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ManagedInstancePairInfoArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.managedInstancePairs = mapped
    }

    /**
     * @param argument List of managed instance pairs in the failover group.
     */
    @JvmName("lmrohnynntqatuly")
    public suspend fun managedInstancePairs(argument: suspend ManagedInstancePairInfoArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ManagedInstancePairInfoArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.managedInstancePairs = mapped
    }

    /**
     * @param values List of managed instance pairs in the failover group.
     */
    @JvmName("fsjqbnppwmjaglus")
    public suspend fun managedInstancePairs(vararg values: ManagedInstancePairInfoArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.managedInstancePairs = mapped
    }

    /**
     * @param value Partner region information for the failover group.
     */
    @JvmName("rcoycfpsacjccwne")
    public suspend fun partnerRegions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.partnerRegions = mapped
    }

    /**
     * @param argument Partner region information for the failover group.
     */
    @JvmName("gpkdpsulqyufmxcv")
    public suspend fun partnerRegions(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            PartnerRegionInfoArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.partnerRegions = mapped
    }

    /**
     * @param argument Partner region information for the failover group.
     */
    @JvmName("dlqfmwkhvsataued")
    public suspend fun partnerRegions(vararg argument: suspend PartnerRegionInfoArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            PartnerRegionInfoArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.partnerRegions = mapped
    }

    /**
     * @param argument Partner region information for the failover group.
     */
    @JvmName("qidgfdkxyplrecmk")
    public suspend fun partnerRegions(argument: suspend PartnerRegionInfoArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(PartnerRegionInfoArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.partnerRegions = mapped
    }

    /**
     * @param values Partner region information for the failover group.
     */
    @JvmName("vwpgikusivntudbw")
    public suspend fun partnerRegions(vararg values: PartnerRegionInfoArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.partnerRegions = mapped
    }

    /**
     * @param value Read-only endpoint of the failover group instance.
     */
    @JvmName("tnldlriaclaefvre")
    public suspend fun readOnlyEndpoint(`value`: InstanceFailoverGroupReadOnlyEndpointArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.readOnlyEndpoint = mapped
    }

    /**
     * @param argument Read-only endpoint of the failover group instance.
     */
    @JvmName("nwuneartoycopoey")
    public suspend fun readOnlyEndpoint(argument: suspend InstanceFailoverGroupReadOnlyEndpointArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceFailoverGroupReadOnlyEndpointArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.readOnlyEndpoint = mapped
    }

    /**
     * @param value Read-write endpoint of the failover group instance.
     */
    @JvmName("xraatgeyjixnyxmb")
    public suspend fun readWriteEndpoint(`value`: InstanceFailoverGroupReadWriteEndpointArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.readWriteEndpoint = mapped
    }

    /**
     * @param argument Read-write endpoint of the failover group instance.
     */
    @JvmName("xfiephftrguaaxrf")
    public suspend fun readWriteEndpoint(argument: suspend InstanceFailoverGroupReadWriteEndpointArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceFailoverGroupReadWriteEndpointArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.readWriteEndpoint = mapped
    }

    /**
     * @param value The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
     */
    @JvmName("trfamclbcqmcyxwo")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    internal fun build(): InstanceFailoverGroupArgs = InstanceFailoverGroupArgs(
        failoverGroupName = failoverGroupName,
        locationName = locationName,
        managedInstancePairs = managedInstancePairs,
        partnerRegions = partnerRegions,
        readOnlyEndpoint = readOnlyEndpoint,
        readWriteEndpoint = readWriteEndpoint,
        resourceGroupName = resourceGroupName,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy