We recommend using Azure Native.
azure.mssql.ManagedInstanceFailoverGroup
Explore with Pulumi AI
Manages an Azure SQL Managed Instance Failover Group.
Example Usage
Note: For a more complete example, see the
./examples/sql-azure/managed_instance_failover_group
directory within the GitHub Repository.
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 exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
name: "example",
location: example.location,
resourceGroupName: example.name,
addressSpaces: ["10.0.0.0/16"],
});
const exampleSubnet = new azure.network.Subnet("example", {
name: "example",
resourceGroupName: example.name,
virtualNetworkName: exampleVirtualNetwork.name,
addressPrefixes: ["10.0.2.0/24"],
});
const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("example", {
name: "example",
location: example.location,
resourceGroupName: example.name,
});
const exampleSubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("example", {
subnetId: exampleSubnet.id,
networkSecurityGroupId: exampleNetworkSecurityGroup.id,
});
const exampleRouteTable = new azure.network.RouteTable("example", {
name: "example",
location: example.location,
resourceGroupName: example.name,
});
const exampleSubnetRouteTableAssociation = new azure.network.SubnetRouteTableAssociation("example", {
subnetId: exampleSubnet.id,
routeTableId: exampleRouteTable.id,
});
const primary = new azure.mssql.ManagedInstance("primary", {
name: "example-primary",
resourceGroupName: example.name,
location: example.location,
administratorLogin: "mradministrator",
administratorLoginPassword: "thisIsDog11",
licenseType: "BasePrice",
subnetId: exampleSubnet.id,
skuName: "GP_Gen5",
vcores: 4,
storageSizeInGb: 32,
tags: {
environment: "prod",
},
}, {
dependsOn: [
exampleSubnetNetworkSecurityGroupAssociation,
exampleSubnetRouteTableAssociation,
],
});
const secondary = new azure.mssql.ManagedInstance("secondary", {
name: "example-secondary",
resourceGroupName: example.name,
location: example.location,
administratorLogin: "mradministrator",
administratorLoginPassword: "thisIsDog11",
licenseType: "BasePrice",
subnetId: exampleSubnet.id,
skuName: "GP_Gen5",
vcores: 4,
storageSizeInGb: 32,
tags: {
environment: "prod",
},
}, {
dependsOn: [
exampleSubnetNetworkSecurityGroupAssociation,
exampleSubnetRouteTableAssociation,
],
});
const exampleManagedInstanceFailoverGroup = new azure.mssql.ManagedInstanceFailoverGroup("example", {
name: "example-failover-group",
location: primary.location,
managedInstanceId: primary.id,
partnerManagedInstanceId: 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")
example_virtual_network = azure.network.VirtualNetwork("example",
name="example",
location=example.location,
resource_group_name=example.name,
address_spaces=["10.0.0.0/16"])
example_subnet = azure.network.Subnet("example",
name="example",
resource_group_name=example.name,
virtual_network_name=example_virtual_network.name,
address_prefixes=["10.0.2.0/24"])
example_network_security_group = azure.network.NetworkSecurityGroup("example",
name="example",
location=example.location,
resource_group_name=example.name)
example_subnet_network_security_group_association = azure.network.SubnetNetworkSecurityGroupAssociation("example",
subnet_id=example_subnet.id,
network_security_group_id=example_network_security_group.id)
example_route_table = azure.network.RouteTable("example",
name="example",
location=example.location,
resource_group_name=example.name)
example_subnet_route_table_association = azure.network.SubnetRouteTableAssociation("example",
subnet_id=example_subnet.id,
route_table_id=example_route_table.id)
primary = azure.mssql.ManagedInstance("primary",
name="example-primary",
resource_group_name=example.name,
location=example.location,
administrator_login="mradministrator",
administrator_login_password="thisIsDog11",
license_type="BasePrice",
subnet_id=example_subnet.id,
sku_name="GP_Gen5",
vcores=4,
storage_size_in_gb=32,
tags={
"environment": "prod",
},
opts=pulumi.ResourceOptions(depends_on=[
example_subnet_network_security_group_association,
example_subnet_route_table_association,
]))
secondary = azure.mssql.ManagedInstance("secondary",
name="example-secondary",
resource_group_name=example.name,
location=example.location,
administrator_login="mradministrator",
administrator_login_password="thisIsDog11",
license_type="BasePrice",
subnet_id=example_subnet.id,
sku_name="GP_Gen5",
vcores=4,
storage_size_in_gb=32,
tags={
"environment": "prod",
},
opts=pulumi.ResourceOptions(depends_on=[
example_subnet_network_security_group_association,
example_subnet_route_table_association,
]))
example_managed_instance_failover_group = azure.mssql.ManagedInstanceFailoverGroup("example",
name="example-failover-group",
location=primary.location,
managed_instance_id=primary.id,
partner_managed_instance_id=secondary.id,
read_write_endpoint_failover_policy=azure.mssql.ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicyArgs(
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/mssql"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
"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
}
exampleVirtualNetwork, err := network.NewVirtualNetwork(ctx, "example", &network.VirtualNetworkArgs{
Name: pulumi.String("example"),
Location: example.Location,
ResourceGroupName: example.Name,
AddressSpaces: pulumi.StringArray{
pulumi.String("10.0.0.0/16"),
},
})
if err != nil {
return err
}
exampleSubnet, err := network.NewSubnet(ctx, "example", &network.SubnetArgs{
Name: pulumi.String("example"),
ResourceGroupName: example.Name,
VirtualNetworkName: exampleVirtualNetwork.Name,
AddressPrefixes: pulumi.StringArray{
pulumi.String("10.0.2.0/24"),
},
})
if err != nil {
return err
}
exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "example", &network.NetworkSecurityGroupArgs{
Name: pulumi.String("example"),
Location: example.Location,
ResourceGroupName: example.Name,
})
if err != nil {
return err
}
exampleSubnetNetworkSecurityGroupAssociation, err := network.NewSubnetNetworkSecurityGroupAssociation(ctx, "example", &network.SubnetNetworkSecurityGroupAssociationArgs{
SubnetId: exampleSubnet.ID(),
NetworkSecurityGroupId: exampleNetworkSecurityGroup.ID(),
})
if err != nil {
return err
}
exampleRouteTable, err := network.NewRouteTable(ctx, "example", &network.RouteTableArgs{
Name: pulumi.String("example"),
Location: example.Location,
ResourceGroupName: example.Name,
})
if err != nil {
return err
}
exampleSubnetRouteTableAssociation, err := network.NewSubnetRouteTableAssociation(ctx, "example", &network.SubnetRouteTableAssociationArgs{
SubnetId: exampleSubnet.ID(),
RouteTableId: exampleRouteTable.ID(),
})
if err != nil {
return err
}
primary, err := mssql.NewManagedInstance(ctx, "primary", &mssql.ManagedInstanceArgs{
Name: pulumi.String("example-primary"),
ResourceGroupName: example.Name,
Location: example.Location,
AdministratorLogin: pulumi.String("mradministrator"),
AdministratorLoginPassword: pulumi.String("thisIsDog11"),
LicenseType: pulumi.String("BasePrice"),
SubnetId: exampleSubnet.ID(),
SkuName: pulumi.String("GP_Gen5"),
Vcores: pulumi.Int(4),
StorageSizeInGb: pulumi.Int(32),
Tags: pulumi.StringMap{
"environment": pulumi.String("prod"),
},
}, pulumi.DependsOn([]pulumi.Resource{
exampleSubnetNetworkSecurityGroupAssociation,
exampleSubnetRouteTableAssociation,
}))
if err != nil {
return err
}
secondary, err := mssql.NewManagedInstance(ctx, "secondary", &mssql.ManagedInstanceArgs{
Name: pulumi.String("example-secondary"),
ResourceGroupName: example.Name,
Location: example.Location,
AdministratorLogin: pulumi.String("mradministrator"),
AdministratorLoginPassword: pulumi.String("thisIsDog11"),
LicenseType: pulumi.String("BasePrice"),
SubnetId: exampleSubnet.ID(),
SkuName: pulumi.String("GP_Gen5"),
Vcores: pulumi.Int(4),
StorageSizeInGb: pulumi.Int(32),
Tags: pulumi.StringMap{
"environment": pulumi.String("prod"),
},
}, pulumi.DependsOn([]pulumi.Resource{
exampleSubnetNetworkSecurityGroupAssociation,
exampleSubnetRouteTableAssociation,
}))
if err != nil {
return err
}
_, err = mssql.NewManagedInstanceFailoverGroup(ctx, "example", &mssql.ManagedInstanceFailoverGroupArgs{
Name: pulumi.String("example-failover-group"),
Location: primary.Location,
ManagedInstanceId: primary.ID(),
PartnerManagedInstanceId: secondary.ID(),
ReadWriteEndpointFailoverPolicy: &mssql.ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicyArgs{
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 exampleVirtualNetwork = new Azure.Network.VirtualNetwork("example", new()
{
Name = "example",
Location = example.Location,
ResourceGroupName = example.Name,
AddressSpaces = new[]
{
"10.0.0.0/16",
},
});
var exampleSubnet = new Azure.Network.Subnet("example", new()
{
Name = "example",
ResourceGroupName = example.Name,
VirtualNetworkName = exampleVirtualNetwork.Name,
AddressPrefixes = new[]
{
"10.0.2.0/24",
},
});
var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("example", new()
{
Name = "example",
Location = example.Location,
ResourceGroupName = example.Name,
});
var exampleSubnetNetworkSecurityGroupAssociation = new Azure.Network.SubnetNetworkSecurityGroupAssociation("example", new()
{
SubnetId = exampleSubnet.Id,
NetworkSecurityGroupId = exampleNetworkSecurityGroup.Id,
});
var exampleRouteTable = new Azure.Network.RouteTable("example", new()
{
Name = "example",
Location = example.Location,
ResourceGroupName = example.Name,
});
var exampleSubnetRouteTableAssociation = new Azure.Network.SubnetRouteTableAssociation("example", new()
{
SubnetId = exampleSubnet.Id,
RouteTableId = exampleRouteTable.Id,
});
var primary = new Azure.MSSql.ManagedInstance("primary", new()
{
Name = "example-primary",
ResourceGroupName = example.Name,
Location = example.Location,
AdministratorLogin = "mradministrator",
AdministratorLoginPassword = "thisIsDog11",
LicenseType = "BasePrice",
SubnetId = exampleSubnet.Id,
SkuName = "GP_Gen5",
Vcores = 4,
StorageSizeInGb = 32,
Tags =
{
{ "environment", "prod" },
},
}, new CustomResourceOptions
{
DependsOn =
{
exampleSubnetNetworkSecurityGroupAssociation,
exampleSubnetRouteTableAssociation,
},
});
var secondary = new Azure.MSSql.ManagedInstance("secondary", new()
{
Name = "example-secondary",
ResourceGroupName = example.Name,
Location = example.Location,
AdministratorLogin = "mradministrator",
AdministratorLoginPassword = "thisIsDog11",
LicenseType = "BasePrice",
SubnetId = exampleSubnet.Id,
SkuName = "GP_Gen5",
Vcores = 4,
StorageSizeInGb = 32,
Tags =
{
{ "environment", "prod" },
},
}, new CustomResourceOptions
{
DependsOn =
{
exampleSubnetNetworkSecurityGroupAssociation,
exampleSubnetRouteTableAssociation,
},
});
var exampleManagedInstanceFailoverGroup = new Azure.MSSql.ManagedInstanceFailoverGroup("example", new()
{
Name = "example-failover-group",
Location = primary.Location,
ManagedInstanceId = primary.Id,
PartnerManagedInstanceId = secondary.Id,
ReadWriteEndpointFailoverPolicy = new Azure.MSSql.Inputs.ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicyArgs
{
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.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.network.NetworkSecurityGroup;
import com.pulumi.azure.network.NetworkSecurityGroupArgs;
import com.pulumi.azure.network.SubnetNetworkSecurityGroupAssociation;
import com.pulumi.azure.network.SubnetNetworkSecurityGroupAssociationArgs;
import com.pulumi.azure.network.RouteTable;
import com.pulumi.azure.network.RouteTableArgs;
import com.pulumi.azure.network.SubnetRouteTableAssociation;
import com.pulumi.azure.network.SubnetRouteTableAssociationArgs;
import com.pulumi.azure.mssql.ManagedInstance;
import com.pulumi.azure.mssql.ManagedInstanceArgs;
import com.pulumi.azure.mssql.ManagedInstanceFailoverGroup;
import com.pulumi.azure.mssql.ManagedInstanceFailoverGroupArgs;
import com.pulumi.azure.mssql.inputs.ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicyArgs;
import com.pulumi.resources.CustomResourceOptions;
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 exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()
.name("example")
.location(example.location())
.resourceGroupName(example.name())
.addressSpaces("10.0.0.0/16")
.build());
var exampleSubnet = new Subnet("exampleSubnet", SubnetArgs.builder()
.name("example")
.resourceGroupName(example.name())
.virtualNetworkName(exampleVirtualNetwork.name())
.addressPrefixes("10.0.2.0/24")
.build());
var exampleNetworkSecurityGroup = new NetworkSecurityGroup("exampleNetworkSecurityGroup", NetworkSecurityGroupArgs.builder()
.name("example")
.location(example.location())
.resourceGroupName(example.name())
.build());
var exampleSubnetNetworkSecurityGroupAssociation = new SubnetNetworkSecurityGroupAssociation("exampleSubnetNetworkSecurityGroupAssociation", SubnetNetworkSecurityGroupAssociationArgs.builder()
.subnetId(exampleSubnet.id())
.networkSecurityGroupId(exampleNetworkSecurityGroup.id())
.build());
var exampleRouteTable = new RouteTable("exampleRouteTable", RouteTableArgs.builder()
.name("example")
.location(example.location())
.resourceGroupName(example.name())
.build());
var exampleSubnetRouteTableAssociation = new SubnetRouteTableAssociation("exampleSubnetRouteTableAssociation", SubnetRouteTableAssociationArgs.builder()
.subnetId(exampleSubnet.id())
.routeTableId(exampleRouteTable.id())
.build());
var primary = new ManagedInstance("primary", ManagedInstanceArgs.builder()
.name("example-primary")
.resourceGroupName(example.name())
.location(example.location())
.administratorLogin("mradministrator")
.administratorLoginPassword("thisIsDog11")
.licenseType("BasePrice")
.subnetId(exampleSubnet.id())
.skuName("GP_Gen5")
.vcores(4)
.storageSizeInGb(32)
.tags(Map.of("environment", "prod"))
.build(), CustomResourceOptions.builder()
.dependsOn(
exampleSubnetNetworkSecurityGroupAssociation,
exampleSubnetRouteTableAssociation)
.build());
var secondary = new ManagedInstance("secondary", ManagedInstanceArgs.builder()
.name("example-secondary")
.resourceGroupName(example.name())
.location(example.location())
.administratorLogin("mradministrator")
.administratorLoginPassword("thisIsDog11")
.licenseType("BasePrice")
.subnetId(exampleSubnet.id())
.skuName("GP_Gen5")
.vcores(4)
.storageSizeInGb(32)
.tags(Map.of("environment", "prod"))
.build(), CustomResourceOptions.builder()
.dependsOn(
exampleSubnetNetworkSecurityGroupAssociation,
exampleSubnetRouteTableAssociation)
.build());
var exampleManagedInstanceFailoverGroup = new ManagedInstanceFailoverGroup("exampleManagedInstanceFailoverGroup", ManagedInstanceFailoverGroupArgs.builder()
.name("example-failover-group")
.location(primary.location())
.managedInstanceId(primary.id())
.partnerManagedInstanceId(secondary.id())
.readWriteEndpointFailoverPolicy(ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicyArgs.builder()
.mode("Automatic")
.graceMinutes(60)
.build())
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleVirtualNetwork:
type: azure:network:VirtualNetwork
name: example
properties:
name: example
location: ${example.location}
resourceGroupName: ${example.name}
addressSpaces:
- 10.0.0.0/16
exampleSubnet:
type: azure:network:Subnet
name: example
properties:
name: example
resourceGroupName: ${example.name}
virtualNetworkName: ${exampleVirtualNetwork.name}
addressPrefixes:
- 10.0.2.0/24
exampleNetworkSecurityGroup:
type: azure:network:NetworkSecurityGroup
name: example
properties:
name: example
location: ${example.location}
resourceGroupName: ${example.name}
exampleSubnetNetworkSecurityGroupAssociation:
type: azure:network:SubnetNetworkSecurityGroupAssociation
name: example
properties:
subnetId: ${exampleSubnet.id}
networkSecurityGroupId: ${exampleNetworkSecurityGroup.id}
exampleRouteTable:
type: azure:network:RouteTable
name: example
properties:
name: example
location: ${example.location}
resourceGroupName: ${example.name}
exampleSubnetRouteTableAssociation:
type: azure:network:SubnetRouteTableAssociation
name: example
properties:
subnetId: ${exampleSubnet.id}
routeTableId: ${exampleRouteTable.id}
primary:
type: azure:mssql:ManagedInstance
properties:
name: example-primary
resourceGroupName: ${example.name}
location: ${example.location}
administratorLogin: mradministrator
administratorLoginPassword: thisIsDog11
licenseType: BasePrice
subnetId: ${exampleSubnet.id}
skuName: GP_Gen5
vcores: 4
storageSizeInGb: 32
tags:
environment: prod
options:
dependson:
- ${exampleSubnetNetworkSecurityGroupAssociation}
- ${exampleSubnetRouteTableAssociation}
secondary:
type: azure:mssql:ManagedInstance
properties:
name: example-secondary
resourceGroupName: ${example.name}
location: ${example.location}
administratorLogin: mradministrator
administratorLoginPassword: thisIsDog11
licenseType: BasePrice
subnetId: ${exampleSubnet.id}
skuName: GP_Gen5
vcores: 4
storageSizeInGb: 32
tags:
environment: prod
options:
dependson:
- ${exampleSubnetNetworkSecurityGroupAssociation}
- ${exampleSubnetRouteTableAssociation}
exampleManagedInstanceFailoverGroup:
type: azure:mssql:ManagedInstanceFailoverGroup
name: example
properties:
name: example-failover-group
location: ${primary.location}
managedInstanceId: ${primary.id}
partnerManagedInstanceId: ${secondary.id}
readWriteEndpointFailoverPolicy:
mode: Automatic
graceMinutes: 60
Create ManagedInstanceFailoverGroup Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ManagedInstanceFailoverGroup(name: string, args: ManagedInstanceFailoverGroupArgs, opts?: CustomResourceOptions);
@overload
def ManagedInstanceFailoverGroup(resource_name: str,
args: ManagedInstanceFailoverGroupArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ManagedInstanceFailoverGroup(resource_name: str,
opts: Optional[ResourceOptions] = None,
managed_instance_id: Optional[str] = None,
partner_managed_instance_id: Optional[str] = None,
read_write_endpoint_failover_policy: Optional[ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicyArgs] = None,
location: Optional[str] = None,
name: Optional[str] = None,
readonly_endpoint_failover_policy_enabled: Optional[bool] = None)
func NewManagedInstanceFailoverGroup(ctx *Context, name string, args ManagedInstanceFailoverGroupArgs, opts ...ResourceOption) (*ManagedInstanceFailoverGroup, error)
public ManagedInstanceFailoverGroup(string name, ManagedInstanceFailoverGroupArgs args, CustomResourceOptions? opts = null)
public ManagedInstanceFailoverGroup(String name, ManagedInstanceFailoverGroupArgs args)
public ManagedInstanceFailoverGroup(String name, ManagedInstanceFailoverGroupArgs args, CustomResourceOptions options)
type: azure:mssql:ManagedInstanceFailoverGroup
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 ManagedInstanceFailoverGroupArgs
- 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 ManagedInstanceFailoverGroupArgs
- 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 ManagedInstanceFailoverGroupArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ManagedInstanceFailoverGroupArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ManagedInstanceFailoverGroupArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var managedInstanceFailoverGroupResource = new Azure.MSSql.ManagedInstanceFailoverGroup("managedInstanceFailoverGroupResource", new()
{
ManagedInstanceId = "string",
PartnerManagedInstanceId = "string",
ReadWriteEndpointFailoverPolicy = new Azure.MSSql.Inputs.ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicyArgs
{
Mode = "string",
GraceMinutes = 0,
},
Location = "string",
Name = "string",
ReadonlyEndpointFailoverPolicyEnabled = false,
});
example, err := mssql.NewManagedInstanceFailoverGroup(ctx, "managedInstanceFailoverGroupResource", &mssql.ManagedInstanceFailoverGroupArgs{
ManagedInstanceId: pulumi.String("string"),
PartnerManagedInstanceId: pulumi.String("string"),
ReadWriteEndpointFailoverPolicy: &mssql.ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicyArgs{
Mode: pulumi.String("string"),
GraceMinutes: pulumi.Int(0),
},
Location: pulumi.String("string"),
Name: pulumi.String("string"),
ReadonlyEndpointFailoverPolicyEnabled: pulumi.Bool(false),
})
var managedInstanceFailoverGroupResource = new ManagedInstanceFailoverGroup("managedInstanceFailoverGroupResource", ManagedInstanceFailoverGroupArgs.builder()
.managedInstanceId("string")
.partnerManagedInstanceId("string")
.readWriteEndpointFailoverPolicy(ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicyArgs.builder()
.mode("string")
.graceMinutes(0)
.build())
.location("string")
.name("string")
.readonlyEndpointFailoverPolicyEnabled(false)
.build());
managed_instance_failover_group_resource = azure.mssql.ManagedInstanceFailoverGroup("managedInstanceFailoverGroupResource",
managed_instance_id="string",
partner_managed_instance_id="string",
read_write_endpoint_failover_policy=azure.mssql.ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicyArgs(
mode="string",
grace_minutes=0,
),
location="string",
name="string",
readonly_endpoint_failover_policy_enabled=False)
const managedInstanceFailoverGroupResource = new azure.mssql.ManagedInstanceFailoverGroup("managedInstanceFailoverGroupResource", {
managedInstanceId: "string",
partnerManagedInstanceId: "string",
readWriteEndpointFailoverPolicy: {
mode: "string",
graceMinutes: 0,
},
location: "string",
name: "string",
readonlyEndpointFailoverPolicyEnabled: false,
});
type: azure:mssql:ManagedInstanceFailoverGroup
properties:
location: string
managedInstanceId: string
name: string
partnerManagedInstanceId: string
readWriteEndpointFailoverPolicy:
graceMinutes: 0
mode: string
readonlyEndpointFailoverPolicyEnabled: false
ManagedInstanceFailoverGroup 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 ManagedInstanceFailoverGroup resource accepts the following input properties:
- Managed
Instance stringId - The ID of the Azure SQL Managed Instance which will be replicated using a Managed Instance Failover Group. Changing this forces a new resource to be created.
- Partner
Managed stringInstance Id - The ID of the Azure SQL Managed Instance which will be replicated to. Changing this forces a new resource to be created.
- Read
Write ManagedEndpoint Failover Policy Instance Failover Group Read Write Endpoint Failover Policy - A
read_write_endpoint_failover_policy
block as defined below. - Location string
- The Azure Region where the Managed Instance Failover Group should exist. Changing this forces a new resource to be created.
- Name string
- The name which should be used for this Managed Instance Failover Group. Changing this forces a new resource to be created.
- Readonly
Endpoint boolFailover Policy Enabled - Failover policy for the read-only endpoint. Defaults to
true
.
- Managed
Instance stringId - The ID of the Azure SQL Managed Instance which will be replicated using a Managed Instance Failover Group. Changing this forces a new resource to be created.
- Partner
Managed stringInstance Id - The ID of the Azure SQL Managed Instance which will be replicated to. Changing this forces a new resource to be created.
- Read
Write ManagedEndpoint Failover Policy Instance Failover Group Read Write Endpoint Failover Policy Args - A
read_write_endpoint_failover_policy
block as defined below. - Location string
- The Azure Region where the Managed Instance Failover Group should exist. Changing this forces a new resource to be created.
- Name string
- The name which should be used for this Managed Instance Failover Group. Changing this forces a new resource to be created.
- Readonly
Endpoint boolFailover Policy Enabled - Failover policy for the read-only endpoint. Defaults to
true
.
- managed
Instance StringId - The ID of the Azure SQL Managed Instance which will be replicated using a Managed Instance Failover Group. Changing this forces a new resource to be created.
- partner
Managed StringInstance Id - The ID of the Azure SQL Managed Instance which will be replicated to. Changing this forces a new resource to be created.
- read
Write ManagedEndpoint Failover Policy Instance Failover Group Read Write Endpoint Failover Policy - A
read_write_endpoint_failover_policy
block as defined below. - location String
- The Azure Region where the Managed Instance Failover Group should exist. Changing this forces a new resource to be created.
- name String
- The name which should be used for this Managed Instance Failover Group. Changing this forces a new resource to be created.
- readonly
Endpoint BooleanFailover Policy Enabled - Failover policy for the read-only endpoint. Defaults to
true
.
- managed
Instance stringId - The ID of the Azure SQL Managed Instance which will be replicated using a Managed Instance Failover Group. Changing this forces a new resource to be created.
- partner
Managed stringInstance Id - The ID of the Azure SQL Managed Instance which will be replicated to. Changing this forces a new resource to be created.
- read
Write ManagedEndpoint Failover Policy Instance Failover Group Read Write Endpoint Failover Policy - A
read_write_endpoint_failover_policy
block as defined below. - location string
- The Azure Region where the Managed Instance Failover Group should exist. Changing this forces a new resource to be created.
- name string
- The name which should be used for this Managed Instance Failover Group. Changing this forces a new resource to be created.
- readonly
Endpoint booleanFailover Policy Enabled - Failover policy for the read-only endpoint. Defaults to
true
.
- managed_
instance_ strid - The ID of the Azure SQL Managed Instance which will be replicated using a Managed Instance Failover Group. Changing this forces a new resource to be created.
- partner_
managed_ strinstance_ id - The ID of the Azure SQL Managed Instance which will be replicated to. Changing this forces a new resource to be created.
- read_
write_ Managedendpoint_ failover_ policy Instance Failover Group Read Write Endpoint Failover Policy Args - A
read_write_endpoint_failover_policy
block as defined below. - location str
- The Azure Region where the Managed Instance Failover Group should exist. Changing this forces a new resource to be created.
- name str
- The name which should be used for this Managed Instance Failover Group. Changing this forces a new resource to be created.
- readonly_
endpoint_ boolfailover_ policy_ enabled - Failover policy for the read-only endpoint. Defaults to
true
.
- managed
Instance StringId - The ID of the Azure SQL Managed Instance which will be replicated using a Managed Instance Failover Group. Changing this forces a new resource to be created.
- partner
Managed StringInstance Id - The ID of the Azure SQL Managed Instance which will be replicated to. Changing this forces a new resource to be created.
- read
Write Property MapEndpoint Failover Policy - A
read_write_endpoint_failover_policy
block as defined below. - location String
- The Azure Region where the Managed Instance Failover Group should exist. Changing this forces a new resource to be created.
- name String
- The name which should be used for this Managed Instance Failover Group. Changing this forces a new resource to be created.
- readonly
Endpoint BooleanFailover Policy Enabled - Failover policy for the read-only endpoint. Defaults to
true
.
Outputs
All input properties are implicitly available as output properties. Additionally, the ManagedInstanceFailoverGroup resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Partner
Regions List<ManagedInstance Failover Group Partner Region> - A
partner_region
block as defined below. - Role string
- The partner replication role of the Managed Instance Failover Group.
- Id string
- The provider-assigned unique ID for this managed resource.
- Partner
Regions []ManagedInstance Failover Group Partner Region - A
partner_region
block as defined below. - Role string
- The partner replication role of the Managed Instance Failover Group.
- id String
- The provider-assigned unique ID for this managed resource.
- partner
Regions List<ManagedInstance Failover Group Partner Region> - A
partner_region
block as defined below. - role String
- The partner replication role of the Managed Instance Failover Group.
- id string
- The provider-assigned unique ID for this managed resource.
- partner
Regions ManagedInstance Failover Group Partner Region[] - A
partner_region
block as defined below. - role string
- The partner replication role of the Managed Instance Failover Group.
- id str
- The provider-assigned unique ID for this managed resource.
- partner_
regions Sequence[ManagedInstance Failover Group Partner Region] - A
partner_region
block as defined below. - role str
- The partner replication role of the Managed Instance Failover Group.
- id String
- The provider-assigned unique ID for this managed resource.
- partner
Regions List<Property Map> - A
partner_region
block as defined below. - role String
- The partner replication role of the Managed Instance Failover Group.
Look up Existing ManagedInstanceFailoverGroup Resource
Get an existing ManagedInstanceFailoverGroup 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?: ManagedInstanceFailoverGroupState, opts?: CustomResourceOptions): ManagedInstanceFailoverGroup
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
location: Optional[str] = None,
managed_instance_id: Optional[str] = None,
name: Optional[str] = None,
partner_managed_instance_id: Optional[str] = None,
partner_regions: Optional[Sequence[ManagedInstanceFailoverGroupPartnerRegionArgs]] = None,
read_write_endpoint_failover_policy: Optional[ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicyArgs] = None,
readonly_endpoint_failover_policy_enabled: Optional[bool] = None,
role: Optional[str] = None) -> ManagedInstanceFailoverGroup
func GetManagedInstanceFailoverGroup(ctx *Context, name string, id IDInput, state *ManagedInstanceFailoverGroupState, opts ...ResourceOption) (*ManagedInstanceFailoverGroup, error)
public static ManagedInstanceFailoverGroup Get(string name, Input<string> id, ManagedInstanceFailoverGroupState? state, CustomResourceOptions? opts = null)
public static ManagedInstanceFailoverGroup get(String name, Output<String> id, ManagedInstanceFailoverGroupState 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.
- Location string
- The Azure Region where the Managed Instance Failover Group should exist. Changing this forces a new resource to be created.
- Managed
Instance stringId - The ID of the Azure SQL Managed Instance which will be replicated using a Managed Instance Failover Group. Changing this forces a new resource to be created.
- Name string
- The name which should be used for this Managed Instance Failover Group. Changing this forces a new resource to be created.
- Partner
Managed stringInstance Id - The ID of the Azure SQL Managed Instance which will be replicated to. Changing this forces a new resource to be created.
- Partner
Regions List<ManagedInstance Failover Group Partner Region> - A
partner_region
block as defined below. - Read
Write ManagedEndpoint Failover Policy Instance Failover Group Read Write Endpoint Failover Policy - A
read_write_endpoint_failover_policy
block as defined below. - Readonly
Endpoint boolFailover Policy Enabled - Failover policy for the read-only endpoint. Defaults to
true
. - Role string
- The partner replication role of the Managed Instance Failover Group.
- Location string
- The Azure Region where the Managed Instance Failover Group should exist. Changing this forces a new resource to be created.
- Managed
Instance stringId - The ID of the Azure SQL Managed Instance which will be replicated using a Managed Instance Failover Group. Changing this forces a new resource to be created.
- Name string
- The name which should be used for this Managed Instance Failover Group. Changing this forces a new resource to be created.
- Partner
Managed stringInstance Id - The ID of the Azure SQL Managed Instance which will be replicated to. Changing this forces a new resource to be created.
- Partner
Regions []ManagedInstance Failover Group Partner Region Args - A
partner_region
block as defined below. - Read
Write ManagedEndpoint Failover Policy Instance Failover Group Read Write Endpoint Failover Policy Args - A
read_write_endpoint_failover_policy
block as defined below. - Readonly
Endpoint boolFailover Policy Enabled - Failover policy for the read-only endpoint. Defaults to
true
. - Role string
- The partner replication role of the Managed Instance Failover Group.
- location String
- The Azure Region where the Managed Instance Failover Group should exist. Changing this forces a new resource to be created.
- managed
Instance StringId - The ID of the Azure SQL Managed Instance which will be replicated using a Managed Instance Failover Group. Changing this forces a new resource to be created.
- name String
- The name which should be used for this Managed Instance Failover Group. Changing this forces a new resource to be created.
- partner
Managed StringInstance Id - The ID of the Azure SQL Managed Instance which will be replicated to. Changing this forces a new resource to be created.
- partner
Regions List<ManagedInstance Failover Group Partner Region> - A
partner_region
block as defined below. - read
Write ManagedEndpoint Failover Policy Instance Failover Group Read Write Endpoint Failover Policy - A
read_write_endpoint_failover_policy
block as defined below. - readonly
Endpoint BooleanFailover Policy Enabled - Failover policy for the read-only endpoint. Defaults to
true
. - role String
- The partner replication role of the Managed Instance Failover Group.
- location string
- The Azure Region where the Managed Instance Failover Group should exist. Changing this forces a new resource to be created.
- managed
Instance stringId - The ID of the Azure SQL Managed Instance which will be replicated using a Managed Instance Failover Group. Changing this forces a new resource to be created.
- name string
- The name which should be used for this Managed Instance Failover Group. Changing this forces a new resource to be created.
- partner
Managed stringInstance Id - The ID of the Azure SQL Managed Instance which will be replicated to. Changing this forces a new resource to be created.
- partner
Regions ManagedInstance Failover Group Partner Region[] - A
partner_region
block as defined below. - read
Write ManagedEndpoint Failover Policy Instance Failover Group Read Write Endpoint Failover Policy - A
read_write_endpoint_failover_policy
block as defined below. - readonly
Endpoint booleanFailover Policy Enabled - Failover policy for the read-only endpoint. Defaults to
true
. - role string
- The partner replication role of the Managed Instance Failover Group.
- location str
- The Azure Region where the Managed Instance Failover Group should exist. Changing this forces a new resource to be created.
- managed_
instance_ strid - The ID of the Azure SQL Managed Instance which will be replicated using a Managed Instance Failover Group. Changing this forces a new resource to be created.
- name str
- The name which should be used for this Managed Instance Failover Group. Changing this forces a new resource to be created.
- partner_
managed_ strinstance_ id - The ID of the Azure SQL Managed Instance which will be replicated to. Changing this forces a new resource to be created.
- partner_
regions Sequence[ManagedInstance Failover Group Partner Region Args] - A
partner_region
block as defined below. - read_
write_ Managedendpoint_ failover_ policy Instance Failover Group Read Write Endpoint Failover Policy Args - A
read_write_endpoint_failover_policy
block as defined below. - readonly_
endpoint_ boolfailover_ policy_ enabled - Failover policy for the read-only endpoint. Defaults to
true
. - role str
- The partner replication role of the Managed Instance Failover Group.
- location String
- The Azure Region where the Managed Instance Failover Group should exist. Changing this forces a new resource to be created.
- managed
Instance StringId - The ID of the Azure SQL Managed Instance which will be replicated using a Managed Instance Failover Group. Changing this forces a new resource to be created.
- name String
- The name which should be used for this Managed Instance Failover Group. Changing this forces a new resource to be created.
- partner
Managed StringInstance Id - The ID of the Azure SQL Managed Instance which will be replicated to. Changing this forces a new resource to be created.
- partner
Regions List<Property Map> - A
partner_region
block as defined below. - read
Write Property MapEndpoint Failover Policy - A
read_write_endpoint_failover_policy
block as defined below. - readonly
Endpoint BooleanFailover Policy Enabled - Failover policy for the read-only endpoint. Defaults to
true
. - role String
- The partner replication role of the Managed Instance Failover Group.
Supporting Types
ManagedInstanceFailoverGroupPartnerRegion, ManagedInstanceFailoverGroupPartnerRegionArgs
ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicy, ManagedInstanceFailoverGroupReadWriteEndpointFailoverPolicyArgs
- Mode string
- The failover mode. Possible values are
Automatic
orManual
. - Grace
Minutes int - Applies only if
mode
isAutomatic
. The grace period in minutes before failover with data loss is attempted.
- Mode string
- The failover mode. Possible values are
Automatic
orManual
. - Grace
Minutes int - Applies only if
mode
isAutomatic
. The grace period in minutes before failover with data loss is attempted.
- mode String
- The failover mode. Possible values are
Automatic
orManual
. - grace
Minutes Integer - Applies only if
mode
isAutomatic
. The grace period in minutes before failover with data loss is attempted.
- mode string
- The failover mode. Possible values are
Automatic
orManual
. - grace
Minutes number - Applies only if
mode
isAutomatic
. The grace period in minutes before failover with data loss is attempted.
- mode str
- The failover mode. Possible values are
Automatic
orManual
. - grace_
minutes int - Applies only if
mode
isAutomatic
. The grace period in minutes before failover with data loss is attempted.
- mode String
- The failover mode. Possible values are
Automatic
orManual
. - grace
Minutes Number - Applies only if
mode
isAutomatic
. The grace period in minutes before failover with data loss is attempted.
Import
SQL Instance Failover Groups can be imported using the resource id
, e.g.
$ pulumi import azure:mssql/managedInstanceFailoverGroup:ManagedInstanceFailoverGroup example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Sql/locations/Location/instanceFailoverGroups/failoverGroup1
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.