newrelic.synthetics.AlertCondition
Use this resource to create and manage synthetics alert conditions in New Relic.
NOTE: The newrelic.NrqlAlertCondition resource is preferred for configuring alerts conditions. In most cases feature parity can be achieved with a NRQL query. Other condition types may be deprecated in the future and receive fewer product updates.
Example Usage
using System.Collections.Generic;
using Pulumi;
using NewRelic = Pulumi.NewRelic;
return await Deployment.RunAsync(() =>
{
var foo = new NewRelic.Synthetics.AlertCondition("foo", new()
{
PolicyId = newrelic_alert_policy.Foo.Id,
MonitorId = newrelic_synthetics_monitor.Foo.Id,
RunbookUrl = "https://www.example.com",
});
});
package main
import (
"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic/synthetics"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := synthetics.NewAlertCondition(ctx, "foo", &synthetics.AlertConditionArgs{
PolicyId: pulumi.Any(newrelic_alert_policy.Foo.Id),
MonitorId: pulumi.Any(newrelic_synthetics_monitor.Foo.Id),
RunbookUrl: pulumi.String("https://www.example.com"),
})
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.newrelic.synthetics.AlertCondition;
import com.pulumi.newrelic.synthetics.AlertConditionArgs;
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 foo = new AlertCondition("foo", AlertConditionArgs.builder()
.policyId(newrelic_alert_policy.foo().id())
.monitorId(newrelic_synthetics_monitor.foo().id())
.runbookUrl("https://www.example.com")
.build());
}
}
import pulumi
import pulumi_newrelic as newrelic
foo = newrelic.synthetics.AlertCondition("foo",
policy_id=newrelic_alert_policy["foo"]["id"],
monitor_id=newrelic_synthetics_monitor["foo"]["id"],
runbook_url="https://www.example.com")
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const foo = new newrelic.synthetics.AlertCondition("foo", {
policyId: newrelic_alert_policy.foo.id,
monitorId: newrelic_synthetics_monitor.foo.id,
runbookUrl: "https://www.example.com",
});
resources:
foo:
type: newrelic:synthetics:AlertCondition
properties:
policyId: ${newrelic_alert_policy.foo.id}
monitorId: ${newrelic_synthetics_monitor.foo.id}
runbookUrl: https://www.example.com
Create AlertCondition Resource
new AlertCondition(name: string, args: AlertConditionArgs, opts?: CustomResourceOptions);
@overload
def AlertCondition(resource_name: str,
opts: Optional[ResourceOptions] = None,
enabled: Optional[bool] = None,
monitor_id: Optional[str] = None,
name: Optional[str] = None,
policy_id: Optional[int] = None,
runbook_url: Optional[str] = None)
@overload
def AlertCondition(resource_name: str,
args: AlertConditionArgs,
opts: Optional[ResourceOptions] = None)
func NewAlertCondition(ctx *Context, name string, args AlertConditionArgs, opts ...ResourceOption) (*AlertCondition, error)
public AlertCondition(string name, AlertConditionArgs args, CustomResourceOptions? opts = null)
public AlertCondition(String name, AlertConditionArgs args)
public AlertCondition(String name, AlertConditionArgs args, CustomResourceOptions options)
type: newrelic:synthetics:AlertCondition
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AlertConditionArgs
- 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 AlertConditionArgs
- 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 AlertConditionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AlertConditionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AlertConditionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
AlertCondition 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 AlertCondition resource accepts the following input properties:
- Monitor
Id string The GUID of the Synthetics monitor to be referenced in the alert condition.
- Policy
Id int The ID of the policy where this condition should be used.
- Enabled bool
Set whether to enable the alert condition. Defaults to
true
.- Name string
The title of this condition.
- Runbook
Url string Runbook URL to display in notifications.
- Monitor
Id string The GUID of the Synthetics monitor to be referenced in the alert condition.
- Policy
Id int The ID of the policy where this condition should be used.
- Enabled bool
Set whether to enable the alert condition. Defaults to
true
.- Name string
The title of this condition.
- Runbook
Url string Runbook URL to display in notifications.
- monitor
Id String The GUID of the Synthetics monitor to be referenced in the alert condition.
- policy
Id Integer The ID of the policy where this condition should be used.
- enabled Boolean
Set whether to enable the alert condition. Defaults to
true
.- name String
The title of this condition.
- runbook
Url String Runbook URL to display in notifications.
- monitor
Id string The GUID of the Synthetics monitor to be referenced in the alert condition.
- policy
Id number The ID of the policy where this condition should be used.
- enabled boolean
Set whether to enable the alert condition. Defaults to
true
.- name string
The title of this condition.
- runbook
Url string Runbook URL to display in notifications.
- monitor_
id str The GUID of the Synthetics monitor to be referenced in the alert condition.
- policy_
id int The ID of the policy where this condition should be used.
- enabled bool
Set whether to enable the alert condition. Defaults to
true
.- name str
The title of this condition.
- runbook_
url str Runbook URL to display in notifications.
- monitor
Id String The GUID of the Synthetics monitor to be referenced in the alert condition.
- policy
Id Number The ID of the policy where this condition should be used.
- enabled Boolean
Set whether to enable the alert condition. Defaults to
true
.- name String
The title of this condition.
- runbook
Url String Runbook URL to display in notifications.
Outputs
All input properties are implicitly available as output properties. Additionally, the AlertCondition 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 AlertCondition Resource
Get an existing AlertCondition 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?: AlertConditionState, opts?: CustomResourceOptions): AlertCondition
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
enabled: Optional[bool] = None,
monitor_id: Optional[str] = None,
name: Optional[str] = None,
policy_id: Optional[int] = None,
runbook_url: Optional[str] = None) -> AlertCondition
func GetAlertCondition(ctx *Context, name string, id IDInput, state *AlertConditionState, opts ...ResourceOption) (*AlertCondition, error)
public static AlertCondition Get(string name, Input<string> id, AlertConditionState? state, CustomResourceOptions? opts = null)
public static AlertCondition get(String name, Output<String> id, AlertConditionState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Enabled bool
Set whether to enable the alert condition. Defaults to
true
.- Monitor
Id string The GUID of the Synthetics monitor to be referenced in the alert condition.
- Name string
The title of this condition.
- Policy
Id int The ID of the policy where this condition should be used.
- Runbook
Url string Runbook URL to display in notifications.
- Enabled bool
Set whether to enable the alert condition. Defaults to
true
.- Monitor
Id string The GUID of the Synthetics monitor to be referenced in the alert condition.
- Name string
The title of this condition.
- Policy
Id int The ID of the policy where this condition should be used.
- Runbook
Url string Runbook URL to display in notifications.
- enabled Boolean
Set whether to enable the alert condition. Defaults to
true
.- monitor
Id String The GUID of the Synthetics monitor to be referenced in the alert condition.
- name String
The title of this condition.
- policy
Id Integer The ID of the policy where this condition should be used.
- runbook
Url String Runbook URL to display in notifications.
- enabled boolean
Set whether to enable the alert condition. Defaults to
true
.- monitor
Id string The GUID of the Synthetics monitor to be referenced in the alert condition.
- name string
The title of this condition.
- policy
Id number The ID of the policy where this condition should be used.
- runbook
Url string Runbook URL to display in notifications.
- enabled bool
Set whether to enable the alert condition. Defaults to
true
.- monitor_
id str The GUID of the Synthetics monitor to be referenced in the alert condition.
- name str
The title of this condition.
- policy_
id int The ID of the policy where this condition should be used.
- runbook_
url str Runbook URL to display in notifications.
- enabled Boolean
Set whether to enable the alert condition. Defaults to
true
.- monitor
Id String The GUID of the Synthetics monitor to be referenced in the alert condition.
- name String
The title of this condition.
- policy
Id Number The ID of the policy where this condition should be used.
- runbook
Url String Runbook URL to display in notifications.
Import
Synthetics alert conditions can be imported using a composite ID of <policy_id>:<condition_id>
, e.g.
$ pulumi import newrelic:synthetics/alertCondition:AlertCondition main 12345:67890
Package Details
- Repository
- New Relic pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
newrelic
Terraform Provider.