getAlertRule

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

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.operationalinsights.OperationalinsightsFunctions;
import com.pulumi.azure.operationalinsights.inputs.GetAnalyticsWorkspaceArgs;
import com.pulumi.azure.sentinel.SentinelFunctions;
import com.pulumi.azure.sentinel.inputs.GetAlertRuleArgs;
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) {
final var exampleAnalyticsWorkspace = OperationalinsightsFunctions.getAnalyticsWorkspace(GetAnalyticsWorkspaceArgs.builder()
.name("example")
.resourceGroupName("example-resources")
.build());
final var exampleAlertRule = SentinelFunctions.getAlertRule(GetAlertRuleArgs.builder()
.name("existing")
.logAnalyticsWorkspaceId(exampleAnalyticsWorkspace.applyValue(getAnalyticsWorkspaceResult -> getAnalyticsWorkspaceResult.id()))
.build());
ctx.export("id", exampleAlertRule.applyValue(getAlertRuleResult -> getAlertRuleResult.id()));
}
}

Return

A collection of values returned by getAlertRule.

Parameters

argument

A collection of arguments for invoking getAlertRule.


suspend fun getAlertRule(logAnalyticsWorkspaceId: String, name: String): GetAlertRuleResult

Return

A collection of values returned by getAlertRule.

See also

Parameters

logAnalyticsWorkspaceId

The ID of the Log Analytics Workspace this Sentinel Alert Rule belongs to.

name

The name which should be used for this Sentinel Alert Rule.


Return

A collection of values returned by getAlertRule.

See also

Parameters

argument

Builder for com.pulumi.azure.sentinel.kotlin.inputs.GetAlertRulePlainArgs.