NetworkWatcherFlowLog

class NetworkWatcherFlowLog : KotlinCustomResource

Example Usage

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()
.location("West Europe")
.build());
var testNetworkSecurityGroup = new NetworkSecurityGroup("testNetworkSecurityGroup", NetworkSecurityGroupArgs.builder()
.location(example.location())
.resourceGroupName(example.name())
.build());
var testNetworkWatcher = new NetworkWatcher("testNetworkWatcher", NetworkWatcherArgs.builder()
.location(example.location())
.resourceGroupName(example.name())
.build());
var testAccount = new Account("testAccount", AccountArgs.builder()
.resourceGroupName(example.name())
.location(example.location())
.accountTier("Standard")
.accountKind("StorageV2")
.accountReplicationType("LRS")
.enableHttpsTrafficOnly(true)
.build());
var testAnalyticsWorkspace = new AnalyticsWorkspace("testAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()
.location(example.location())
.resourceGroupName(example.name())
.sku("PerGB2018")
.build());
var testNetworkWatcherFlowLog = new NetworkWatcherFlowLog("testNetworkWatcherFlowLog", NetworkWatcherFlowLogArgs.builder()
.networkWatcherName(testNetworkWatcher.name())
.resourceGroupName(example.name())
.networkSecurityGroupId(testNetworkSecurityGroup.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());
}
}

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

Properties

Link copied to clipboard
val enabled: Output<Boolean>

Should Network Flow Logging be Enabled?

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val location: Output<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.

Link copied to clipboard
val name: Output<String>

The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.

Link copied to clipboard

The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.

Link copied to clipboard

The name of the Network Watcher. Changing this forces a new resource to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.

Link copied to clipboard

A retention_policy block as documented below.

Link copied to clipboard

The ID of the Storage Account where flow logs are stored.

Link copied to clipboard
val tags: Output<Map<String, String>>?

A mapping of tags which should be assigned to the Network Watcher Flow Log.

Link copied to clipboard

A traffic_analytics block as documented below.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val version: Output<Int>

The version (revision) of the flow log. Possible values are 1 and 2.