get Network Watcher
Use this data source to access information about an existing Network Watcher.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.network.getNetworkWatcher({
name: exampleAzurermNetworkWatcher.name,
resourceGroupName: exampleAzurermResourceGroup.name,
});
export const networkWatcherId = example.then(example => example.id);
Content copied to clipboard
import pulumi
import pulumi_azure as azure
example = azure.network.get_network_watcher(name=example_azurerm_network_watcher["name"],
resource_group_name=example_azurerm_resource_group["name"])
pulumi.export("networkWatcherId", example.id)
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Network.GetNetworkWatcher.Invoke(new()
{
Name = exampleAzurermNetworkWatcher.Name,
ResourceGroupName = exampleAzurermResourceGroup.Name,
});
return new Dictionary<string, object?>
{
["networkWatcherId"] = example.Apply(getNetworkWatcherResult => getNetworkWatcherResult.Id),
};
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := network.LookupNetworkWatcher(ctx, &network.LookupNetworkWatcherArgs{
Name: exampleAzurermNetworkWatcher.Name,
ResourceGroupName: exampleAzurermResourceGroup.Name,
}, nil)
if err != nil {
return err
}
ctx.Export("networkWatcherId", example.Id)
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.network.NetworkFunctions;
import com.pulumi.azure.network.inputs.GetNetworkWatcherArgs;
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) {
final var example = NetworkFunctions.getNetworkWatcher(GetNetworkWatcherArgs.builder()
.name(exampleAzurermNetworkWatcher.name())
.resourceGroupName(exampleAzurermResourceGroup.name())
.build());
ctx.export("networkWatcherId", example.id());
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
function: azure:network:getNetworkWatcher
arguments:
name: ${exampleAzurermNetworkWatcher.name}
resourceGroupName: ${exampleAzurermResourceGroup.name}
outputs:
networkWatcherId: ${example.id}
Content copied to clipboard
API Providers
This data source uses the following Azure API Providers:
Microsoft.Network
: 2024-05-01
Return
A collection of values returned by getNetworkWatcher.
Parameters
argument
A collection of arguments for invoking getNetworkWatcher.
Return
A collection of values returned by getNetworkWatcher.
Parameters
name
Specifies the Name of the Network Watcher.
resource Group Name
Specifies the Name of the Resource Group within which the Network Watcher exists.
See also
suspend fun getNetworkWatcher(argument: suspend GetNetworkWatcherPlainArgsBuilder.() -> Unit): GetNetworkWatcherResult
Return
A collection of values returned by getNetworkWatcher.
Parameters
argument
Builder for com.pulumi.azure.network.kotlin.inputs.GetNetworkWatcherPlainArgs.