FailoverGroup

class FailoverGroup : KotlinCustomResource

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

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 exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var primary = new SqlServer("primary", SqlServerArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.version("12.0")
.administratorLogin("sqladmin")
.administratorLoginPassword("pa$$w0rd")
.build());
var secondary = new SqlServer("secondary", SqlServerArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.version("12.0")
.administratorLogin("sqladmin")
.administratorLoginPassword("pa$$w0rd")
.build());
var db1 = new Database("db1", DatabaseArgs.builder()
.resourceGroupName(primary.resourceGroupName())
.location(primary.location())
.serverName(primary.name())
.build());
var exampleFailoverGroup = new FailoverGroup("exampleFailoverGroup", FailoverGroupArgs.builder()
.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());
}
}

Import

SQL Failover Groups can be imported using the resource id, e.g.

$ pulumi import azure:sql/failoverGroup:FailoverGroup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/servers/myserver/failoverGroups/group1

Properties

Link copied to clipboard
val databases: Output<List<String>>?

A list of database ids to add to the failover group

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val location: Output<String>

the location of the failover group.

Link copied to clipboard
val name: Output<String>

The name of the failover group. Changing this forces a new resource to be created.

Link copied to clipboard

A list of secondary servers as documented below

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

a read-only policy as documented below

Link copied to clipboard

A read/write policy as documented below

Link copied to clipboard

The name of the resource group containing the SQL server Changing this forces a new resource to be created.

Link copied to clipboard
val role: Output<String>

local replication role of the failover group instance.

Link copied to clipboard
val serverName: Output<String>

The name of the primary SQL server. Changing this forces a new resource to be created.

Link copied to clipboard
val tags: Output<Map<String, String>>?

A mapping of tags to assign to the resource.

Link copied to clipboard
val urn: Output<String>