Skip to content

Data Source: azurermSentinelAlertRule

Use this data source to access information about an existing Sentinel Alert Rule.

Example Usage

import * as cdktf from "cdktf";
/*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.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
  features: [{}],
});
const dataAzurermLogAnalyticsWorkspaceExample =
  new azurerm.dataAzurermLogAnalyticsWorkspace.DataAzurermLogAnalyticsWorkspace(
    this,
    "example",
    {
      name: "example",
      resource_group_name: "example-resources",
    }
  );
const dataAzurermSentinelAlertRuleExample =
  new azurerm.dataAzurermSentinelAlertRule.DataAzurermSentinelAlertRule(
    this,
    "example_2",
    {
      log_analytics_workspace_id: dataAzurermLogAnalyticsWorkspaceExample.id,
      name: "existing",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
dataAzurermSentinelAlertRuleExample.overrideLogicalId("example");
new cdktf.TerraformOutput(this, "id", {
  value: dataAzurermSentinelAlertRuleExample.id,
});

Arguments Reference

The following arguments are supported:

  • name - (Required) The name which should be used for this Sentinel Alert Rule.

  • logAnalyticsWorkspaceId - (Required) The ID of the Log Analytics Workspace this Sentinel Alert Rule belongs to.

Attributes Reference

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

  • id - The ID of the Sentinel Alert Rule.

Timeouts

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

  • read - (Defaults to 5 minutes) Used when retrieving the Sentinel Alert Rule.