Azure Native

Pulumi Official
Package maintained by Pulumi
v1.67.0 published on Tuesday, Jul 12, 2022 by Pulumi

AlertRule

Deprecated:

Please use one of the variants: FusionAlertRule, MicrosoftSecurityIncidentCreationAlertRule, ScheduledAlertRule.

Alert rule. API Version: 2020-01-01.

Example Usage

Creates or updates a Fusion alert rule.

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var alertRule = new AzureNative.SecurityInsights.AlertRule("alertRule", new AzureNative.SecurityInsights.AlertRuleArgs
        {
            Kind = "Fusion",
            ResourceGroupName = "myRg",
            RuleId = "myFirstFusionRule",
            WorkspaceName = "myWorkspace",
        });
    }

}
package main

import (
	securityinsights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/securityinsights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := securityinsights.NewAlertRule(ctx, "alertRule", &securityinsights.AlertRuleArgs{
			Kind:              pulumi.String("Fusion"),
			ResourceGroupName: pulumi.String("myRg"),
			RuleId:            pulumi.String("myFirstFusionRule"),
			WorkspaceName:     pulumi.String("myWorkspace"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var alertRule = new AlertRule("alertRule", AlertRuleArgs.builder()        
            .kind("Fusion")
            .resourceGroupName("myRg")
            .ruleId("myFirstFusionRule")
            .workspaceName("myWorkspace")
            .build());

    }
}
import pulumi
import pulumi_azure_native as azure_native

alert_rule = azure_native.securityinsights.AlertRule("alertRule",
    kind="Fusion",
    resource_group_name="myRg",
    rule_id="myFirstFusionRule",
    workspace_name="myWorkspace")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const alertRule = new azure_native.securityinsights.AlertRule("alertRule", {
    kind: "Fusion",
    resourceGroupName: "myRg",
    ruleId: "myFirstFusionRule",
    workspaceName: "myWorkspace",
});
resources:
  alertRule:
    type: azure-native:securityinsights:AlertRule
    properties:
      kind: Fusion
      resourceGroupName: myRg
      ruleId: myFirstFusionRule
      workspaceName: myWorkspace

Creates or updates a MicrosoftSecurityIncidentCreation rule.

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var alertRule = new AzureNative.SecurityInsights.AlertRule("alertRule", new AzureNative.SecurityInsights.AlertRuleArgs
        {
            Kind = "MicrosoftSecurityIncidentCreation",
            ResourceGroupName = "myRg",
            RuleId = "microsoftSecurityIncidentCreationRuleExample",
            WorkspaceName = "myWorkspace",
        });
    }

}
package main

