1. Packages
  2. Azure Classic
  3. API Docs
  4. network
  5. NetworkWatcherFlowLog

We recommend using Azure Native.

Azure Classic v5.73.0 published on Monday, Apr 22, 2024 by Pulumi

azure.network.NetworkWatcherFlowLog

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.73.0 published on Monday, Apr 22, 2024 by Pulumi

    Manages a Network Watcher Flow Log.

    Note The azure.network.NetworkWatcherFlowLog creates a new storage lifecyle management rule that overwrites existing rules. Please make sure to use a storage_account with no existing management rules, until the issue is fixed.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-resources",
        location: "West Europe",
    });
    const test = new azure.network.NetworkSecurityGroup("test", {
        name: "acctestnsg",
        location: example.location,
        resourceGroupName: example.name,
    });
    const testNetworkWatcher = new azure.network.NetworkWatcher("test", {
        name: "acctestnw",
        location: example.location,
        resourceGroupName: example.name,
    });
    const testAccount = new azure.storage.Account("test", {
        name: "acctestsa",
        resourceGroupName: example.name,
        location: example.location,
        accountTier: "Standard",
        accountKind: "StorageV2",
        accountReplicationType: "LRS",
        enableHttpsTrafficOnly: true,
    });
    const testAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("test", {
        name: "acctestlaw",
        location: example.location,
        resourceGroupName: example.name,
        sku: "PerGB2018",
    });
    const testNetworkWatcherFlowLog = new azure.network.NetworkWatcherFlowLog("test", {
        networkWatcherName: testNetworkWatcher.name,
        resourceGroupName: example.name,
        name: "example-log",
        networkSecurityGroupId: test.id,
        storageAccountId: testAccount.id,
        enabled: true,
        retentionPolicy: {
            enabled: true,
            days: 7,
        },
        trafficAnalytics: {
            enabled: true,
            workspaceId: testAnalyticsWorkspace.workspaceId,
            workspaceRegion: testAnalyticsWorkspace.location,
            workspaceResourceId: testAnalyticsWorkspace.id,
            intervalInMinutes: 10,
        },
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-resources",
        location="West Europe")
    test = azure.network.NetworkSecurityGroup("test",
        name="acctestnsg",
        location=example.location,
        resource_group_name=example.name)
    test_network_watcher = azure.network.NetworkWatcher("test",
        name="acctestnw",
        location=example.location,
        resource_group_name=example.name)
    test_account = azure.storage.Account("test",
        name="acctestsa",
        resource_group_name=example.name,
        location=example.location,
        account_tier="Standard",
        account_kind="StorageV2",
        account_replication_type="LRS",
        enable_https_traffic_only=True)
    test_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("test",
        name="acctestlaw",
        location=example.location,
        resource_group_name=example.name,
        sku="PerGB2018")
    test_network_watcher_flow_log = azure.network.NetworkWatcherFlowLog("test",
        network_watcher_name=test_network_watcher.name,
        resource_group_name=example.name,
        name="example-log",
        network_security_group_id=test.id,
        storage_account_id=test_account.id,
        enabled=True,
        retention_policy=azure.network.NetworkWatcherFlowLogRetentionPolicyArgs(
            enabled=True,
            days=7,
        ),
        traffic_analytics=azure.network.NetworkWatcherFlowLogTrafficAnalyticsArgs(
            enabled=True,
            workspace_id=test_analytics_workspace.workspace_id,
            workspace_region=test_analytics_workspace.location,
            workspace_resource_id=test_analytics_workspace.id,
            interval_in_minutes=10,
        ))
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-resources"),
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		test, err := network.NewNetworkSecurityGroup(ctx, "test", &network.NetworkSecurityGroupArgs{
    			Name:              pulumi.String("acctestnsg"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    		})
    		if err != nil {
    			return err
    		}
    		testNetworkWatcher, err := network.NewNetworkWatcher(ctx, "test", &network.NetworkWatcherArgs{
    			Name:              pulumi.String("acctestnw"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    		})
    		if err != nil {
    			return err
    		}
    		testAccount, err := storage.NewAccount(ctx, "test", &storage.AccountArgs{
    			Name:                   pulumi.String("acctestsa"),
    			ResourceGroupName:      example.Name,
    			Location:               example.Location,
    			AccountTier:            pulumi.String("Standard"),
    			AccountKind:            pulumi.String("StorageV2"),
    			AccountReplicationType: pulumi.String("LRS"),
    			EnableHttpsTrafficOnly: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		testAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "test", &operationalinsights.AnalyticsWorkspaceArgs{
    			Name:              pulumi.String("acctestlaw"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			Sku:               pulumi.String("PerGB2018"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = network.NewNetworkWatcherFlowLog(ctx, "test", &network.NetworkWatcherFlowLogArgs{
    			NetworkWatcherName:     testNetworkWatcher.Name,
    			ResourceGroupName:      example.Name,
    			Name:                   pulumi.String("example-log"),
    			NetworkSecurityGroupId: test.ID(),
    			StorageAccountId:       testAccount.ID(),
    			Enabled:                pulumi.Bool(true),
    			RetentionPolicy: &network.NetworkWatcherFlowLogRetentionPolicyArgs{
    				Enabled: pulumi.Bool(true),
    				Days:    pulumi.Int(7),
    			},
    			TrafficAnalytics: &network.NetworkWatcherFlowLogTrafficAnalyticsArgs{
    				Enabled:             pulumi.Bool(true),
    				WorkspaceId:         testAnalyticsWorkspace.WorkspaceId,
    				WorkspaceRegion:     testAnalyticsWorkspace.Location,
    				WorkspaceResourceId: testAnalyticsWorkspace.ID(),
    				IntervalInMinutes:   pulumi.Int(10),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-resources",
            Location = "West Europe",
        });
    
        var test = new Azure.Network.NetworkSecurityGroup("test", new()
        {
            Name = "acctestnsg",
            Location = example.Location,
            ResourceGroupName = example.Name,
        });
    
        var testNetworkWatcher = new Azure.Network.NetworkWatcher("test", new()
        {
            Name = "acctestnw",
            Location = example.Location,
            ResourceGroupName = example.Name,
        });
    
        var testAccount = new Azure.Storage.Account("test", new()
        {
            Name = "acctestsa",
            ResourceGroupName = example.Name,
            Location = example.Location,
            AccountTier = "Standard",
            AccountKind = "StorageV2",
            AccountReplicationType = "LRS",
            EnableHttpsTrafficOnly = true,
        });
    
        var testAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("test", new()
        {
            Name = "acctestlaw",
            Location = example.Location,
            ResourceGroupName = example.Name,
            Sku = "PerGB2018",
        });
    
        var testNetworkWatcherFlowLog = new Azure.Network.NetworkWatcherFlowLog("test", new()
        {
            NetworkWatcherName = testNetworkWatcher.Name,
            ResourceGroupName = example.Name,
            Name = "example-log",
            NetworkSecurityGroupId = test.Id,
            StorageAccountId = testAccount.Id,
            Enabled = true,
            RetentionPolicy = new Azure.Network.Inputs.NetworkWatcherFlowLogRetentionPolicyArgs
            {
                Enabled = true,
                Days = 7,
            },
            TrafficAnalytics = new Azure.Network.Inputs.NetworkWatcherFlowLogTrafficAnalyticsArgs
            {
                Enabled = true,
                WorkspaceId = testAnalyticsWorkspace.WorkspaceId,
                WorkspaceRegion = testAnalyticsWorkspace.Location,
                WorkspaceResourceId = testAnalyticsWorkspace.Id,
                IntervalInMinutes = 10,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.network.NetworkSecurityGroup;
    import com.pulumi.azure.network.NetworkSecurityGroupArgs;
    import com.pulumi.azure.network.NetworkWatcher;
    import com.pulumi.azure.network.NetworkWatcherArgs;
    import com.pulumi.azure.storage.Account;
    import com.pulumi.azure.storage.AccountArgs;
    import com.pulumi.azure.operationalinsights.AnalyticsWorkspace;
    import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
    import com.pulumi.azure.network.NetworkWatcherFlowLog;
    import com.pulumi.azure.network.NetworkWatcherFlowLogArgs;
    import com.pulumi.azure.network.inputs.NetworkWatcherFlowLogRetentionPolicyArgs;
    import com.pulumi.azure.network.inputs.NetworkWatcherFlowLogTrafficAnalyticsArgs;
    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 example = new ResourceGroup("example", ResourceGroupArgs.builder()        
                .name("example-resources")
                .location("West Europe")
                .build());
    
            var test = new NetworkSecurityGroup("test", NetworkSecurityGroupArgs.builder()        
                .name("acctestnsg")
                .location(example.location())
                .resourceGroupName(example.name())
                .build());
    
            var testNetworkWatcher = new NetworkWatcher("testNetworkWatcher", NetworkWatcherArgs.builder()        
                .name("acctestnw")
                .location(example.location())
                .resourceGroupName(example.name())
                .build());
    
            var testAccount = new Account("testAccount", AccountArgs.builder()        
                .name("acctestsa")
                .resourceGroupName(example.name())
                .location(example.location())
                .accountTier("Standard")
                .accountKind("StorageV2")
                .accountReplicationType("LRS")
                .enableHttpsTrafficOnly(true)
                .build());
    
            var testAnalyticsWorkspace = new AnalyticsWorkspace("testAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()        
                .name("acctestlaw")
                .location(example.location())
                .resourceGroupName(example.name())
                .sku("PerGB2018")
                .build());
    
            var testNetworkWatcherFlowLog = new NetworkWatcherFlowLog("testNetworkWatcherFlowLog", NetworkWatcherFlowLogArgs.builder()        
                .networkWatcherName(testNetworkWatcher.name())
                .resourceGroupName(example.name())
                .name("example-log")
                .networkSecurityGroupId(test.id())
                .storageAccountId(testAccount.id())
                .enabled(true)
                .retentionPolicy(NetworkWatcherFlowLogRetentionPolicyArgs.builder()
                    .enabled(true)
                    .days(7)
                    .build())
                .trafficAnalytics(NetworkWatcherFlowLogTrafficAnalyticsArgs.builder()
                    .enabled(true)
                    .workspaceId(testAnalyticsWorkspace.workspaceId())
                    .workspaceRegion(testAnalyticsWorkspace.location())
                    .workspaceResourceId(testAnalyticsWorkspace.id())
                    .intervalInMinutes(10)
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-resources
          location: West Europe
      test:
        type: azure:network:NetworkSecurityGroup
        properties:
          name: acctestnsg
          location: ${example.location}
          resourceGroupName: ${example.name}
      testNetworkWatcher:
        type: azure:network:NetworkWatcher
        name: test
        properties:
          name: acctestnw
          location: ${example.location}
          resourceGroupName: ${example.name}
      testAccount:
        type: azure:storage:Account
        name: test
        properties:
          name: acctestsa
          resourceGroupName: ${example.name}
          location: ${example.location}
          accountTier: Standard
          accountKind: StorageV2
          accountReplicationType: LRS
          enableHttpsTrafficOnly: true
      testAnalyticsWorkspace:
        type: azure:operationalinsights:AnalyticsWorkspace
        name: test
        properties:
          name: acctestlaw
          location: ${example.location}
          resourceGroupName: ${example.name}
          sku: PerGB2018
      testNetworkWatcherFlowLog:
        type: azure:network:NetworkWatcherFlowLog
        name: test
        properties:
          networkWatcherName: ${testNetworkWatcher.name}
          resourceGroupName: ${example.name}
          name: example-log
          networkSecurityGroupId: ${test.id}
          storageAccountId: ${testAccount.id}
          enabled: true
          retentionPolicy:
            enabled: true
            days: 7
          trafficAnalytics:
            enabled: true
            workspaceId: ${testAnalyticsWorkspace.workspaceId}
            workspaceRegion: ${testAnalyticsWorkspace.location}
            workspaceResourceId: ${testAnalyticsWorkspace.id}
            intervalInMinutes: 10
    

    Create NetworkWatcherFlowLog Resource

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

    Constructor syntax

    new NetworkWatcherFlowLog(name: string, args: NetworkWatcherFlowLogArgs, opts?: CustomResourceOptions);
    @overload
    def NetworkWatcherFlowLog(resource_name: str,
                              args: NetworkWatcherFlowLogArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def NetworkWatcherFlowLog(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              enabled: Optional[bool] = None,
                              network_security_group_id: Optional[str] = None,
                              network_watcher_name: Optional[str] = None,
                              resource_group_name: Optional[str] = None,
                              retention_policy: Optional[NetworkWatcherFlowLogRetentionPolicyArgs] = None,
                              storage_account_id: Optional[str] = None,
                              location: Optional[str] = None,
                              name: Optional[str] = None,
                              tags: Optional[Mapping[str, str]] = None,
                              traffic_analytics: Optional[NetworkWatcherFlowLogTrafficAnalyticsArgs] = None,
                              version: Optional[int] = None)
    func NewNetworkWatcherFlowLog(ctx *Context, name string, args NetworkWatcherFlowLogArgs, opts ...ResourceOption) (*NetworkWatcherFlowLog, error)
    public NetworkWatcherFlowLog(string name, NetworkWatcherFlowLogArgs args, CustomResourceOptions? opts = null)
    public NetworkWatcherFlowLog(String name, NetworkWatcherFlowLogArgs args)
    public NetworkWatcherFlowLog(String name, NetworkWatcherFlowLogArgs args, CustomResourceOptions options)
    
    type: azure:network:NetworkWatcherFlowLog
    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 NetworkWatcherFlowLogArgs
    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 NetworkWatcherFlowLogArgs
    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 NetworkWatcherFlowLogArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NetworkWatcherFlowLogArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NetworkWatcherFlowLogArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var networkWatcherFlowLogResource = new Azure.Network.NetworkWatcherFlowLog("networkWatcherFlowLogResource", new()
    {
        Enabled = false,
        NetworkSecurityGroupId = "string",
        NetworkWatcherName = "string",
        ResourceGroupName = "string",
        RetentionPolicy = new Azure.Network.Inputs.NetworkWatcherFlowLogRetentionPolicyArgs
        {
            Days = 0,
            Enabled = false,
        },
        StorageAccountId = "string",
        Location = "string",
        Name = "string",
        Tags = 
        {
            { "string", "string" },
        },
        TrafficAnalytics = new Azure.Network.Inputs.NetworkWatcherFlowLogTrafficAnalyticsArgs
        {
            Enabled = false,
            WorkspaceId = "string",
            WorkspaceRegion = "string",
            WorkspaceResourceId = "string",
            IntervalInMinutes = 0,
        },
        Version = 0,
    });
    
    example, err := network.NewNetworkWatcherFlowLog(ctx, "networkWatcherFlowLogResource", &network.NetworkWatcherFlowLogArgs{
    	Enabled:                pulumi.Bool(false),
    	NetworkSecurityGroupId: pulumi.String("string"),
    	NetworkWatcherName:     pulumi.String("string"),
    	ResourceGroupName:      pulumi.String("string"),
    	RetentionPolicy: &network.NetworkWatcherFlowLogRetentionPolicyArgs{
    		Days:    pulumi.Int(0),
    		Enabled: pulumi.Bool(false),
    	},
    	StorageAccountId: pulumi.String("string"),
    	Location:         pulumi.String("string"),
    	Name:             pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	TrafficAnalytics: &network.NetworkWatcherFlowLogTrafficAnalyticsArgs{
    		Enabled:             pulumi.Bool(false),
    		WorkspaceId:         pulumi.String("string"),
    		WorkspaceRegion:     pulumi.String("string"),
    		WorkspaceResourceId: pulumi.String("string"),
    		IntervalInMinutes:   pulumi.Int(0),
    	},
    	Version: pulumi.Int(0),
    })
    
    var networkWatcherFlowLogResource = new NetworkWatcherFlowLog("networkWatcherFlowLogResource", NetworkWatcherFlowLogArgs.builder()        
        .enabled(false)
        .networkSecurityGroupId("string")
        .networkWatcherName("string")
        .resourceGroupName("string")
        .retentionPolicy(NetworkWatcherFlowLogRetentionPolicyArgs.builder()
            .days(0)
            .enabled(false)
            .build())
        .storageAccountId("string")
        .location("string")
        .name("string")
        .tags(Map.of("string", "string"))
        .trafficAnalytics(NetworkWatcherFlowLogTrafficAnalyticsArgs.builder()
            .enabled(false)
            .workspaceId("string")
            .workspaceRegion("string")
            .workspaceResourceId("string")
            .intervalInMinutes(0)
            .build())
        .version(0)
        .build());
    
    network_watcher_flow_log_resource = azure.network.NetworkWatcherFlowLog("networkWatcherFlowLogResource",
        enabled=False,
        network_security_group_id="string",
        network_watcher_name="string",
        resource_group_name="string",
        retention_policy=azure.network.NetworkWatcherFlowLogRetentionPolicyArgs(
            days=0,
            enabled=False,
        ),
        storage_account_id="string",
        location="string",
        name="string",
        tags={
            "string": "string",
        },
        traffic_analytics=azure.network.NetworkWatcherFlowLogTrafficAnalyticsArgs(
            enabled=False,
            workspace_id="string",
            workspace_region="string",
            workspace_resource_id="string",
            interval_in_minutes=0,
        ),
        version=0)
    
    const networkWatcherFlowLogResource = new azure.network.NetworkWatcherFlowLog("networkWatcherFlowLogResource", {
        enabled: false,
        networkSecurityGroupId: "string",
        networkWatcherName: "string",
        resourceGroupName: "string",
        retentionPolicy: {
            days: 0,
            enabled: false,
        },
        storageAccountId: "string",
        location: "string",
        name: "string",
        tags: {
            string: "string",
        },
        trafficAnalytics: {
            enabled: false,
            workspaceId: "string",
            workspaceRegion: "string",
            workspaceResourceId: "string",
            intervalInMinutes: 0,
        },
        version: 0,
    });
    
    type: azure:network:NetworkWatcherFlowLog
    properties:
        enabled: false
        location: string
        name: string
        networkSecurityGroupId: string
        networkWatcherName: string
        resourceGroupName: string
        retentionPolicy:
            days: 0
            enabled: false
        storageAccountId: string
        tags:
            string: string
        trafficAnalytics:
            enabled: false
            intervalInMinutes: 0
            workspaceId: string
            workspaceRegion: string
            workspaceResourceId: string
        version: 0
    

    NetworkWatcherFlowLog 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 NetworkWatcherFlowLog resource accepts the following input properties:

    Enabled bool
    Should Network Flow Logging be Enabled?
    NetworkSecurityGroupId string
    The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
    NetworkWatcherName string
    The name of the Network Watcher. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
    RetentionPolicy NetworkWatcherFlowLogRetentionPolicy
    A retention_policy block as documented below.
    StorageAccountId string
    The ID of the Storage Account where flow logs are stored.
    Location string
    The location where the Network Watcher Flow Log resides. Changing this forces a new resource to be created. Defaults to the location of the Network Watcher.
    Name string
    The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
    Tags Dictionary<string, string>
    A mapping of tags which should be assigned to the Network Watcher Flow Log.
    TrafficAnalytics NetworkWatcherFlowLogTrafficAnalytics
    A traffic_analytics block as documented below.
    Version int
    The version (revision) of the flow log. Possible values are 1 and 2.
    Enabled bool
    Should Network Flow Logging be Enabled?
    NetworkSecurityGroupId string
    The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
    NetworkWatcherName string
    The name of the Network Watcher. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
    RetentionPolicy NetworkWatcherFlowLogRetentionPolicyArgs
    A retention_policy block as documented below.
    StorageAccountId string
    The ID of the Storage Account where flow logs are stored.
    Location string
    The location where the Network Watcher Flow Log resides. Changing this forces a new resource to be created. Defaults to the location of the Network Watcher.
    Name string
    The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
    Tags map[string]string
    A mapping of tags which should be assigned to the Network Watcher Flow Log.
    TrafficAnalytics NetworkWatcherFlowLogTrafficAnalyticsArgs
    A traffic_analytics block as documented below.
    Version int
    The version (revision) of the flow log. Possible values are 1 and 2.
    enabled Boolean
    Should Network Flow Logging be Enabled?
    networkSecurityGroupId String
    The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
    networkWatcherName String
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
    retentionPolicy NetworkWatcherFlowLogRetentionPolicy
    A retention_policy block as documented below.
    storageAccountId String
    The ID of the Storage Account where flow logs are stored.
    location String
    The location where the Network Watcher Flow Log resides. Changing this forces a new resource to be created. Defaults to the location of the Network Watcher.
    name String
    The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
    tags Map<String,String>
    A mapping of tags which should be assigned to the Network Watcher Flow Log.
    trafficAnalytics NetworkWatcherFlowLogTrafficAnalytics
    A traffic_analytics block as documented below.
    version Integer
    The version (revision) of the flow log. Possible values are 1 and 2.
    enabled boolean
    Should Network Flow Logging be Enabled?
    networkSecurityGroupId string
    The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
    networkWatcherName string
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resourceGroupName string
    The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
    retentionPolicy NetworkWatcherFlowLogRetentionPolicy
    A retention_policy block as documented below.
    storageAccountId string
    The ID of the Storage Account where flow logs are stored.
    location string
    The location where the Network Watcher Flow Log resides. Changing this forces a new resource to be created. Defaults to the location of the Network Watcher.
    name string
    The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
    tags {[key: string]: string}
    A mapping of tags which should be assigned to the Network Watcher Flow Log.
    trafficAnalytics NetworkWatcherFlowLogTrafficAnalytics
    A traffic_analytics block as documented below.
    version number
    The version (revision) of the flow log. Possible values are 1 and 2.
    enabled bool
    Should Network Flow Logging be Enabled?
    network_security_group_id str
    The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
    network_watcher_name str
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resource_group_name str
    The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
    retention_policy NetworkWatcherFlowLogRetentionPolicyArgs
    A retention_policy block as documented below.
    storage_account_id str
    The ID of the Storage Account where flow logs are stored.
    location str
    The location where the Network Watcher Flow Log resides. Changing this forces a new resource to be created. Defaults to the location of the Network Watcher.
    name str
    The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
    tags Mapping[str, str]
    A mapping of tags which should be assigned to the Network Watcher Flow Log.
    traffic_analytics NetworkWatcherFlowLogTrafficAnalyticsArgs
    A traffic_analytics block as documented below.
    version int
    The version (revision) of the flow log. Possible values are 1 and 2.
    enabled Boolean
    Should Network Flow Logging be Enabled?
    networkSecurityGroupId String
    The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
    networkWatcherName String
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
    retentionPolicy Property Map
    A retention_policy block as documented below.
    storageAccountId String
    The ID of the Storage Account where flow logs are stored.
    location String
    The location where the Network Watcher Flow Log resides. Changing this forces a new resource to be created. Defaults to the location of the Network Watcher.
    name String
    The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
    tags Map<String>
    A mapping of tags which should be assigned to the Network Watcher Flow Log.
    trafficAnalytics Property Map
    A traffic_analytics block as documented below.
    version Number
    The version (revision) of the flow log. Possible values are 1 and 2.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing NetworkWatcherFlowLog Resource

    Get an existing NetworkWatcherFlowLog 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?: NetworkWatcherFlowLogState, opts?: CustomResourceOptions): NetworkWatcherFlowLog
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            enabled: Optional[bool] = None,
            location: Optional[str] = None,
            name: Optional[str] = None,
            network_security_group_id: Optional[str] = None,
            network_watcher_name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            retention_policy: Optional[NetworkWatcherFlowLogRetentionPolicyArgs] = None,
            storage_account_id: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            traffic_analytics: Optional[NetworkWatcherFlowLogTrafficAnalyticsArgs] = None,
            version: Optional[int] = None) -> NetworkWatcherFlowLog
    func GetNetworkWatcherFlowLog(ctx *Context, name string, id IDInput, state *NetworkWatcherFlowLogState, opts ...ResourceOption) (*NetworkWatcherFlowLog, error)
    public static NetworkWatcherFlowLog Get(string name, Input<string> id, NetworkWatcherFlowLogState? state, CustomResourceOptions? opts = null)
    public static NetworkWatcherFlowLog get(String name, Output<String> id, NetworkWatcherFlowLogState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    Enabled bool
    Should Network Flow Logging be Enabled?
    Location string
    The location where the Network Watcher Flow Log resides. Changing this forces a new resource to be created. Defaults to the location of the Network Watcher.
    Name string
    The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
    NetworkSecurityGroupId string
    The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
    NetworkWatcherName string
    The name of the Network Watcher. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
    RetentionPolicy NetworkWatcherFlowLogRetentionPolicy
    A retention_policy block as documented below.
    StorageAccountId string
    The ID of the Storage Account where flow logs are stored.
    Tags Dictionary<string, string>
    A mapping of tags which should be assigned to the Network Watcher Flow Log.
    TrafficAnalytics NetworkWatcherFlowLogTrafficAnalytics
    A traffic_analytics block as documented below.
    Version int
    The version (revision) of the flow log. Possible values are 1 and 2.
    Enabled bool
    Should Network Flow Logging be Enabled?
    Location string
    The location where the Network Watcher Flow Log resides. Changing this forces a new resource to be created. Defaults to the location of the Network Watcher.
    Name string
    The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
    NetworkSecurityGroupId string
    The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
    NetworkWatcherName string
    The name of the Network Watcher. Changing this forces a new resource to be created.
    ResourceGroupName string
    The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
    RetentionPolicy NetworkWatcherFlowLogRetentionPolicyArgs
    A retention_policy block as documented below.
    StorageAccountId string
    The ID of the Storage Account where flow logs are stored.
    Tags map[string]string
    A mapping of tags which should be assigned to the Network Watcher Flow Log.
    TrafficAnalytics NetworkWatcherFlowLogTrafficAnalyticsArgs
    A traffic_analytics block as documented below.
    Version int
    The version (revision) of the flow log. Possible values are 1 and 2.
    enabled Boolean
    Should Network Flow Logging be Enabled?
    location String
    The location where the Network Watcher Flow Log resides. Changing this forces a new resource to be created. Defaults to the location of the Network Watcher.
    name String
    The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
    networkSecurityGroupId String
    The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
    networkWatcherName String
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
    retentionPolicy NetworkWatcherFlowLogRetentionPolicy
    A retention_policy block as documented below.
    storageAccountId String
    The ID of the Storage Account where flow logs are stored.
    tags Map<String,String>
    A mapping of tags which should be assigned to the Network Watcher Flow Log.
    trafficAnalytics NetworkWatcherFlowLogTrafficAnalytics
    A traffic_analytics block as documented below.
    version Integer
    The version (revision) of the flow log. Possible values are 1 and 2.
    enabled boolean
    Should Network Flow Logging be Enabled?
    location string
    The location where the Network Watcher Flow Log resides. Changing this forces a new resource to be created. Defaults to the location of the Network Watcher.
    name string
    The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
    networkSecurityGroupId string
    The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
    networkWatcherName string
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resourceGroupName string
    The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
    retentionPolicy NetworkWatcherFlowLogRetentionPolicy
    A retention_policy block as documented below.
    storageAccountId string
    The ID of the Storage Account where flow logs are stored.
    tags {[key: string]: string}
    A mapping of tags which should be assigned to the Network Watcher Flow Log.
    trafficAnalytics NetworkWatcherFlowLogTrafficAnalytics
    A traffic_analytics block as documented below.
    version number
    The version (revision) of the flow log. Possible values are 1 and 2.
    enabled bool
    Should Network Flow Logging be Enabled?
    location str
    The location where the Network Watcher Flow Log resides. Changing this forces a new resource to be created. Defaults to the location of the Network Watcher.
    name str
    The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
    network_security_group_id str
    The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
    network_watcher_name str
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resource_group_name str
    The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
    retention_policy NetworkWatcherFlowLogRetentionPolicyArgs
    A retention_policy block as documented below.
    storage_account_id str
    The ID of the Storage Account where flow logs are stored.
    tags Mapping[str, str]
    A mapping of tags which should be assigned to the Network Watcher Flow Log.
    traffic_analytics NetworkWatcherFlowLogTrafficAnalyticsArgs
    A traffic_analytics block as documented below.
    version int
    The version (revision) of the flow log. Possible values are 1 and 2.
    enabled Boolean
    Should Network Flow Logging be Enabled?
    location String
    The location where the Network Watcher Flow Log resides. Changing this forces a new resource to be created. Defaults to the location of the Network Watcher.
    name String
    The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
    networkSecurityGroupId String
    The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
    networkWatcherName String
    The name of the Network Watcher. Changing this forces a new resource to be created.
    resourceGroupName String
    The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
    retentionPolicy Property Map
    A retention_policy block as documented below.
    storageAccountId String
    The ID of the Storage Account where flow logs are stored.
    tags Map<String>
    A mapping of tags which should be assigned to the Network Watcher Flow Log.
    trafficAnalytics Property Map
    A traffic_analytics block as documented below.
    version Number
    The version (revision) of the flow log. Possible values are 1 and 2.

    Supporting Types

    NetworkWatcherFlowLogRetentionPolicy, NetworkWatcherFlowLogRetentionPolicyArgs

    Days int
    The number of days to retain flow log records.
    Enabled bool
    Boolean flag to enable/disable retention.
    Days int
    The number of days to retain flow log records.
    Enabled bool
    Boolean flag to enable/disable retention.
    days Integer
    The number of days to retain flow log records.
    enabled Boolean
    Boolean flag to enable/disable retention.
    days number
    The number of days to retain flow log records.
    enabled boolean
    Boolean flag to enable/disable retention.
    days int
    The number of days to retain flow log records.
    enabled bool
    Boolean flag to enable/disable retention.
    days Number
    The number of days to retain flow log records.
    enabled Boolean
    Boolean flag to enable/disable retention.

    NetworkWatcherFlowLogTrafficAnalytics, NetworkWatcherFlowLogTrafficAnalyticsArgs

    Enabled bool
    Boolean flag to enable/disable traffic analytics.
    WorkspaceId string
    The resource GUID of the attached workspace.
    WorkspaceRegion string
    The location of the attached workspace.
    WorkspaceResourceId string
    The resource ID of the attached workspace.
    IntervalInMinutes int
    How frequently service should do flow analytics in minutes. Defaults to 60.
    Enabled bool
    Boolean flag to enable/disable traffic analytics.
    WorkspaceId string
    The resource GUID of the attached workspace.
    WorkspaceRegion string
    The location of the attached workspace.
    WorkspaceResourceId string
    The resource ID of the attached workspace.
    IntervalInMinutes int
    How frequently service should do flow analytics in minutes. Defaults to 60.
    enabled Boolean
    Boolean flag to enable/disable traffic analytics.
    workspaceId String
    The resource GUID of the attached workspace.
    workspaceRegion String
    The location of the attached workspace.
    workspaceResourceId String
    The resource ID of the attached workspace.
    intervalInMinutes Integer
    How frequently service should do flow analytics in minutes. Defaults to 60.
    enabled boolean
    Boolean flag to enable/disable traffic analytics.
    workspaceId string
    The resource GUID of the attached workspace.
    workspaceRegion string
    The location of the attached workspace.
    workspaceResourceId string
    The resource ID of the attached workspace.
    intervalInMinutes number
    How frequently service should do flow analytics in minutes. Defaults to 60.
    enabled bool
    Boolean flag to enable/disable traffic analytics.
    workspace_id str
    The resource GUID of the attached workspace.
    workspace_region str
    The location of the attached workspace.
    workspace_resource_id str
    The resource ID of the attached workspace.
    interval_in_minutes int
    How frequently service should do flow analytics in minutes. Defaults to 60.
    enabled Boolean
    Boolean flag to enable/disable traffic analytics.
    workspaceId String
    The resource GUID of the attached workspace.
    workspaceRegion String
    The location of the attached workspace.
    workspaceResourceId String
    The resource ID of the attached workspace.
    intervalInMinutes Number
    How frequently service should do flow analytics in minutes. Defaults to 60.

    Import

    Network Watcher Flow Logs can be imported using the resource id, e.g.

    $ pulumi import azure:network/networkWatcherFlowLog:NetworkWatcherFlowLog watcher1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/networkWatchers/watcher1/flowLogs/log1
    

    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.

    Azure Classic v5.73.0 published on Monday, Apr 22, 2024 by Pulumi