LogProfileArgs

data class LogProfileArgs(val categories: Output<List<String>>? = null, val locations: Output<List<String>>? = null, val name: Output<String>? = null, val retentionPolicy: Output<LogProfileRetentionPolicyArgs>? = null, val servicebusRuleId: Output<String>? = null, val storageAccountId: Output<String>? = null) : ConvertibleToJava<LogProfileArgs>

Manages a Log Profile. A Log Profile configures how Activity Logs are exported.

NOTE: It'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. !>NOTE: Azure Log Profiles will be retired on 30th September 2026 and will be removed in v4.0 of the AzureRM Provider. More information on the deprecation can be found in the Azure documentation.

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.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("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.location(exampleResourceGroup.location())
.accountTier("Standard")
.accountReplicationType("GRS")
.build());
var exampleEventHubNamespace = new EventHubNamespace("exampleEventHubNamespace", EventHubNamespaceArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.sku("Standard")
.capacity(2)
.build());
var exampleLogProfile = new LogProfile("exampleLogProfile", LogProfileArgs.builder()
.categories(
"Action",
"Delete",
"Write")
.locations(
"westus",
"global")
.servicebusRuleId(exampleEventHubNamespace.id().applyValue(id -> String.format("%s/authorizationrules/RootManageSharedAccessKey", 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.

$ pulumi import azure:monitoring/logProfile:LogProfile example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Insights/logProfiles/test

Constructors

Link copied to clipboard
fun LogProfileArgs(categories: Output<List<String>>? = null, locations: Output<List<String>>? = null, name: Output<String>? = null, retentionPolicy: Output<LogProfileRetentionPolicyArgs>? = null, servicebusRuleId: Output<String>? = null, storageAccountId: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): LogProfileArgs

Properties

Link copied to clipboard
val categories: Output<List<String>>? = null

List of categories of the logs.

Link copied to clipboard
val locations: Output<List<String>>? = null

List of regions for which Activity Log events are stored or streamed.

Link copied to clipboard
val name: Output<String>? = null

The name of the Log Profile. Changing this forces a new resource to be created.

Link copied to clipboard

A retention_policy block as documented below. A retention policy for how long Activity Logs are retained in the storage account.

Link copied to clipboard
val servicebusRuleId: Output<String>? = null

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.

Link copied to clipboard
val storageAccountId: Output<String>? = null

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.