newrelic logo
New Relic v5.12.0, May 30 23

newrelic.InfraAlertCondition

Explore with Pulumi AI

Use this resource to create and manage Infrastructure alert conditions in New Relic.

NOTE: This is a legacy resource. The newrelic.NrqlAlertCondition resource is preferred for configuring alerts conditions. In most cases feature parity can be achieved with a NRQL query. This condition type may be deprecated in the future.

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 the comparison operator. Supported by infra_metric and infra_process_running alert condition types.
  • time_function - (Optional) Indicates if the condition needs to be sustained or to just break the threshold once; all or any. Supported by the infra_metric alert condition type.

Tags

Manage infra alert condition tags with newrelic.EntityTags. For up-to-date documentation about the tagging resource, please check newrelic.EntityTags

import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";

const fooAlertPolicy = new newrelic.AlertPolicy("fooAlertPolicy", {});
const fooInfraAlertCondition = new newrelic.InfraAlertCondition("fooInfraAlertCondition", {
    policyId: fooAlertPolicy.id,
    description: "Warning if disk usage goes above 80% and critical alert if goes above 90%",
    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 myConditionEntityTags = new newrelic.EntityTags("myConditionEntityTags", {
    guid: fooInfraAlertCondition.entityGuid,
    tags: [
        {
            key: "my-key",
            values: [
                "my-value",
                "my-other-value",
            ],
        },
        {
            key: "my-key-2",
            values: ["my-value-2"],
        },
    ],
});
import pulumi
import pulumi_newrelic as newrelic

foo_alert_policy = newrelic.AlertPolicy("fooAlertPolicy")
foo_infra_alert_condition = newrelic.InfraAlertCondition("fooInfraAlertCondition",
    policy_id=foo_alert_policy.id,
    description="Warning if disk usage goes above 80% and critical alert if goes above 90%",
    type="infra_metric",
    event="StorageSample",
    select="diskUsedPercent",
    comparison="above",
    where="(hostname LIKE '%frontend%')",
    critical=newrelic.InfraAlertConditionCriticalArgs(
        duration=25,
        value=90,
        time_function="all",
    ),
    warning=newrelic.InfraAlertConditionWarningArgs(
        duration=10,
        value=80,
        time_function="all",
    ))
my_condition_entity_tags = newrelic.EntityTags("myConditionEntityTags",
    guid=foo_infra_alert_condition.entity_guid,
    tags=[
        newrelic.EntityTagsTagArgs(
            key="my-key",
            values=[
                "my-value",
                "my-other-value",
            ],
        ),
        newrelic.EntityTagsTagArgs(
            key="my-key-2",
            values=["my-value-2"],
        ),
    ])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;

return await Deployment.RunAsync(() => 
{
    var fooAlertPolicy = new NewRelic.AlertPolicy("fooAlertPolicy");

    var fooInfraAlertCondition = new NewRelic.InfraAlertCondition("fooInfraAlertCondition", new()
    {
        PolicyId = fooAlertPolicy.Id,
        Description = "Warning if disk usage goes above 80% and critical alert if goes above 90%",
        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 myConditionEntityTags = new NewRelic.EntityTags("myConditionEntityTags", new()
    {
        Guid = fooInfraAlertCondition.EntityGuid,
        Tags = new[]
        {
            new NewRelic.Inputs.EntityTagsTagArgs
            {
                Key = "my-key",
                Values = new[]
                {
                    "my-value",
                    "my-other-value",
                },
            },
            new NewRelic.Inputs.EntityTagsTagArgs
            {
                Key = "my-key-2",
                Values = new[]
                {
                    "my-value-2",
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooAlertPolicy, err := newrelic.NewAlertPolicy(ctx, "fooAlertPolicy", nil)
		if err != nil {
			return err
		}
		fooInfraAlertCondition, err := newrelic.NewInfraAlertCondition(ctx, "fooInfraAlertCondition", &newrelic.InfraAlertConditionArgs{
			PolicyId:    fooAlertPolicy.ID(),
			Description: pulumi.String("Warning if disk usage goes above 80% and critical alert if goes above 90%"),
			Type:        pulumi.String("infra_metric"),
			Event:       pulumi.String("StorageSample"),
			Select:      pulumi.String("diskUsedPercent"),
			Comparison:  pulumi.String("above"),
			Where:       pulumi.String("(hostname LIKE '%frontend%')"),
			Critical: &newrelic.InfraAlertConditionCriticalArgs{
				Duration:     pulumi.Int(25),
				Value:        pulumi.Float64(90),
				TimeFunction: pulumi.String("all"),
			},
			Warning: &newrelic.InfraAlertConditionWarningArgs{
				Duration:     pulumi.Int(10),
				Value:        pulumi.Float64(80),
				TimeFunction: pulumi.String("all"),
			},
		})
		if err != nil {
			return err
		}
		_, err = newrelic.NewEntityTags(ctx, "myConditionEntityTags", &newrelic.EntityTagsArgs{
			Guid: fooInfraAlertCondition.EntityGuid,
			Tags: newrelic.EntityTagsTagArray{
				&newrelic.EntityTagsTagArgs{
					Key: pulumi.String("my-key"),
					Values: pulumi.StringArray{
						pulumi.String("my-value"),
						pulumi.String("my-other-value"),
					},
				},
				&newrelic.EntityTagsTagArgs{
					Key: pulumi.String("my-key-2"),
					Values: pulumi.StringArray{
						pulumi.String("my-value-2"),
					},
				},
			},
		})
		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.AlertPolicy;
import com.pulumi.newrelic.InfraAlertCondition;
import com.pulumi.newrelic.InfraAlertConditionArgs;
import com.pulumi.newrelic.inputs.InfraAlertConditionCriticalArgs;
import com.pulumi.newrelic.inputs.InfraAlertConditionWarningArgs;
import com.pulumi.newrelic.EntityTags;
import com.pulumi.newrelic.EntityTagsArgs;
import com.pulumi.newrelic.inputs.EntityTagsTagArgs;
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 fooAlertPolicy = new AlertPolicy("fooAlertPolicy");

        var fooInfraAlertCondition = new InfraAlertCondition("fooInfraAlertCondition", InfraAlertConditionArgs.builder()        
            .policyId(fooAlertPolicy.id())
            .description("Warning if disk usage goes above 80% and critical alert if goes above 90%")
            .type("infra_metric")
            .event("StorageSample")
            .select("diskUsedPercent")
            .comparison("above")
            .where("(hostname LIKE '%frontend%')")
            .critical(InfraAlertConditionCriticalArgs.builder()
                .duration(25)
                .value(90)
                .timeFunction("all")
                .build())
            .warning(InfraAlertConditionWarningArgs.builder()
                .duration(10)
                .value(80)
                .timeFunction("all")
                .build())
            .build());

        var myConditionEntityTags = new EntityTags("myConditionEntityTags", EntityTagsArgs.builder()        
            .guid(fooInfraAlertCondition.entityGuid())
            .tags(            
                EntityTagsTagArgs.builder()
                    .key("my-key")
                    .values(                    
                        "my-value",
                        "my-other-value")
                    .build(),
                EntityTagsTagArgs.builder()
                    .key("my-key-2")
                    .values("my-value-2")
                    .build())
            .build());

    }
}
resources:
  fooAlertPolicy:
    type: newrelic:AlertPolicy
  fooInfraAlertCondition:
    type: newrelic:InfraAlertCondition
    properties:
      policyId: ${fooAlertPolicy.id}
      description: Warning if disk usage goes above 80% and critical alert if goes above 90%
      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
  myConditionEntityTags:
    type: newrelic:EntityTags
    properties:
      guid: ${fooInfraAlertCondition.entityGuid}
      tags:
        - key: my-key
          values:
            - my-value
            - my-other-value
        - key: my-key-2
          values:
            - my-value-2

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;

return await Deployment.RunAsync(() => 
{
    var foo = new NewRelic.AlertPolicy("foo");

    var highDiskUsage = new NewRelic.InfraAlertCondition("highDiskUsage", new()
    {
        PolicyId = foo.Id,
        Description = "Warning if disk usage goes above 80% and critical alert if goes above 90%",
        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()
    {
        PolicyId = foo.Id,
        Description = "Critical alert when the number of database connections goes above 90",
        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()
    {
        PolicyId = foo.Id,
        Description = "Critical alert when ruby isn't running",
        Type = "infra_process_running",
        Comparison = "equal",
        Where = "hostname = 'web01'",
        ProcessWhere = "commandName = '/usr/bin/ruby'",
        Critical = new NewRelic.Inputs.InfraAlertConditionCriticalArgs
        {
            Duration = 5,
            Value = 0,
        },
    });

    var hostNotReporting = new NewRelic.InfraAlertCondition("hostNotReporting", new()
    {
        PolicyId = foo.Id,
        Description = "Critical alert when the host is not reporting",
        Type = "infra_host_not_reporting",
        Where = "(hostname LIKE '%frontend%')",
        Critical = new NewRelic.Inputs.InfraAlertConditionCriticalArgs
        {
            Duration = 5,
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		foo, err := newrelic.NewAlertPolicy(ctx, "foo", nil)
		if err != nil {
			return err
		}
		_, err = newrelic.NewInfraAlertCondition(ctx, "highDiskUsage", &newrelic.InfraAlertConditionArgs{
			PolicyId:    foo.ID(),
			Description: pulumi.String("Warning if disk usage goes above 80% and critical alert if goes above 90%"),
			Type:        pulumi.String("infra_metric"),
			Event:       pulumi.String("StorageSample"),
			Select:      pulumi.String("diskUsedPercent"),
			Comparison:  pulumi.String("above"),
			Where:       pulumi.String("(hostname LIKE '%frontend%')"),
			Critical: &newrelic.InfraAlertConditionCriticalArgs{
				Duration:     pulumi.Int(25),
				Value:        pulumi.Float64(90),
				TimeFunction: pulumi.String("all"),
			},
			Warning: &newrelic.InfraAlertConditionWarningArgs{
				Duration:     pulumi.Int(10),
				Value:        pulumi.Float64(80),
				TimeFunction: pulumi.String("all"),
			},
		})
		if err != nil {
			return err
		}
		_, err = newrelic.NewInfraAlertCondition(ctx, "highDbConnCount", &newrelic.InfraAlertConditionArgs{
			PolicyId:            foo.ID(),
			Description:         pulumi.String("Critical alert when the number of database connections goes above 90"),
			Type:                pulumi.String("infra_metric"),
			Event:               pulumi.String("DatastoreSample"),
			Select:              pulumi.String("provider.databaseConnections.Average"),
			Comparison:          pulumi.String("above"),
			Where:               pulumi.String("(hostname LIKE '%db%')"),
			IntegrationProvider: pulumi.String("RdsDbInstance"),
			Critical: &newrelic.InfraAlertConditionCriticalArgs{
				Duration:     pulumi.Int(25),
				Value:        pulumi.Float64(90),
				TimeFunction: pulumi.String("all"),
			},
		})
		if err != nil {
			return err
		}
		_, err = newrelic.NewInfraAlertCondition(ctx, "processNotRunning", &newrelic.InfraAlertConditionArgs{
			PolicyId:     foo.ID(),
			Description:  pulumi.String("Critical alert when ruby isn't running"),
			Type:         pulumi.String("infra_process_running"),
			Comparison:   pulumi.String("equal"),
			Where:        pulumi.String("hostname = 'web01'"),
			ProcessWhere: pulumi.String("commandName = '/usr/bin/ruby'"),
			Critical: &newrelic.InfraAlertConditionCriticalArgs{
				Duration: pulumi.Int(5),
				Value:    pulumi.Float64(0),
			},
		})
		if err != nil {
			return err
		}
		_, err = newrelic.NewInfraAlertCondition(ctx, "hostNotReporting", &newrelic.InfraAlertConditionArgs{
			PolicyId:    foo.ID(),
			Description: pulumi.String("Critical alert when the host is not reporting"),
			Type:        pulumi.String("infra_host_not_reporting"),
			Where:       pulumi.String("(hostname LIKE '%frontend%')"),
			Critical: &newrelic.InfraAlertConditionCriticalArgs{
				Duration: pulumi.Int(5),
			},
		})
		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.AlertPolicy;
import com.pulumi.newrelic.InfraAlertCondition;
import com.pulumi.newrelic.InfraAlertConditionArgs;
import com.pulumi.newrelic.inputs.InfraAlertConditionCriticalArgs;
import com.pulumi.newrelic.inputs.InfraAlertConditionWarningArgs;
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 AlertPolicy("foo");

        var highDiskUsage = new InfraAlertCondition("highDiskUsage", InfraAlertConditionArgs.builder()        
            .policyId(foo.id())
            .description("Warning if disk usage goes above 80% and critical alert if goes above 90%")
            .type("infra_metric")
            .event("StorageSample")
            .select("diskUsedPercent")
            .comparison("above")
            .where("(hostname LIKE '%frontend%')")
            .critical(InfraAlertConditionCriticalArgs.builder()
                .duration(25)
                .value(90)
                .timeFunction("all")
                .build())
            .warning(InfraAlertConditionWarningArgs.builder()
                .duration(10)
                .value(80)
                .timeFunction("all")
                .build())
            .build());

        var highDbConnCount = new InfraAlertCondition("highDbConnCount", InfraAlertConditionArgs.builder()        
            .policyId(foo.id())
            .description("Critical alert when the number of database connections goes above 90")
            .type("infra_metric")
            .event("DatastoreSample")
            .select("provider.databaseConnections.Average")
            .comparison("above")
            .where("(hostname LIKE '%db%')")
            .integrationProvider("RdsDbInstance")
            .critical(InfraAlertConditionCriticalArgs.builder()
                .duration(25)
                .value(90)
                .timeFunction("all")
                .build())
            .build());

        var processNotRunning = new InfraAlertCondition("processNotRunning", InfraAlertConditionArgs.builder()        
            .policyId(foo.id())
            .description("Critical alert when ruby isn't running")
            .type("infra_process_running")
            .comparison("equal")
            .where("hostname = 'web01'")
            .processWhere("commandName = '/usr/bin/ruby'")
            .critical(InfraAlertConditionCriticalArgs.builder()
                .duration(5)
                .value(0)
                .build())
            .build());

        var hostNotReporting = new InfraAlertCondition("hostNotReporting", InfraAlertConditionArgs.builder()        
            .policyId(foo.id())
            .description("Critical alert when the host is not reporting")
            .type("infra_host_not_reporting")
            .where("(hostname LIKE '%frontend%')")
            .critical(InfraAlertConditionCriticalArgs.builder()
                .duration(5)
                .build())
            .build());

    }
}
import pulumi
import pulumi_newrelic as newrelic

foo = newrelic.AlertPolicy("foo")
high_disk_usage = newrelic.InfraAlertCondition("highDiskUsage",
    policy_id=foo.id,
    description="Warning if disk usage goes above 80% and critical alert if goes above 90%",
    type="infra_metric",
    event="StorageSample",
    select="diskUsedPercent",
    comparison="above",
    where="(hostname LIKE '%frontend%')",
    critical=newrelic.InfraAlertConditionCriticalArgs(
        duration=25,
        value=90,
        time_function="all",
    ),
    warning=newrelic.InfraAlertConditionWarningArgs(
        duration=10,
        value=80,
        time_function="all",
    ))
high_db_conn_count = newrelic.InfraAlertCondition("highDbConnCount",
    policy_id=foo.id,
    description="Critical alert when the number of database connections goes above 90",
    type="infra_metric",
    event="DatastoreSample",
    select="provider.databaseConnections.Average",
    comparison="above",
    where="(hostname LIKE '%db%')",
    integration_provider="RdsDbInstance",
    critical=newrelic.InfraAlertConditionCriticalArgs(
        duration=25,
        value=90,
        time_function="all",
    ))
process_not_running = newrelic.InfraAlertCondition("processNotRunning",
    policy_id=foo.id,
    description="Critical alert when ruby isn't running",
    type="infra_process_running",
    comparison="equal",
    where="hostname = 'web01'",
    process_where="commandName = '/usr/bin/ruby'",
    critical=newrelic.InfraAlertConditionCriticalArgs(
        duration=5,
        value=0,
    ))
host_not_reporting = newrelic.InfraAlertCondition("hostNotReporting",
    policy_id=foo.id,
    description="Critical alert when the host is not reporting",
    type="infra_host_not_reporting",
    where="(hostname LIKE '%frontend%')",
    critical=newrelic.InfraAlertConditionCriticalArgs(
        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,
    description: "Warning if disk usage goes above 80% and critical alert if goes above 90%",
    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,
    description: "Critical alert when the number of database connections goes above 90",
    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,
    description: "Critical alert when ruby isn't running",
    type: "infra_process_running",
    comparison: "equal",
    where: "hostname = 'web01'",
    processWhere: "commandName = '/usr/bin/ruby'",
    critical: {
        duration: 5,
        value: 0,
    },
});
const hostNotReporting = new newrelic.InfraAlertCondition("hostNotReporting", {
    policyId: foo.id,
    description: "Critical alert when the host is not reporting",
    type: "infra_host_not_reporting",
    where: "(hostname LIKE '%frontend%')",
    critical: {
        duration: 5,
    },
});
resources:
  foo:
    type: newrelic:AlertPolicy
  highDiskUsage:
    type: newrelic:InfraAlertCondition
    properties:
      policyId: ${foo.id}
      description: Warning if disk usage goes above 80% and critical alert if goes above 90%
      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
  highDbConnCount:
    type: newrelic:InfraAlertCondition
    properties:
      policyId: ${foo.id}
      description: Critical alert when the number of database connections goes above 90
      type: infra_metric
      event: DatastoreSample
      select: provider.databaseConnections.Average
      comparison: above
      where: (hostname LIKE '%db%')
      integrationProvider: RdsDbInstance
      critical:
        duration: 25
        value: 90
        timeFunction: all
  processNotRunning:
    type: newrelic:InfraAlertCondition
    properties:
      policyId: ${foo.id}
      description: Critical alert when ruby isn't running
      type: infra_process_running
      comparison: equal
      where: hostname = 'web01'
      processWhere: commandName = '/usr/bin/ruby'
      critical:
        duration: 5
        value: 0
  hostNotReporting:
    type: newrelic:InfraAlertCondition
    properties:
      policyId: ${foo.id}
      description: Critical alert when the host is not reporting
      type: infra_host_not_reporting
      where: (hostname LIKE '%frontend%')
      critical:
        duration: 5

. For up-to-date documentation about the tagging resource, please check newrelic.EntityTags

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using NewRelic = Pulumi.NewRelic;

return await Deployment.RunAsync(() => 
{
    var fooAlertPolicy = new NewRelic.AlertPolicy("fooAlertPolicy");

    var fooInfraAlertCondition = new NewRelic.InfraAlertCondition("fooInfraAlertCondition", new()
    {
        PolicyId = fooAlertPolicy.Id,
        Description = "Warning if disk usage goes above 80% and critical alert if goes above 90%",
        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 myConditionEntityTags = new NewRelic.EntityTags("myConditionEntityTags", new()
    {
        Guid = fooInfraAlertCondition.EntityGuid,
        Tags = new[]
        {
            new NewRelic.Inputs.EntityTagsTagArgs
            {
                Key = "my-key",
                Values = new[]
                {
                    "my-value",
                    "my-other-value",
                },
            },
            new NewRelic.Inputs.EntityTagsTagArgs
            {
                Key = "my-key-2",
                Values = new[]
                {
                    "my-value-2",
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooAlertPolicy, err := newrelic.NewAlertPolicy(ctx, "fooAlertPolicy", nil)
		if err != nil {
			return err
		}
		fooInfraAlertCondition, err := newrelic.NewInfraAlertCondition(ctx, "fooInfraAlertCondition", &newrelic.InfraAlertConditionArgs{
			PolicyId:    fooAlertPolicy.ID(),
			Description: pulumi.String("Warning if disk usage goes above 80% and critical alert if goes above 90%"),
			Type:        pulumi.String("infra_metric"),
			Event:       pulumi.String("StorageSample"),
			Select:      pulumi.String("diskUsedPercent"),
			Comparison:  pulumi.String("above"),
			Where:       pulumi.String("(hostname LIKE '%frontend%')"),
			Critical: &newrelic.InfraAlertConditionCriticalArgs{
				Duration:     pulumi.Int(25),
				Value:        pulumi.Float64(90),
				TimeFunction: pulumi.String("all"),
			},
			Warning: &newrelic.InfraAlertConditionWarningArgs{
				Duration:     pulumi.Int(10),
				Value:        pulumi.Float64(80),
				TimeFunction: pulumi.String("all"),
			},
		})
		if err != nil {
			return err
		}
		_, err = newrelic.NewEntityTags(ctx, "myConditionEntityTags", &newrelic.EntityTagsArgs{
			Guid: fooInfraAlertCondition.EntityGuid,
			Tags: newrelic.EntityTagsTagArray{
				&newrelic.EntityTagsTagArgs{
					Key: pulumi.String("my-key"),
					Values: pulumi.StringArray{
						pulumi.String("my-value"),
						pulumi.String("my-other-value"),
					},
				},
				&newrelic.EntityTagsTagArgs{
					Key: pulumi.String("my-key-2"),
					Values: pulumi.StringArray{
						pulumi.String("my-value-2"),
					},
				},
			},
		})
		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.AlertPolicy;
import com.pulumi.newrelic.InfraAlertCondition;
import com.pulumi.newrelic.InfraAlertConditionArgs;
import com.pulumi.newrelic.inputs.InfraAlertConditionCriticalArgs;
import com.pulumi.newrelic.inputs.InfraAlertConditionWarningArgs;
import com.pulumi.newrelic.EntityTags;
import com.pulumi.newrelic.EntityTagsArgs;
import com.pulumi.newrelic.inputs.EntityTagsTagArgs;
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 fooAlertPolicy = new AlertPolicy("fooAlertPolicy");

        var fooInfraAlertCondition = new InfraAlertCondition("fooInfraAlertCondition", InfraAlertConditionArgs.builder()        
            .policyId(fooAlertPolicy.id())
            .description("Warning if disk usage goes above 80% and critical alert if goes above 90%")
            .type("infra_metric")
            .event("StorageSample")
            .select("diskUsedPercent")
            .comparison("above")
            .where("(hostname LIKE '%frontend%')")
            .critical(InfraAlertConditionCriticalArgs.builder()
                .duration(25)
                .value(90)
                .timeFunction("all")
                .build())
            .warning(InfraAlertConditionWarningArgs.builder()
                .duration(10)
                .value(80)
                .timeFunction("all")
                .build())
            .build());

        var myConditionEntityTags = new EntityTags("myConditionEntityTags", EntityTagsArgs.builder()        
            .guid(fooInfraAlertCondition.entityGuid())
            .tags(            
                EntityTagsTagArgs.builder()
                    .key("my-key")
                    .values(                    
                        "my-value",
                        "my-other-value")
                    .build(),
                EntityTagsTagArgs.builder()
                    .key("my-key-2")
                    .values("my-value-2")
                    .build())
            .build());

    }
}
import pulumi
import pulumi_newrelic as newrelic

foo_alert_policy = newrelic.AlertPolicy("fooAlertPolicy")
foo_infra_alert_condition = newrelic.InfraAlertCondition("fooInfraAlertCondition",
    policy_id=foo_alert_policy.id,
    description="Warning if disk usage goes above 80% and critical alert if goes above 90%",
    type="infra_metric",
    event="StorageSample",
    select="diskUsedPercent",
    comparison="above",
    where="(hostname LIKE '%frontend%')",
    critical=newrelic.InfraAlertConditionCriticalArgs(
        duration=25,
        value=90,
        time_function="all",
    ),
    warning=newrelic.InfraAlertConditionWarningArgs(
        duration=10,
        value=80,
        time_function="all",
    ))
my_condition_entity_tags = newrelic.EntityTags("myConditionEntityTags",
    guid=foo_infra_alert_condition.entity_guid,
    tags=[
        newrelic.EntityTagsTagArgs(
            key="my-key",
            values=[
                "my-value",
                "my-other-value",
            ],
        ),
        newrelic.EntityTagsTagArgs(
            key="my-key-2",
            values=["my-value-2"],
        ),
    ])
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";

const fooAlertPolicy = new newrelic.AlertPolicy("fooAlertPolicy", {});
const fooInfraAlertCondition = new newrelic.InfraAlertCondition("fooInfraAlertCondition", {
    policyId: fooAlertPolicy.id,
    description: "Warning if disk usage goes above 80% and critical alert if goes above 90%",
    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 myConditionEntityTags = new newrelic.EntityTags("myConditionEntityTags", {
    guid: fooInfraAlertCondition.entityGuid,
    tags: [
        {
            key: "my-key",
            values: [
                "my-value",
                "my-other-value",
            ],
        },
        {
            key: "my-key-2",
            values: ["my-value-2"],
        },
    ],
});
resources:
  fooAlertPolicy:
    type: newrelic:AlertPolicy
  fooInfraAlertCondition:
    type: newrelic:InfraAlertCondition
    properties:
      policyId: ${fooAlertPolicy.id}
      description: Warning if disk usage goes above 80% and critical alert if goes above 90%
      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
  myConditionEntityTags:
    type: newrelic:EntityTags
    properties:
      guid: ${fooInfraAlertCondition.entityGuid}
      tags:
        - key: my-key
          values:
            - my-value
            - my-other-value
        - key: my-key-2
          values:
            - my-value-2

Create InfraAlertCondition Resource

new InfraAlertCondition(name: string, args: InfraAlertConditionArgs, opts?: CustomResourceOptions);
@overload
def InfraAlertCondition(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        comparison: Optional[str] = None,
                        critical: Optional[InfraAlertConditionCriticalArgs] = None,
                        description: Optional[str] = None,
                        enabled: Optional[bool] = None,
                        event: Optional[str] = None,
                        integration_provider: Optional[str] = None,
                        name: Optional[str] = None,
                        policy_id: Optional[int] = None,
                        process_where: Optional[str] = None,
                        runbook_url: Optional[str] = None,
                        select: Optional[str] = None,
                        type: Optional[str] = None,
                        violation_close_timer: Optional[int] = None,
                        warning: Optional[InfraAlertConditionWarningArgs] = None,
                        where: Optional[str] = None)
@overload
def InfraAlertCondition(resource_name: str,
                        args: InfraAlertConditionArgs,
                        opts: Optional[ResourceOptions] = None)
func NewInfraAlertCondition(ctx *Context, name string, args InfraAlertConditionArgs, opts ...ResourceOption) (*InfraAlertCondition, error)
public InfraAlertCondition(string name, InfraAlertConditionArgs args, CustomResourceOptions? opts = null)
public InfraAlertCondition(String name, InfraAlertConditionArgs args)
public InfraAlertCondition(String name, InfraAlertConditionArgs args, CustomResourceOptions options)
type: newrelic:InfraAlertCondition
properties: # The arguments to resource properties.
options: # 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.
resource_name str
The unique name of the resource.
args InfraAlertConditionArgs
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 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.
name String
The unique name of the resource.
args InfraAlertConditionArgs
The arguments to resource properties.
options 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 Architecture and Concepts docs.

Inputs

The InfraAlertCondition resource accepts the following input properties:

PolicyId 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, and infra_host_not_reporting.

Comparison string

The operator used to evaluate the threshold value. Valid values are above, below, and equal. Supported by the infra_metric and infra_process_running condition types.

Critical Pulumi.NewRelic.Inputs.InfraAlertConditionCriticalArgs

Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.

Description string

The description of the Infrastructure alert condition.

Enabled bool

Whether the condition is turned on or off. Valid values are true and false. Defaults to true.

Event string

The metric event; for example, SystemSample or StorageSample. Supported by the infra_metric condition type.

IntegrationProvider string

For alerts on integrations, use this instead of event. Supported by the infra_metric condition type.

Name string

The Infrastructure alert condition's name.

ProcessWhere string

Any filters applied to processes; for example: commandName = 'java'. Required by the infra_process_running condition type.

RunbookUrl string

Runbook URL to display in notifications.

Select string

The attribute name to identify the metric being targeted; for example, cpuPercent, diskFreePercent, or memoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for example diskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by the infra_metric condition type.

ViolationCloseTimer int

Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are 1 2 4 8 12 24 48 72. Defaults to 24. If 0 is provided, default of 24 is used and will have configuration drift during the apply phase until a valid value is provided.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
    }
}
{}
Warning Pulumi.NewRelic.Inputs.InfraAlertConditionWarningArgs

Identifies the threshold parameters for opening a warning alert incident. See Thresholds below for details.

Where string

If applicable, this identifies any Infrastructure host filters used; for example: hostname LIKE '%cassandra%'.

PolicyId 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, and infra_host_not_reporting.

Comparison string

The operator used to evaluate the threshold value. Valid values are above, below, and equal. Supported by the infra_metric and infra_process_running condition types.

Critical InfraAlertConditionCriticalArgs

Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.

Description string

The description of the Infrastructure alert condition.

Enabled bool

Whether the condition is turned on or off. Valid values are true and false. Defaults to true.

Event string

The metric event; for example, SystemSample or StorageSample. Supported by the infra_metric condition type.

IntegrationProvider string

For alerts on integrations, use this instead of event. Supported by the infra_metric condition type.

Name string

The Infrastructure alert condition's name.

ProcessWhere string

Any filters applied to processes; for example: commandName = 'java'. Required by the infra_process_running condition type.

RunbookUrl string

Runbook URL to display in notifications.

Select string

The attribute name to identify the metric being targeted; for example, cpuPercent, diskFreePercent, or memoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for example diskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by the infra_metric condition type.

ViolationCloseTimer int

Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are 1 2 4 8 12 24 48 72. Defaults to 24. If 0 is provided, default of 24 is used and will have configuration drift during the apply phase until a valid value is provided.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
    }
}
{}
Warning InfraAlertConditionWarningArgs

Identifies the threshold parameters for opening a warning alert incident. See Thresholds below for details.

Where string

If applicable, this identifies any Infrastructure host filters used; for example: hostname LIKE '%cassandra%'.

policyId Integer

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, and infra_host_not_reporting.

comparison String

The operator used to evaluate the threshold value. Valid values are above, below, and equal. Supported by the infra_metric and infra_process_running condition types.

critical InfraAlertConditionCriticalArgs

Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.

description String

The description of the Infrastructure alert condition.

enabled Boolean

Whether the condition is turned on or off. Valid values are true and false. Defaults to true.

event String

The metric event; for example, SystemSample or StorageSample. Supported by the infra_metric condition type.

integrationProvider String

For alerts on integrations, use this instead of event. Supported by the infra_metric condition type.

name String

The Infrastructure alert condition's name.

processWhere String

Any filters applied to processes; for example: commandName = 'java'. Required by the infra_process_running condition type.

runbookUrl String

Runbook URL to display in notifications.

select String

The attribute name to identify the metric being targeted; for example, cpuPercent, diskFreePercent, or memoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for example diskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by the infra_metric condition type.

violationCloseTimer Integer

Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are 1 2 4 8 12 24 48 72. Defaults to 24. If 0 is provided, default of 24 is used and will have configuration drift during the apply phase until a valid value is provided.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
    }
}
{}
warning InfraAlertConditionWarningArgs

Identifies the threshold parameters for opening a warning alert incident. See Thresholds below for details.

where String

If applicable, this identifies any Infrastructure host filters used; for example: hostname LIKE '%cassandra%'.

policyId 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, and infra_host_not_reporting.

comparison string

The operator used to evaluate the threshold value. Valid values are above, below, and equal. Supported by the infra_metric and infra_process_running condition types.

critical InfraAlertConditionCriticalArgs

Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.

description string

The description of the Infrastructure alert condition.

enabled boolean

Whether the condition is turned on or off. Valid values are true and false. Defaults to true.

event string

The metric event; for example, SystemSample or StorageSample. Supported by the infra_metric condition type.

integrationProvider string

For alerts on integrations, use this instead of event. Supported by the infra_metric condition type.

name string

The Infrastructure alert condition's name.

processWhere string

Any filters applied to processes; for example: commandName = 'java'. Required by the infra_process_running condition type.

runbookUrl string

Runbook URL to display in notifications.

select string

The attribute name to identify the metric being targeted; for example, cpuPercent, diskFreePercent, or memoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for example diskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by the infra_metric condition type.

violationCloseTimer number

Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are 1 2 4 8 12 24 48 72. Defaults to 24. If 0 is provided, default of 24 is used and will have configuration drift during the apply phase until a valid value is provided.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
    }
}
{}
warning InfraAlertConditionWarningArgs

Identifies the threshold parameters for opening a warning alert incident. 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 str

The type of Infrastructure alert condition. Valid values are infra_process_running, infra_metric, and infra_host_not_reporting.

comparison str

The operator used to evaluate the threshold value. Valid values are above, below, and equal. Supported by the infra_metric and infra_process_running condition types.

critical InfraAlertConditionCriticalArgs

Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.

description str

The description of the Infrastructure alert condition.

enabled bool

Whether the condition is turned on or off. Valid values are true and false. Defaults to true.

event str

The metric event; for example, SystemSample or StorageSample. Supported by the infra_metric condition type.

integration_provider str

For alerts on integrations, use this instead of event. Supported by the infra_metric condition type.

name str

The Infrastructure alert condition's name.

process_where str

Any filters applied to processes; for example: commandName = 'java'. Required by the infra_process_running condition 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, or memoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for example diskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by the infra_metric condition type.

violation_close_timer int

Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are 1 2 4 8 12 24 48 72. Defaults to 24. If 0 is provided, default of 24 is used and will have configuration drift during the apply phase until a valid value is provided.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
    }
}
{}
warning InfraAlertConditionWarningArgs

Identifies the threshold parameters for opening a warning alert incident. See Thresholds below for details.

where str

If applicable, this identifies any Infrastructure host filters used; for example: hostname LIKE '%cassandra%'.

policyId 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, and infra_host_not_reporting.

comparison String

The operator used to evaluate the threshold value. Valid values are above, below, and equal. Supported by the infra_metric and infra_process_running condition types.

critical Property Map

Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.

description String

The description of the Infrastructure alert condition.

enabled Boolean

Whether the condition is turned on or off. Valid values are true and false. Defaults to true.

event String

The metric event; for example, SystemSample or StorageSample. Supported by the infra_metric condition type.

integrationProvider String

For alerts on integrations, use this instead of event. Supported by the infra_metric condition type.

name String

The Infrastructure alert condition's name.

processWhere String

Any filters applied to processes; for example: commandName = 'java'. Required by the infra_process_running condition type.

runbookUrl String

Runbook URL to display in notifications.

select String

The attribute name to identify the metric being targeted; for example, cpuPercent, diskFreePercent, or memoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for example diskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by the infra_metric condition type.

violationCloseTimer Number

Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are 1 2 4 8 12 24 48 72. Defaults to 24. If 0 is provided, default of 24 is used and will have configuration drift during the apply phase until a valid value is provided.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
    }
}
{}
warning Property Map

Identifies the threshold parameters for opening a warning alert incident. See Thresholds below for details.

where String

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:

CreatedAt int

The timestamp the alert condition was created.

EntityGuid string

The unique entity identifier of the condition in New Relic.

Id string

The provider-assigned unique ID for this managed resource.

UpdatedAt int

The timestamp the alert condition was last updated.

CreatedAt int

The timestamp the alert condition was created.

EntityGuid string

The unique entity identifier of the condition in New Relic.

Id string

The provider-assigned unique ID for this managed resource.

UpdatedAt int

The timestamp the alert condition was last updated.

createdAt Integer

The timestamp the alert condition was created.

entityGuid String

The unique entity identifier of the condition in New Relic.

id String

The provider-assigned unique ID for this managed resource.

updatedAt Integer

The timestamp the alert condition was last updated.

createdAt number

The timestamp the alert condition was created.

entityGuid string

The unique entity identifier of the condition in New Relic.

id string

The provider-assigned unique ID for this managed resource.

updatedAt number

The timestamp the alert condition was last updated.

created_at int

The timestamp the alert condition was created.

entity_guid str

The unique entity identifier of the condition in New Relic.

id str

The provider-assigned unique ID for this managed resource.

updated_at int

The timestamp the alert condition was last updated.

createdAt Number

The timestamp the alert condition was created.

entityGuid String

The unique entity identifier of the condition in New Relic.

id String

The provider-assigned unique ID for this managed resource.

updatedAt Number

The timestamp the alert condition was last updated.

Look up 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): InfraAlertCondition
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        comparison: Optional[str] = None,
        created_at: Optional[int] = None,
        critical: Optional[InfraAlertConditionCriticalArgs] = None,
        description: Optional[str] = None,
        enabled: Optional[bool] = None,
        entity_guid: Optional[str] = None,
        event: Optional[str] = None,
        integration_provider: Optional[str] = None,
        name: Optional[str] = None,
        policy_id: Optional[int] = None,
        process_where: Optional[str] = None,
        runbook_url: Optional[str] = None,
        select: Optional[str] = None,
        type: Optional[str] = None,
        updated_at: Optional[int] = None,
        violation_close_timer: Optional[int] = None,
        warning: Optional[InfraAlertConditionWarningArgs] = None,
        where: Optional[str] = None) -> InfraAlertCondition
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)
public static InfraAlertCondition get(String name, Output<String> id, InfraAlertConditionState 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.
The following state arguments are supported:
Comparison string

The operator used to evaluate the threshold value. Valid values are above, below, and equal. Supported by the infra_metric and infra_process_running condition types.

CreatedAt int

The timestamp the alert condition was created.

Critical Pulumi.NewRelic.Inputs.InfraAlertConditionCriticalArgs

Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.

Description string

The description of the Infrastructure alert condition.

Enabled bool

Whether the condition is turned on or off. Valid values are true and false. Defaults to true.

EntityGuid string

The unique entity identifier of the condition in New Relic.

Event string

The metric event; for example, SystemSample or StorageSample. Supported by the infra_metric condition type.

IntegrationProvider string

For alerts on integrations, use this instead of event. Supported by the infra_metric condition type.

Name string

The Infrastructure alert condition's name.

PolicyId int

The ID of the alert policy where this condition should be used.

ProcessWhere string

Any filters applied to processes; for example: commandName = 'java'. Required by the infra_process_running condition type.

RunbookUrl string

Runbook URL to display in notifications.

Select string

The attribute name to identify the metric being targeted; for example, cpuPercent, diskFreePercent, or memoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for example diskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by the infra_metric condition type.

Type string

The type of Infrastructure alert condition. Valid values are infra_process_running, infra_metric, and infra_host_not_reporting.

UpdatedAt int

The timestamp the alert condition was last updated.

ViolationCloseTimer int

Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are 1 2 4 8 12 24 48 72. Defaults to 24. If 0 is provided, default of 24 is used and will have configuration drift during the apply phase until a valid value is provided.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
    }
}
{}
Warning Pulumi.NewRelic.Inputs.InfraAlertConditionWarningArgs

Identifies the threshold parameters for opening a warning alert incident. 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, and equal. Supported by the infra_metric and infra_process_running condition types.

CreatedAt int

The timestamp the alert condition was created.

Critical InfraAlertConditionCriticalArgs

Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.

Description string

The description of the Infrastructure alert condition.

Enabled bool

Whether the condition is turned on or off. Valid values are true and false. Defaults to true.

EntityGuid string

The unique entity identifier of the condition in New Relic.

Event string

The metric event; for example, SystemSample or StorageSample. Supported by the infra_metric condition type.

IntegrationProvider string

For alerts on integrations, use this instead of event. Supported by the infra_metric condition type.

Name string

The Infrastructure alert condition's name.

PolicyId int

The ID of the alert policy where this condition should be used.

ProcessWhere string

Any filters applied to processes; for example: commandName = 'java'. Required by the infra_process_running condition type.

RunbookUrl string

Runbook URL to display in notifications.

Select string

The attribute name to identify the metric being targeted; for example, cpuPercent, diskFreePercent, or memoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for example diskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by the infra_metric condition type.

Type string

The type of Infrastructure alert condition. Valid values are infra_process_running, infra_metric, and infra_host_not_reporting.

UpdatedAt int

The timestamp the alert condition was last updated.

ViolationCloseTimer int

Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are 1 2 4 8 12 24 48 72. Defaults to 24. If 0 is provided, default of 24 is used and will have configuration drift during the apply phase until a valid value is provided.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
    }
}
{}
Warning InfraAlertConditionWarningArgs

Identifies the threshold parameters for opening a warning alert incident. 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, and equal. Supported by the infra_metric and infra_process_running condition types.

createdAt Integer

The timestamp the alert condition was created.

critical InfraAlertConditionCriticalArgs

Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.

description String

The description of the Infrastructure alert condition.

enabled Boolean

Whether the condition is turned on or off. Valid values are true and false. Defaults to true.

entityGuid String

The unique entity identifier of the condition in New Relic.

event String

The metric event; for example, SystemSample or StorageSample. Supported by the infra_metric condition type.

integrationProvider String

For alerts on integrations, use this instead of event. Supported by the infra_metric condition type.

name String

The Infrastructure alert condition's name.

policyId Integer

The ID of the alert policy where this condition should be used.

processWhere String

Any filters applied to processes; for example: commandName = 'java'. Required by the infra_process_running condition type.

runbookUrl String

Runbook URL to display in notifications.

select String

The attribute name to identify the metric being targeted; for example, cpuPercent, diskFreePercent, or memoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for example diskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by the infra_metric condition type.

type String

The type of Infrastructure alert condition. Valid values are infra_process_running, infra_metric, and infra_host_not_reporting.

updatedAt Integer

The timestamp the alert condition was last updated.

violationCloseTimer Integer

Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are 1 2 4 8 12 24 48 72. Defaults to 24. If 0 is provided, default of 24 is used and will have configuration drift during the apply phase until a valid value is provided.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
    }
}
{}
warning InfraAlertConditionWarningArgs

Identifies the threshold parameters for opening a warning alert incident. 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, and equal. Supported by the infra_metric and infra_process_running condition types.

createdAt number

The timestamp the alert condition was created.

critical InfraAlertConditionCriticalArgs

Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.

description string

The description of the Infrastructure alert condition.

enabled boolean

Whether the condition is turned on or off. Valid values are true and false. Defaults to true.

entityGuid string

The unique entity identifier of the condition in New Relic.

event string

The metric event; for example, SystemSample or StorageSample. Supported by the infra_metric condition type.

integrationProvider string

For alerts on integrations, use this instead of event. Supported by the infra_metric condition type.

name string

The Infrastructure alert condition's name.

policyId number

The ID of the alert policy where this condition should be used.

processWhere string

Any filters applied to processes; for example: commandName = 'java'. Required by the infra_process_running condition type.

runbookUrl string

Runbook URL to display in notifications.

select string

The attribute name to identify the metric being targeted; for example, cpuPercent, diskFreePercent, or memoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for example diskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by the infra_metric condition type.

type string

The type of Infrastructure alert condition. Valid values are infra_process_running, infra_metric, and infra_host_not_reporting.

updatedAt number

The timestamp the alert condition was last updated.

violationCloseTimer number

Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are 1 2 4 8 12 24 48 72. Defaults to 24. If 0 is provided, default of 24 is used and will have configuration drift during the apply phase until a valid value is provided.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
    }
}
{}
warning InfraAlertConditionWarningArgs

Identifies the threshold parameters for opening a warning alert incident. 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, and equal. Supported by the infra_metric and infra_process_running condition types.

created_at int

The timestamp the alert condition was created.

critical InfraAlertConditionCriticalArgs

Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.

description str

The description of the Infrastructure alert condition.

enabled bool

Whether the condition is turned on or off. Valid values are true and false. Defaults to true.

entity_guid str

The unique entity identifier of the condition in New Relic.

event str

The metric event; for example, SystemSample or StorageSample. Supported by the infra_metric condition type.

integration_provider str

For alerts on integrations, use this instead of event. Supported by the infra_metric condition type.

name str

The Infrastructure alert condition's name.

policy_id int

The ID of the alert policy where this condition should be used.

process_where str

Any filters applied to processes; for example: commandName = 'java'. Required by the infra_process_running condition 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, or memoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for example diskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by the infra_metric condition type.

type str

The type of Infrastructure alert condition. Valid values are infra_process_running, infra_metric, and infra_host_not_reporting.

updated_at int

The timestamp the alert condition was last updated.

violation_close_timer int

Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are 1 2 4 8 12 24 48 72. Defaults to 24. If 0 is provided, default of 24 is used and will have configuration drift during the apply phase until a valid value is provided.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
    }
}
{}
warning InfraAlertConditionWarningArgs

