// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.network;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.network.NetworkWatcherFlowLogArgs;
import com.pulumi.azure.network.inputs.NetworkWatcherFlowLogState;
import com.pulumi.azure.network.outputs.NetworkWatcherFlowLogRetentionPolicy;
import com.pulumi.azure.network.outputs.NetworkWatcherFlowLogTrafficAnalytics;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Boolean;
import java.lang.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * ## Example Usage
 * ```java
 * 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(&#34;example&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var testNetworkSecurityGroup = new NetworkSecurityGroup(&#34;testNetworkSecurityGroup&#34;, NetworkSecurityGroupArgs.builder()        
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 * 
 *         var testNetworkWatcher = new NetworkWatcher(&#34;testNetworkWatcher&#34;, NetworkWatcherArgs.builder()        
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .build());
 * 
 *         var testAccount = new Account(&#34;testAccount&#34;, AccountArgs.builder()        
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .accountTier(&#34;Standard&#34;)
 *             .accountKind(&#34;StorageV2&#34;)
 *             .accountReplicationType(&#34;LRS&#34;)
 *             .enableHttpsTrafficOnly(true)
 *             .build());
 * 
 *         var testAnalyticsWorkspace = new AnalyticsWorkspace(&#34;testAnalyticsWorkspace&#34;, AnalyticsWorkspaceArgs.builder()        
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .sku(&#34;PerGB2018&#34;)
 *             .build());
 * 
 *         var testNetworkWatcherFlowLog = new NetworkWatcherFlowLog(&#34;testNetworkWatcherFlowLog&#34;, 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.
 * 
 * ```sh
 *  $ pulumi import azure:network/networkWatcherFlowLog:NetworkWatcherFlowLog watcher1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/networkWatchers/watcher1/flowLogs/log1
 * ```
 * 
 */
@ResourceType(type="azure:network/networkWatcherFlowLog:NetworkWatcherFlowLog")
public class NetworkWatcherFlowLog extends com.pulumi.resources.CustomResource {
    /**
     * Should Network Flow Logging be Enabled?
     * 
     */
    @Export(name="enabled", refs={Boolean.class}, tree="[0]")
    private Output<Boolean> enabled;

    /**
     * @return Should Network Flow Logging be Enabled?
     * 
     */
    public Output<Boolean> enabled() {
        return this.enabled;
    }
    /**
     * 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.
     * 
     */
    @Export(name="location", refs={String.class}, tree="[0]")
    private Output<String> location;

    /**
     * @return 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.
     * 
     */
    public Output<String> location() {
        return this.location;
    }
    /**
     * The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="name", refs={String.class}, tree="[0]")
    private Output<String> name;

    /**
     * @return The name of the Network Watcher Flow Log. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="networkSecurityGroupId", refs={String.class}, tree="[0]")
    private Output<String> networkSecurityGroupId;

    /**
     * @return The ID of the Network Security Group for which to enable flow logs for. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> networkSecurityGroupId() {
        return this.networkSecurityGroupId;
    }
    /**
     * The name of the Network Watcher. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="networkWatcherName", refs={String.class}, tree="[0]")
    private Output<String> networkWatcherName;

    /**
     * @return The name of the Network Watcher. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> networkWatcherName() {
        return this.networkWatcherName;
    }
    /**
     * The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
     * 
     */
    @Export(name="resourceGroupName", refs={String.class}, tree="[0]")
    private Output<String> resourceGroupName;

    /**
     * @return The name of the resource group in which the Network Watcher was deployed. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> resourceGroupName() {
        return this.resourceGroupName;
    }
    /**
     * A `retention_policy` block as documented below.
     * 
     */
    @Export(name="retentionPolicy", refs={NetworkWatcherFlowLogRetentionPolicy.class}, tree="[0]")
    private Output<NetworkWatcherFlowLogRetentionPolicy> retentionPolicy;

    /**
     * @return A `retention_policy` block as documented below.
     * 
     */
    public Output<NetworkWatcherFlowLogRetentionPolicy> retentionPolicy() {
        return this.retentionPolicy;
    }
    /**
     * The ID of the Storage Account where flow logs are stored.
     * 
     */
    @Export(name="storageAccountId", refs={String.class}, tree="[0]")
    private Output<String> storageAccountId;

    /**
     * @return The ID of the Storage Account where flow logs are stored.
     * 
     */
    public Output<String> storageAccountId() {
        return this.storageAccountId;
    }
    /**
     * A mapping of tags which should be assigned to the Network Watcher Flow Log.
     * 
     */
    @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
    private Output</* @Nullable */ Map<String,String>> tags;

    /**
     * @return A mapping of tags which should be assigned to the Network Watcher Flow Log.
     * 
     */
    public Output<Optional<Map<String,String>>> tags() {
        return Codegen.optional(this.tags);
    }
    /**
     * A `traffic_analytics` block as documented below.
     * 
     */
    @Export(name="trafficAnalytics", refs={NetworkWatcherFlowLogTrafficAnalytics.class}, tree="[0]")
    private Output</* @Nullable */ NetworkWatcherFlowLogTrafficAnalytics> trafficAnalytics;

    /**
     * @return A `traffic_analytics` block as documented below.
     * 
     */
    public Output<Optional<NetworkWatcherFlowLogTrafficAnalytics>> trafficAnalytics() {
        return Codegen.optional(this.trafficAnalytics);
    }
    /**
     * The version (revision) of the flow log. Possible values are `1` and `2`.
     * 
     */
    @Export(name="version", refs={Integer.class}, tree="[0]")
    private Output<Integer> version;

    /**
     * @return The version (revision) of the flow log. Possible values are `1` and `2`.
     * 
     */
    public Output<Integer> version() {
        return this.version;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public NetworkWatcherFlowLog(String name) {
        this(name, NetworkWatcherFlowLogArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public NetworkWatcherFlowLog(String name, NetworkWatcherFlowLogArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public NetworkWatcherFlowLog(String name, NetworkWatcherFlowLogArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:network/networkWatcherFlowLog:NetworkWatcherFlowLog", name, args == null ? NetworkWatcherFlowLogArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private NetworkWatcherFlowLog(String name, Output<String> id, @Nullable NetworkWatcherFlowLogState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:network/networkWatcherFlowLog:NetworkWatcherFlowLog", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host 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
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static NetworkWatcherFlowLog get(String name, Output<String> id, @Nullable NetworkWatcherFlowLogState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new NetworkWatcherFlowLog(name, id, state, options);
    }
}
