// *** 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.monitoring;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.monitoring.LogProfileArgs;
import com.pulumi.azure.monitoring.inputs.LogProfileState;
import com.pulumi.azure.monitoring.outputs.LogProfileRetentionPolicy;
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.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Manages a [Log Profile](https://docs.microsoft.com/azure/monitoring-and-diagnostics/monitoring-overview-activity-logs#export-the-activity-log-with-a-log-profile). A Log Profile configures how Activity Logs are exported.
 * 
 * &gt; **NOTE:** It&#39;s only possible to configure one Log Profile per Subscription. If you are trying to create more than one Log Profile, an error with `StatusCode=409` will occur.
 * 
 * ## 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.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.eventhub.EventHubNamespace;
 * import com.pulumi.azure.eventhub.EventHubNamespaceArgs;
 * import com.pulumi.azure.monitoring.LogProfile;
 * import com.pulumi.azure.monitoring.LogProfileArgs;
 * import com.pulumi.azure.monitoring.inputs.LogProfileRetentionPolicyArgs;
 * 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 exampleResourceGroup = new ResourceGroup(&#34;exampleResourceGroup&#34;, ResourceGroupArgs.builder()        
 *             .location(&#34;West Europe&#34;)
 *             .build());
 * 
 *         var exampleAccount = new Account(&#34;exampleAccount&#34;, AccountArgs.builder()        
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .accountTier(&#34;Standard&#34;)
 *             .accountReplicationType(&#34;GRS&#34;)
 *             .build());
 * 
 *         var exampleEventHubNamespace = new EventHubNamespace(&#34;exampleEventHubNamespace&#34;, EventHubNamespaceArgs.builder()        
 *             .location(exampleResourceGroup.location())
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .sku(&#34;Standard&#34;)
 *             .capacity(2)
 *             .build());
 * 
 *         var exampleLogProfile = new LogProfile(&#34;exampleLogProfile&#34;, LogProfileArgs.builder()        
 *             .categories(            
 *                 &#34;Action&#34;,
 *                 &#34;Delete&#34;,
 *                 &#34;Write&#34;)
 *             .locations(            
 *                 &#34;westus&#34;,
 *                 &#34;global&#34;)
 *             .servicebusRuleId(exampleEventHubNamespace.id().applyValue(id -&gt; String.format(&#34;%s/authorizationrules/RootManageSharedAccessKey&#34;, id)))
 *             .storageAccountId(exampleAccount.id())
 *             .retentionPolicy(LogProfileRetentionPolicyArgs.builder()
 *                 .enabled(true)
 *                 .days(7)
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * A Log Profile can be imported using the `resource id`, e.g.
 * 
 * ```sh
 *  $ pulumi import azure:monitoring/logProfile:LogProfile example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Insights/logProfiles/test
 * ```
 * 
 */
@ResourceType(type="azure:monitoring/logProfile:LogProfile")
public class LogProfile extends com.pulumi.resources.CustomResource {
    /**
     * List of categories of the logs.
     * 
     */
    @Export(name="categories", refs={List.class,String.class}, tree="[0,1]")
    private Output<List<String>> categories;

    /**
     * @return List of categories of the logs.
     * 
     */
    public Output<List<String>> categories() {
        return this.categories;
    }
    /**
     * List of regions for which Activity Log events are stored or streamed.
     * 
     */
    @Export(name="locations", refs={List.class,String.class}, tree="[0,1]")
    private Output<List<String>> locations;

    /**
     * @return List of regions for which Activity Log events are stored or streamed.
     * 
     */
    public Output<List<String>> locations() {
        return this.locations;
    }
    /**
     * The name of the Log Profile. 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 Log Profile. Changing this forces a new resource to be created.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * A `retention_policy` block as documented below. A retention policy for how long Activity Logs are retained in the storage account.
     * 
     */
    @Export(name="retentionPolicy", refs={LogProfileRetentionPolicy.class}, tree="[0]")
    private Output<LogProfileRetentionPolicy> retentionPolicy;

    /**
     * @return A `retention_policy` block as documented below. A retention policy for how long Activity Logs are retained in the storage account.
     * 
     */
    public Output<LogProfileRetentionPolicy> retentionPolicy() {
        return this.retentionPolicy;
    }
    /**
     * The service bus (or event hub) rule ID of the service bus (or event hub) namespace in which the Activity Log is streamed to. At least one of `storage_account_id` or `servicebus_rule_id` must be set.
     * 
     */
    @Export(name="servicebusRuleId", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> servicebusRuleId;

    /**
     * @return The service bus (or event hub) rule ID of the service bus (or event hub) namespace in which the Activity Log is streamed to. At least one of `storage_account_id` or `servicebus_rule_id` must be set.
     * 
     */
    public Output<Optional<String>> servicebusRuleId() {
        return Codegen.optional(this.servicebusRuleId);
    }
    /**
     * The resource ID of the storage account in which the Activity Log is stored. At least one of `storage_account_id` or `servicebus_rule_id` must be set.
     * 
     */
    @Export(name="storageAccountId", refs={String.class}, tree="[0]")
    private Output</* @Nullable */ String> storageAccountId;

    /**
     * @return The resource ID of the storage account in which the Activity Log is stored. At least one of `storage_account_id` or `servicebus_rule_id` must be set.
     * 
     */
    public Output<Optional<String>> storageAccountId() {
        return Codegen.optional(this.storageAccountId);
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public LogProfile(String name) {
        this(name, LogProfileArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public LogProfile(String name, LogProfileArgs 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 LogProfile(String name, LogProfileArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:monitoring/logProfile:LogProfile", name, args == null ? LogProfileArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private LogProfile(String name, Output<String> id, @Nullable LogProfileState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("azure:monitoring/logProfile:LogProfile", 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 LogProfile get(String name, Output<String> id, @Nullable LogProfileState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new LogProfile(name, id, state, options);
    }
}
