ActionRuleByName

class ActionRuleByName : KotlinCustomResource

Action rule object containing target scope, conditions and suppression logic API Version: 2019-05-05-preview.

Example Usage

PutActionRule

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var actionRuleByName = new AzureNative.AlertsManagement.ActionRuleByName("actionRuleByName", new()
{
ActionRuleName = "DailySuppression",
Location = "Global",
Properties = new AzureNative.AlertsManagement.Inputs.SuppressionArgs
{
Conditions = new AzureNative.AlertsManagement.Inputs.ConditionsArgs
{
MonitorCondition = new AzureNative.AlertsManagement.Inputs.ConditionArgs
{
Operator = "Equals",
Values = new[]
{
"Fired",
},
},
MonitorService = new AzureNative.AlertsManagement.Inputs.ConditionArgs
{
Operator = "Equals",
Values = new[]
{
"Platform",
"Application Insights",
},
},
Severity = new AzureNative.AlertsManagement.Inputs.ConditionArgs
{
Operator = "Equals",
Values = new[]
{
"Sev0",
"Sev2",
},
},
TargetResourceType = new AzureNative.AlertsManagement.Inputs.ConditionArgs
{
Operator = "NotEquals",
Values = new[]
{
"Microsoft.Compute/VirtualMachines",
},
},
},
Description = "Action rule on resource group for daily suppression",
Scope = new AzureNative.AlertsManagement.Inputs.ScopeArgs
{
ScopeType = "ResourceGroup",
Values = new[]
{
"/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg",
},
},
Status = "Enabled",
SuppressionConfig = new AzureNative.AlertsManagement.Inputs.SuppressionConfigArgs
{
RecurrenceType = "Daily",
Schedule = new AzureNative.AlertsManagement.Inputs.SuppressionScheduleArgs
{
EndDate = "12/18/2018",
EndTime = "14:00:00",
StartDate = "12/09/2018",
StartTime = "06:00:00",
},
},
Type = "Suppression",
},
ResourceGroupName = "alertscorrelationrg",
Tags = null,
});
});
package main
import (
alertsmanagement "github.com/pulumi/pulumi-azure-native-sdk/alertsmanagement"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := alertsmanagement.NewActionRuleByName(ctx, "actionRuleByName", &alertsmanagement.ActionRuleByNameArgs{
ActionRuleName: pulumi.String("DailySuppression"),
Location: pulumi.String("Global"),
Properties: alertsmanagement.Suppression{
Conditions: alertsmanagement.Conditions{
MonitorCondition: alertsmanagement.Condition{
Operator: "Equals",
Values: []string{
"Fired",
},
},
MonitorService: alertsmanagement.Condition{
Operator: "Equals",
Values: []string{
"Platform",
"Application Insights",
},
},
Severity: alertsmanagement.Condition{
Operator: "Equals",
Values: []string{
"Sev0",
"Sev2",
},
},
TargetResourceType: alertsmanagement.Condition{
Operator: "NotEquals",
Values: []string{
"Microsoft.Compute/VirtualMachines",
},
},
},
Description: "Action rule on resource group for daily suppression",
Scope: alertsmanagement.Scope{
ScopeType: "ResourceGroup",
Values: []string{
"/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg",
},
},
Status: "Enabled",
SuppressionConfig: alertsmanagement.SuppressionConfig{
RecurrenceType: "Daily",
Schedule: alertsmanagement.SuppressionSchedule{
EndDate: "12/18/2018",
EndTime: "14:00:00",
StartDate: "12/09/2018",
StartTime: "06:00:00",
},
},
Type: "Suppression",
},
ResourceGroupName: pulumi.String("alertscorrelationrg"),
Tags: nil,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.alertsmanagement.ActionRuleByName;
import com.pulumi.azurenative.alertsmanagement.ActionRuleByNameArgs;
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 actionRuleByName = new ActionRuleByName("actionRuleByName", ActionRuleByNameArgs.builder()
.actionRuleName("DailySuppression")
.location("Global")
.properties(Map.ofEntries(
Map.entry("conditions", Map.ofEntries(
Map.entry("monitorCondition", Map.ofEntries(
Map.entry("operator", "Equals"),
Map.entry("values", "Fired")
)),
Map.entry("monitorService", Map.ofEntries(
Map.entry("operator", "Equals"),
Map.entry("values",
"Platform",
"Application Insights")
)),
Map.entry("severity", Map.ofEntries(
Map.entry("operator", "Equals"),
Map.entry("values",
"Sev0",
"Sev2")
)),
Map.entry("targetResourceType", Map.ofEntries(
Map.entry("operator", "NotEquals"),
Map.entry("values", "Microsoft.Compute/VirtualMachines")
))
)),
Map.entry("description", "Action rule on resource group for daily suppression"),
Map.entry("scope", Map.ofEntries(
Map.entry("scopeType", "ResourceGroup"),
Map.entry("values", "/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg")
)),
Map.entry("status", "Enabled"),
Map.entry("suppressionConfig", Map.ofEntries(
Map.entry("recurrenceType", "Daily"),
Map.entry("schedule", Map.ofEntries(
Map.entry("endDate", "12/18/2018"),
Map.entry("endTime", "14:00:00"),
Map.entry("startDate", "12/09/2018"),
Map.entry("startTime", "06:00:00")
))
)),
Map.entry("type", "Suppression")
))
.resourceGroupName("alertscorrelationrg")
.tags()
.build());
}
}

Import

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

$ pulumi import azure-native:alertsmanagement:ActionRuleByName DailySuppression /subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourceGroups/alertscorrelationrg/providers/Microsoft.AlertsManagement/actionRules/DailySuppression

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val location: Output<String>

Resource location

Link copied to clipboard
val name: Output<String>

Azure resource name

Link copied to clipboard
val properties: Output<Any>

action rule properties

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tags: Output<Map<String, String>>?

Resource tags

Link copied to clipboard
val type: Output<String>

Azure resource type

Link copied to clipboard
val urn: Output<String>