AlertArgs

data class AlertArgs(val alertDescription: Output<String>? = null, val alertDisplayname: Output<String>? = null, val alertName: Output<String>? = null, val annotations: Output<List<AlertAnnotationArgs>>? = null, val autoAnnotation: Output<Boolean>? = null, val condition: Output<String>? = null, val dashboard: Output<String>? = null, val groupConfiguration: Output<AlertGroupConfigurationArgs>? = null, val joinConfigurations: Output<List<AlertJoinConfigurationArgs>>? = null, val labels: Output<List<AlertLabelArgs>>? = null, val muteUntil: Output<Int>? = null, val noDataFire: Output<Boolean>? = null, val noDataSeverity: Output<Int>? = null, val notificationLists: Output<List<AlertNotificationListArgs>>? = null, val notifyThreshold: Output<Int>? = null, val policyConfiguration: Output<AlertPolicyConfigurationArgs>? = null, val projectName: Output<String>? = null, val queryLists: Output<List<AlertQueryListArgs>>? = null, val schedule: Output<AlertScheduleArgs>? = null, val scheduleInterval: Output<String>? = null, val scheduleType: Output<String>? = null, val sendResolved: Output<Boolean>? = null, val severityConfigurations: Output<List<AlertSeverityConfigurationArgs>>? = null, val templateConfiguration: Output<AlertTemplateConfigurationArgs>? = null, val threshold: Output<Int>? = null, val throttling: Output<String>? = null, val type: Output<String>? = null, val version: Output<String>? = null) : ConvertibleToJava<AlertArgs>

Log alert is a unit of log service, which is used to monitor and alert the user's logstore status information. Log Service enables you to configure alerts based on the charts in a dashboard to monitor the service status in real time. For information about SLS Alert and how to use it, see SLS Alert Overview

NOTE: Available in 1.78.0

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.RandomInteger;
import com.pulumi.random.RandomIntegerArgs;
import com.pulumi.alicloud.log.Project;
import com.pulumi.alicloud.log.ProjectArgs;
import com.pulumi.alicloud.log.Store;
import com.pulumi.alicloud.log.StoreArgs;
import com.pulumi.alicloud.log.Alert;
import com.pulumi.alicloud.log.AlertArgs;
import com.pulumi.alicloud.log.inputs.AlertScheduleArgs;
import com.pulumi.alicloud.log.inputs.AlertQueryListArgs;
import com.pulumi.alicloud.log.inputs.AlertNotificationListArgs;
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 default_ = new RandomInteger("default", RandomIntegerArgs.builder()
.max(99999)
.min(10000)
.build());
var exampleProject = new Project("exampleProject", ProjectArgs.builder()
.description("terraform-example")
.build());
var exampleStore = new Store("exampleStore", StoreArgs.builder()
.project(exampleProject.name())
.retentionPeriod(3650)
.shardCount(3)
.autoSplit(true)
.maxSplitShardCount(60)
.appendMeta(true)
.build());
var exampleAlert = new Alert("exampleAlert", AlertArgs.builder()
.projectName(exampleProject.name())
.alertName("example-alert")
.alertDisplayname("example-alert")
.condition("count> 100")
.dashboard("example-dashboard")
.schedule(AlertScheduleArgs.builder()
.type("FixedRate")
.interval("5m")
.hour(0)
.dayOfWeek(0)
.delay(0)
.runImmediately(false)
.build())
.queryLists(AlertQueryListArgs.builder()
.logstore(exampleStore.name())
.chartTitle("chart_title")
.start("-60s")
.end("20s")
.query("* AND aliyun")
.build())
.notificationLists(
AlertNotificationListArgs.builder()
.type("SMS")
.mobileLists(
"12345678",
"87654321")
.content("alert content")
.build(),
AlertNotificationListArgs.builder()
.type("Email")
.emailLists(
"aliyun@alibaba-inc.com",
"tf-example@123.com")
.content("alert content")
.build(),
AlertNotificationListArgs.builder()
.type("DingTalk")
.serviceUri("www.aliyun.com")
.content("alert content")
.build())
.build());
}
}

Import

Log alert can be imported using the id, e.g.

$ pulumi import alicloud:log/alert:Alert example tf-log:tf-log-alert

Constructors

