DiagnosticSettingArgs

data class DiagnosticSettingArgs(val enabledLogs: Output<List<DiagnosticSettingEnabledLogArgs>>? = null, val eventhubAuthorizationRuleId: Output<String>? = null, val eventhubName: Output<String>? = null, val logAnalyticsDestinationType: Output<String>? = null, val logAnalyticsWorkspaceId: Output<String>? = null, val logs: Output<List<DiagnosticSettingLogArgs>>? = null, val metrics: Output<List<DiagnosticSettingMetricArgs>>? = null, val name: Output<String>? = null, val partnerSolutionId: Output<String>? = null, val storageAccountId: Output<String>? = null, val targetResourceId: Output<String>? = null) : ConvertibleToJava<DiagnosticSettingArgs>

Manages a Diagnostic Setting for an existing Resource.

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.core.CoreFunctions;
import com.pulumi.azure.keyvault.KeyVault;
import com.pulumi.azure.keyvault.KeyVaultArgs;
import com.pulumi.azure.monitoring.DiagnosticSetting;
import com.pulumi.azure.monitoring.DiagnosticSettingArgs;
import com.pulumi.azure.monitoring.inputs.DiagnosticSettingEnabledLogArgs;
import com.pulumi.azure.monitoring.inputs.DiagnosticSettingEnabledLogRetentionPolicyArgs;
import com.pulumi.azure.monitoring.inputs.DiagnosticSettingMetricArgs;
import com.pulumi.azure.monitoring.inputs.DiagnosticSettingMetricRetentionPolicyArgs;
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("LRS")
.build());
final var current = CoreFunctions.getClientConfig();
var exampleKeyVault = new KeyVault("exampleKeyVault", KeyVaultArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.tenantId(current.applyValue(getClientConfigResult -> getClientConfigResult.tenantId()))
.softDeleteRetentionDays(7)
.purgeProtectionEnabled(false)
.skuName("standard")
.build());
var exampleDiagnosticSetting = new DiagnosticSetting("exampleDiagnosticSetting", DiagnosticSettingArgs.builder()
.targetResourceId(exampleKeyVault.id())
.storageAccountId(exampleAccount.id())
.enabledLogs(DiagnosticSettingEnabledLogArgs.builder()
.category("AuditEvent")
.retentionPolicy(DiagnosticSettingEnabledLogRetentionPolicyArgs.builder()
.enabled(false)
.build())
.build())
.metrics(DiagnosticSettingMetricArgs.builder()
.category("AllMetrics")
.retentionPolicy(DiagnosticSettingMetricRetentionPolicyArgs.builder()
.enabled(false)
.build())
.build())
.build());
}
}

Import

Diagnostic Settings can be imported using the resource id, e.g.

$ pulumi import azure:monitoring/diagnosticSetting:DiagnosticSetting example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.KeyVault/vaults/vault1|logMonitoring1"

Constructors

Link copied to clipboard
fun DiagnosticSettingArgs(enabledLogs: Output<List<DiagnosticSettingEnabledLogArgs>>? = null, eventhubAuthorizationRuleId: Output<String>? = null, eventhubName: Output<String>? = null, logAnalyticsDestinationType: Output<String>? = null, logAnalyticsWorkspaceId: Output<String>? = null, logs: Output<List<DiagnosticSettingLogArgs>>? = null, metrics: Output<List<DiagnosticSettingMetricArgs>>? = null, name: Output<String>? = null, partnerSolutionId: Output<String>? = null, storageAccountId: Output<String>? = null, targetResourceId: Output<String>? = null)

Functions

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

Properties

Link copied to clipboard

One or more enabled_log blocks as defined below.

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

Specifies the ID of an Event Hub Namespace Authorization Rule used to send Diagnostics Data.

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

Specifies the name of the Event Hub where Diagnostics Data should be sent.

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

Possible values are AzureDiagnostics and Dedicated. When set to Dedicated, logs sent to a Log Analytics workspace will go into resource specific tables, instead of the legacy AzureDiagnostics table.

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

Specifies the ID of a Log Analytics Workspace where Diagnostics Data should be sent.

Link copied to clipboard
val logs: Output<List<DiagnosticSettingLogArgs>>? = null

One or more log blocks as defined below.

Link copied to clipboard

One or more metric blocks as defined below.

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

Specifies the name of the Diagnostic Setting. Changing this forces a new resource to be created.

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

The ID of the market partner solution where Diagnostics Data should be sent. For potential partner integrations, click to learn more about partner integration.

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

The ID of the Storage Account where logs should be sent.

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

The ID of an existing Resource on which to configure Diagnostic Settings. Changing this forces a new resource to be created.