1. Packages
  2. Azure Classic
  3. API Docs
  4. sql
  5. FailoverGroup

We recommend using Azure Native.

Azure Classic v5.73.0 published on Monday, Apr 22, 2024 by Pulumi

azure.sql.FailoverGroup

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.73.0 published on Monday, Apr 22, 2024 by Pulumi

    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

    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,
        },
    });
    
    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,
        ))
    
    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
    	})
    }
    
    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,
            },
        });
    
    });
    
    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());
    
        }
    }
    
    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
    

    Create FailoverGroup Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new FailoverGroup(name: string, args: FailoverGroupArgs, opts?: CustomResourceOptions);
    @overload
    def FailoverGroup(resource_name: str,
                      args: FailoverGroupArgs,
                      opts: Optional[ResourceOptions] = None)
    
    @overload
    def FailoverGroup(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      partner_servers: Optional[Sequence[FailoverGroupPartnerServerArgs]] = None,
                      read_write_endpoint_failover_policy: Optional[FailoverGroupReadWriteEndpointFailoverPolicyArgs] = None,
                      resource_group_name: Optional[str] = None,
                      server_name: Optional[str] = None,
                      databases: Optional[Sequence[str]] = None,
                      name: Optional[str] = None,
                      readonly_endpoint_failover_policy: Optional[FailoverGroupReadonlyEndpointFailoverPolicyArgs] = None,
                      tags: Optional[Mapping[str, str]] = None)
    func NewFailoverGroup(ctx *Context, name string, args FailoverGroupArgs, opts ...ResourceOption) (*FailoverGroup, error)
    public FailoverGroup(string name, FailoverGroupArgs args, CustomResourceOptions? opts = null)
    public FailoverGroup(String name, FailoverGroupArgs args)
    public FailoverGroup(String name, FailoverGroupArgs args, CustomResourceOptions options)
    
    type: azure:sql:FailoverGroup
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args FailoverGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args FailoverGroupArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args FailoverGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FailoverGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FailoverGroupArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var azureFailoverGroupResource = new Azure.Sql.FailoverGroup("azureFailoverGroupResource", new()
    {
        PartnerServers = new[]
        {
            new Azure.Sql.Inputs.FailoverGroupPartnerServerArgs
            {
                Id = "string",
                Location = "string",
                Role = "string",
            },
        },
        ReadWriteEndpointFailoverPolicy = new Azure.Sql.Inputs.FailoverGroupReadWriteEndpointFailoverPolicyArgs
        {
            Mode = "string",
            GraceMinutes = 0,
        },
        ResourceGroupName = "string",
        ServerName = "string",
        Databases = new[]
        {
            "string",
        },
        Name = "string",
        ReadonlyEndpointFailoverPolicy = new Azure.Sql.Inputs.FailoverGroupReadonlyEndpointFailoverPolicyArgs
        {
            Mode = "string",
        },
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := sql.NewFailoverGroup(ctx, "azureFailoverGroupResource", &sql.FailoverGroupArgs{
    	PartnerServers: sql.FailoverGroupPartnerServerArray{
    		&sql.FailoverGroupPartnerServerArgs{
    			Id:       pulumi.String("string"),
    			Location: pulumi.String("string"),
    			Role:     pulumi.String("string"),
    		},
    	},
    	ReadWriteEndpointFailoverPolicy: &sql.FailoverGroupReadWriteEndpointFailoverPolicyArgs{
    		Mode:         pulumi.String("string"),
    		GraceMinutes: pulumi.Int(0),
    	},
    	ResourceGroupName: pulumi.String("string"),
    	ServerName:        pulumi.String("string"),
    	Databases: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Name: pulumi.String("string"),
    	ReadonlyEndpointFailoverPolicy: &sql.FailoverGroupReadonlyEndpointFailoverPolicyArgs{
    		Mode: pulumi.String("string"),
    	},
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var azureFailoverGroupResource = new FailoverGroup("azureFailoverGroupResource", FailoverGroupArgs.builder()        
        .partnerServers(FailoverGroupPartnerServerArgs.builder()
            .id("string")
            .location("string")
            .role("string")
            .build())
        .readWriteEndpointFailoverPolicy(FailoverGroupReadWriteEndpointFailoverPolicyArgs.builder()
            .mode("string")
            .graceMinutes(0)
            .build())
        .resourceGroupName("string")
        .serverName("string")
        .databases("string")
        .name("string")
        .readonlyEndpointFailoverPolicy(FailoverGroupReadonlyEndpointFailoverPolicyArgs.builder()
            .mode("string")
            .build())
        .tags(Map.of("string", "string"))
        .build());
    
    azure_failover_group_resource = azure.sql.FailoverGroup("azureFailoverGroupResource",
        partner_servers=[azure.sql.FailoverGroupPartnerServerArgs(
            id="string",
            location="string",
            role="string",
        )],
        read_write_endpoint_failover_policy=azure.sql.FailoverGroupReadWriteEndpointFailoverPolicyArgs(
            mode="string",
            grace_minutes=0,
        ),
        resource_group_name="string",
        server_name="string",
        databases=["string"],
        name="string",
        readonly_endpoint_failover_policy=azure.sql.FailoverGroupReadonlyEndpointFailoverPolicyArgs(
            mode="string",
        ),
        tags={
            "string": "string",
        })
    
    const azureFailoverGroupResource = new azure.sql.FailoverGroup("azureFailoverGroupResource", {
        partnerServers: [{
            id: "string",
            location: "string",
            role: "string",
        }],
        readWriteEndpointFailoverPolicy: {
            mode: "string",
            graceMinutes: 0,
        },
        resourceGroupName: "string",
        serverName: "string",
        databases: ["string"],
        name: "string",
        readonlyEndpointFailoverPolicy: {
            mode: "string",
        },
        tags: {
            string: "string",
        },
    });
    
    type: azure:sql:FailoverGroup
    properties:
        databases:
            - string
        name: string
        partnerServers:
            - id: string
              location: string
              role: string
        readWriteEndpointFailoverPolicy:
            graceMinutes: 0
            mode: string
        readonlyEndpointFailoverPolicy:
            mode: string
        resourceGroupName: string
        serverName: string
        tags:
            string: string
    

    FailoverGroup Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The FailoverGroup resource accepts the following input properties:

    PartnerServers List<FailoverGroupPartnerServer>
    A list of partner_servers blocks as documented below.
    ReadWriteEndpointFailoverPolicy FailoverGroupReadWriteEndpointFailoverPolicy
    A read_write_endpoint_failover_policy block as documented below.
    ResourceGroupName string
    The name of the resource group containing the SQL server Changing this forces a new resource to be created.
    ServerName string
    The name of the primary SQL server. Changing this forces a new resource to be created.
    Databases List<string>

    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.

    Name string
    The name of the failover group. Changing this forces a new resource to be created.
    ReadonlyEndpointFailoverPolicy FailoverGroupReadonlyEndpointFailoverPolicy
    A readonly_endpoint_failover_policy block as documented below.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    PartnerServers []FailoverGroupPartnerServerArgs
    A list of partner_servers blocks as documented below.
    ReadWriteEndpointFailoverPolicy FailoverGroupReadWriteEndpointFailoverPolicyArgs
    A read_write_endpoint_failover_policy block as documented below.
    ResourceGroupName string
    The name of the resource group containing the SQL server Changing this forces a new resource to be created.
    ServerName string
    The name of the primary SQL server. Changing this forces a new resource to be created.
    Databases []string

    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.

    Name string
    The name of the failover group. Changing this forces a new resource to be created.
    ReadonlyEndpointFailoverPolicy FailoverGroupReadonlyEndpointFailoverPolicyArgs
    A readonly_endpoint_failover_policy block as documented below.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    partnerServers List<FailoverGroupPartnerServer>
    A list of partner_servers blocks as documented below.
    readWriteEndpointFailoverPolicy FailoverGroupReadWriteEndpointFailoverPolicy
    A read_write_endpoint_failover_policy block as documented below.
    resourceGroupName String
    The name of the resource group containing the SQL server Changing this forces a new resource to be created.
    serverName String
    The name of the primary SQL server. Changing this forces a new resource to be created.
    databases List<String>

    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.

    name String
    The name of the failover group. Changing this forces a new resource to be created.
    readonlyEndpointFailoverPolicy FailoverGroupReadonlyEndpointFailoverPolicy
    A readonly_endpoint_failover_policy block as documented below.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    partnerServers FailoverGroupPartnerServer[]
    A list of partner_servers blocks as documented below.
    readWriteEndpointFailoverPolicy FailoverGroupReadWriteEndpointFailoverPolicy
    A read_write_endpoint_failover_policy block as documented below.
    resourceGroupName string
    The name of the resource group containing the SQL server Changing this forces a new resource to be created.
    serverName string
    The name of the primary SQL server. Changing this forces a new resource to be created.
    databases string[]

    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.

    name string
    The name of the failover group. Changing this forces a new resource to be created.
    readonlyEndpointFailoverPolicy FailoverGroupReadonlyEndpointFailoverPolicy
    A readonly_endpoint_failover_policy block as documented below.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    partner_servers Sequence[FailoverGroupPartnerServerArgs]
    A list of partner_servers blocks as documented below.
    read_write_endpoint_failover_policy FailoverGroupReadWriteEndpointFailoverPolicyArgs
    A read_write_endpoint_failover_policy block as documented below.
    resource_group_name str
    The name of the resource group containing the SQL server Changing this forces a new resource to be created.
    server_name str
    The name of the primary SQL server. Changing this forces a new resource to be created.
    databases Sequence[str]

    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.

    name str
    The name of the failover group. Changing this forces a new resource to be created.
    readonly_endpoint_failover_policy FailoverGroupReadonlyEndpointFailoverPolicyArgs
    A readonly_endpoint_failover_policy block as documented below.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    partnerServers List<Property Map>
    A list of partner_servers blocks as documented below.
    readWriteEndpointFailoverPolicy Property Map
    A read_write_endpoint_failover_policy block as documented below.
    resourceGroupName String
    The name of the resource group containing the SQL server Changing this forces a new resource to be created.
    serverName String
    The name of the primary SQL server. Changing this forces a new resource to be created.
    databases List<String>

    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.

    name String
    The name of the failover group. Changing this forces a new resource to be created.
    readonlyEndpointFailoverPolicy Property Map
    A readonly_endpoint_failover_policy block as documented below.
    tags Map<String>
    A mapping of tags to assign to the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the FailoverGroup resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    the location of the failover group.
    Role string
    local replication role of the failover group instance.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    the location of the failover group.
    Role string
    local replication role of the failover group instance.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    the location of the failover group.
    role String
    local replication role of the failover group instance.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    the location of the failover group.
    role string
    local replication role of the failover group instance.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    the location of the failover group.
    role str
    local replication role of the failover group instance.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    the location of the failover group.
    role String
    local replication role of the failover group instance.

    Look up Existing FailoverGroup Resource

    Get an existing FailoverGroup resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: FailoverGroupState, opts?: CustomResourceOptions): FailoverGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            databases: Optional[Sequence[str]] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            partner_servers: Optional[Sequence[FailoverGroupPartnerServerArgs]] = None,
            read_write_endpoint_failover_policy: Optional[FailoverGroupReadWriteEndpointFailoverPolicyArgs] = None,
            readonly_endpoint_failover_policy: Optional[FailoverGroupReadonlyEndpointFailoverPolicyArgs] = None,
            resource_group_name: Optional[str] = None,
            role: Optional[str] = None,
            server_name: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None) -> FailoverGroup
    func GetFailoverGroup(ctx *Context, name string, id IDInput, state *FailoverGroupState, opts ...ResourceOption) (*FailoverGroup, error)
    public static FailoverGroup Get(string name, Input<string> id, FailoverGroupState? state, CustomResourceOptions? opts = null)
    public static FailoverGroup get(String name, Output<String> id, FailoverGroupState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Databases List<string>

    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.

    Location string
    the location of the failover group.
    Name string
    The name of the failover group. Changing this forces a new resource to be created.
    PartnerServers List<FailoverGroupPartnerServer>
    A list of partner_servers blocks as documented below.
    ReadWriteEndpointFailoverPolicy FailoverGroupReadWriteEndpointFailoverPolicy
    A read_write_endpoint_failover_policy block as documented below.
    ReadonlyEndpointFailoverPolicy FailoverGroupReadonlyEndpointFailoverPolicy
    A readonly_endpoint_failover_policy block as documented below.
    ResourceGroupName string
    The name of the resource group containing the SQL server Changing this forces a new resource to be created.
    Role string
    local replication role of the failover group instance.
    ServerName string
    The name of the primary SQL server. Changing this forces a new resource to be created.
    Tags Dictionary<string, string>
    A mapping of tags to assign to the resource.
    Databases []string

    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.

    Location string
    the location of the failover group.
    Name string
    The name of the failover group. Changing this forces a new resource to be created.
    PartnerServers []FailoverGroupPartnerServerArgs
    A list of partner_servers blocks as documented below.
    ReadWriteEndpointFailoverPolicy FailoverGroupReadWriteEndpointFailoverPolicyArgs
    A read_write_endpoint_failover_policy block as documented below.
    ReadonlyEndpointFailoverPolicy FailoverGroupReadonlyEndpointFailoverPolicyArgs
    A readonly_endpoint_failover_policy block as documented below.
    ResourceGroupName string
    The name of the resource group containing the SQL server Changing this forces a new resource to be created.
    Role string
    local replication role of the failover group instance.
    ServerName string
    The name of the primary SQL server. Changing this forces a new resource to be created.
    Tags map[string]string
    A mapping of tags to assign to the resource.
    databases List<String>

    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.

    location String
    the location of the failover group.
    name String
    The name of the failover group. Changing this forces a new resource to be created.
    partnerServers List<FailoverGroupPartnerServer>
    A list of partner_servers blocks as documented below.
    readWriteEndpointFailoverPolicy FailoverGroupReadWriteEndpointFailoverPolicy
    A read_write_endpoint_failover_policy block as documented below.
    readonlyEndpointFailoverPolicy FailoverGroupReadonlyEndpointFailoverPolicy
    A readonly_endpoint_failover_policy block as documented below.
    resourceGroupName String
    The name of the resource group containing the SQL server Changing this forces a new resource to be created.
    role String
    local replication role of the failover group instance.
    serverName String
    The name of the primary SQL server. Changing this forces a new resource to be created.
    tags Map<String,String>
    A mapping of tags to assign to the resource.
    databases string[]

    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.

    location string
    the location of the failover group.
    name string
    The name of the failover group. Changing this forces a new resource to be created.
    partnerServers FailoverGroupPartnerServer[]
    A list of partner_servers blocks as documented below.
    readWriteEndpointFailoverPolicy FailoverGroupReadWriteEndpointFailoverPolicy
    A read_write_endpoint_failover_policy block as documented below.
    readonlyEndpointFailoverPolicy FailoverGroupReadonlyEndpointFailoverPolicy
    A readonly_endpoint_failover_policy block as documented below.
    resourceGroupName string
    The name of the resource group containing the SQL server Changing this forces a new resource to be created.
    role string
    local replication role of the failover group instance.
    serverName string
    The name of the primary SQL server. Changing this forces a new resource to be created.
    tags {[key: string]: string}
    A mapping of tags to assign to the resource.
    databases Sequence[str]

    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.

    location str
    the location of the failover group.
    name str
    The name of the failover group. Changing this forces a new resource to be created.
    partner_servers Sequence[FailoverGroupPartnerServerArgs]
    A list of partner_servers blocks as documented below.
    read_write_endpoint_failover_policy FailoverGroupReadWriteEndpointFailoverPolicyArgs
    A read_write_endpoint_failover_policy block as documented below.
    readonly_endpoint_failover_policy FailoverGroupReadonlyEndpointFailoverPolicyArgs
    A readonly_endpoint_failover_policy block as documented below.
    resource_group_name str
    The name of the resource group containing the SQL server Changing this forces a new resource to be created.
    role str
    local replication role of the failover group instance.
    server_name str
    The name of the primary SQL server. Changing this forces a new resource to be created.
    tags Mapping[str, str]
    A mapping of tags to assign to the resource.
    databases List<String>

    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.

    location String
    the location of the failover group.
    name String
    The name of the failover group. Changing this forces a new resource to be created.
    partnerServers List<Property Map>
    A list of partner_servers blocks as documented below.
    readWriteEndpointFailoverPolicy Property Map
    A read_write_endpoint_failover_policy block as documented below.
    readonlyEndpointFailoverPolicy Property Map
    A readonly_endpoint_failover_policy block as documented below.
    resourceGroupName String
    The name of the resource group containing the SQL server Changing this forces a new resource to be created.
    role String
    local replication role of the failover group instance.
    serverName String
    The name of the primary SQL server. Changing this forces a new resource to be created.
    tags Map<String>
    A mapping of tags to assign to the resource.

    Supporting Types

    FailoverGroupPartnerServer, FailoverGroupPartnerServerArgs

    Id string
    the SQL server ID
    Location string
    the location of the failover group.
    Role string
    local replication role of the failover group instance.
    Id string
    the SQL server ID
    Location string
    the location of the failover group.
    Role string
    local replication role of the failover group instance.
    id String
    the SQL server ID
    location String
    the location of the failover group.
    role String
    local replication role of the failover group instance.
    id string
    the SQL server ID
    location string
    the location of the failover group.
    role string
    local replication role of the failover group instance.
    id str
    the SQL server ID
    location str
    the location of the failover group.
    role str
    local replication role of the failover group instance.
    id String
    the SQL server ID
    location String
    the location of the failover group.
    role String
    local replication role of the failover group instance.

    FailoverGroupReadWriteEndpointFailoverPolicy, FailoverGroupReadWriteEndpointFailoverPolicyArgs

    Mode string
    the failover mode. Possible values are Manual, Automatic
    GraceMinutes int
    Applies only if mode is Automatic. The grace period in minutes before failover with data loss is attempted
    Mode string
    the failover mode. Possible values are Manual, Automatic
    GraceMinutes int
    Applies only if mode is Automatic. The grace period in minutes before failover with data loss is attempted
    mode String
    the failover mode. Possible values are Manual, Automatic
    graceMinutes Integer
    Applies only if mode is Automatic. The grace period in minutes before failover with data loss is attempted
    mode string
    the failover mode. Possible values are Manual, Automatic
    graceMinutes number
    Applies only if mode is Automatic. The grace period in minutes before failover with data loss is attempted
    mode str
    the failover mode. Possible values are Manual, Automatic
    grace_minutes int
    Applies only if mode is Automatic. The grace period in minutes before failover with data loss is attempted
    mode String
    the failover mode. Possible values are Manual, Automatic
    graceMinutes Number
    Applies only if mode is Automatic. The grace period in minutes before failover with data loss is attempted

    FailoverGroupReadonlyEndpointFailoverPolicy, FailoverGroupReadonlyEndpointFailoverPolicyArgs

    Mode string
    Failover policy for the read-only endpoint. Possible values are Enabled, and Disabled
    Mode string
    Failover policy for the read-only endpoint. Possible values are Enabled, and Disabled
    mode String
    Failover policy for the read-only endpoint. Possible values are Enabled, and Disabled
    mode string
    Failover policy for the read-only endpoint. Possible values are Enabled, and Disabled
    mode str
    Failover policy for the read-only endpoint. Possible values are Enabled, and Disabled
    mode String
    Failover policy for the read-only endpoint. Possible values are Enabled, and Disabled

    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
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.73.0 published on Monday, Apr 22, 2024 by Pulumi