"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.NetworkConnectionMonitor = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
 * Manages a Network Connection Monitor.
 *
 * > **NOTE:** Any Network Connection Monitor resource created with API versions 2019-06-01 or earlier (v1) are now incompatible with this provider, which now only supports v2.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 *
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-Watcher-resources",
 *     location: "West Europe",
 * });
 * const exampleNetworkWatcher = new azure.network.NetworkWatcher("example", {
 *     name: "example-Watcher",
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", {
 *     name: "example-Vnet",
 *     addressSpaces: ["10.0.0.0/16"],
 *     location: example.location,
 *     resourceGroupName: example.name,
 * });
 * const exampleSubnet = new azure.network.Subnet("example", {
 *     name: "example-Subnet",
 *     resourceGroupName: example.name,
 *     virtualNetworkName: exampleVirtualNetwork.name,
 *     addressPrefixes: ["10.0.2.0/24"],
 * });
 * const exampleNetworkInterface = new azure.network.NetworkInterface("example", {
 *     name: "example-Nic",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     ipConfigurations: [{
 *         name: "testconfiguration1",
 *         subnetId: exampleSubnet.id,
 *         privateIpAddressAllocation: "Dynamic",
 *     }],
 * });
 * const exampleVirtualMachine = new azure.compute.VirtualMachine("example", {
 *     name: "example-VM",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     networkInterfaceIds: [exampleNetworkInterface.id],
 *     vmSize: "Standard_D2s_v3",
 *     storageImageReference: {
 *         publisher: "Canonical",
 *         offer: "0001-com-ubuntu-server-jammy",
 *         sku: "22_04-lts",
 *         version: "latest",
 *     },
 *     storageOsDisk: {
 *         name: "osdisk-example01",
 *         caching: "ReadWrite",
 *         createOption: "FromImage",
 *         managedDiskType: "Standard_LRS",
 *     },
 *     osProfile: {
 *         computerName: "hostnametest01",
 *         adminUsername: "testadmin",
 *         adminPassword: "Password1234!",
 *     },
 *     osProfileLinuxConfig: {
 *         disablePasswordAuthentication: false,
 *     },
 * });
 * const exampleExtension = new azure.compute.Extension("example", {
 *     name: "example-VMExtension",
 *     virtualMachineId: exampleVirtualMachine.id,
 *     publisher: "Microsoft.Azure.NetworkWatcher",
 *     type: "NetworkWatcherAgentLinux",
 *     typeHandlerVersion: "1.4",
 *     autoUpgradeMinorVersion: true,
 * });
 * const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("example", {
 *     name: "example-Workspace",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: "PerGB2018",
 * });
 * const exampleNetworkConnectionMonitor = new azure.network.NetworkConnectionMonitor("example", {
 *     name: "example-Monitor",
 *     networkWatcherId: exampleNetworkWatcher.id,
 *     location: exampleNetworkWatcher.location,
 *     endpoints: [
 *         {
 *             name: "source",
 *             targetResourceId: exampleVirtualMachine.id,
 *             filter: {
 *                 items: [{
 *                     address: exampleVirtualMachine.id,
 *                     type: "AgentAddress",
 *                 }],
 *                 type: "Include",
 *             },
 *         },
 *         {
 *             name: "destination",
 *             address: "mycompany.io",
 *         },
 *     ],
 *     testConfigurations: [{
 *         name: "tcpName",
 *         protocol: "Tcp",
 *         testFrequencyInSeconds: 60,
 *         tcpConfiguration: {
 *             port: 80,
 *         },
 *     }],
 *     testGroups: [{
 *         name: "exampletg",
 *         destinationEndpoints: ["destination"],
 *         sourceEndpoints: ["source"],
 *         testConfigurationNames: ["tcpName"],
 *     }],
 *     notes: "examplenote",
 *     outputWorkspaceResourceIds: [exampleAnalyticsWorkspace.id],
 * }, {
 *     dependsOn: [exampleExtension],
 * });
 * ```
 *
 * ## API Providers
 *
 * <!-- This section is generated, changes will be overwritten -->
 * This resource uses the following Azure API Providers:
 *
 * * `Microsoft.Network` - 2025-01-01
 *
 * ## Import
 *
 * Network Connection Monitors can be imported using the `resource id`, e.g.
 *
 * ```sh
 * $ pulumi import azure:network/networkConnectionMonitor:NetworkConnectionMonitor example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/networkWatchers/watcher1/connectionMonitors/connectionMonitor1
 * ```
 */
class NetworkConnectionMonitor extends pulumi.CustomResource {
    /**
     * Get an existing NetworkConnectionMonitor 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 NetworkConnectionMonitor(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'azure:network/networkConnectionMonitor:NetworkConnectionMonitor';
    /**
     * Returns true if the given object is an instance of NetworkConnectionMonitor.  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'] === NetworkConnectionMonitor.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["endpoints"] = state?.endpoints;
            resourceInputs["location"] = state?.location;
            resourceInputs["name"] = state?.name;
            resourceInputs["networkWatcherId"] = state?.networkWatcherId;
            resourceInputs["notes"] = state?.notes;
            resourceInputs["outputWorkspaceResourceIds"] = state?.outputWorkspaceResourceIds;
            resourceInputs["tags"] = state?.tags;
            resourceInputs["testConfigurations"] = state?.testConfigurations;
            resourceInputs["testGroups"] = state?.testGroups;
        }
        else {
            const args = argsOrState;
            if (args?.endpoints === undefined && !opts.urn) {
                throw new Error("Missing required property 'endpoints'");
            }
            if (args?.networkWatcherId === undefined && !opts.urn) {
                throw new Error("Missing required property 'networkWatcherId'");
            }
            if (args?.testConfigurations === undefined && !opts.urn) {
                throw new Error("Missing required property 'testConfigurations'");
            }
            if (args?.testGroups === undefined && !opts.urn) {
                throw new Error("Missing required property 'testGroups'");
            }
            resourceInputs["endpoints"] = args?.endpoints;
            resourceInputs["location"] = args?.location;
            resourceInputs["name"] = args?.name;
            resourceInputs["networkWatcherId"] = args?.networkWatcherId;
            resourceInputs["notes"] = args?.notes;
            resourceInputs["outputWorkspaceResourceIds"] = args?.outputWorkspaceResourceIds;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["testConfigurations"] = args?.testConfigurations;
            resourceInputs["testGroups"] = args?.testGroups;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(NetworkConnectionMonitor.__pulumiType, name, resourceInputs, opts);
    }
}
exports.NetworkConnectionMonitor = NetworkConnectionMonitor;
//# sourceMappingURL=networkConnectionMonitor.js.map