1. Packages
  2. Azure Native
  3. API Docs
  4. sql
  5. DistributedAvailabilityGroup
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.63.0 published on Tuesday, Sep 24, 2024 by Pulumi

azure-native.sql.DistributedAvailabilityGroup

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.63.0 published on Tuesday, Sep 24, 2024 by Pulumi

    Distributed availability group between box and Sql Managed Instance. Azure REST API version: 2021-11-01. Prior API version in Azure Native 1.x: 2021-05-01-preview.

    Other available API versions: 2022-11-01-preview, 2023-02-01-preview, 2023-05-01-preview, 2023-08-01-preview, 2024-05-01-preview.

    Example Usage

    Create a distributed availability group.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var distributedAvailabilityGroup = new AzureNative.Sql.DistributedAvailabilityGroup("distributedAvailabilityGroup", new()
        {
            DistributedAvailabilityGroupName = "dag",
            ManagedInstanceName = "testcl",
            PrimaryAvailabilityGroupName = "BoxLocalAg1",
            ResourceGroupName = "testrg",
            SecondaryAvailabilityGroupName = "testcl",
            SourceEndpoint = "TCP://SERVER:7022",
            TargetDatabase = "testdb",
        });
    
    });
    
    package main
    
    import (
    	sql "github.com/pulumi/pulumi-azure-native-sdk/sql/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sql.NewDistributedAvailabilityGroup(ctx, "distributedAvailabilityGroup", &sql.DistributedAvailabilityGroupArgs{
    			DistributedAvailabilityGroupName: pulumi.String("dag"),
    			ManagedInstanceName:              pulumi.String("testcl"),
    			PrimaryAvailabilityGroupName:     pulumi.String("BoxLocalAg1"),
    			ResourceGroupName:                pulumi.String("testrg"),
    			SecondaryAvailabilityGroupName:   pulumi.String("testcl"),
    			SourceEndpoint:                   pulumi.String("TCP://SERVER:7022"),
    			TargetDatabase:                   pulumi.String("testdb"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.sql.DistributedAvailabilityGroup;
    import com.pulumi.azurenative.sql.DistributedAvailabilityGroupArgs;
    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 distributedAvailabilityGroup = new DistributedAvailabilityGroup("distributedAvailabilityGroup", DistributedAvailabilityGroupArgs.builder()
                .distributedAvailabilityGroupName("dag")
                .managedInstanceName("testcl")
                .primaryAvailabilityGroupName("BoxLocalAg1")
                .resourceGroupName("testrg")
                .secondaryAvailabilityGroupName("testcl")
                .sourceEndpoint("TCP://SERVER:7022")
                .targetDatabase("testdb")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    distributed_availability_group = azure_native.sql.DistributedAvailabilityGroup("distributedAvailabilityGroup",
        distributed_availability_group_name="dag",
        managed_instance_name="testcl",
        primary_availability_group_name="BoxLocalAg1",
        resource_group_name="testrg",
        secondary_availability_group_name="testcl",
        source_endpoint="TCP://SERVER:7022",
        target_database="testdb")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const distributedAvailabilityGroup = new azure_native.sql.DistributedAvailabilityGroup("distributedAvailabilityGroup", {
        distributedAvailabilityGroupName: "dag",
        managedInstanceName: "testcl",
        primaryAvailabilityGroupName: "BoxLocalAg1",
        resourceGroupName: "testrg",
        secondaryAvailabilityGroupName: "testcl",
        sourceEndpoint: "TCP://SERVER:7022",
        targetDatabase: "testdb",
    });
    
    resources:
      distributedAvailabilityGroup:
        type: azure-native:sql:DistributedAvailabilityGroup
        properties:
          distributedAvailabilityGroupName: dag
          managedInstanceName: testcl
          primaryAvailabilityGroupName: BoxLocalAg1
          resourceGroupName: testrg
          secondaryAvailabilityGroupName: testcl
          sourceEndpoint: TCP://SERVER:7022
          targetDatabase: testdb
    

    Create DistributedAvailabilityGroup Resource

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

    Constructor syntax

    new DistributedAvailabilityGroup(name: string, args: DistributedAvailabilityGroupArgs, opts?: CustomResourceOptions);
    @overload
    def DistributedAvailabilityGroup(resource_name: str,
                                     args: DistributedAvailabilityGroupArgs,
                                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def DistributedAvailabilityGroup(resource_name: str,
                                     opts: Optional[ResourceOptions] = None,
                                     managed_instance_name: Optional[str] = None,
                                     resource_group_name: Optional[str] = None,
                                     distributed_availability_group_name: Optional[str] = None,
                                     primary_availability_group_name: Optional[str] = None,
                                     replication_mode: Optional[Union[str, ReplicationMode]] = None,
                                     secondary_availability_group_name: Optional[str] = None,
                                     source_endpoint: Optional[str] = None,
                                     target_database: Optional[str] = None)
    func NewDistributedAvailabilityGroup(ctx *Context, name string, args DistributedAvailabilityGroupArgs, opts ...ResourceOption) (*DistributedAvailabilityGroup, error)
    public DistributedAvailabilityGroup(string name, DistributedAvailabilityGroupArgs args, CustomResourceOptions? opts = null)
    public DistributedAvailabilityGroup(String name, DistributedAvailabilityGroupArgs args)
    public DistributedAvailabilityGroup(String name, DistributedAvailabilityGroupArgs args, CustomResourceOptions options)
    
    type: azure-native:sql:DistributedAvailabilityGroup
    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 DistributedAvailabilityGroupArgs
    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 DistributedAvailabilityGroupArgs
    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 DistributedAvailabilityGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DistributedAvailabilityGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DistributedAvailabilityGroupArgs
    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 distributedAvailabilityGroupResource = new AzureNative.Sql.DistributedAvailabilityGroup("distributedAvailabilityGroupResource", new()
    {
        ManagedInstanceName = "string",
        ResourceGroupName = "string",
        DistributedAvailabilityGroupName = "string",
        PrimaryAvailabilityGroupName = "string",
        ReplicationMode = "string",
        SecondaryAvailabilityGroupName = "string",
        SourceEndpoint = "string",
        TargetDatabase = "string",
    });
    
    example, err := sql.NewDistributedAvailabilityGroup(ctx, "distributedAvailabilityGroupResource", &sql.DistributedAvailabilityGroupArgs{
    	ManagedInstanceName:              pulumi.String("string"),
    	ResourceGroupName:                pulumi.String("string"),
    	DistributedAvailabilityGroupName: pulumi.String("string"),
    	PrimaryAvailabilityGroupName:     pulumi.String("string"),
    	ReplicationMode:                  pulumi.String("string"),
    	SecondaryAvailabilityGroupName:   pulumi.String("string"),
    	SourceEndpoint:                   pulumi.String("string"),
    	TargetDatabase:                   pulumi.String("string"),
    })
    
    var distributedAvailabilityGroupResource = new DistributedAvailabilityGroup("distributedAvailabilityGroupResource", DistributedAvailabilityGroupArgs.builder()
        .managedInstanceName("string")
        .resourceGroupName("string")
        .distributedAvailabilityGroupName("string")
        .primaryAvailabilityGroupName("string")
        .replicationMode("string")
        .secondaryAvailabilityGroupName("string")
        .sourceEndpoint("string")
        .targetDatabase("string")
        .build());
    
    distributed_availability_group_resource = azure_native.sql.DistributedAvailabilityGroup("distributedAvailabilityGroupResource",
        managed_instance_name="string",
        resource_group_name="string",
        distributed_availability_group_name="string",
        primary_availability_group_name="string",
        replication_mode="string",
        secondary_availability_group_name="string",
        source_endpoint="string",
        target_database="string")
    
    const distributedAvailabilityGroupResource = new azure_native.sql.DistributedAvailabilityGroup("distributedAvailabilityGroupResource", {
        managedInstanceName: "string",
        resourceGroupName: "string",
        distributedAvailabilityGroupName: "string",
        primaryAvailabilityGroupName: "string",
        replicationMode: "string",
        secondaryAvailabilityGroupName: "string",
        sourceEndpoint: "string",
        targetDatabase: "string",
    });
    
    type: azure-native:sql:DistributedAvailabilityGroup
    properties:
        distributedAvailabilityGroupName: string
        managedInstanceName: string
        primaryAvailabilityGroupName: string
        replicationMode: string
        resourceGroupName: string
        secondaryAvailabilityGroupName: string
        sourceEndpoint: string
        targetDatabase: string
    

    DistributedAvailabilityGroup 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 DistributedAvailabilityGroup resource accepts the following input properties:

    ManagedInstanceName string
    The name of the managed instance.
    ResourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    DistributedAvailabilityGroupName string
    The distributed availability group name.
    PrimaryAvailabilityGroupName string
    The primary availability group name
    ReplicationMode string | Pulumi.AzureNative.Sql.ReplicationMode
    The replication mode of a distributed availability group. Parameter will be ignored during link creation.
    SecondaryAvailabilityGroupName string
    The secondary availability group name
    SourceEndpoint string
    The source endpoint
    TargetDatabase string
    The name of the target database
    ManagedInstanceName string
    The name of the managed instance.
    ResourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    DistributedAvailabilityGroupName string
    The distributed availability group name.
    PrimaryAvailabilityGroupName string
    The primary availability group name
    ReplicationMode string | ReplicationMode
    The replication mode of a distributed availability group. Parameter will be ignored during link creation.
    SecondaryAvailabilityGroupName string
    The secondary availability group name
    SourceEndpoint string
    The source endpoint
    TargetDatabase string
    The name of the target database
    managedInstanceName String
    The name of the managed instance.
    resourceGroupName String
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    distributedAvailabilityGroupName String
    The distributed availability group name.
    primaryAvailabilityGroupName String
    The primary availability group name
    replicationMode String | ReplicationMode
    The replication mode of a distributed availability group. Parameter will be ignored during link creation.
    secondaryAvailabilityGroupName String
    The secondary availability group name
    sourceEndpoint String
    The source endpoint
    targetDatabase String
    The name of the target database
    managedInstanceName string
    The name of the managed instance.
    resourceGroupName string
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    distributedAvailabilityGroupName string
    The distributed availability group name.
    primaryAvailabilityGroupName string
    The primary availability group name
    replicationMode string | ReplicationMode
    The replication mode of a distributed availability group. Parameter will be ignored during link creation.
    secondaryAvailabilityGroupName string
    The secondary availability group name
    sourceEndpoint string
    The source endpoint
    targetDatabase string
    The name of the target database
    managed_instance_name str
    The name of the managed instance.
    resource_group_name str
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    distributed_availability_group_name str
    The distributed availability group name.
    primary_availability_group_name str
    The primary availability group name
    replication_mode str | ReplicationMode
    The replication mode of a distributed availability group. Parameter will be ignored during link creation.
    secondary_availability_group_name str
    The secondary availability group name
    source_endpoint str
    The source endpoint
    target_database str
    The name of the target database
    managedInstanceName String
    The name of the managed instance.
    resourceGroupName String
    The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
    distributedAvailabilityGroupName String
    The distributed availability group name.
    primaryAvailabilityGroupName String
    The primary availability group name
    replicationMode String | "Async" | "Sync"
    The replication mode of a distributed availability group. Parameter will be ignored during link creation.
    secondaryAvailabilityGroupName String
    The secondary availability group name
    sourceEndpoint String
    The source endpoint
    targetDatabase String
    The name of the target database

    Outputs

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

    DistributedAvailabilityGroupId string
    The distributed availability group id
    Id string
    The provider-assigned unique ID for this managed resource.
    LastHardenedLsn string
    The last hardened lsn
    LinkState string
    The link state
    Name string
    Resource name.
    SourceReplicaId string
    The source replica id
    TargetReplicaId string
    The target replica id
    Type string
    Resource type.
    DistributedAvailabilityGroupId string
    The distributed availability group id
    Id string
    The provider-assigned unique ID for this managed resource.
    LastHardenedLsn string
    The last hardened lsn
    LinkState string
    The link state
    Name string
    Resource name.
    SourceReplicaId string
    The source replica id
    TargetReplicaId string
    The target replica id
    Type string
    Resource type.
    distributedAvailabilityGroupId String
    The distributed availability group id
    id String
    The provider-assigned unique ID for this managed resource.
    lastHardenedLsn String
    The last hardened lsn
    linkState String
    The link state
    name String
    Resource name.
    sourceReplicaId String
    The source replica id
    targetReplicaId String
    The target replica id
    type String
    Resource type.
    distributedAvailabilityGroupId string
    The distributed availability group id
    id string
    The provider-assigned unique ID for this managed resource.
    lastHardenedLsn string
    The last hardened lsn
    linkState string
    The link state
    name string
    Resource name.
    sourceReplicaId string
    The source replica id
    targetReplicaId string
    The target replica id
    type string
    Resource type.
    distributed_availability_group_id str
    The distributed availability group id
    id str
    The provider-assigned unique ID for this managed resource.
    last_hardened_lsn str
    The last hardened lsn
    link_state str
    The link state
    name str
    Resource name.
    source_replica_id str
    The source replica id
    target_replica_id str
    The target replica id
    type str
    Resource type.
    distributedAvailabilityGroupId String
    The distributed availability group id
    id String
    The provider-assigned unique ID for this managed resource.
    lastHardenedLsn String
    The last hardened lsn
    linkState String
    The link state
    name String
    Resource name.
    sourceReplicaId String
    The source replica id
    targetReplicaId String
    The target replica id
    type String
    Resource type.

    Supporting Types

    ReplicationMode, ReplicationModeArgs

    Async
    Async
    Sync
    Sync
    ReplicationModeAsync
    Async
    ReplicationModeSync
    Sync
    Async
    Async
    Sync
    Sync
    Async
    Async
    Sync
    Sync
    ASYNC_
    Async
    SYNC
    Sync
    "Async"
    Async
    "Sync"
    Sync

    Import

    An existing resource can be imported using its type token, name, and identifier, e.g.

    $ pulumi import azure-native:sql:DistributedAvailabilityGroup dag /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName} 
    

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

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.63.0 published on Tuesday, Sep 24, 2024 by Pulumi