"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ReplicaSet = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Replica Set for an Active Directory Domain Service.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as azuread from "@pulumi/azuread";
 *
 * const primary = new azure.core.ResourceGroup("primary", {
 *     name: "aadds-primary-rg",
 *     location: "West Europe",
 * });
 * const primaryVirtualNetwork = new azure.network.VirtualNetwork("primary", {
 *     name: "aadds-primary-vnet",
 *     location: primary.location,
 *     resourceGroupName: primary.name,
 *     addressSpaces: ["10.0.1.0/16"],
 * });
 * const primarySubnet = new azure.network.Subnet("primary", {
 *     name: "aadds-primary-subnet",
 *     resourceGroupName: primary.name,
 *     virtualNetworkName: primaryVirtualNetwork.name,
 *     addressPrefixes: ["10.0.1.0/24"],
 * });
 * const primaryNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("primary", {
 *     name: "aadds-primary-nsg",
 *     location: primary.location,
 *     resourceGroupName: primary.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("primary", {
 *     subnetId: primarySubnet.id,
 *     networkSecurityGroupId: primaryNetworkSecurityGroup.id,
 * });
 * const dcAdmins = new azuread.Group("dc_admins", {
 *     displayName: "aad-dc-administrators",
 *     securityEnabled: true,
 * });
 * const admin = new azuread.User("admin", {
 *     userPrincipalName: "dc-admin@hashicorp-example.net",
 *     displayName: "DC Administrator",
 *     password: "Pa55w0Rd!!1",
 * });
 * const adminGroupMember = new azuread.GroupMember("admin", {
 *     groupObjectId: dcAdmins.objectId,
 *     memberObjectId: admin.objectId,
 * });
 * const example = new azuread.ServicePrincipal("example", {applicationId: "2565bd9d-da50-47d4-8b85-4c97f669dc36"});
 * const aadds = new azure.core.ResourceGroup("aadds", {
 *     name: "aadds-rg",
 *     location: "westeurope",
 * });
 * const exampleService = new azure.domainservices.Service("example", {
 *     name: "example-aadds",
 *     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: [
 *         example,
 *         primarySubnetNetworkSecurityGroupAssociation,
 *     ],
 * });
 * const replica = new azure.core.ResourceGroup("replica", {
 *     name: "aadds-replica-rg",
 *     location: "North Europe",
 * });
 * const replicaVirtualNetwork = new azure.network.VirtualNetwork("replica", {
 *     name: "aadds-replica-vnet",
 *     location: replica.location,
 *     resourceGroupName: replica.name,
 *     addressSpaces: ["10.20.0.0/16"],
 * });
 * const aaddsReplica = new azure.network.Subnet("aadds_replica", {
 *     name: "aadds-replica-subnet",
 *     resourceGroupName: replica.name,
 *     virtualNetworkName: replicaVirtualNetwork.name,
 *     addressPrefixes: ["10.20.0.0/24"],
 * });
 * const aaddsReplicaNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("aadds_replica", {
 *     name: "aadds-replica-nsg",
 *     location: replica.location,
 *     resourceGroupName: replica.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("replica", {
 *     subnetId: aaddsReplica.id,
 *     networkSecurityGroupId: aaddsReplicaNetworkSecurityGroup.id,
 * });
 * const primaryReplica = new azure.network.VirtualNetworkPeering("primary_replica", {
 *     name: "aadds-primary-replica",
 *     resourceGroupName: primaryVirtualNetwork.resourceGroupName,
 *     virtualNetworkName: primaryVirtualNetwork.name,
 *     remoteVirtualNetworkId: replicaVirtualNetwork.id,
 *     allowForwardedTraffic: true,
 *     allowGatewayTransit: false,
 *     allowVirtualNetworkAccess: true,
 *     useRemoteGateways: false,
 * });
 * const replicaPrimary = new azure.network.VirtualNetworkPeering("replica_primary", {
 *     name: "aadds-replica-primary",
 *     resourceGroupName: replicaVirtualNetwork.resourceGroupName,
 *     virtualNetworkName: replicaVirtualNetwork.name,
 *     remoteVirtualNetworkId: primaryVirtualNetwork.id,
 *     allowForwardedTraffic: true,
 *     allowGatewayTransit: false,
 *     allowVirtualNetworkAccess: true,
 *     useRemoteGateways: false,
 * });
 * const replicaVirtualNetworkDnsServers = new azure.network.VirtualNetworkDnsServers("replica", {
 *     virtualNetworkId: replicaVirtualNetwork.id,
 *     dnsServers: exampleService.initialReplicaSet.apply(initialReplicaSet => initialReplicaSet.domainControllerIpAddresses),
 * });
 * const replicaReplicaSet = new azure.domainservices.ReplicaSet("replica", {
 *     domainServiceId: exampleService.id,
 *     location: replica.location,
 *     subnetId: aaddsReplica.id,
 * }, {
 *     dependsOn: [
 *         replicaSubnetNetworkSecurityGroupAssociation,
 *         primaryReplica,
 *         replicaPrimary,
 *     ],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.AAD` - 2021-05-01
 *
 * ## Import
 *
 * Domain Service Replica Sets can be imported using the resource ID of the parent Domain Service and the Replica Set ID, e.g.
 *
 * ```sh
 * $ 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
 * ```
 */
class ReplicaSet extends pulumi.CustomResource {
    /**
     * Get an existing ReplicaSet resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new ReplicaSet(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:domainservices/replicaSet:ReplicaSet';
    /**
     * Returns true if the given object is an instance of ReplicaSet.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === ReplicaSet.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["domainControllerIpAddresses"] = state?.domainControllerIpAddresses;
            resourceInputs["domainServiceId"] = state?.domainServiceId;
            resourceInputs["externalAccessIpAddress"] = state?.externalAccessIpAddress;
            resourceInputs["location"] = state?.location;
            resourceInputs["serviceStatus"] = state?.serviceStatus;
            resourceInputs["subnetId"] = state?.subnetId;
        }
        else {
            const args = argsOrState;
            if (args?.domainServiceId === undefined && !opts.urn) {
                throw new Error("Missing required property 'domainServiceId'");
            }
            if (args?.subnetId === undefined && !opts.urn) {
                throw new Error("Missing required property 'subnetId'");
            }
            resourceInputs["domainServiceId"] = args?.domainServiceId;
            resourceInputs["location"] = args?.location;
            resourceInputs["subnetId"] = args?.subnetId;
            resourceInputs["domainControllerIpAddresses"] = undefined /*out*/;
            resourceInputs["externalAccessIpAddress"] = undefined /*out*/;
            resourceInputs["serviceStatus"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(ReplicaSet.__pulumiType, name, resourceInputs, opts);
    }
}
exports.ReplicaSet = ReplicaSet;
//# sourceMappingURL=replicaSet.js.map