Identifies the threshold parameters for opening a warning alert incident. See Thresholds below for details.

where str

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, and equal. Supported by the infra_metric and infra_process_running condition types.

createdAt Number

The timestamp the alert condition was created.

critical Property Map

Identifies the threshold parameters for opening a critical alert incident. See Thresholds below for details.

description String

The description of the Infrastructure alert condition.

enabled Boolean

Whether the condition is turned on or off. Valid values are true and false. Defaults to true.

entityGuid String

The unique entity identifier of the condition in New Relic.

event String

The metric event; for example, SystemSample or StorageSample. Supported by the infra_metric condition type.

integrationProvider String

For alerts on integrations, use this instead of event. Supported by the infra_metric condition type.

name String

The Infrastructure alert condition's name.

policyId Number

The ID of the alert policy where this condition should be used.

processWhere String

Any filters applied to processes; for example: commandName = 'java'. Required by the infra_process_running condition type.

runbookUrl String

Runbook URL to display in notifications.

select String

The attribute name to identify the metric being targeted; for example, cpuPercent, diskFreePercent, or memoryResidentSizeBytes. The underlying API will automatically populate this value for Infrastructure integrations (for example diskFreePercent), so make sure to explicitly include this value to avoid diff issues. Supported by the infra_metric condition type.

