1. Packages
  2. Newrelic Provider
  3. API Docs
  4. plugins
  5. AlertCondition
Viewing docs for New Relic v4.20.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
newrelic logo
Viewing docs for New Relic v4.20.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    New Relic Plugins reached end of life Wednesday June 16, 2021.

    This resource has been removed.

    For more information, click here

    Create AlertCondition Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new AlertCondition(name: string, args: AlertConditionArgs, opts?: CustomResourceOptions);
    @overload
    def AlertCondition(resource_name: str,
                       args: AlertConditionArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def AlertCondition(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       entities: Optional[Sequence[int]] = None,
                       metric: Optional[str] = None,
                       metric_description: Optional[str] = None,
                       plugin_guid: Optional[str] = None,
                       plugin_id: Optional[str] = None,
                       policy_id: Optional[int] = None,
                       terms: Optional[Sequence[AlertConditionTermArgs]] = None,
                       value_function: Optional[str] = None,
                       enabled: Optional[bool] = None,
                       name: Optional[str] = None,
                       runbook_url: Optional[str] = None)
    func NewAlertCondition(ctx *Context, name string, args AlertConditionArgs, opts ...ResourceOption) (*AlertCondition, error)
    public AlertCondition(string name, AlertConditionArgs args, CustomResourceOptions? opts = null)
    public AlertCondition(String name, AlertConditionArgs args)
    public AlertCondition(String name, AlertConditionArgs args, CustomResourceOptions options)
    
    type: newrelic:plugins:AlertCondition
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args AlertConditionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args AlertConditionArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args AlertConditionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlertConditionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlertConditionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var newrelicAlertConditionResource = new NewRelic.Plugins.AlertCondition("newrelicAlertConditionResource", new()
    {
        Entities = new[]
        {
            0,
        },
        Metric = "string",
        MetricDescription = "string",
        PluginGuid = "string",
        PluginId = "string",
        PolicyId = 0,
        Terms = new[]
        {
            new NewRelic.Plugins.Inputs.AlertConditionTermArgs
            {
                Duration = 0,
                Threshold = 0,
                TimeFunction = "string",
                Operator = "string",
                Priority = "string",
            },
        },
        ValueFunction = "string",
        Enabled = false,
        Name = "string",
        RunbookUrl = "string",
    });
    
    example, err := plugins.NewAlertCondition(ctx, "newrelicAlertConditionResource", &plugins.AlertConditionArgs{
    	Entities: pulumi.IntArray{
    		pulumi.Int(0),
    	},
    	Metric:            pulumi.String("string"),
    	MetricDescription: pulumi.String("string"),
    	PluginGuid:        pulumi.String("string"),
    	PluginId:          pulumi.String("string"),
    	PolicyId:          pulumi.Int(0),
    	Terms: plugins.AlertConditionTermArray{
    		&plugins.AlertConditionTermArgs{
    			Duration:     pulumi.Int(0),
    			Threshold:    pulumi.Float64(0),
    			TimeFunction: pulumi.String("string"),
    			Operator:     pulumi.String("string"),
    			Priority:     pulumi.String("string"),
    		},
    	},
    	ValueFunction: pulumi.String("string"),
    	Enabled:       pulumi.Bool(false),
    	Name:          pulumi.String("string"),
    	RunbookUrl:    pulumi.String("string"),
    })
    
    var newrelicAlertConditionResource = new com.pulumi.newrelic.plugins.AlertCondition("newrelicAlertConditionResource", com.pulumi.newrelic.plugins.AlertConditionArgs.builder()
        .entities(0)
        .metric("string")
        .metricDescription("string")
        .pluginGuid("string")
        .pluginId("string")
        .policyId(0)
        .terms(AlertConditionTermArgs.builder()
            .duration(0)
            .threshold(0.0)
            .timeFunction("string")
            .operator("string")
            .priority("string")
            .build())
        .valueFunction("string")
        .enabled(false)
        .name("string")
        .runbookUrl("string")
        .build());
    
    newrelic_alert_condition_resource = newrelic.plugins.AlertCondition("newrelicAlertConditionResource",
        entities=[0],
        metric="string",
        metric_description="string",
        plugin_guid="string",
        plugin_id="string",
        policy_id=0,
        terms=[{
            "duration": 0,
            "threshold": 0,
            "time_function": "string",
            "operator": "string",
            "priority": "string",
        }],
        value_function="string",
        enabled=False,
        name="string",
        runbook_url="string")
    
    const newrelicAlertConditionResource = new newrelic.plugins.AlertCondition("newrelicAlertConditionResource", {
        entities: [0],
        metric: "string",
        metricDescription: "string",
        pluginGuid: "string",
        pluginId: "string",
        policyId: 0,
        terms: [{
            duration: 0,
            threshold: 0,
            timeFunction: "string",
            operator: "string",
            priority: "string",
        }],
        valueFunction: "string",
        enabled: false,
        name: "string",
        runbookUrl: "string",
    });
    
    type: newrelic:plugins:AlertCondition
    properties:
        enabled: false
        entities:
            - 0
        metric: string
        metricDescription: string
        name: string
        pluginGuid: string
        pluginId: string
        policyId: 0
        runbookUrl: string
        terms:
            - duration: 0
              operator: string
              priority: string
              threshold: 0
              timeFunction: string
        valueFunction: string
    

    AlertCondition Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The AlertCondition resource accepts the following input properties:

    Entities List<int>
    The plugin component IDs to target.
    Metric string
    The plugin metric to evaluate.
    MetricDescription string
    The metric description.
    PluginGuid string
    The GUID of the plugin which produces the metric.
    PluginId string
    The ID of the installed plugin instance which produces the metric.
    PolicyId int
    The ID of the policy where this condition should be used.
    Terms List<Pulumi.NewRelic.Plugins.Inputs.AlertConditionTerm>
    ValueFunction string
    The value function to apply to the metric data. One of min, max, average, sample_size, total, or percent.
    Enabled bool
    Whether or not this condition is enabled.
    Name string
    The title of the condition. Must be between 1 and 64 characters, inclusive.
    RunbookUrl string
    Runbook URL to display in notifications.
    Entities []int
    The plugin component IDs to target.
    Metric string
    The plugin metric to evaluate.
    MetricDescription string
    The metric description.
    PluginGuid string
    The GUID of the plugin which produces the metric.
    PluginId string
    The ID of the installed plugin instance which produces the metric.
    PolicyId int
    The ID of the policy where this condition should be used.
    Terms []AlertConditionTermArgs
    ValueFunction string
    The value function to apply to the metric data. One of min, max, average, sample_size, total, or percent.
    Enabled bool
    Whether or not this condition is enabled.
    Name string
    The title of the condition. Must be between 1 and 64 characters, inclusive.
    RunbookUrl string
    Runbook URL to display in notifications.
    entities List<Integer>
    The plugin component IDs to target.
    metric String
    The plugin metric to evaluate.
    metricDescription String
    The metric description.
    pluginGuid String
    The GUID of the plugin which produces the metric.
    pluginId String
    The ID of the installed plugin instance which produces the metric.
    policyId Integer
    The ID of the policy where this condition should be used.
    terms List<AlertConditionTerm>
    valueFunction String
    The value function to apply to the metric data. One of min, max, average, sample_size, total, or percent.
    enabled Boolean
    Whether or not this condition is enabled.
    name String
    The title of the condition. Must be between 1 and 64 characters, inclusive.
    runbookUrl String
    Runbook URL to display in notifications.
    entities number[]
    The plugin component IDs to target.
    metric string
    The plugin metric to evaluate.
    metricDescription string
    The metric description.
    pluginGuid string
    The GUID of the plugin which produces the metric.
    pluginId string
    The ID of the installed plugin instance which produces the metric.
    policyId number
    The ID of the policy where this condition should be used.
    terms AlertConditionTerm[]
    valueFunction string
    The value function to apply to the metric data. One of min, max, average, sample_size, total, or percent.
    enabled boolean
    Whether or not this condition is enabled.
    name string
    The title of the condition. Must be between 1 and 64 characters, inclusive.
    runbookUrl string
    Runbook URL to display in notifications.
    entities Sequence[int]
    The plugin component IDs to target.
    metric str
    The plugin metric to evaluate.
    metric_description str
    The metric description.
    plugin_guid str
    The GUID of the plugin which produces the metric.
    plugin_id str
    The ID of the installed plugin instance which produces the metric.
    policy_id int
    The ID of the policy where this condition should be used.
    terms Sequence[AlertConditionTermArgs]
    value_function str
    The value function to apply to the metric data. One of min, max, average, sample_size, total, or percent.
    enabled bool
    Whether or not this condition is enabled.
    name str
    The title of the condition. Must be between 1 and 64 characters, inclusive.
    runbook_url str
    Runbook URL to display in notifications.
    entities List<Number>
    The plugin component IDs to target.
    metric String
    The plugin metric to evaluate.
    metricDescription String
    The metric description.
    pluginGuid String
    The GUID of the plugin which produces the metric.
    pluginId String
    The ID of the installed plugin instance which produces the metric.
    policyId Number
    The ID of the policy where this condition should be used.
    terms List<Property Map>
    valueFunction String
    The value function to apply to the metric data. One of min, max, average, sample_size, total, or percent.
    enabled Boolean
    Whether or not this condition is enabled.
    name String
    The title of the condition. Must be between 1 and 64 characters, inclusive.
    runbookUrl String
    Runbook URL to display in notifications.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the AlertCondition resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing AlertCondition Resource

    Get an existing AlertCondition resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: AlertConditionState, opts?: CustomResourceOptions): AlertCondition
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            enabled: Optional[bool] = None,
            entities: Optional[Sequence[int]] = None,
            metric: Optional[str] = None,
            metric_description: Optional[str] = None,
            name: Optional[str] = None,
            plugin_guid: Optional[str] = None,
            plugin_id: Optional[str] = None,
            policy_id: Optional[int] = None,
            runbook_url: Optional[str] = None,
            terms: Optional[Sequence[AlertConditionTermArgs]] = None,
            value_function: Optional[str] = None) -> AlertCondition
    func GetAlertCondition(ctx *Context, name string, id IDInput, state *AlertConditionState, opts ...ResourceOption) (*AlertCondition, error)
    public static AlertCondition Get(string name, Input<string> id, AlertConditionState? state, CustomResourceOptions? opts = null)
    public static AlertCondition get(String name, Output<String> id, AlertConditionState state, CustomResourceOptions options)
    resources:  _:    type: newrelic:plugins:AlertCondition    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Enabled bool
    Whether or not this condition is enabled.
    Entities List<int>
    The plugin component IDs to target.
    Metric string
    The plugin metric to evaluate.
    MetricDescription string
    The metric description.
    Name string
    The title of the condition. Must be between 1 and 64 characters, inclusive.
    PluginGuid string
    The GUID of the plugin which produces the metric.
    PluginId string
    The ID of the installed plugin instance which produces the metric.
    PolicyId int
    The ID of the policy where this condition should be used.
    RunbookUrl string
    Runbook URL to display in notifications.
    Terms List<Pulumi.NewRelic.Plugins.Inputs.AlertConditionTerm>
    ValueFunction string
    The value function to apply to the metric data. One of min, max, average, sample_size, total, or percent.
    Enabled bool
    Whether or not this condition is enabled.
    Entities []int
    The plugin component IDs to target.
    Metric string
    The plugin metric to evaluate.
    MetricDescription string
    The metric description.
    Name string
    The title of the condition. Must be between 1 and 64 characters, inclusive.
    PluginGuid string
    The GUID of the plugin which produces the metric.
    PluginId string
    The ID of the installed plugin instance which produces the metric.
    PolicyId int
    The ID of the policy where this condition should be used.
    RunbookUrl string
    Runbook URL to display in notifications.
    Terms []AlertConditionTermArgs
    ValueFunction string
    The value function to apply to the metric data. One of min, max, average, sample_size, total, or percent.
    enabled Boolean
    Whether or not this condition is enabled.
    entities List<Integer>
    The plugin component IDs to target.
    metric String
    The plugin metric to evaluate.
    metricDescription String
    The metric description.
    name String
    The title of the condition. Must be between 1 and 64 characters, inclusive.
    pluginGuid String
    The GUID of the plugin which produces the metric.
    pluginId String
    The ID of the installed plugin instance which produces the metric.
    policyId Integer
    The ID of the policy where this condition should be used.
    runbookUrl String
    Runbook URL to display in notifications.
    terms List<AlertConditionTerm>
    valueFunction String
    The value function to apply to the metric data. One of min, max, average, sample_size, total, or percent.
    enabled boolean
    Whether or not this condition is enabled.
    entities number[]
    The plugin component IDs to target.
    metric string
    The plugin metric to evaluate.
    metricDescription string
    The metric description.
    name string
    The title of the condition. Must be between 1 and 64 characters, inclusive.
    pluginGuid string
    The GUID of the plugin which produces the metric.
    pluginId string
    The ID of the installed plugin instance which produces the metric.
    policyId number
    The ID of the policy where this condition should be used.
    runbookUrl string
    Runbook URL to display in notifications.
    terms AlertConditionTerm[]
    valueFunction string
    The value function to apply to the metric data. One of min, max, average, sample_size, total, or percent.
    enabled bool
    Whether or not this condition is enabled.
    entities Sequence[int]
    The plugin component IDs to target.
    metric str
    The plugin metric to evaluate.
    metric_description str
    The metric description.
    name str
    The title of the condition. Must be between 1 and 64 characters, inclusive.
    plugin_guid str
    The GUID of the plugin which produces the metric.
    plugin_id str
    The ID of the installed plugin instance which produces the metric.
    policy_id int
    The ID of the policy where this condition should be used.
    runbook_url str
    Runbook URL to display in notifications.
    terms Sequence[AlertConditionTermArgs]
    value_function str
    The value function to apply to the metric data. One of min, max, average, sample_size, total, or percent.
    enabled Boolean
    Whether or not this condition is enabled.
    entities List<Number>
    The plugin component IDs to target.
    metric String
    The plugin metric to evaluate.
    metricDescription String
    The metric description.
    name String
    The title of the condition. Must be between 1 and 64 characters, inclusive.
    pluginGuid String
    The GUID of the plugin which produces the metric.
    pluginId String
    The ID of the installed plugin instance which produces the metric.
    policyId Number
    The ID of the policy where this condition should be used.
    runbookUrl String
    Runbook URL to display in notifications.
    terms List<Property Map>
    valueFunction String
    The value function to apply to the metric data. One of min, max, average, sample_size, total, or percent.

    Supporting Types

    AlertConditionTerm, AlertConditionTermArgs

    Duration int
    Threshold double
    TimeFunction string
    Operator string
    Priority string
    Duration int
    Threshold float64
    TimeFunction string
    Operator string
    Priority string
    duration Integer
    threshold Double
    timeFunction String
    operator String
    priority String
    duration number
    threshold number
    timeFunction string
    operator string
    priority string
    duration Number
    threshold Number
    timeFunction String
    operator String
    priority String

    Package Details

    Repository
    New Relic pulumi/pulumi-newrelic
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the newrelic Terraform Provider.
    newrelic logo
    Viewing docs for New Relic v4.20.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.