sysdig.MonitorAlertMetric
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as sysdig from "@pulumi/sysdig";
const sample = new sysdig.MonitorAlertMetric("sample", {
capture: {
duration: 15,
filename: "CrashLoopBackOff",
},
description: "A Kubernetes pod failed to restart",
metric: "sum(timeAvg(kubernetes.pod.restart.count)) > 2",
multipleAlertsBies: [
"kubernetes.cluster.name",
"kubernetes.namespace.name",
"kubernetes.deployment.name",
"kubernetes.pod.name",
],
severity: 6,
triggerAfterMinutes: 1,
});
import pulumi
import pulumi_sysdig as sysdig
sample = sysdig.MonitorAlertMetric("sample",
capture={
"duration": 15,
"filename": "CrashLoopBackOff",
},
description="A Kubernetes pod failed to restart",
metric="sum(timeAvg(kubernetes.pod.restart.count)) > 2",
multiple_alerts_bies=[
"kubernetes.cluster.name",
"kubernetes.namespace.name",
"kubernetes.deployment.name",
"kubernetes.pod.name",
],
severity=6,
trigger_after_minutes=1)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/sysdig/sysdig"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := sysdig.NewMonitorAlertMetric(ctx, "sample", &sysdig.MonitorAlertMetricArgs{
Capture: &sysdig.MonitorAlertMetricCaptureArgs{
Duration: pulumi.Float64(15),
Filename: pulumi.String("CrashLoopBackOff"),
},
Description: pulumi.String("A Kubernetes pod failed to restart"),
Metric: pulumi.String("sum(timeAvg(kubernetes.pod.restart.count)) > 2"),
MultipleAlertsBies: pulumi.StringArray{
pulumi.String("kubernetes.cluster.name"),
pulumi.String("kubernetes.namespace.name"),
pulumi.String("kubernetes.deployment.name"),
pulumi.String("kubernetes.pod.name"),
},
Severity: pulumi.Float64(6),
TriggerAfterMinutes: pulumi.Float64(1),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Sysdig = Pulumi.Sysdig;
return await Deployment.RunAsync(() =>
{
var sample = new Sysdig.MonitorAlertMetric("sample", new()
{
Capture = new Sysdig.Inputs.MonitorAlertMetricCaptureArgs
{
Duration = 15,
Filename = "CrashLoopBackOff",
},
Description = "A Kubernetes pod failed to restart",
Metric = "sum(timeAvg(kubernetes.pod.restart.count)) > 2",
MultipleAlertsBies = new[]
{
"kubernetes.cluster.name",
"kubernetes.namespace.name",
"kubernetes.deployment.name",
"kubernetes.pod.name",
},
Severity = 6,
TriggerAfterMinutes = 1,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sysdig.MonitorAlertMetric;
import com.pulumi.sysdig.MonitorAlertMetricArgs;
import com.pulumi.sysdig.inputs.MonitorAlertMetricCaptureArgs;
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 sample = new MonitorAlertMetric("sample", MonitorAlertMetricArgs.builder()
.capture(MonitorAlertMetricCaptureArgs.builder()
.duration(15)
.filename("CrashLoopBackOff")
.build())
.description("A Kubernetes pod failed to restart")
.metric("sum(timeAvg(kubernetes.pod.restart.count)) > 2")
.multipleAlertsBies(
"kubernetes.cluster.name",
"kubernetes.namespace.name",
"kubernetes.deployment.name",
"kubernetes.pod.name")
.severity(6)
.triggerAfterMinutes(1)
.build());
}
}
resources:
sample:
type: sysdig:MonitorAlertMetric
properties:
capture:
duration: 15
filename: CrashLoopBackOff
description: A Kubernetes pod failed to restart
metric: sum(timeAvg(kubernetes.pod.restart.count)) > 2
multipleAlertsBies:
- kubernetes.cluster.name
- kubernetes.namespace.name
- kubernetes.deployment.name
- kubernetes.pod.name
severity: 6
triggerAfterMinutes: 1
Create MonitorAlertMetric Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MonitorAlertMetric(name: string, args: MonitorAlertMetricArgs, opts?: CustomResourceOptions);
@overload
def MonitorAlertMetric(resource_name: str,
args: MonitorAlertMetricArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MonitorAlertMetric(resource_name: str,
opts: Optional[ResourceOptions] = None,
metric: Optional[str] = None,
trigger_after_minutes: Optional[float] = None,
monitor_alert_metric_id: Optional[str] = None,
enabled: Optional[bool] = None,
group_name: Optional[str] = None,
description: Optional[str] = None,
capture: Optional[MonitorAlertMetricCaptureArgs] = None,
multiple_alerts_bies: Optional[Sequence[str]] = None,
name: Optional[str] = None,
notification_channels: Optional[Sequence[float]] = None,
renotification_minutes: Optional[float] = None,
scope: Optional[str] = None,
severity: Optional[float] = None,
timeouts: Optional[MonitorAlertMetricTimeoutsArgs] = None,
custom_notification: Optional[MonitorAlertMetricCustomNotificationArgs] = None)
func NewMonitorAlertMetric(ctx *Context, name string, args MonitorAlertMetricArgs, opts ...ResourceOption) (*MonitorAlertMetric, error)
public MonitorAlertMetric(string name, MonitorAlertMetricArgs args, CustomResourceOptions? opts = null)
public MonitorAlertMetric(String name, MonitorAlertMetricArgs args)
public MonitorAlertMetric(String name, MonitorAlertMetricArgs args, CustomResourceOptions options)
type: sysdig:MonitorAlertMetric
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args MonitorAlertMetricArgs
- 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 MonitorAlertMetricArgs
- 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 MonitorAlertMetricArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MonitorAlertMetricArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MonitorAlertMetricArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var monitorAlertMetricResource = new Sysdig.MonitorAlertMetric("monitorAlertMetricResource", new()
{
Metric = "string",
TriggerAfterMinutes = 0,
MonitorAlertMetricId = "string",
Enabled = false,
GroupName = "string",
Description = "string",
Capture = new Sysdig.Inputs.MonitorAlertMetricCaptureArgs
{
Duration = 0,
Filename = "string",
Filter = "string",
},
MultipleAlertsBies = new[]
{
"string",
},
Name = "string",
NotificationChannels = new[]
{
0,
},
RenotificationMinutes = 0,
Scope = "string",
Severity = 0,
Timeouts = new Sysdig.Inputs.MonitorAlertMetricTimeoutsArgs
{
Create = "string",
Delete = "string",
Read = "string",
Update = "string",
},
CustomNotification = new Sysdig.Inputs.MonitorAlertMetricCustomNotificationArgs
{
Title = "string",
Append = "string",
Prepend = "string",
},
});
example, err := sysdig.NewMonitorAlertMetric(ctx, "monitorAlertMetricResource", &sysdig.MonitorAlertMetricArgs{
Metric: pulumi.String("string"),
TriggerAfterMinutes: pulumi.Float64(0),
MonitorAlertMetricId: pulumi.String("string"),
Enabled: pulumi.Bool(false),
GroupName: pulumi.String("string"),
Description: pulumi.String("string"),
Capture: &sysdig.MonitorAlertMetricCaptureArgs{
Duration: pulumi.Float64(0),
Filename: pulumi.String("string"),
Filter: pulumi.String("string"),
},
MultipleAlertsBies: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
NotificationChannels: pulumi.Float64Array{
pulumi.Float64(0),
},
RenotificationMinutes: pulumi.Float64(0),
Scope: pulumi.String("string"),
Severity: pulumi.Float64(0),
Timeouts: &sysdig.MonitorAlertMetricTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
Read: pulumi.String("string"),
Update: pulumi.String("string"),
},
CustomNotification: &sysdig.MonitorAlertMetricCustomNotificationArgs{
Title: pulumi.String("string"),
Append: pulumi.String("string"),
Prepend: pulumi.String("string"),
},
})
var monitorAlertMetricResource = new MonitorAlertMetric("monitorAlertMetricResource", MonitorAlertMetricArgs.builder()
.metric("string")
.triggerAfterMinutes(0)
.monitorAlertMetricId("string")
.enabled(false)
.groupName("string")
.description("string")
.capture(MonitorAlertMetricCaptureArgs.builder()
.duration(0)
.filename("string")
.filter("string")
.build())
.multipleAlertsBies("string")
.name("string")
.notificationChannels(0)
.renotificationMinutes(0)
.scope("string")
.severity(0)
.timeouts(MonitorAlertMetricTimeoutsArgs.builder()
.create("string")
.delete("string")
.read("string")
.update("string")
.build())
.customNotification(MonitorAlertMetricCustomNotificationArgs.builder()
.title("string")
.append("string")
.prepend("string")
.build())
.build());
monitor_alert_metric_resource = sysdig.MonitorAlertMetric("monitorAlertMetricResource",
metric="string",
trigger_after_minutes=0,
monitor_alert_metric_id="string",
enabled=False,
group_name="string",
description="string",
capture={
"duration": 0,
"filename": "string",
"filter": "string",
},
multiple_alerts_bies=["string"],
name="string",
notification_channels=[0],
renotification_minutes=0,
scope="string",
severity=0,
timeouts={
"create": "string",
"delete": "string",
"read": "string",
"update": "string",
},
custom_notification={
"title": "string",
"append": "string",
"prepend": "string",
})
const monitorAlertMetricResource = new sysdig.MonitorAlertMetric("monitorAlertMetricResource", {
metric: "string",
triggerAfterMinutes: 0,
monitorAlertMetricId: "string",
enabled: false,
groupName: "string",
description: "string",
capture: {
duration: 0,
filename: "string",
filter: "string",
},
multipleAlertsBies: ["string"],
name: "string",
notificationChannels: [0],
renotificationMinutes: 0,
scope: "string",
severity: 0,
timeouts: {
create: "string",
"delete": "string",
read: "string",
update: "string",
},
customNotification: {
title: "string",
append: "string",
prepend: "string",
},
});
type: sysdig:MonitorAlertMetric
properties:
capture:
duration: 0
filename: string
filter: string
customNotification:
append: string
prepend: string
title: string
description: string
enabled: false
groupName: string
metric: string
monitorAlertMetricId: string
multipleAlertsBies:
- string
name: string
notificationChannels:
- 0
renotificationMinutes: 0
scope: string
severity: 0
timeouts:
create: string
delete: string
read: string
update: string
triggerAfterMinutes: 0
MonitorAlertMetric Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The MonitorAlertMetric resource accepts the following input properties:
- Metric string
- Trigger
After doubleMinutes - Capture
Monitor
Alert Metric Capture - Custom
Notification MonitorAlert Metric Custom Notification - Description string
- Enabled bool
- Group
Name string - Monitor
Alert stringMetric Id - ID of the alert created.
- Multiple
Alerts List<string>Bies - Name string
- Notification
Channels List<double> - Renotification
Minutes double - Scope string
- Severity double
- Timeouts
Monitor
Alert Metric Timeouts
- Metric string
- Trigger
After float64Minutes - Capture
Monitor
Alert Metric Capture Args - Custom
Notification MonitorAlert Metric Custom Notification Args - Description string
- Enabled bool
- Group
Name string - Monitor
Alert stringMetric Id - ID of the alert created.
- Multiple
Alerts []stringBies - Name string
- Notification
Channels []float64 - Renotification
Minutes float64 - Scope string
- Severity float64
- Timeouts
Monitor
Alert Metric Timeouts Args
- metric String
- trigger
After DoubleMinutes - capture
Monitor
Alert Metric Capture - custom
Notification MonitorAlert Metric Custom Notification - description String
- enabled Boolean
- group
Name String - monitor
Alert StringMetric Id - ID of the alert created.
- multiple
Alerts List<String>Bies - name String
- notification
Channels List<Double> - renotification
Minutes Double - scope String
- severity Double
- timeouts
Monitor
Alert Metric Timeouts
- metric string
- trigger
After numberMinutes - capture
Monitor
Alert Metric Capture - custom
Notification MonitorAlert Metric Custom Notification - description string
- enabled boolean
- group
Name string - monitor
Alert stringMetric Id - ID of the alert created.
- multiple
Alerts string[]Bies - name string
- notification
Channels number[] - renotification
Minutes number - scope string
- severity number
- timeouts
Monitor
Alert Metric Timeouts
- metric str
- trigger_
after_ floatminutes - capture
Monitor
Alert Metric Capture Args - custom_
notification MonitorAlert Metric Custom Notification Args - description str
- enabled bool
- group_
name str - monitor_
alert_ strmetric_ id - ID of the alert created.
- multiple_
alerts_ Sequence[str]bies - name str
- notification_
channels Sequence[float] - renotification_
minutes float - scope str
- severity float
- timeouts
Monitor
Alert Metric Timeouts Args
- metric String
- trigger
After NumberMinutes - capture Property Map
- custom
Notification Property Map - description String
- enabled Boolean
- group
Name String - monitor
Alert StringMetric Id - ID of the alert created.
- multiple
Alerts List<String>Bies - name String
- notification
Channels List<Number> - renotification
Minutes Number - scope String
- severity Number
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the MonitorAlertMetric resource produces the following output properties:
Look up Existing MonitorAlertMetric Resource
Get an existing MonitorAlertMetric resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: MonitorAlertMetricState, opts?: CustomResourceOptions): MonitorAlertMetric
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
capture: Optional[MonitorAlertMetricCaptureArgs] = None,
custom_notification: Optional[MonitorAlertMetricCustomNotificationArgs] = None,
description: Optional[str] = None,
enabled: Optional[bool] = None,
group_name: Optional[str] = None,
metric: Optional[str] = None,
monitor_alert_metric_id: Optional[str] = None,
multiple_alerts_bies: Optional[Sequence[str]] = None,
name: Optional[str] = None,
notification_channels: Optional[Sequence[float]] = None,
renotification_minutes: Optional[float] = None,
scope: Optional[str] = None,
severity: Optional[float] = None,
team: Optional[float] = None,
timeouts: Optional[MonitorAlertMetricTimeoutsArgs] = None,
trigger_after_minutes: Optional[float] = None,
version: Optional[float] = None) -> MonitorAlertMetric
func GetMonitorAlertMetric(ctx *Context, name string, id IDInput, state *MonitorAlertMetricState, opts ...ResourceOption) (*MonitorAlertMetric, error)
public static MonitorAlertMetric Get(string name, Input<string> id, MonitorAlertMetricState? state, CustomResourceOptions? opts = null)
public static MonitorAlertMetric get(String name, Output<String> id, MonitorAlertMetricState state, CustomResourceOptions options)
resources: _: type: sysdig:MonitorAlertMetric get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Capture
Monitor
Alert Metric Capture - Custom
Notification MonitorAlert Metric Custom Notification - Description string
- Enabled bool
- Group
Name string - Metric string
- Monitor
Alert stringMetric Id - ID of the alert created.
- Multiple
Alerts List<string>Bies - Name string
- Notification
Channels List<double> - Renotification
Minutes double - Scope string
- Severity double
- Team double
- Team ID that owns the alert.
- Timeouts
Monitor
Alert Metric Timeouts - Trigger
After doubleMinutes - Version double
- Current version of the resource in Sysdig Monitor.
- Capture
Monitor
Alert Metric Capture Args - Custom
Notification MonitorAlert Metric Custom Notification Args - Description string
- Enabled bool
- Group
Name string - Metric string
- Monitor
Alert stringMetric Id - ID of the alert created.
- Multiple
Alerts []stringBies - Name string
- Notification
Channels []float64 - Renotification
Minutes float64 - Scope string
- Severity float64
- Team float64
- Team ID that owns the alert.
- Timeouts
Monitor
Alert Metric Timeouts Args - Trigger
After float64Minutes - Version float64
- Current version of the resource in Sysdig Monitor.
- capture
Monitor
Alert Metric Capture - custom
Notification MonitorAlert Metric Custom Notification - description String
- enabled Boolean
- group
Name String - metric String
- monitor
Alert StringMetric Id - ID of the alert created.
- multiple
Alerts List<String>Bies - name String
- notification
Channels List<Double> - renotification
Minutes Double - scope String
- severity Double
- team Double
- Team ID that owns the alert.
- timeouts
Monitor
Alert Metric Timeouts - trigger
After DoubleMinutes - version Double
- Current version of the resource in Sysdig Monitor.
- capture
Monitor
Alert Metric Capture - custom
Notification MonitorAlert Metric Custom Notification - description string
- enabled boolean
- group
Name string - metric string
- monitor
Alert stringMetric Id - ID of the alert created.
- multiple
Alerts string[]Bies - name string
- notification
Channels number[] - renotification
Minutes number - scope string
- severity number
- team number
- Team ID that owns the alert.
- timeouts
Monitor
Alert Metric Timeouts - trigger
After numberMinutes - version number
- Current version of the resource in Sysdig Monitor.
- capture
Monitor
Alert Metric Capture Args - custom_
notification MonitorAlert Metric Custom Notification Args - description str
- enabled bool
- group_
name str - metric str
- monitor_
alert_ strmetric_ id - ID of the alert created.
- multiple_
alerts_ Sequence[str]bies - name str
- notification_
channels Sequence[float] - renotification_
minutes float - scope str
- severity float
- team float
- Team ID that owns the alert.
- timeouts
Monitor
Alert Metric Timeouts Args - trigger_
after_ floatminutes - version float
- Current version of the resource in Sysdig Monitor.
- capture Property Map
- custom
Notification Property Map - description String
- enabled Boolean
- group
Name String - metric String
- monitor
Alert StringMetric Id - ID of the alert created.
- multiple
Alerts List<String>Bies - name String
- notification
Channels List<Number> - renotification
Minutes Number - scope String
- severity Number
- team Number
- Team ID that owns the alert.
- timeouts Property Map
- trigger
After NumberMinutes - version Number
- Current version of the resource in Sysdig Monitor.
Supporting Types
MonitorAlertMetricCapture, MonitorAlertMetricCaptureArgs
MonitorAlertMetricCustomNotification, MonitorAlertMetricCustomNotificationArgs
MonitorAlertMetricTimeouts, MonitorAlertMetricTimeoutsArgs
Import
Metric Threshold alerts can be imported using the alert ID, e.g.
$ pulumi import sysdig:index/monitorAlertMetric:MonitorAlertMetric example 12345
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- sysdig sysdiglabs/terraform-provider-sysdig
- License
- Notes
- This Pulumi package is based on the
sysdig
Terraform Provider.