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

com.pulumi.azure.sql.kotlin.FailoverGroupArgs.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.sql.kotlin

import com.pulumi.azure.sql.FailoverGroupArgs.builder
import com.pulumi.azure.sql.kotlin.inputs.FailoverGroupPartnerServerArgs
import com.pulumi.azure.sql.kotlin.inputs.FailoverGroupPartnerServerArgsBuilder
import com.pulumi.azure.sql.kotlin.inputs.FailoverGroupReadWriteEndpointFailoverPolicyArgs
import com.pulumi.azure.sql.kotlin.inputs.FailoverGroupReadWriteEndpointFailoverPolicyArgsBuilder
import com.pulumi.azure.sql.kotlin.inputs.FailoverGroupReadonlyEndpointFailoverPolicyArgs
import com.pulumi.azure.sql.kotlin.inputs.FailoverGroupReadonlyEndpointFailoverPolicyArgsBuilder
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.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Create a failover group of databases on a collection of Azure SQL servers.
 * > **Note:** The `azure.sql.FailoverGroup` resource is deprecated in version 3.0 of the AzureRM provider and will be removed in version 4.0. Please use the `azure.mssql.FailoverGroup` resource instead.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const primary = new azure.sql.SqlServer("primary", {
 *     name: "sql-primary",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     version: "12.0",
 *     administratorLogin: "sqladmin",
 *     administratorLoginPassword: "pa$$w0rd",
 * });
 * const secondary = new azure.sql.SqlServer("secondary", {
 *     name: "sql-secondary",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     version: "12.0",
 *     administratorLogin: "sqladmin",
 *     administratorLoginPassword: "pa$$w0rd",
 * });
 * const db1 = new azure.sql.Database("db1", {
 *     name: "db1",
 *     resourceGroupName: primary.resourceGroupName,
 *     location: primary.location,
 *     serverName: primary.name,
 * });
 * const exampleFailoverGroup = new azure.sql.FailoverGroup("example", {
 *     name: "example-failover-group",
 *     resourceGroupName: primary.resourceGroupName,
 *     serverName: primary.name,
 *     databases: [db1.id],
 *     partnerServers: [{
 *         id: secondary.id,
 *     }],
 *     readWriteEndpointFailoverPolicy: {
 *         mode: "Automatic",
 *         graceMinutes: 60,
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * primary = azure.sql.SqlServer("primary",
 *     name="sql-primary",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     version="12.0",
 *     administrator_login="sqladmin",
 *     administrator_login_password="pa$$w0rd")
 * secondary = azure.sql.SqlServer("secondary",
 *     name="sql-secondary",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     version="12.0",
 *     administrator_login="sqladmin",
 *     administrator_login_password="pa$$w0rd")
 * db1 = azure.sql.Database("db1",
 *     name="db1",
 *     resource_group_name=primary.resource_group_name,
 *     location=primary.location,
 *     server_name=primary.name)
 * example_failover_group = azure.sql.FailoverGroup("example",
 *     name="example-failover-group",
 *     resource_group_name=primary.resource_group_name,
 *     server_name=primary.name,
 *     databases=[db1.id],
 *     partner_servers=[azure.sql.FailoverGroupPartnerServerArgs(
 *         id=secondary.id,
 *     )],
 *     read_write_endpoint_failover_policy=azure.sql.FailoverGroupReadWriteEndpointFailoverPolicyArgs(
 *         mode="Automatic",
 *         grace_minutes=60,
 *     ))
 * ```
 * ```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 = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var primary = new Azure.Sql.SqlServer("primary", new()
 *     {
 *         Name = "sql-primary",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Version = "12.0",
 *         AdministratorLogin = "sqladmin",
 *         AdministratorLoginPassword = "pa$$w0rd",
 *     });
 *     var secondary = new Azure.Sql.SqlServer("secondary", new()
 *     {
 *         Name = "sql-secondary",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Version = "12.0",
 *         AdministratorLogin = "sqladmin",
 *         AdministratorLoginPassword = "pa$$w0rd",
 *     });
 *     var db1 = new Azure.Sql.Database("db1", new()
 *     {
 *         Name = "db1",
 *         ResourceGroupName = primary.ResourceGroupName,
 *         Location = primary.Location,
 *         ServerName = primary.Name,
 *     });
 *     var exampleFailoverGroup = new Azure.Sql.FailoverGroup("example", new()
 *     {
 *         Name = "example-failover-group",
 *         ResourceGroupName = primary.ResourceGroupName,
 *         ServerName = primary.Name,
 *         Databases = new[]
 *         {
 *             db1.Id,
 *         },
 *         PartnerServers = new[]
 *         {
 *             new Azure.Sql.Inputs.FailoverGroupPartnerServerArgs
 *             {
 *                 Id = secondary.Id,
 *             },
 *         },
 *         ReadWriteEndpointFailoverPolicy = new Azure.Sql.Inputs.FailoverGroupReadWriteEndpointFailoverPolicyArgs
 *         {
 *             Mode = "Automatic",
 *             GraceMinutes = 60,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql"
 * 	"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("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		primary, err := sql.NewSqlServer(ctx, "primary", &sql.SqlServerArgs{
 * 			Name:                       pulumi.String("sql-primary"),
 * 			ResourceGroupName:          example.Name,
 * 			Location:                   example.Location,
 * 			Version:                    pulumi.String("12.0"),
 * 			AdministratorLogin:         pulumi.String("sqladmin"),
 * 			AdministratorLoginPassword: pulumi.String("pa$$w0rd"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		secondary, err := sql.NewSqlServer(ctx, "secondary", &sql.SqlServerArgs{
 * 			Name:                       pulumi.String("sql-secondary"),
 * 			ResourceGroupName:          example.Name,
 * 			Location:                   example.Location,
 * 			Version:                    pulumi.String("12.0"),
 * 			AdministratorLogin:         pulumi.String("sqladmin"),
 * 			AdministratorLoginPassword: pulumi.String("pa$$w0rd"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		db1, err := sql.NewDatabase(ctx, "db1", &sql.DatabaseArgs{
 * 			Name:              pulumi.String("db1"),
 * 			ResourceGroupName: primary.ResourceGroupName,
 * 			Location:          primary.Location,
 * 			ServerName:        primary.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = sql.NewFailoverGroup(ctx, "example", &sql.FailoverGroupArgs{
 * 			Name:              pulumi.String("example-failover-group"),
 * 			ResourceGroupName: primary.ResourceGroupName,
 * 			ServerName:        primary.Name,
 * 			Databases: pulumi.StringArray{
 * 				db1.ID(),
 * 			},
 * 			PartnerServers: sql.FailoverGroupPartnerServerArray{
 * 				&sql.FailoverGroupPartnerServerArgs{
 * 					Id: secondary.ID(),
 * 				},
 * 			},
 * 			ReadWriteEndpointFailoverPolicy: &sql.FailoverGroupReadWriteEndpointFailoverPolicyArgs{
 * 				Mode:         pulumi.String("Automatic"),
 * 				GraceMinutes: pulumi.Int(60),
 * 			},
 * 		})
 * 		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.sql.SqlServer;
 * import com.pulumi.azure.sql.SqlServerArgs;
 * import com.pulumi.azure.sql.Database;
 * import com.pulumi.azure.sql.DatabaseArgs;
 * import com.pulumi.azure.sql.FailoverGroup;
 * import com.pulumi.azure.sql.FailoverGroupArgs;
 * import com.pulumi.azure.sql.inputs.FailoverGroupPartnerServerArgs;
 * import com.pulumi.azure.sql.inputs.FailoverGroupReadWriteEndpointFailoverPolicyArgs;
 * 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("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var primary = new SqlServer("primary", SqlServerArgs.builder()
 *             .name("sql-primary")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .version("12.0")
 *             .administratorLogin("sqladmin")
 *             .administratorLoginPassword("pa$$w0rd")
 *             .build());
 *         var secondary = new SqlServer("secondary", SqlServerArgs.builder()
 *             .name("sql-secondary")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .version("12.0")
 *             .administratorLogin("sqladmin")
 *             .administratorLoginPassword("pa$$w0rd")
 *             .build());
 *         var db1 = new Database("db1", DatabaseArgs.builder()
 *             .name("db1")
 *             .resourceGroupName(primary.resourceGroupName())
 *             .location(primary.location())
 *             .serverName(primary.name())
 *             .build());
 *         var exampleFailoverGroup = new FailoverGroup("exampleFailoverGroup", FailoverGroupArgs.builder()
 *             .name("example-failover-group")
 *             .resourceGroupName(primary.resourceGroupName())
 *             .serverName(primary.name())
 *             .databases(db1.id())
 *             .partnerServers(FailoverGroupPartnerServerArgs.builder()
 *                 .id(secondary.id())
 *                 .build())
 *             .readWriteEndpointFailoverPolicy(FailoverGroupReadWriteEndpointFailoverPolicyArgs.builder()
 *                 .mode("Automatic")
 *                 .graceMinutes(60)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   primary:
 *     type: azure:sql:SqlServer
 *     properties:
 *       name: sql-primary
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       version: '12.0'
 *       administratorLogin: sqladmin
 *       administratorLoginPassword: pa$$w0rd
 *   secondary:
 *     type: azure:sql:SqlServer
 *     properties:
 *       name: sql-secondary
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       version: '12.0'
 *       administratorLogin: sqladmin
 *       administratorLoginPassword: pa$$w0rd
 *   db1:
 *     type: azure:sql:Database
 *     properties:
 *       name: db1
 *       resourceGroupName: ${primary.resourceGroupName}
 *       location: ${primary.location}
 *       serverName: ${primary.name}
 *   exampleFailoverGroup:
 *     type: azure:sql:FailoverGroup
 *     name: example
 *     properties:
 *       name: example-failover-group
 *       resourceGroupName: ${primary.resourceGroupName}
 *       serverName: ${primary.name}
 *       databases:
 *         - ${db1.id}
 *       partnerServers:
 *         - id: ${secondary.id}
 *       readWriteEndpointFailoverPolicy:
 *         mode: Automatic
 *         graceMinutes: 60
 * ```
 * 
 * ## Import
 * SQL Failover Groups can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:sql/failoverGroup:FailoverGroup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/servers/myserver/failoverGroups/group1
 * ```
 * @property databases A list of database ids to add to the failover group
 * > **NOTE:** The failover group will create a secondary database for each database listed in `databases`. If the secondary databases need to be managed through this provider, they should be defined as resources and a dependency added to the failover group to ensure the secondary databases are created first.
 * @property name The name of the failover group. Changing this forces a new resource to be created.
 * @property partnerServers A list of `partner_servers` blocks as documented below.
 * @property readWriteEndpointFailoverPolicy A `read_write_endpoint_failover_policy` block as documented below.
 * @property readonlyEndpointFailoverPolicy A `readonly_endpoint_failover_policy` block as documented below.
 * @property resourceGroupName The name of the resource group containing the SQL server Changing this forces a new resource to be created.
 * @property serverName The name of the primary SQL server. Changing this forces a new resource to be created.
 * @property tags A mapping of tags to assign to the resource.
 */
public data class FailoverGroupArgs(
    public val databases: Output>? = null,
    public val name: Output? = null,
    public val partnerServers: Output>? = null,
    public val readWriteEndpointFailoverPolicy:
    Output? = null,
    public val readonlyEndpointFailoverPolicy:
    Output? = null,
    public val resourceGroupName: Output? = null,
    public val serverName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.sql.FailoverGroupArgs =
        com.pulumi.azure.sql.FailoverGroupArgs.builder()
            .databases(databases?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .partnerServers(
                partnerServers?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .readWriteEndpointFailoverPolicy(
                readWriteEndpointFailoverPolicy?.applyValue({ args0 ->
                    args0.let({ args0 -> args0.toJava() })
                }),
            )
            .readonlyEndpointFailoverPolicy(
                readonlyEndpointFailoverPolicy?.applyValue({ args0 ->
                    args0.let({ args0 -> args0.toJava() })
                }),
            )
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .serverName(serverName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [FailoverGroupArgs].
 */
@PulumiTagMarker
public class FailoverGroupArgsBuilder internal constructor() {
    private var databases: Output>? = null

    private var name: Output? = null

    private var partnerServers: Output>? = null

    private var readWriteEndpointFailoverPolicy:
        Output? = null

    private var readonlyEndpointFailoverPolicy:
        Output? = null

    private var resourceGroupName: Output? = null

    private var serverName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value A list of database ids to add to the failover group
     * > **NOTE:** The failover group will create a secondary database for each database listed in `databases`. If the secondary databases need to be managed through this provider, they should be defined as resources and a dependency added to the failover group to ensure the secondary databases are created first.
     */
    @JvmName("tnwlkreiqcpxqijs")
    public suspend fun databases(`value`: Output>) {
        this.databases = value
    }

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

    /**
     * @param values A list of database ids to add to the failover group
     * > **NOTE:** The failover group will create a secondary database for each database listed in `databases`. If the secondary databases need to be managed through this provider, they should be defined as resources and a dependency added to the failover group to ensure the secondary databases are created first.
     */
    @JvmName("oimyiqguxmkcnepn")
    public suspend fun databases(values: List>) {
        this.databases = Output.all(values)
    }

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

    /**
     * @param value A list of `partner_servers` blocks as documented below.
     */
    @JvmName("qdndleljcptmorhr")
    public suspend fun partnerServers(`value`: Output>) {
        this.partnerServers = value
    }

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

    /**
     * @param values A list of `partner_servers` blocks as documented below.
     */
    @JvmName("fgtmnpvbosqciwaa")
    public suspend fun partnerServers(values: List>) {
        this.partnerServers = Output.all(values)
    }

    /**
     * @param value A `read_write_endpoint_failover_policy` block as documented below.
     */
    @JvmName("nwksaqovxkpgowvr")
    public suspend
    fun readWriteEndpointFailoverPolicy(`value`: Output) {
        this.readWriteEndpointFailoverPolicy = value
    }

    /**
     * @param value A `readonly_endpoint_failover_policy` block as documented below.
     */
    @JvmName("wwwtxadwqflsbsbx")
    public suspend
    fun readonlyEndpointFailoverPolicy(`value`: Output) {
        this.readonlyEndpointFailoverPolicy = value
    }

    /**
     * @param value The name of the resource group containing the SQL server Changing this forces a new resource to be created.
     */
    @JvmName("xknoblaujgykanto")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The name of the primary SQL server. Changing this forces a new resource to be created.
     */
    @JvmName("eytemfrtndagtsje")
    public suspend fun serverName(`value`: Output) {
        this.serverName = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("yfvedbfyoflrtqar")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value A list of database ids to add to the failover group
     * > **NOTE:** The failover group will create a secondary database for each database listed in `databases`. If the secondary databases need to be managed through this provider, they should be defined as resources and a dependency added to the failover group to ensure the secondary databases are created first.
     */
    @JvmName("eombhuhxstblrqnt")
    public suspend fun databases(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.databases = mapped
    }

    /**
     * @param values A list of database ids to add to the failover group
     * > **NOTE:** The failover group will create a secondary database for each database listed in `databases`. If the secondary databases need to be managed through this provider, they should be defined as resources and a dependency added to the failover group to ensure the secondary databases are created first.
     */
    @JvmName("bbeibnbbqfqrsssn")
    public suspend fun databases(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.databases = mapped
    }

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

    /**
     * @param value A list of `partner_servers` blocks as documented below.
     */
    @JvmName("abvaxnxefopshvmx")
    public suspend fun partnerServers(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.partnerServers = mapped
    }

    /**
     * @param argument A list of `partner_servers` blocks as documented below.
     */
    @JvmName("iagthqblrwndjjgj")
    public suspend
    fun partnerServers(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            FailoverGroupPartnerServerArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.partnerServers = mapped
    }

    /**
     * @param argument A list of `partner_servers` blocks as documented below.
     */
    @JvmName("yvrecbagslqsjovr")
    public suspend fun partnerServers(
        vararg
        argument: suspend FailoverGroupPartnerServerArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            FailoverGroupPartnerServerArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.partnerServers = mapped
    }

    /**
     * @param argument A list of `partner_servers` blocks as documented below.
     */
    @JvmName("jyydpfsatwstftot")
    public suspend
    fun partnerServers(argument: suspend FailoverGroupPartnerServerArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            FailoverGroupPartnerServerArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.partnerServers = mapped
    }

    /**
     * @param values A list of `partner_servers` blocks as documented below.
     */
    @JvmName("fyewvmaqrdtuxdvn")
    public suspend fun partnerServers(vararg values: FailoverGroupPartnerServerArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.partnerServers = mapped
    }

    /**
     * @param value A `read_write_endpoint_failover_policy` block as documented below.
     */
    @JvmName("tbjxjeyfqrgdqser")
    public suspend
    fun readWriteEndpointFailoverPolicy(`value`: FailoverGroupReadWriteEndpointFailoverPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.readWriteEndpointFailoverPolicy = mapped
    }

    /**
     * @param argument A `read_write_endpoint_failover_policy` block as documented below.
     */
    @JvmName("matfiryriljwwhyb")
    public suspend
    fun readWriteEndpointFailoverPolicy(argument: suspend FailoverGroupReadWriteEndpointFailoverPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = FailoverGroupReadWriteEndpointFailoverPolicyArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.readWriteEndpointFailoverPolicy = mapped
    }

    /**
     * @param value A `readonly_endpoint_failover_policy` block as documented below.
     */
    @JvmName("ygmbarfufmgxihve")
    public suspend
    fun readonlyEndpointFailoverPolicy(`value`: FailoverGroupReadonlyEndpointFailoverPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.readonlyEndpointFailoverPolicy = mapped
    }

    /**
     * @param argument A `readonly_endpoint_failover_policy` block as documented below.
     */
    @JvmName("ejqhiquruwrwywoy")
    public suspend
    fun readonlyEndpointFailoverPolicy(argument: suspend FailoverGroupReadonlyEndpointFailoverPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = FailoverGroupReadonlyEndpointFailoverPolicyArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.readonlyEndpointFailoverPolicy = mapped
    }

    /**
     * @param value The name of the resource group containing the SQL server Changing this forces a new resource to be created.
     */
    @JvmName("pbxqyauaktwdcjfg")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

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

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("wuouobhnxpbivmnb")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource.
     */
    @JvmName("meiltmqphpjrnaxx")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): FailoverGroupArgs = FailoverGroupArgs(
        databases = databases,
        name = name,
        partnerServers = partnerServers,
        readWriteEndpointFailoverPolicy = readWriteEndpointFailoverPolicy,
        readonlyEndpointFailoverPolicy = readonlyEndpointFailoverPolicy,
        resourceGroupName = resourceGroupName,
        serverName = serverName,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy