1. Packages
  2. Azure Classic
  3. API Docs
  4. domainservices
  5. ReplicaSet

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Manages a Replica Set for an Active Directory Domain Service.

    Example Usage

    Example coming soon!

    Example coming soon!

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    import * as azuread from "@pulumi/azuread";
    
    const primaryResourceGroup = new azure.core.ResourceGroup("primaryResourceGroup", {location: "West Europe"});
    const primaryVirtualNetwork = new azure.network.VirtualNetwork("primaryVirtualNetwork", {
        location: primaryResourceGroup.location,
        resourceGroupName: primaryResourceGroup.name,
        addressSpaces: ["10.0.1.0/16"],
    });
    const primarySubnet = new azure.network.Subnet("primarySubnet", {
        resourceGroupName: primaryResourceGroup.name,
        virtualNetworkName: primaryVirtualNetwork.name,
        addressPrefixes: ["10.0.1.0/24"],
    });
    const primaryNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("primaryNetworkSecurityGroup", {
        location: primaryResourceGroup.location,
        resourceGroupName: primaryResourceGroup.name,
        securityRules: [
            {
                name: "AllowSyncWithAzureAD",
                priority: 101,
                direction: "Inbound",
                access: "Allow",
                protocol: "Tcp",
                sourcePortRange: "*",
                destinationPortRange: "443",
                sourceAddressPrefix: "AzureActiveDirectoryDomainServices",
                destinationAddressPrefix: "*",
            },
            {
                name: "AllowRD",
                priority: 201,
                direction: "Inbound",
                access: "Allow",
                protocol: "Tcp",
                sourcePortRange: "*",
                destinationPortRange: "3389",
                sourceAddressPrefix: "CorpNetSaw",
                destinationAddressPrefix: "*",
            },
            {
                name: "AllowPSRemoting",
                priority: 301,
                direction: "Inbound",
                access: "Allow",
                protocol: "Tcp",
                sourcePortRange: "*",
                destinationPortRange: "5986",
                sourceAddressPrefix: "AzureActiveDirectoryDomainServices",
                destinationAddressPrefix: "*",
            },
            {
                name: "AllowLDAPS",
                priority: 401,
                direction: "Inbound",
                access: "Allow",
                protocol: "Tcp",
                sourcePortRange: "*",
                destinationPortRange: "636",
                sourceAddressPrefix: "*",
                destinationAddressPrefix: "*",
            },
        ],
    });
    const primarySubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("primarySubnetNetworkSecurityGroupAssociation", {
        subnetId: primarySubnet.id,
        networkSecurityGroupId: primaryNetworkSecurityGroup.id,
    });
    const dcAdmins = new azuread.Group("dcAdmins", {securityEnabled: true});
    const adminUser = new azuread.User("adminUser", {
        userPrincipalName: `dc-admin@$hashicorp-example.net`,
        displayName: "DC Administrator",
        password: "Pa55w0Rd!!1",
    });
    const adminGroupMember = new azuread.GroupMember("adminGroupMember", {
        groupObjectId: dcAdmins.objectId,
        memberObjectId: adminUser.objectId,
    });
    const exampleServicePrincipal = new azuread.ServicePrincipal("exampleServicePrincipal", {applicationId: "2565bd9d-da50-47d4-8b85-4c97f669dc36"});
    // published app for domain services
    const aadds = new azure.core.ResourceGroup("aadds", {location: "westeurope"});
    const exampleService = new azure.domainservices.Service("exampleService", {
        location: aadds.location,
        resourceGroupName: aadds.name,
        domainName: "widgetslogin.net",
        sku: "Enterprise",
        filteredSyncEnabled: false,
        initialReplicaSet: {
            location: primaryVirtualNetwork.location,
            subnetId: primarySubnet.id,
        },
        notifications: {
            additionalRecipients: [
                "notifyA@example.net",
                "notifyB@example.org",
            ],
            notifyDcAdmins: true,
            notifyGlobalAdmins: true,
        },
        security: {
            syncKerberosPasswords: true,
            syncNtlmPasswords: true,
            syncOnPremPasswords: true,
        },
        tags: {
            Environment: "prod",
        },
    }, {
        dependsOn: [
            exampleServicePrincipal,
            primarySubnetNetworkSecurityGroupAssociation,
        ],
    });
    const replicaResourceGroup = new azure.core.ResourceGroup("replicaResourceGroup", {location: "North Europe"});
    const replicaVirtualNetwork = new azure.network.VirtualNetwork("replicaVirtualNetwork", {
        location: replicaResourceGroup.location,
        resourceGroupName: replicaResourceGroup.name,
        addressSpaces: ["10.20.0.0/16"],
    });
    const aaddsReplicaSubnet = new azure.network.Subnet("aaddsReplicaSubnet", {
        resourceGroupName: replicaResourceGroup.name,
        virtualNetworkName: replicaVirtualNetwork.name,
        addressPrefixes: ["10.20.0.0/24"],
    });
    const aaddsReplicaNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("aaddsReplicaNetworkSecurityGroup", {
        location: replicaResourceGroup.location,
        resourceGroupName: replicaResourceGroup.name,
        securityRules: [
            {
                name: "AllowSyncWithAzureAD",
                priority: 101,
                direction: "Inbound",
                access: "Allow",
                protocol: "Tcp",
                sourcePortRange: "*",
                destinationPortRange: "443",
                sourceAddressPrefix: "AzureActiveDirectoryDomainServices",
                destinationAddressPrefix: "*",
            },
            {
                name: "AllowRD",
                priority: 201,
                direction: "Inbound",
                access: "Allow",
                protocol: "Tcp",
                sourcePortRange: "*",
                destinationPortRange: "3389",
                sourceAddressPrefix: "CorpNetSaw",
                destinationAddressPrefix: "*",
            },
            {
                name: "AllowPSRemoting",
                priority: 301,
                direction: "Inbound",
                access: "Allow",
                protocol: "Tcp",
                sourcePortRange: "*",
                destinationPortRange: "5986",
                sourceAddressPrefix: "AzureActiveDirectoryDomainServices",
                destinationAddressPrefix: "*",
            },
            {
                name: "AllowLDAPS",
                priority: 401,
                direction: "Inbound",
                access: "Allow",
                protocol: "Tcp",
                sourcePortRange: "*",
                destinationPortRange: "636",
                sourceAddressPrefix: "*",
                destinationAddressPrefix: "*",
            },
        ],
    });
    const replicaSubnetNetworkSecurityGroupAssociation = new azure.network.SubnetNetworkSecurityGroupAssociation("replicaSubnetNetworkSecurityGroupAssociation", {
        subnetId: aaddsReplicaSubnet.id,
        networkSecurityGroupId: aaddsReplicaNetworkSecurityGroup.id,
    });
    const primaryReplica = new azure.network.VirtualNetworkPeering("primaryReplica", {
        resourceGroupName: primaryVirtualNetwork.resourceGroupName,
        virtualNetworkName: primaryVirtualNetwork.name,
        remoteVirtualNetworkId: replicaVirtualNetwork.id,
        allowForwardedTraffic: true,
        allowGatewayTransit: false,
        allowVirtualNetworkAccess: true,
        useRemoteGateways: false,
    });
    const replicaPrimary = new azure.network.VirtualNetworkPeering("replicaPrimary", {
        resourceGroupName: replicaVirtualNetwork.resourceGroupName,
        virtualNetworkName: replicaVirtualNetwork.name,
        remoteVirtualNetworkId: primaryVirtualNetwork.id,
        allowForwardedTraffic: true,
        allowGatewayTransit: false,
        allowVirtualNetworkAccess: true,
        useRemoteGateways: false,
    });
    const replicaVirtualNetworkDnsServers = new azure.network.VirtualNetworkDnsServers("replicaVirtualNetworkDnsServers", {
        virtualNetworkId: replicaVirtualNetwork.id,
        dnsServers: exampleService.initialReplicaSet.apply(initialReplicaSet => initialReplicaSet.domainControllerIpAddresses),
    });
    const replicaReplicaSet = new azure.domainservices.ReplicaSet("replicaReplicaSet", {
        domainServiceId: exampleService.id,
        location: replicaResourceGroup.location,
        subnetId: aaddsReplicaSubnet.id,
    }, {
        dependsOn: [
            replicaSubnetNetworkSecurityGroupAssociation,
            primaryReplica,
            replicaPrimary,
        ],
    });
    

    Example coming soon!

    Example coming soon!

    Create ReplicaSet Resource

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

    Constructor syntax

    new ReplicaSet(name: string, args: ReplicaSetArgs, opts?: CustomResourceOptions);
    @overload
    def ReplicaSet(resource_name: str,
                   args: ReplicaSetArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def ReplicaSet(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   domain_service_id: Optional[str] = None,
                   subnet_id: Optional[str] = None,
                   location: Optional[str] = None)
    func NewReplicaSet(ctx *Context, name string, args ReplicaSetArgs, opts ...ResourceOption) (*ReplicaSet, error)
    public ReplicaSet(string name, ReplicaSetArgs args, CustomResourceOptions? opts = null)
    public ReplicaSet(String name, ReplicaSetArgs args)
    public ReplicaSet(String name, ReplicaSetArgs args, CustomResourceOptions options)
    
    type: azure:domainservices:ReplicaSet
    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 ReplicaSetArgs
    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 ReplicaSetArgs
    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 ReplicaSetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ReplicaSetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ReplicaSetArgs
    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 replicaSetResource = new Azure.DomainServices.ReplicaSet("replicaSetResource", new()
    {
        DomainServiceId = "string",
        SubnetId = "string",
        Location = "string",
    });
    
    example, err := domainservices.NewReplicaSet(ctx, "replicaSetResource", &domainservices.ReplicaSetArgs{
    	DomainServiceId: pulumi.String("string"),
    	SubnetId:        pulumi.String("string"),
    	Location:        pulumi.String("string"),
    })
    
    var replicaSetResource = new ReplicaSet("replicaSetResource", ReplicaSetArgs.builder()
        .domainServiceId("string")
        .subnetId("string")
        .location("string")
        .build());
    
    replica_set_resource = azure.domainservices.ReplicaSet("replicaSetResource",
        domain_service_id="string",
        subnet_id="string",
        location="string")
    
    const replicaSetResource = new azure.domainservices.ReplicaSet("replicaSetResource", {
        domainServiceId: "string",
        subnetId: "string",
        location: "string",
    });
    
    type: azure:domainservices:ReplicaSet
    properties:
        domainServiceId: string
        location: string
        subnetId: string
    

    ReplicaSet Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ReplicaSet resource accepts the following input properties:

    DomainServiceId string
    The ID of the Domain Service for which to create this Replica Set. Changing this forces a new resource to be created.
    SubnetId string
    The ID of the subnet in which to place this Replica Set.
    Location string
    The Azure location where this Replica Set should exist. Changing this forces a new resource to be created.
    DomainServiceId string
    The ID of the Domain Service for which to create this Replica Set. Changing this forces a new resource to be created.
    SubnetId string
    The ID of the subnet in which to place this Replica Set.
    Location string
    The Azure location where this Replica Set should exist. Changing this forces a new resource to be created.
    domainServiceId String
    The ID of the Domain Service for which to create this Replica Set. Changing this forces a new resource to be created.
    subnetId String
    The ID of the subnet in which to place this Replica Set.
    location String
    The Azure location where this Replica Set should exist. Changing this forces a new resource to be created.
    domainServiceId string
    The ID of the Domain Service for which to create this Replica Set. Changing this forces a new resource to be created.
    subnetId string
    The ID of the subnet in which to place this Replica Set.
    location string
    The Azure location where this Replica Set should exist. Changing this forces a new resource to be created.
    domain_service_id str
    The ID of the Domain Service for which to create this Replica Set. Changing this forces a new resource to be created.
    subnet_id str
    The ID of the subnet in which to place this Replica Set.
    location str
    The Azure location where this Replica Set should exist. Changing this forces a new resource to be created.
    domainServiceId String
    The ID of the Domain Service for which to create this Replica Set. Changing this forces a new resource to be created.
    subnetId String
    The ID of the subnet in which to place this Replica Set.
    location String
    The Azure location where this Replica Set should exist. Changing this forces a new resource to be created.

    Outputs

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

    DomainControllerIpAddresses List<string>
    A list of subnet IP addresses for the domain controllers in this Replica Set, typically two.
    ExternalAccessIpAddress string
    The publicly routable IP address for the domain controllers in this Replica Set.
    Id string
    The provider-assigned unique ID for this managed resource.
    ServiceStatus string
    The current service status for the replica set.
    DomainControllerIpAddresses []string
    A list of subnet IP addresses for the domain controllers in this Replica Set, typically two.
    ExternalAccessIpAddress string
    The publicly routable IP address for the domain controllers in this Replica Set.
    Id string
    The provider-assigned unique ID for this managed resource.
    ServiceStatus string
    The current service status for the replica set.
    domainControllerIpAddresses List<String>
    A list of subnet IP addresses for the domain controllers in this Replica Set, typically two.
    externalAccessIpAddress String
    The publicly routable IP address for the domain controllers in this Replica Set.
    id String
    The provider-assigned unique ID for this managed resource.
    serviceStatus String
    The current service status for the replica set.
    domainControllerIpAddresses string[]
    A list of subnet IP addresses for the domain controllers in this Replica Set, typically two.
    externalAccessIpAddress string
    The publicly routable IP address for the domain controllers in this Replica Set.
    id string
    The provider-assigned unique ID for this managed resource.
    serviceStatus string
    The current service status for the replica set.
    domain_controller_ip_addresses Sequence[str]
    A list of subnet IP addresses for the domain controllers in this Replica Set, typically two.
    external_access_ip_address str
    The publicly routable IP address for the domain controllers in this Replica Set.
    id str
    The provider-assigned unique ID for this managed resource.
    service_status str
    The current service status for the replica set.
    domainControllerIpAddresses List<String>
    A list of subnet IP addresses for the domain controllers in this Replica Set, typically two.
    externalAccessIpAddress String
    The publicly routable IP address for the domain controllers in this Replica Set.
    id String
    The provider-assigned unique ID for this managed resource.
    serviceStatus String
    The current service status for the replica set.

    Look up Existing ReplicaSet Resource

    Get an existing ReplicaSet 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?: ReplicaSetState, opts?: CustomResourceOptions): ReplicaSet
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            domain_controller_ip_addresses: Optional[Sequence[str]] = None,
            domain_service_id: Optional[str] = None,
            external_access_ip_address: Optional[str] = None,
            location: Optional[str] = None,
            service_status: Optional[str] = None,
            subnet_id: Optional[str] = None) -> ReplicaSet
    func GetReplicaSet(ctx *Context, name string, id IDInput, state *ReplicaSetState, opts ...ResourceOption) (*ReplicaSet, error)
    public static ReplicaSet Get(string name, Input<string> id, ReplicaSetState? state, CustomResourceOptions? opts = null)
    public static ReplicaSet get(String name, Output<String> id, ReplicaSetState state, CustomResourceOptions options)
    resources:  _:    type: azure:domainservices:ReplicaSet    get:      id: ${id}
    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:
    DomainControllerIpAddresses List<string>
    A list of subnet IP addresses for the domain controllers in this Replica Set, typically two.
    DomainServiceId string
    The ID of the Domain Service for which to create this Replica Set. Changing this forces a new resource to be created.
    ExternalAccessIpAddress string
    The publicly routable IP address for the domain controllers in this Replica Set.
    Location string
    The Azure location where this Replica Set should exist. Changing this forces a new resource to be created.
    ServiceStatus string
    The current service status for the replica set.
    SubnetId string
    The ID of the subnet in which to place this Replica Set.
    DomainControllerIpAddresses []string
    A list of subnet IP addresses for the domain controllers in this Replica Set, typically two.
    DomainServiceId string
    The ID of the Domain Service for which to create this Replica Set. Changing this forces a new resource to be created.
    ExternalAccessIpAddress string
    The publicly routable IP address for the domain controllers in this Replica Set.
    Location string
    The Azure location where this Replica Set should exist. Changing this forces a new resource to be created.
    ServiceStatus string
    The current service status for the replica set.
    SubnetId string
    The ID of the subnet in which to place this Replica Set.
    domainControllerIpAddresses List<String>
    A list of subnet IP addresses for the domain controllers in this Replica Set, typically two.
    domainServiceId String
    The ID of the Domain Service for which to create this Replica Set. Changing this forces a new resource to be created.
    externalAccessIpAddress String
    The publicly routable IP address for the domain controllers in this Replica Set.
    location String
    The Azure location where this Replica Set should exist. Changing this forces a new resource to be created.
    serviceStatus String
    The current service status for the replica set.
    subnetId String
    The ID of the subnet in which to place this Replica Set.
    domainControllerIpAddresses string[]
    A list of subnet IP addresses for the domain controllers in this Replica Set, typically two.
    domainServiceId string
    The ID of the Domain Service for which to create this Replica Set. Changing this forces a new resource to be created.
    externalAccessIpAddress string
    The publicly routable IP address for the domain controllers in this Replica Set.
    location string
    The Azure location where this Replica Set should exist. Changing this forces a new resource to be created.
    serviceStatus string
    The current service status for the replica set.
    subnetId string
    The ID of the subnet in which to place this Replica Set.
    domain_controller_ip_addresses Sequence[str]
    A list of subnet IP addresses for the domain controllers in this Replica Set, typically two.
    domain_service_id str
    The ID of the Domain Service for which to create this Replica Set. Changing this forces a new resource to be created.
    external_access_ip_address str
    The publicly routable IP address for the domain controllers in this Replica Set.
    location str
    The Azure location where this Replica Set should exist. Changing this forces a new resource to be created.
    service_status str
    The current service status for the replica set.
    subnet_id str
    The ID of the subnet in which to place this Replica Set.
    domainControllerIpAddresses List<String>
    A list of subnet IP addresses for the domain controllers in this Replica Set, typically two.
    domainServiceId String
    The ID of the Domain Service for which to create this Replica Set. Changing this forces a new resource to be created.
    externalAccessIpAddress String
    The publicly routable IP address for the domain controllers in this Replica Set.
    location String
    The Azure location where this Replica Set should exist. Changing this forces a new resource to be created.
    serviceStatus String
    The current service status for the replica set.
    subnetId String
    The ID of the subnet in which to place this Replica Set.

    Import

    Domain Service Replica Sets can be imported using the resource ID of the parent Domain Service and the Replica Set ID, e.g.

     $ pulumi import azure:domainservices/replicaSet:ReplicaSet example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.AAD/domainServices/instance1/replicaSets/00000000-0000-0000-0000-000000000000
    

    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.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.