InfraAlertCondition
Use this resource to create and manage Infrastructure alert conditions in New Relic.
Thresholds
The critical and warning threshold mapping supports the following arguments:
duration- (Required) Identifies the number of minutes the threshold must be passed or met for the alert to trigger. Threshold durations must be between 1 and 60 minutes (inclusive).value- (Optional) Threshold value, computed against thecomparisonoperator. Supported byinfra_metricandinfra_process_runningalert condition types.time_function- (Optional) Indicates if the condition needs to be sustained or to just break the threshold once;allorany. Supported by theinfra_metricalert condition type.
Example Usage
using Pulumi;
using NewRelic = Pulumi.NewRelic;
class MyStack : Stack
{
public MyStack()
{
var foo = new NewRelic.AlertPolicy("foo", new NewRelic.AlertPolicyArgs
{
});
var highDiskUsage = new NewRelic.InfraAlertCondition("highDiskUsage", new NewRelic.InfraAlertConditionArgs
{
PolicyId = foo.Id,
Type = "infra_metric",
Event = "StorageSample",
Select = "diskUsedPercent",
Comparison = "above",
Where = "(`hostname` LIKE '%frontend%')",
Critical = new NewRelic.Inputs.InfraAlertConditionCriticalArgs
{
Duration = 25,
Value = 90,
TimeFunction = "all",
},
Warning = new NewRelic.Inputs.InfraAlertConditionWarningArgs
{
Duration = 10,
Value = 80,
TimeFunction = "all",
},
});
var highDbConnCount = new NewRelic.InfraAlertCondition("highDbConnCount", new NewRelic.InfraAlertConditionArgs
{
PolicyId = foo.Id,
Type = "infra_metric",
Event = "DatastoreSample",
Select = "provider.databaseConnections.Average",
Comparison = "above",
Where = "(`hostname` LIKE '%db%')",
IntegrationProvider = "RdsDbInstance",
Critical = new NewRelic.Inputs.InfraAlertConditionCriticalArgs
{
Duration = 25,
Value = 90,
TimeFunction = "all",
},
});
var processNotRunning = new NewRelic.InfraAlertCondition("processNotRunning", new NewRelic.InfraAlertConditionArgs
{
PolicyId = foo.Id,
Type = "infra_process_running",
Comparison = "equal",
ProcessWhere = "`commandName` = '/usr/bin/ruby'",
Critical = new NewRelic.Inputs.InfraAlertConditionCriticalArgs
{
Duration = 5,
Value = 0,
},
});
var hostNotReporting = new NewRelic.InfraAlertCondition("hostNotReporting", new NewRelic.InfraAlertConditionArgs
{
PolicyId = foo.Id,
Type = "infra_host_not_reporting",
Where = "(`hostname` LIKE '%frontend%')",
Critical = new NewRelic.Inputs.InfraAlertConditionCriticalArgs
{
Duration = 5,
},
});
}
}
Coming soon!
import pulumi
import pulumi_newrelic as newrelic
foo = newrelic.AlertPolicy("foo")
high_disk_usage = newrelic.InfraAlertCondition("highDiskUsage",
policy_id=foo.id,
type="infra_metric",
event="StorageSample",
select="diskUsedPercent",
comparison="above",
where="(`hostname` LIKE '%frontend%')",
critical={
"duration": 25,
"value": 90,
"timeFunction": "all",
},
warning={
"duration": 10,
"value": 80,
"timeFunction": "all",
})
high_db_conn_count = newrelic.InfraAlertCondition("highDbConnCount",
policy_id=foo.id,
type="infra_metric",
event="DatastoreSample",
select="provider.databaseConnections.Average",
comparison="above",
where="(`hostname` LIKE '%db%')",
integration_provider="RdsDbInstance",
critical={
"duration": 25,
"value": 90,
"timeFunction": "all",
})
process_not_running = newrelic.InfraAlertCondition("processNotRunning",
policy_id=foo.id,
type="infra_process_running",
comparison="equal",
process_where="`commandName` = '/usr/bin/ruby'",
critical={
"duration": 5,
"value": 0,
})
host_not_reporting = newrelic.InfraAlertCondition("hostNotReporting",
policy_id=foo.id,
type="infra_host_not_reporting",
where="(`hostname` LIKE '%frontend%')",
critical={
"duration": 5,
})import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";
const foo = new newrelic.AlertPolicy("foo", {});
const highDiskUsage = new newrelic.InfraAlertCondition("highDiskUsage", {
policyId: foo.id,
type: "infra_metric",
event: "StorageSample",
select: "diskUsedPercent",
comparison: "above",
where: `(`hostname` LIKE '%frontend%')`,
critical: {
duration: 25,
value: 90,
timeFunction: "all",
},
warning: {
duration: 10,
value: 80,
timeFunction: "all",
},
});
const highDbConnCount = new newrelic.InfraAlertCondition("highDbConnCount", {
policyId: foo.id,
type: "infra_metric",
event: "DatastoreSample",
select: "provider.databaseConnections.Average",
comparison: "above",
where: `(`hostname` LIKE '%db%')`,
integrationProvider: "RdsDbInstance",
critical: {
duration: 25,
value: 90,
timeFunction: "all",
},
});
const processNotRunning = new newrelic.InfraAlertCondition("processNotRunning", {
policyId: foo.id,
type: "infra_process_running",
comparison: "equal",
processWhere: "`commandName` = '/usr/bin/ruby'",
critical: {
duration: 5,
value: 0,
},
});
const hostNotReporting = new newrelic.InfraAlertCondition("hostNotReporting", {
policyId: foo.id,
type: "infra_host_not_reporting",
where: `(`hostname` LIKE '%frontend%')`,
critical: {
duration: 5,
},
});Create a InfraAlertCondition Resource
new InfraAlertCondition(name: string, args: InfraAlertConditionArgs, opts?: CustomResourceOptions);def InfraAlertCondition(resource_name, opts=None, comparison=None, critical=None, enabled=None, event=None, integration_provider=None, name=None, policy_id=None, process_where=None, runbook_url=None, select=None, type=None, violation_close_timer=None, warning=None, where=None, __props__=None);func NewInfraAlertCondition(ctx *Context, name string, args InfraAlertConditionArgs, opts ...ResourceOption) (*InfraAlertCondition, error)public InfraAlertCondition(string name, InfraAlertConditionArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args InfraAlertConditionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args InfraAlertConditionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args InfraAlertConditionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
InfraAlertCondition Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The InfraAlertCondition resource accepts the following input properties:
- Policy
Id int The ID of the alert policy where this condition should be used.
- Type string
The type of Infrastructure alert condition. Valid values are
infra_process_running,infra_metric, andinfra_host_not_reporting.- Comparison string
The operator used to evaluate the threshold value. Valid values are
above,below, andequal. Supported by theinfra_metricandinfra_process_runningcondition types.- Critical
Pulumi.
New Relic. Inputs. Infra Alert Condition Critical Args Identifies the threshold parameters for opening a critical alert violation. See Thresholds below for details.
- Enabled bool
Whether the condition is turned on or off. Valid values are
trueandfalse. Defaults totrue.- Event string
The metric event; for example,
SystemSampleorStorageSample. Supported by theinfra_metriccondition type.- Integration
Provider string For alerts on integrations, use this instead of
event. Supported by theinfra_metriccondition type.- Name string
The Infrastructure alert condition’s name.
- Process
Where string Any filters applied to processes; for example:
commandName = 'java'. Supported by theinfra_process_runningcondition type.- Runbook
Url string Runbook URL to display in notifications.
- Select string
The attribute name to identify the metric being targeted; for example,
cpuPercent,diskFreePercent, ormemoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for examplediskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by theinfra_metriccondition type.- Violation
Close intTimer Determines how much time will pass before a violation is automatically closed. Setting the time limit to 0 prevents a violation from being force-closed.
- Warning
Pulumi.
New Relic. Inputs. Infra Alert Condition Warning Args Identifies the threshold parameters for opening a warning alert violation. See Thresholds below for details.
- Where string
If applicable, this identifies any Infrastructure host filters used; for example:
hostname LIKE '%cassandra%'.
- Policy
Id int The ID of the alert policy where this condition should be used.
- Type string
The type of Infrastructure alert condition. Valid values are
infra_process_running,infra_metric, andinfra_host_not_reporting.- Comparison string
The operator used to evaluate the threshold value. Valid values are
above,below, andequal. Supported by theinfra_metricandinfra_process_runningcondition types.- Critical
Infra
Alert Condition Critical Identifies the threshold parameters for opening a critical alert violation. See Thresholds below for details.
- Enabled bool
Whether the condition is turned on or off. Valid values are
trueandfalse. Defaults totrue.- Event string
The metric event; for example,
SystemSampleorStorageSample. Supported by theinfra_metriccondition type.- Integration
Provider string For alerts on integrations, use this instead of
event. Supported by theinfra_metriccondition type.- Name string
The Infrastructure alert condition’s name.
- Process
Where string Any filters applied to processes; for example:
commandName = 'java'. Supported by theinfra_process_runningcondition type.- Runbook
Url string Runbook URL to display in notifications.
- Select string
The attribute name to identify the metric being targeted; for example,
cpuPercent,diskFreePercent, ormemoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for examplediskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by theinfra_metriccondition type.- Violation
Close intTimer Determines how much time will pass before a violation is automatically closed. Setting the time limit to 0 prevents a violation from being force-closed.
- Warning
Infra
Alert Condition Warning Identifies the threshold parameters for opening a warning alert violation. See Thresholds below for details.
- Where string
If applicable, this identifies any Infrastructure host filters used; for example:
hostname LIKE '%cassandra%'.
- policy
Id number The ID of the alert policy where this condition should be used.
- type string
The type of Infrastructure alert condition. Valid values are
infra_process_running,infra_metric, andinfra_host_not_reporting.- comparison string
The operator used to evaluate the threshold value. Valid values are
above,below, andequal. Supported by theinfra_metricandinfra_process_runningcondition types.- critical
Infra
Alert Condition Critical Identifies the threshold parameters for opening a critical alert violation. See Thresholds below for details.
- enabled boolean
Whether the condition is turned on or off. Valid values are
trueandfalse. Defaults totrue.- event string
The metric event; for example,
SystemSampleorStorageSample. Supported by theinfra_metriccondition type.- integration
Provider string For alerts on integrations, use this instead of
event. Supported by theinfra_metriccondition type.- name string
The Infrastructure alert condition’s name.
- process
Where string Any filters applied to processes; for example:
commandName = 'java'. Supported by theinfra_process_runningcondition type.- runbook
Url string Runbook URL to display in notifications.
- select string
The attribute name to identify the metric being targeted; for example,
cpuPercent,diskFreePercent, ormemoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for examplediskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by theinfra_metriccondition type.- violation
Close numberTimer Determines how much time will pass before a violation is automatically closed. Setting the time limit to 0 prevents a violation from being force-closed.
- warning
Infra
Alert Condition Warning Identifies the threshold parameters for opening a warning alert violation. See Thresholds below for details.
- where string
If applicable, this identifies any Infrastructure host filters used; for example:
hostname LIKE '%cassandra%'.
- policy_
id float The ID of the alert policy where this condition should be used.
- type str
The type of Infrastructure alert condition. Valid values are
infra_process_running,infra_metric, andinfra_host_not_reporting.- comparison str
The operator used to evaluate the threshold value. Valid values are
above,below, andequal. Supported by theinfra_metricandinfra_process_runningcondition types.- critical
Dict[Infra
Alert Condition Critical] Identifies the threshold parameters for opening a critical alert violation. See Thresholds below for details.
- enabled bool
Whether the condition is turned on or off. Valid values are
trueandfalse. Defaults totrue.- event str
The metric event; for example,
SystemSampleorStorageSample. Supported by theinfra_metriccondition type.- integration_
provider str For alerts on integrations, use this instead of
event. Supported by theinfra_metriccondition type.- name str
The Infrastructure alert condition’s name.
- process_
where str Any filters applied to processes; for example:
commandName = 'java'. Supported by theinfra_process_runningcondition type.- runbook_
url str Runbook URL to display in notifications.
- select str
The attribute name to identify the metric being targeted; for example,
cpuPercent,diskFreePercent, ormemoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for examplediskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by theinfra_metriccondition type.- violation_
close_ floattimer Determines how much time will pass before a violation is automatically closed. Setting the time limit to 0 prevents a violation from being force-closed.
- warning
Dict[Infra
Alert Condition Warning] Identifies the threshold parameters for opening a warning alert violation. See Thresholds below for details.
- where str
If applicable, this identifies any Infrastructure host filters used; for example:
hostname LIKE '%cassandra%'.
Outputs
All input properties are implicitly available as output properties. Additionally, the InfraAlertCondition resource produces the following output properties:
- created_
at float The timestamp the alert condition was created.
- id str
- The provider-assigned unique ID for this managed resource.
- updated_
at float The timestamp the alert condition was last updated.
Look up an Existing InfraAlertCondition Resource
Get an existing InfraAlertCondition 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?: InfraAlertConditionState, opts?: CustomResourceOptions): InfraAlertConditionstatic get(resource_name, id, opts=None, comparison=None, created_at=None, critical=None, enabled=None, event=None, integration_provider=None, name=None, policy_id=None, process_where=None, runbook_url=None, select=None, type=None, updated_at=None, violation_close_timer=None, warning=None, where=None, __props__=None);func GetInfraAlertCondition(ctx *Context, name string, id IDInput, state *InfraAlertConditionState, opts ...ResourceOption) (*InfraAlertCondition, error)public static InfraAlertCondition Get(string name, Input<string> id, InfraAlertConditionState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Comparison string
The operator used to evaluate the threshold value. Valid values are
above,below, andequal. Supported by theinfra_metricandinfra_process_runningcondition types.- Created
At int The timestamp the alert condition was created.
- Critical
Pulumi.
New Relic. Inputs. Infra Alert Condition Critical Args Identifies the threshold parameters for opening a critical alert violation. See Thresholds below for details.
- Enabled bool
Whether the condition is turned on or off. Valid values are
trueandfalse. Defaults totrue.- Event string
The metric event; for example,
SystemSampleorStorageSample. Supported by theinfra_metriccondition type.- Integration
Provider string For alerts on integrations, use this instead of
event. Supported by theinfra_metriccondition type.- Name string
The Infrastructure alert condition’s name.
- Policy
Id int The ID of the alert policy where this condition should be used.
- Process
Where string Any filters applied to processes; for example:
commandName = 'java'. Supported by theinfra_process_runningcondition type.- Runbook
Url string Runbook URL to display in notifications.
- Select string
The attribute name to identify the metric being targeted; for example,
cpuPercent,diskFreePercent, ormemoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for examplediskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by theinfra_metriccondition type.- Type string
The type of Infrastructure alert condition. Valid values are
infra_process_running,infra_metric, andinfra_host_not_reporting.- Updated
At int The timestamp the alert condition was last updated.
- Violation
Close intTimer Determines how much time will pass before a violation is automatically closed. Setting the time limit to 0 prevents a violation from being force-closed.
- Warning
Pulumi.
New Relic. Inputs. Infra Alert Condition Warning Args Identifies the threshold parameters for opening a warning alert violation. See Thresholds below for details.
- Where string
If applicable, this identifies any Infrastructure host filters used; for example:
hostname LIKE '%cassandra%'.
- Comparison string
The operator used to evaluate the threshold value. Valid values are
above,below, andequal. Supported by theinfra_metricandinfra_process_runningcondition types.- Created
At int The timestamp the alert condition was created.
- Critical
Infra
Alert Condition Critical Identifies the threshold parameters for opening a critical alert violation. See Thresholds below for details.
- Enabled bool
Whether the condition is turned on or off. Valid values are
trueandfalse. Defaults totrue.- Event string
The metric event; for example,
SystemSampleorStorageSample. Supported by theinfra_metriccondition type.- Integration
Provider string For alerts on integrations, use this instead of
event. Supported by theinfra_metriccondition type.- Name string
The Infrastructure alert condition’s name.
- Policy
Id int The ID of the alert policy where this condition should be used.
- Process
Where string Any filters applied to processes; for example:
commandName = 'java'. Supported by theinfra_process_runningcondition type.- Runbook
Url string Runbook URL to display in notifications.
- Select string
The attribute name to identify the metric being targeted; for example,
cpuPercent,diskFreePercent, ormemoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for examplediskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by theinfra_metriccondition type.- Type string
The type of Infrastructure alert condition. Valid values are
infra_process_running,infra_metric, andinfra_host_not_reporting.- Updated
At int The timestamp the alert condition was last updated.
- Violation
Close intTimer Determines how much time will pass before a violation is automatically closed. Setting the time limit to 0 prevents a violation from being force-closed.
- Warning
Infra
Alert Condition Warning Identifies the threshold parameters for opening a warning alert violation. See Thresholds below for details.
- Where string
If applicable, this identifies any Infrastructure host filters used; for example:
hostname LIKE '%cassandra%'.
- comparison string
The operator used to evaluate the threshold value. Valid values are
above,below, andequal. Supported by theinfra_metricandinfra_process_runningcondition types.- created
At number The timestamp the alert condition was created.
- critical
Infra
Alert Condition Critical Identifies the threshold parameters for opening a critical alert violation. See Thresholds below for details.
- enabled boolean
Whether the condition is turned on or off. Valid values are
trueandfalse. Defaults totrue.- event string
The metric event; for example,
SystemSampleorStorageSample. Supported by theinfra_metriccondition type.- integration
Provider string For alerts on integrations, use this instead of
event. Supported by theinfra_metriccondition type.- name string
The Infrastructure alert condition’s name.
- policy
Id number The ID of the alert policy where this condition should be used.
- process
Where string Any filters applied to processes; for example:
commandName = 'java'. Supported by theinfra_process_runningcondition type.- runbook
Url string Runbook URL to display in notifications.
- select string
The attribute name to identify the metric being targeted; for example,
cpuPercent,diskFreePercent, ormemoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for examplediskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by theinfra_metriccondition type.- type string
The type of Infrastructure alert condition. Valid values are
infra_process_running,infra_metric, andinfra_host_not_reporting.- updated
At number The timestamp the alert condition was last updated.
- violation
Close numberTimer Determines how much time will pass before a violation is automatically closed. Setting the time limit to 0 prevents a violation from being force-closed.
- warning
Infra
Alert Condition Warning Identifies the threshold parameters for opening a warning alert violation. See Thresholds below for details.
- where string
If applicable, this identifies any Infrastructure host filters used; for example:
hostname LIKE '%cassandra%'.
- comparison str
The operator used to evaluate the threshold value. Valid values are
above,below, andequal. Supported by theinfra_metricandinfra_process_runningcondition types.- created_
at float The timestamp the alert condition was created.
- critical
Dict[Infra
Alert Condition Critical] Identifies the threshold parameters for opening a critical alert violation. See Thresholds below for details.
- enabled bool
Whether the condition is turned on or off. Valid values are
trueandfalse. Defaults totrue.- event str
The metric event; for example,
SystemSampleorStorageSample. Supported by theinfra_metriccondition type.- integration_
provider str For alerts on integrations, use this instead of
event. Supported by theinfra_metriccondition type.- name str
The Infrastructure alert condition’s name.
- policy_
id float The ID of the alert policy where this condition should be used.
- process_
where str Any filters applied to processes; for example:
commandName = 'java'. Supported by theinfra_process_runningcondition type.- runbook_
url str Runbook URL to display in notifications.
- select str
The attribute name to identify the metric being targeted; for example,
cpuPercent,diskFreePercent, ormemoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for examplediskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by theinfra_metriccondition type.- type str
The type of Infrastructure alert condition. Valid values are
infra_process_running,infra_metric, andinfra_host_not_reporting.- updated_
at float The timestamp the alert condition was last updated.
- violation_
close_ floattimer Determines how much time will pass before a violation is automatically closed. Setting the time limit to 0 prevents a violation from being force-closed.
- warning
Dict[Infra
Alert Condition Warning] Identifies the threshold parameters for opening a warning alert violation. See Thresholds below for details.
- where str
If applicable, this identifies any Infrastructure host filters used; for example:
hostname LIKE '%cassandra%'.
Supporting Types
InfraAlertConditionCritical
InfraAlertConditionWarning
Package Details
- Repository
- https://github.com/pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
newrelicTerraform Provider.