Log Profile Args
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());
}
}
Content copied to clipboard
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
Content copied to clipboard
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)