Link copied to clipboard
fun AlertArgs(alertDescription: Output<String>? = null, alertDisplayname: Output<String>? = null, alertName: Output<String>? = null, annotations: Output<List<AlertAnnotationArgs>>? = null, autoAnnotation: Output<Boolean>? = null, condition: Output<String>? = null, dashboard: Output<String>? = null, groupConfiguration: Output<AlertGroupConfigurationArgs>? = null, joinConfigurations: Output<List<AlertJoinConfigurationArgs>>? = null, labels: Output<List<AlertLabelArgs>>? = null, muteUntil: Output<Int>? = null, noDataFire: Output<Boolean>? = null, noDataSeverity: Output<Int>? = null, notificationLists: Output<List<AlertNotificationListArgs>>? = null, notifyThreshold: Output<Int>? = null, policyConfiguration: Output<AlertPolicyConfigurationArgs>? = null, projectName: Output<String>? = null, queryLists: Output<List<AlertQueryListArgs>>? = null, schedule: Output<AlertScheduleArgs>? = null, scheduleInterval: Output<String>? = null, scheduleType: Output<String>? = null, sendResolved: Output<Boolean>? = null, severityConfigurations: Output<List<AlertSeverityConfigurationArgs>>? = null, templateConfiguration: Output<AlertTemplateConfigurationArgs>? = null, threshold: Output<Int>? = null, throttling: Output<String>? = null, type: Output<String>? = null, version: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): AlertArgs

Properties

Link copied to clipboard
val alertDescription: Output<String>? = null

Alert description.

Link copied to clipboard
val alertDisplayname: Output<String>? = null

Alert displayname.

Link copied to clipboard
val alertName: Output<String>? = null

Name of logstore for configuring alarm service.

Link copied to clipboard
val annotations: Output<List<AlertAnnotationArgs>>? = null

Alert template annotations.

Link copied to clipboard
val autoAnnotation: Output<Boolean>? = null

whether to add automatic annotation, default is false.

Link copied to clipboard
val condition: Output<String>? = null

Join condition.

Link copied to clipboard
val dashboard: Output<String>? = null
Link copied to clipboard

Group configuration for new alert.

Link copied to clipboard

Join configuration for different queries.

Link copied to clipboard
val labels: Output<List<AlertLabelArgs>>? = null

Labels for new alert.

Link copied to clipboard
val muteUntil: Output<Int>? = null

Timestamp, notifications before closing again.

Link copied to clipboard
val noDataFire: Output<Boolean>? = null

Switch for whether new alert fires when no data happens, default is false.

Link copied to clipboard
val noDataSeverity: Output<Int>? = null

when no data happens, the severity of new alert.

Link copied to clipboard

Alarm information notification list, Deprecated from 1.161.0+.

Link copied to clipboard
val notifyThreshold: Output<Int>? = null

Notification threshold, which is not notified until the number of triggers is reached. The default is 1, Deprecated from 1.161.0+.

Link copied to clipboard

Policy configuration for new alert.

Link copied to clipboard
val projectName: Output<String>? = null

The project name.

Link copied to clipboard
val queryLists: Output<List<AlertQueryListArgs>>? = null

Multiple conditions for configured alarm query.

Link copied to clipboard
val schedule: Output<AlertScheduleArgs>? = null

schedule for alert.

Link copied to clipboard
val scheduleInterval: Output<String>? = null

Execution interval. 60 seconds minimum, such as 60s, 1h. Deprecated from 1.176.0+. use interval in schedule.

Link copied to clipboard
val scheduleType: Output<String>? = null

Default FixedRate. No need to configure this parameter. Deprecated from 1.176.0+. use type in schedule.

Link copied to clipboard
val sendResolved: Output<Boolean>? = null

when new alert is resolved, whether to notify, default is false.

Link copied to clipboard

Severity configuration for new alert.

Link copied to clipboard

Template configuration for alert, when type is tpl.

Link copied to clipboard
val threshold: Output<Int>? = null

Evaluation threshold, alert will not fire until the number of triggers is reached. The default is 1.

Link copied to clipboard
val throttling: Output<String>? = null

Notification interval, default is no interval. Support number + unit type, for example 60s, 1h, Deprecated from 1.161.0+.

Link copied to clipboard
val type: Output<String>? = null

including FixedRate,Hourly,Daily,Weekly,Cron.

Link copied to clipboard
val version: Output<String>? = null

The version of alert, new alert is 2.0.