Skip to content

azurermSentinelAlertRuleMachineLearningBehaviorAnalytics

Manages a Sentinel Machine Learning Behavior Analytics Alert Rule.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermLogAnalyticsWorkspaceExample =
  new azurerm.logAnalyticsWorkspace.LogAnalyticsWorkspace(this, "example_1", {
    location: azurermResourceGroupExample.location,
    name: "example-workspace",
    resource_group_name: azurermResourceGroupExample.name,
    sku: "PerGB2018",
  });
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermLogAnalyticsWorkspaceExample.overrideLogicalId("example");
const azurermSentinelAlertRuleMachineLearningBehaviorAnalyticsExample =
  new azurerm.sentinelAlertRuleMachineLearningBehaviorAnalytics.SentinelAlertRuleMachineLearningBehaviorAnalytics(
    this,
    "example_2",
    {
      alert_rule_template_guid: "737a2ce1-70a3-4968-9e90-3e6aca836abf",
      log_analytics_workspace_id: azurermLogAnalyticsWorkspaceExample.id,
      name: "example-ml-alert-rule",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSentinelAlertRuleMachineLearningBehaviorAnalyticsExample.overrideLogicalId(
  "example"
);
const azurermSentinelLogAnalyticsWorkspaceOnboardingExample =
  new azurerm.sentinelLogAnalyticsWorkspaceOnboarding.SentinelLogAnalyticsWorkspaceOnboarding(
    this,
    "example_3",
    {
      workspace_id: azurermLogAnalyticsWorkspaceExample.id,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermSentinelLogAnalyticsWorkspaceOnboardingExample.overrideLogicalId(
  "example"
);

Arguments Reference

The following arguments are supported:

  • name - (Required) The name which should be used for this SentinelMachine Learning Behavior Analytics Alert Rule. Changing this forces a new Sentinel Machine Learning Behavior Analytics Alert Rule to be created.

  • logAnalyticsWorkspaceId - (Required) The ID of the Log Analytics Workspace this SentinelMachine Learning Behavior Analytics Alert Rule belongs to. Changing this forces a new Sentinel Machine Learning Behavior Analytics Alert Rule to be created.

  • alertRuleTemplateGuid - (Required) The GUID of the alert rule template which is used for this Sentinel Machine Learning Behavior Analytics Alert Rule. Changing this forces a new Sentinel Machine Learning Behavior Analytics Alert Rule to be created.

  • enabled - (Optional) Should this Sentinel Machine Learning Behavior Analytics Alert Rule be enabled? Defaults to true.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Sentinel Machine Learning Behavior Analytics Alert Rule.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Sentinel Machine Learning Behavior Analytics Alert Rule.
  • read - (Defaults to 5 minutes) Used when retrieving the Sentinel Machine Learning Behavior Analytics Alert Rule.
  • update - (Defaults to 30 minutes) Used when updating the Sentinel Machine Learning Behavior Analytics Alert Rule.
  • delete - (Defaults to 30 minutes) Used when deleting the Sentinel Machine Learning Behavior Analytics Alert Rule.

Import

Sentinel Machine Learning Behavior Analytics Rules can be imported using the resourceId, e.g.

terraform import azurerm_sentinel_alert_rule_machine_learning_behavior_analytics.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/alertRules/rule1