Flow Log
A flow log resource. Uses Azure REST API version 2023-02-01. In version 1.x of the Azure Native provider, it used API version 2020-11-01. Other available API versions: 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01, 2024-03-01, 2024-05-01.
Example Usage
Create or update flow log
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var flowLog = new AzureNative.Network.FlowLog("flowLog", new()
{
Enabled = true,
FlowLogName = "fl",
Format = new AzureNative.Network.Inputs.FlowLogFormatParametersArgs
{
Type = AzureNative.Network.FlowLogFormatType.JSON,
Version = 1,
},
Location = "centraluseuap",
NetworkWatcherName = "nw1",
ResourceGroupName = "rg1",
StorageId = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe",
TargetResourceId = "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg",
});
});
Content copied to clipboard
package main
import (
network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := network.NewFlowLog(ctx, "flowLog", &network.FlowLogArgs{
Enabled: pulumi.Bool(true),
FlowLogName: pulumi.String("fl"),
Format: &network.FlowLogFormatParametersArgs{
Type: pulumi.String(network.FlowLogFormatTypeJSON),
Version: pulumi.Int(1),
},
Location: pulumi.String("centraluseuap"),
NetworkWatcherName: pulumi.String("nw1"),
ResourceGroupName: pulumi.String("rg1"),
StorageId: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe"),
TargetResourceId: pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg"),
})
if err != nil {
return err
}
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.azurenative.network.FlowLog;
import com.pulumi.azurenative.network.FlowLogArgs;
import com.pulumi.azurenative.network.inputs.FlowLogFormatParametersArgs;
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 flowLog = new FlowLog("flowLog", FlowLogArgs.builder()
.enabled(true)
.flowLogName("fl")
.format(FlowLogFormatParametersArgs.builder()
.type("JSON")
.version(1)
.build())
.location("centraluseuap")
.networkWatcherName("nw1")
.resourceGroupName("rg1")
.storageId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/nwtest1mgvbfmqsigdxe")
.targetResourceId("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/desmondcentral-nsg")
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:network:FlowLog Microsoft.Networkdesmond-rgdesmondcentral-nsg /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/flowLogs/{flowLogName}
Content copied to clipboard
Properties
Link copied to clipboard
Parameters that define the configuration of traffic analytics.
Link copied to clipboard
Parameters that define the flow log format.
Link copied to clipboard
The provisioning state of the flow log.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Parameters that define the retention policy for flow log.
Link copied to clipboard
Guid of network security group to which flow log will be applied.
Link copied to clipboard
ID of network security group to which flow log will be applied.