import (
	securityinsights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/securityinsights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := securityinsights.NewAlertRule(ctx, "alertRule", &securityinsights.AlertRuleArgs{
			Kind:              pulumi.String("MicrosoftSecurityIncidentCreation"),
			ResourceGroupName: pulumi.String("myRg"),
			RuleId:            pulumi.String("microsoftSecurityIncidentCreationRuleExample"),
			WorkspaceName:     pulumi.String("myWorkspace"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var alertRule = new AlertRule("alertRule", AlertRuleArgs.builder()        
            .kind("MicrosoftSecurityIncidentCreation")
            .resourceGroupName("myRg")
            .ruleId("microsoftSecurityIncidentCreationRuleExample")
            .workspaceName("myWorkspace")
            .build());

    }
}
import pulumi
import pulumi_azure_native as azure_native

alert_rule = azure_native.securityinsights.AlertRule("alertRule",
    kind="MicrosoftSecurityIncidentCreation",
    resource_group_name="myRg",
    rule_id="microsoftSecurityIncidentCreationRuleExample",
    workspace_name="myWorkspace")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const alertRule = new azure_native.securityinsights.AlertRule("alertRule", {
    kind: "MicrosoftSecurityIncidentCreation",
    resourceGroupName: "myRg",
    ruleId: "microsoftSecurityIncidentCreationRuleExample",
    workspaceName: "myWorkspace",
});
resources:
  alertRule:
    type: azure-native:securityinsights:AlertRule
    properties:
      kind: MicrosoftSecurityIncidentCreation
      resourceGroupName: myRg
      ruleId: microsoftSecurityIncidentCreationRuleExample
      workspaceName: myWorkspace

Creates or updates a Scheduled alert rule.

using Pulumi;
using AzureNative = Pulumi.AzureNative;

class MyStack : Stack
{
    public MyStack()
    {
        var alertRule = new AzureNative.SecurityInsights.AlertRule("alertRule", new AzureNative.SecurityInsights.AlertRuleArgs
        {
            Kind = "Scheduled",
            ResourceGroupName = "myRg",
            RuleId = "73e01a99-5cd7-4139-a149-9f2736ff2ab5",
            WorkspaceName = "myWorkspace",
        });
    }

}
package main

import (
	securityinsights "github.com/pulumi/pulumi-azure-native/sdk/go/azure/securityinsights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := securityinsights.NewAlertRule(ctx, "alertRule", &securityinsights.AlertRuleArgs{
			Kind:              pulumi.String("Scheduled"),
			ResourceGroupName: pulumi.String("myRg"),
			RuleId:            pulumi.String("73e01a99-5cd7-4139-a149-9f2736ff2ab5"),
			WorkspaceName:     pulumi.String("myWorkspace"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var alertRule = new AlertRule("alertRule", AlertRuleArgs.builder()        
            .kind("Scheduled")
            .resourceGroupName("myRg")
            .ruleId("73e01a99-5cd7-4139-a149-9f2736ff2ab5")
            .workspaceName("myWorkspace")
            .build());

    }
}
import pulumi
import pulumi_azure_native as azure_native

alert_rule = azure_native.securityinsights.AlertRule("alertRule",
    kind="Scheduled",
    resource_group_name="myRg",
    rule_id="73e01a99-5cd7-4139-a149-9f2736ff2ab5",
    workspace_name="myWorkspace")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const alertRule = new azure_native.securityinsights.AlertRule("alertRule", {
    kind: "Scheduled",
    resourceGroupName: "myRg",
    ruleId: "73e01a99-5cd7-4139-a149-9f2736ff2ab5",
    workspaceName: "myWorkspace",
});
resources:
  alertRule:
    type: azure-native:securityinsights:AlertRule
    properties:
      kind: Scheduled
      resourceGroupName: myRg
      ruleId: 73e01a99-5cd7-4139-a149-9f2736ff2ab5
      workspaceName: myWorkspace

Create a AlertRule Resource

new AlertRule(name: string, args: AlertRuleArgs, opts?: CustomResourceOptions);
@overload
def AlertRule(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              kind: Optional[Union[str, AlertRuleKind]] = None,
              resource_group_name: Optional[str] = None,
              rule_id: Optional[str] = None,
              workspace_name: Optional[str] = None)
@overload
def AlertRule(resource_name: str,
              args: AlertRuleArgs,
              opts: Optional[ResourceOptions] = None)
func NewAlertRule(ctx *Context, name string, args AlertRuleArgs, opts ...ResourceOption) (*AlertRule, error)
public AlertRule(string name, AlertRuleArgs args, CustomResourceOptions? opts = null)
public AlertRule(String name, AlertRuleArgs args)
public AlertRule(String name, AlertRuleArgs args, CustomResourceOptions options)
type: azure-native:securityinsights:AlertRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args AlertRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args AlertRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AlertRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AlertRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args AlertRuleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

AlertRule Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The AlertRule resource accepts the following input properties:

Kind string | Pulumi.AzureNative.SecurityInsights.AlertRuleKind

The alert rule kind

ResourceGroupName string

The name of the resource group within the user's subscription. The name is case insensitive.

WorkspaceName string

The name of the workspace.

RuleId string

Alert rule ID

Kind string | AlertRuleKind

The alert rule kind

ResourceGroupName string

The name of the resource group within the user's subscription. The name is case insensitive.

WorkspaceName string

The name of the workspace.

RuleId string

Alert rule ID

kind String | AlertRuleKind

The alert rule kind

resourceGroupName String

The name of the resource group within the user's subscription. The name is case insensitive.

workspaceName String

The name of the workspace.

ruleId String

Alert rule ID

kind string | AlertRuleKind

The alert rule kind

resourceGroupName string

The name of the resource group within the user's subscription. The name is case insensitive.

workspaceName string

The name of the workspace.

ruleId string

Alert rule ID

kind str | AlertRuleKind

The alert rule kind

resource_group_name str

The name of the resource group within the user's subscription. The name is case insensitive.

workspace_name str

The name of the workspace.

rule_id str

Alert rule ID

kind String | "Scheduled" | "MicrosoftSecurityIncidentCreation" | "Fusion"

The alert rule kind

resourceGroupName String

The name of the resource group within the user's subscription. The name is case insensitive.

workspaceName String

The name of the workspace.

ruleId String

Alert rule ID

Outputs

All input properties are implicitly available as output properties. Additionally, the AlertRule resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Name string

Azure resource name

Type string

Azure resource type

Etag string

Etag of the azure resource

Id string

The provider-assigned unique ID for this managed resource.

Name string

Azure resource name

Type string

Azure resource type

Etag string

Etag of the azure resource

id String

The provider-assigned unique ID for this managed resource.

name String

Azure resource name

type String

Azure resource type

etag String

Etag of the azure resource

id string

The provider-assigned unique ID for this managed resource.

name string

Azure resource name

type string

Azure resource type

etag string

Etag of the azure resource

id str

The provider-assigned unique ID for this managed resource.

name str

Azure resource name

type str

Azure resource type

etag str

Etag of the azure resource

id String

The provider-assigned unique ID for this managed resource.

name String

Azure resource name

type String

Azure resource type

etag String

Etag of the azure resource

Supporting Types

AlertRuleKind

Scheduled
Scheduled
MicrosoftSecurityIncidentCreation
MicrosoftSecurityIncidentCreation
Fusion
Fusion
AlertRuleKindScheduled
Scheduled
AlertRuleKindMicrosoftSecurityIncidentCreation
MicrosoftSecurityIncidentCreation
AlertRuleKindFusion
Fusion
Scheduled
Scheduled
MicrosoftSecurityIncidentCreation
MicrosoftSecurityIncidentCreation
Fusion
Fusion
Scheduled
Scheduled
MicrosoftSecurityIncidentCreation
MicrosoftSecurityIncidentCreation
Fusion
Fusion
SCHEDULED
Scheduled
MICROSOFT_SECURITY_INCIDENT_CREATION
MicrosoftSecurityIncidentCreation
FUSION
Fusion
"Scheduled"
Scheduled
"MicrosoftSecurityIncidentCreation"
MicrosoftSecurityIncidentCreation
"Fusion"
Fusion

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:securityinsights:AlertRule 73e01a99-5cd7-4139-a149-9f2736ff2ab5 /subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/73e01a99-5cd7-4139-a149-9f2736ff2ab5 

Package Details

Repository
https://github.com/pulumi/pulumi-azure-native
License
Apache-2.0