azure-native.sql.DistributedAvailabilityGroup
Explore with Pulumi AI
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:
- Managed
Instance stringName - The name of the managed instance.
- Resource
Group stringName - 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 stringGroup Name - The distributed availability group name.
- Primary
Availability stringGroup Name - The primary availability group name
- Replication
Mode string | Pulumi.Azure Native. Sql. Replication Mode - The replication mode of a distributed availability group. Parameter will be ignored during link creation.
- Secondary
Availability stringGroup Name - The secondary availability group name
- Source
Endpoint string - The source endpoint
- Target
Database string - The name of the target database
- Managed
Instance stringName - The name of the managed instance.
- Resource
Group stringName - 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 stringGroup Name - The distributed availability group name.
- Primary
Availability stringGroup Name - The primary availability group name
- Replication
Mode string | ReplicationMode - The replication mode of a distributed availability group. Parameter will be ignored during link creation.
- Secondary
Availability stringGroup Name - The secondary availability group name
- Source
Endpoint string - The source endpoint
- Target
Database string - The name of the target database
- managed
Instance StringName - The name of the managed instance.
- resource
Group StringName - 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 StringGroup Name - The distributed availability group name.
- primary
Availability StringGroup Name - The primary availability group name
- replication
Mode String | ReplicationMode - The replication mode of a distributed availability group. Parameter will be ignored during link creation.
- secondary
Availability StringGroup Name - The secondary availability group name
- source
Endpoint String - The source endpoint
- target
Database String - The name of the target database
- managed
Instance stringName - The name of the managed instance.
- resource
Group stringName - 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 stringGroup Name - The distributed availability group name.
- primary
Availability stringGroup Name - The primary availability group name
- replication
Mode string | ReplicationMode - The replication mode of a distributed availability group. Parameter will be ignored during link creation.
- secondary
Availability stringGroup Name - The secondary availability group name
- source
Endpoint string - The source endpoint
- target
Database string - The name of the target database
- managed_
instance_ strname - The name of the managed instance.
- resource_
group_ strname - 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_ strgroup_ name - The distributed availability group name.
- primary_
availability_ strgroup_ name - 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_ strgroup_ name - The secondary availability group name
- source_
endpoint str - The source endpoint
- target_
database str - The name of the target database
- managed
Instance StringName - The name of the managed instance.
- resource
Group StringName - 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 StringGroup Name - The distributed availability group name.
- primary
Availability StringGroup Name - The primary availability group name
- replication
Mode String | "Async" | "Sync" - The replication mode of a distributed availability group. Parameter will be ignored during link creation.
- secondary
Availability StringGroup Name - The secondary availability group name
- source
Endpoint String - The source endpoint
- target
Database 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:
- Distributed
Availability stringGroup Id - The distributed availability group id
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Hardened stringLsn - The last hardened lsn
- Link
State string - The link state
- Name string
- Resource name.
- Source
Replica stringId - The source replica id
- Target
Replica stringId - The target replica id
- Type string
- Resource type.
- Distributed
Availability stringGroup Id - The distributed availability group id
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Hardened stringLsn - The last hardened lsn
- Link
State string - The link state
- Name string
- Resource name.
- Source
Replica stringId - The source replica id
- Target
Replica stringId - The target replica id
- Type string
- Resource type.
- distributed
Availability StringGroup Id - The distributed availability group id
- id String
- The provider-assigned unique ID for this managed resource.
- last
Hardened StringLsn - The last hardened lsn
- link
State String - The link state
- name String
- Resource name.
- source
Replica StringId - The source replica id
- target
Replica StringId - The target replica id
- type String
- Resource type.
- distributed
Availability stringGroup Id - The distributed availability group id
- id string
- The provider-assigned unique ID for this managed resource.
- last
Hardened stringLsn - The last hardened lsn
- link
State string - The link state
- name string
- Resource name.
- source
Replica stringId - The source replica id
- target
Replica stringId - The target replica id
- type string
- Resource type.
- distributed_
availability_ strgroup_ id - The distributed availability group id
- id str
- The provider-assigned unique ID for this managed resource.
- last_
hardened_ strlsn - The last hardened lsn
- link_
state str - The link state
- name str
- Resource name.
- source_
replica_ strid - The source replica id
- target_
replica_ strid - The target replica id
- type str
- Resource type.
- distributed
Availability StringGroup Id - The distributed availability group id
- id String
- The provider-assigned unique ID for this managed resource.
- last
Hardened StringLsn - The last hardened lsn
- link
State String - The link state
- name String
- Resource name.
- source
Replica StringId - The source replica id
- target
Replica StringId - The target replica id
- type String
- Resource type.
Supporting Types
ReplicationMode, ReplicationModeArgs
- Async
- Async
- Sync
- Sync
- Replication
Mode Async - Async
- Replication
Mode Sync - 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