grafana.syntheticMonitoring.CheckAlerts
Explore with Pulumi AI
Manages alerts for a check in Grafana Synthetic Monitoring.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumiverse/grafana";
const main = new grafana.syntheticmonitoring.Check("main", {
job: "Check Alert Test",
target: "https://grafana.com",
enabled: true,
probes: [1],
labels: {},
settings: {
http: {
ipVersion: "V4",
method: "GET",
},
},
});
const mainCheckAlerts = new grafana.syntheticmonitoring.CheckAlerts("main", {
checkId: main.id,
alerts: [
{
name: "ProbeFailedExecutionsTooHigh",
threshold: 1,
period: "15m",
},
{
name: "TLSTargetCertificateCloseToExpiring",
threshold: 14,
period: "",
},
],
});
import pulumi
import pulumiverse_grafana as grafana
main = grafana.synthetic_monitoring.Check("main",
job="Check Alert Test",
target="https://grafana.com",
enabled=True,
probes=[1],
labels={},
settings={
"http": {
"ip_version": "V4",
"method": "GET",
},
})
main_check_alerts = grafana.synthetic_monitoring.CheckAlerts("main",
check_id=main.id,
alerts=[
{
"name": "ProbeFailedExecutionsTooHigh",
"threshold": 1,
"period": "15m",
},
{
"name": "TLSTargetCertificateCloseToExpiring",
"threshold": 14,
"period": "",
},
])
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/syntheticmonitoring"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
main, err := syntheticmonitoring.NewCheck(ctx, "main", &syntheticmonitoring.CheckArgs{
Job: pulumi.String("Check Alert Test"),
Target: pulumi.String("https://grafana.com"),
Enabled: pulumi.Bool(true),
Probes: pulumi.IntArray{
pulumi.Int(1),
},
Labels: pulumi.StringMap{},
Settings: &syntheticmonitoring.CheckSettingsArgs{
Http: &syntheticmonitoring.CheckSettingsHttpArgs{
IpVersion: pulumi.String("V4"),
Method: pulumi.String("GET"),
},
},
})
if err != nil {
return err
}
_, err = syntheticmonitoring.NewCheckAlerts(ctx, "main", &syntheticmonitoring.CheckAlertsArgs{
CheckId: main.ID(),
Alerts: syntheticmonitoring.CheckAlertsAlertArray{
&syntheticmonitoring.CheckAlertsAlertArgs{
Name: pulumi.String("ProbeFailedExecutionsTooHigh"),
Threshold: pulumi.Float64(1),
Period: pulumi.String("15m"),
},
&syntheticmonitoring.CheckAlertsAlertArgs{
Name: pulumi.String("TLSTargetCertificateCloseToExpiring"),
Threshold: pulumi.Float64(14),
Period: pulumi.String(""),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Pulumiverse.Grafana;
return await Deployment.RunAsync(() =>
{
var main = new Grafana.SyntheticMonitoring.Check("main", new()
{
Job = "Check Alert Test",
Target = "https://grafana.com",
Enabled = true,
Probes = new[]
{
1,
},
Labels = null,
Settings = new Grafana.SyntheticMonitoring.Inputs.CheckSettingsArgs
{
Http = new Grafana.SyntheticMonitoring.Inputs.CheckSettingsHttpArgs
{
IpVersion = "V4",
Method = "GET",
},
},
});
var mainCheckAlerts = new Grafana.SyntheticMonitoring.CheckAlerts("main", new()
{
CheckId = main.Id,
Alerts = new[]
{
new Grafana.SyntheticMonitoring.Inputs.CheckAlertsAlertArgs
{
Name = "ProbeFailedExecutionsTooHigh",
Threshold = 1,
Period = "15m",
},
new Grafana.SyntheticMonitoring.Inputs.CheckAlertsAlertArgs
{
Name = "TLSTargetCertificateCloseToExpiring",
Threshold = 14,
Period = "",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.syntheticMonitoring.Check;
import com.pulumi.grafana.syntheticMonitoring.CheckArgs;
import com.pulumi.grafana.syntheticMonitoring.inputs.CheckSettingsArgs;
import com.pulumi.grafana.syntheticMonitoring.inputs.CheckSettingsHttpArgs;
import com.pulumi.grafana.syntheticMonitoring.CheckAlerts;
import com.pulumi.grafana.syntheticMonitoring.CheckAlertsArgs;
import com.pulumi.grafana.syntheticMonitoring.inputs.CheckAlertsAlertArgs;
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 main = new Check("main", CheckArgs.builder()
.job("Check Alert Test")
.target("https://grafana.com")
.enabled(true)
.probes(1)
.labels(Map.ofEntries(
))
.settings(CheckSettingsArgs.builder()
.http(CheckSettingsHttpArgs.builder()
.ipVersion("V4")
.method("GET")
.build())
.build())
.build());
var mainCheckAlerts = new CheckAlerts("mainCheckAlerts", CheckAlertsArgs.builder()
.checkId(main.id())
.alerts(
CheckAlertsAlertArgs.builder()
.name("ProbeFailedExecutionsTooHigh")
.threshold(1.0)
.period("15m")
.build(),
CheckAlertsAlertArgs.builder()
.name("TLSTargetCertificateCloseToExpiring")
.threshold(14.0)
.period("")
.build())
.build());
}
}
resources:
main:
type: grafana:syntheticMonitoring:Check
properties:
job: Check Alert Test
target: https://grafana.com
enabled: true
probes:
- 1
labels: {}
settings:
http:
ipVersion: V4
method: GET
mainCheckAlerts:
type: grafana:syntheticMonitoring:CheckAlerts
name: main
properties:
checkId: ${main.id}
alerts:
- name: ProbeFailedExecutionsTooHigh
threshold: 1
period: 15m
- name: TLSTargetCertificateCloseToExpiring
threshold: 14
period: ""
Create CheckAlerts Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CheckAlerts(name: string, args: CheckAlertsArgs, opts?: CustomResourceOptions);
@overload
def CheckAlerts(resource_name: str,
args: CheckAlertsArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CheckAlerts(resource_name: str,
opts: Optional[ResourceOptions] = None,
alerts: Optional[Sequence[CheckAlertsAlertArgs]] = None,
check_id: Optional[int] = None)
func NewCheckAlerts(ctx *Context, name string, args CheckAlertsArgs, opts ...ResourceOption) (*CheckAlerts, error)
public CheckAlerts(string name, CheckAlertsArgs args, CustomResourceOptions? opts = null)
public CheckAlerts(String name, CheckAlertsArgs args)
public CheckAlerts(String name, CheckAlertsArgs args, CustomResourceOptions options)
type: grafana:syntheticMonitoring:CheckAlerts
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 CheckAlertsArgs
- 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 CheckAlertsArgs
- 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 CheckAlertsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CheckAlertsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CheckAlertsArgs
- 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 checkAlertsResource = new Grafana.SyntheticMonitoring.CheckAlerts("checkAlertsResource", new()
{
Alerts = new[]
{
new Grafana.SyntheticMonitoring.Inputs.CheckAlertsAlertArgs
{
Name = "string",
Threshold = 0,
Period = "string",
},
},
CheckId = 0,
});
example, err := syntheticmonitoring.NewCheckAlerts(ctx, "checkAlertsResource", &syntheticmonitoring.CheckAlertsArgs{
Alerts: syntheticmonitoring.CheckAlertsAlertArray{
&syntheticmonitoring.CheckAlertsAlertArgs{
Name: pulumi.String("string"),
Threshold: pulumi.Float64(0),
Period: pulumi.String("string"),
},
},
CheckId: pulumi.Int(0),
})
var checkAlertsResource = new CheckAlerts("checkAlertsResource", CheckAlertsArgs.builder()
.alerts(CheckAlertsAlertArgs.builder()
.name("string")
.threshold(0.0)
.period("string")
.build())
.checkId(0)
.build());
check_alerts_resource = grafana.synthetic_monitoring.CheckAlerts("checkAlertsResource",
alerts=[{
"name": "string",
"threshold": 0,
"period": "string",
}],
check_id=0)
const checkAlertsResource = new grafana.syntheticmonitoring.CheckAlerts("checkAlertsResource", {
alerts: [{
name: "string",
threshold: 0,
period: "string",
}],
checkId: 0,
});
type: grafana:syntheticMonitoring:CheckAlerts
properties:
alerts:
- name: string
period: string
threshold: 0
checkId: 0
CheckAlerts 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 CheckAlerts resource accepts the following input properties:
- Alerts
List<Pulumiverse.
Grafana. Synthetic Monitoring. Inputs. Check Alerts Alert> - List of alerts for the check.
- Check
Id int - The ID of the check to manage alerts for.
- Alerts
[]Check
Alerts Alert Args - List of alerts for the check.
- Check
Id int - The ID of the check to manage alerts for.
- alerts
List<Check
Alerts Alert> - List of alerts for the check.
- check
Id Integer - The ID of the check to manage alerts for.
- alerts
Check
Alerts Alert[] - List of alerts for the check.
- check
Id number - The ID of the check to manage alerts for.
- alerts
Sequence[Check
Alerts Alert Args] - List of alerts for the check.
- check_
id int - The ID of the check to manage alerts for.
- alerts List<Property Map>
- List of alerts for the check.
- check
Id Number - The ID of the check to manage alerts for.
Outputs
All input properties are implicitly available as output properties. Additionally, the CheckAlerts resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing CheckAlerts Resource
Get an existing CheckAlerts 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?: CheckAlertsState, opts?: CustomResourceOptions): CheckAlerts
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
alerts: Optional[Sequence[CheckAlertsAlertArgs]] = None,
check_id: Optional[int] = None) -> CheckAlerts
func GetCheckAlerts(ctx *Context, name string, id IDInput, state *CheckAlertsState, opts ...ResourceOption) (*CheckAlerts, error)
public static CheckAlerts Get(string name, Input<string> id, CheckAlertsState? state, CustomResourceOptions? opts = null)
public static CheckAlerts get(String name, Output<String> id, CheckAlertsState state, CustomResourceOptions options)
resources: _: type: grafana:syntheticMonitoring:CheckAlerts 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.
- Alerts
List<Pulumiverse.
Grafana. Synthetic Monitoring. Inputs. Check Alerts Alert> - List of alerts for the check.
- Check
Id int - The ID of the check to manage alerts for.
- Alerts
[]Check
Alerts Alert Args - List of alerts for the check.
- Check
Id int - The ID of the check to manage alerts for.
- alerts
List<Check
Alerts Alert> - List of alerts for the check.
- check
Id Integer - The ID of the check to manage alerts for.
- alerts
Check
Alerts Alert[] - List of alerts for the check.
- check
Id number - The ID of the check to manage alerts for.
- alerts
Sequence[Check
Alerts Alert Args] - List of alerts for the check.
- check_
id int - The ID of the check to manage alerts for.
- alerts List<Property Map>
- List of alerts for the check.
- check
Id Number - The ID of the check to manage alerts for.
Supporting Types
CheckAlertsAlert, CheckAlertsAlertArgs
Import
$ pulumi import grafana:syntheticMonitoring/checkAlerts:CheckAlerts name "{{ check_id }}"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- grafana pulumiverse/pulumi-grafana
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
grafana
Terraform Provider.