type String

The type of Infrastructure alert condition. Valid values are infra_process_running, infra_metric, and infra_host_not_reporting.

updatedAt Number

The timestamp the alert condition was last updated.

violationCloseTimer Number

Determines how much time will pass (in hours) before an incident is automatically closed. Valid values are 1 2 4 8 12 24 48 72. Defaults to 24. If 0 is provided, default of 24 is used and will have configuration drift during the apply phase until a valid value is provided.

import * as pulumi from "@pulumi/pulumi";
import pulumi
using System.Collections.Generic;
using System.Linq;
using Pulumi;

return await Deployment.RunAsync(() => { });

package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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) {
    }
}
{}
warning Property Map

Identifies the threshold parameters for opening a warning alert incident. See Thresholds below for details.

where String

If applicable, this identifies any Infrastructure host filters used; for example: hostname LIKE '%cassandra%'.

Supporting Types

InfraAlertConditionCritical

Duration int
TimeFunction string
Value double
Duration int
TimeFunction string
Value float64
duration Integer
timeFunction String
value Double
duration number
timeFunction string
value number
duration Number
timeFunction String
value Number

InfraAlertConditionWarning

Duration int
TimeFunction string
Value double
Duration int
TimeFunction string
Value float64
duration Integer
timeFunction String
value Double
duration number
timeFunction string
value number
duration Number
timeFunction String
value Number

Import

Infrastructure alert conditions can be imported using a composite ID of <policy_id>:<condition_id>, e.g.

 $ pulumi import newrelic:index/infraAlertCondition:InfraAlertCondition 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.