1. Packages
  2. Datadog Provider
  3. API Docs
  4. MonitorNotificationRule
Datadog v4.62.0 published on Friday, Jan 16, 2026 by Pulumi
datadog logo
Datadog v4.62.0 published on Friday, Jan 16, 2026 by Pulumi

    Provides a Datadog MonitorNotificationRule resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    // Create new monitor_notification_rule resource
    const foo = new datadog.MonitorNotificationRule("foo", {
        name: "A notification rule name",
        recipients: [
            "slack-test-channel",
            "jira-test",
        ],
        filter: [{
            tags: ["env:foo"],
        }],
    });
    
    import pulumi
    import pulumi_datadog as datadog
    
    # Create new monitor_notification_rule resource
    foo = datadog.MonitorNotificationRule("foo",
        name="A notification rule name",
        recipients=[
            "slack-test-channel",
            "jira-test",
        ],
        filter=[{
            "tags": ["env:foo"],
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create new monitor_notification_rule resource
    		_, err := datadog.NewMonitorNotificationRule(ctx, "foo", &datadog.MonitorNotificationRuleArgs{
    			Name: pulumi.String("A notification rule name"),
    			Recipients: pulumi.StringArray{
    				pulumi.String("slack-test-channel"),
    				pulumi.String("jira-test"),
    			},
    			Filter: datadog.MonitorNotificationRuleFilterArgs{
    				map[string]interface{}{
    					"tags": []string{
    						"env:foo",
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datadog = Pulumi.Datadog;
    
    return await Deployment.RunAsync(() => 
    {
        // Create new monitor_notification_rule resource
        var foo = new Datadog.MonitorNotificationRule("foo", new()
        {
            Name = "A notification rule name",
            Recipients = new[]
            {
                "slack-test-channel",
                "jira-test",
            },
            Filter = new[]
            {
                
                {
                    { "tags", new[]
                    {
                        "env:foo",
                    } },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.MonitorNotificationRule;
    import com.pulumi.datadog.MonitorNotificationRuleArgs;
    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) {
            // Create new monitor_notification_rule resource
            var foo = new MonitorNotificationRule("foo", MonitorNotificationRuleArgs.builder()
                .name("A notification rule name")
                .recipients(            
                    "slack-test-channel",
                    "jira-test")
                .filter(MonitorNotificationRuleFilterArgs.builder()
                    .tags("env:foo")
                    .build())
                .build());
    
        }
    }
    
    resources:
      # Create new monitor_notification_rule resource
      foo:
        type: datadog:MonitorNotificationRule
        properties:
          name: A notification rule name
          recipients:
            - slack-test-channel
            - jira-test
          filter:
            - tags:
                - env:foo
    

    Create MonitorNotificationRule Resource

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

    Constructor syntax

    new MonitorNotificationRule(name: string, args: MonitorNotificationRuleArgs, opts?: CustomResourceOptions);
    @overload
    def MonitorNotificationRule(resource_name: str,
                                args: MonitorNotificationRuleArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def MonitorNotificationRule(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                name: Optional[str] = None,
                                conditional_recipients: Optional[MonitorNotificationRuleConditionalRecipientsArgs] = None,
                                filter: Optional[MonitorNotificationRuleFilterArgs] = None,
                                recipients: Optional[Sequence[str]] = None)
    func NewMonitorNotificationRule(ctx *Context, name string, args MonitorNotificationRuleArgs, opts ...ResourceOption) (*MonitorNotificationRule, error)
    public MonitorNotificationRule(string name, MonitorNotificationRuleArgs args, CustomResourceOptions? opts = null)
    public MonitorNotificationRule(String name, MonitorNotificationRuleArgs args)
    public MonitorNotificationRule(String name, MonitorNotificationRuleArgs args, CustomResourceOptions options)
    
    type: datadog:MonitorNotificationRule
    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 MonitorNotificationRuleArgs
    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 MonitorNotificationRuleArgs
    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 MonitorNotificationRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MonitorNotificationRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MonitorNotificationRuleArgs
    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 monitorNotificationRuleResource = new Datadog.MonitorNotificationRule("monitorNotificationRuleResource", new()
    {
        Name = "string",
        ConditionalRecipients = new Datadog.Inputs.MonitorNotificationRuleConditionalRecipientsArgs
        {
            Conditions = new[]
            {
                new Datadog.Inputs.MonitorNotificationRuleConditionalRecipientsConditionArgs
                {
                    Recipients = new[]
                    {
                        "string",
                    },
                    Scope = "string",
                },
            },
            FallbackRecipients = new[]
            {
                "string",
            },
        },
        Filter = new Datadog.Inputs.MonitorNotificationRuleFilterArgs
        {
            Scope = "string",
            Tags = new[]
            {
                "string",
            },
        },
        Recipients = new[]
        {
            "string",
        },
    });
    
    example, err := datadog.NewMonitorNotificationRule(ctx, "monitorNotificationRuleResource", &datadog.MonitorNotificationRuleArgs{
    	Name: pulumi.String("string"),
    	ConditionalRecipients: &datadog.MonitorNotificationRuleConditionalRecipientsArgs{
    		Conditions: datadog.MonitorNotificationRuleConditionalRecipientsConditionArray{
    			&datadog.MonitorNotificationRuleConditionalRecipientsConditionArgs{
    				Recipients: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    				Scope: pulumi.String("string"),
    			},
    		},
    		FallbackRecipients: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	Filter: &datadog.MonitorNotificationRuleFilterArgs{
    		Scope: pulumi.String("string"),
    		Tags: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	Recipients: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var monitorNotificationRuleResource = new MonitorNotificationRule("monitorNotificationRuleResource", MonitorNotificationRuleArgs.builder()
        .name("string")
        .conditionalRecipients(MonitorNotificationRuleConditionalRecipientsArgs.builder()
            .conditions(MonitorNotificationRuleConditionalRecipientsConditionArgs.builder()
                .recipients("string")
                .scope("string")
                .build())
            .fallbackRecipients("string")
            .build())
        .filter(MonitorNotificationRuleFilterArgs.builder()
            .scope("string")
            .tags("string")
            .build())
        .recipients("string")
        .build());
    
    monitor_notification_rule_resource = datadog.MonitorNotificationRule("monitorNotificationRuleResource",
        name="string",
        conditional_recipients={
            "conditions": [{
                "recipients": ["string"],
                "scope": "string",
            }],
            "fallback_recipients": ["string"],
        },
        filter={
            "scope": "string",
            "tags": ["string"],
        },
        recipients=["string"])
    
    const monitorNotificationRuleResource = new datadog.MonitorNotificationRule("monitorNotificationRuleResource", {
        name: "string",
        conditionalRecipients: {
            conditions: [{
                recipients: ["string"],
                scope: "string",
            }],
            fallbackRecipients: ["string"],
        },
        filter: {
            scope: "string",
            tags: ["string"],
        },
        recipients: ["string"],
    });
    
    type: datadog:MonitorNotificationRule
    properties:
        conditionalRecipients:
            conditions:
                - recipients:
                    - string
                  scope: string
            fallbackRecipients:
                - string
        filter:
            scope: string
            tags:
                - string
        name: string
        recipients:
            - string
    

    MonitorNotificationRule 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 MonitorNotificationRule resource accepts the following input properties:

    Name string
    The name of the monitor notification rule.
    ConditionalRecipients MonitorNotificationRuleConditionalRecipients
    Use conditional recipients to define different recipients for different situations. Cannot be used with recipients.
    Filter MonitorNotificationRuleFilter
    Recipients List<string>
    List of recipients to notify. Cannot be used with conditional_recipients.
    Name string
    The name of the monitor notification rule.
    ConditionalRecipients MonitorNotificationRuleConditionalRecipientsArgs
    Use conditional recipients to define different recipients for different situations. Cannot be used with recipients.
    Filter MonitorNotificationRuleFilterArgs
    Recipients []string
    List of recipients to notify. Cannot be used with conditional_recipients.
    name String
    The name of the monitor notification rule.
    conditionalRecipients MonitorNotificationRuleConditionalRecipients
    Use conditional recipients to define different recipients for different situations. Cannot be used with recipients.
    filter MonitorNotificationRuleFilter
    recipients List<String>
    List of recipients to notify. Cannot be used with conditional_recipients.
    name string
    The name of the monitor notification rule.
    conditionalRecipients MonitorNotificationRuleConditionalRecipients
    Use conditional recipients to define different recipients for different situations. Cannot be used with recipients.
    filter MonitorNotificationRuleFilter
    recipients string[]
    List of recipients to notify. Cannot be used with conditional_recipients.
    name str
    The name of the monitor notification rule.
    conditional_recipients MonitorNotificationRuleConditionalRecipientsArgs
    Use conditional recipients to define different recipients for different situations. Cannot be used with recipients.
    filter MonitorNotificationRuleFilterArgs
    recipients Sequence[str]
    List of recipients to notify. Cannot be used with conditional_recipients.
    name String
    The name of the monitor notification rule.
    conditionalRecipients Property Map
    Use conditional recipients to define different recipients for different situations. Cannot be used with recipients.
    filter Property Map
    recipients List<String>
    List of recipients to notify. Cannot be used with conditional_recipients.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the MonitorNotificationRule 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 MonitorNotificationRule Resource

    Get an existing MonitorNotificationRule 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?: MonitorNotificationRuleState, opts?: CustomResourceOptions): MonitorNotificationRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            conditional_recipients: Optional[MonitorNotificationRuleConditionalRecipientsArgs] = None,
            filter: Optional[MonitorNotificationRuleFilterArgs] = None,
            name: Optional[str] = None,
            recipients: Optional[Sequence[str]] = None) -> MonitorNotificationRule
    func GetMonitorNotificationRule(ctx *Context, name string, id IDInput, state *MonitorNotificationRuleState, opts ...ResourceOption) (*MonitorNotificationRule, error)
    public static MonitorNotificationRule Get(string name, Input<string> id, MonitorNotificationRuleState? state, CustomResourceOptions? opts = null)
    public static MonitorNotificationRule get(String name, Output<String> id, MonitorNotificationRuleState state, CustomResourceOptions options)
    resources:  _:    type: datadog:MonitorNotificationRule    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:
    ConditionalRecipients MonitorNotificationRuleConditionalRecipients
    Use conditional recipients to define different recipients for different situations. Cannot be used with recipients.
    Filter MonitorNotificationRuleFilter
    Name string
    The name of the monitor notification rule.
    Recipients List<string>
    List of recipients to notify. Cannot be used with conditional_recipients.
    ConditionalRecipients MonitorNotificationRuleConditionalRecipientsArgs
    Use conditional recipients to define different recipients for different situations. Cannot be used with recipients.
    Filter MonitorNotificationRuleFilterArgs
    Name string
    The name of the monitor notification rule.
    Recipients []string
    List of recipients to notify. Cannot be used with conditional_recipients.
    conditionalRecipients MonitorNotificationRuleConditionalRecipients
    Use conditional recipients to define different recipients for different situations. Cannot be used with recipients.
    filter MonitorNotificationRuleFilter
    name String
    The name of the monitor notification rule.
    recipients List<String>
    List of recipients to notify. Cannot be used with conditional_recipients.
    conditionalRecipients MonitorNotificationRuleConditionalRecipients
    Use conditional recipients to define different recipients for different situations. Cannot be used with recipients.
    filter MonitorNotificationRuleFilter
    name string
    The name of the monitor notification rule.
    recipients string[]
    List of recipients to notify. Cannot be used with conditional_recipients.
    conditional_recipients MonitorNotificationRuleConditionalRecipientsArgs
    Use conditional recipients to define different recipients for different situations. Cannot be used with recipients.
    filter MonitorNotificationRuleFilterArgs
    name str
    The name of the monitor notification rule.
    recipients Sequence[str]
    List of recipients to notify. Cannot be used with conditional_recipients.
    conditionalRecipients Property Map
    Use conditional recipients to define different recipients for different situations. Cannot be used with recipients.
    filter Property Map
    name String
    The name of the monitor notification rule.
    recipients List<String>
    List of recipients to notify. Cannot be used with conditional_recipients.

    Supporting Types

    MonitorNotificationRuleConditionalRecipients, MonitorNotificationRuleConditionalRecipientsArgs

    Conditions List<MonitorNotificationRuleConditionalRecipientsCondition>
    Conditions of the notification rule.
    FallbackRecipients List<string>
    If none of the conditions applied, fallback_recipients will get notified.
    Conditions []MonitorNotificationRuleConditionalRecipientsCondition
    Conditions of the notification rule.
    FallbackRecipients []string
    If none of the conditions applied, fallback_recipients will get notified.
    conditions List<MonitorNotificationRuleConditionalRecipientsCondition>
    Conditions of the notification rule.
    fallbackRecipients List<String>
    If none of the conditions applied, fallback_recipients will get notified.
    conditions MonitorNotificationRuleConditionalRecipientsCondition[]
    Conditions of the notification rule.
    fallbackRecipients string[]
    If none of the conditions applied, fallback_recipients will get notified.
    conditions Sequence[MonitorNotificationRuleConditionalRecipientsCondition]
    Conditions of the notification rule.
    fallback_recipients Sequence[str]
    If none of the conditions applied, fallback_recipients will get notified.
    conditions List<Property Map>
    Conditions of the notification rule.
    fallbackRecipients List<String>
    If none of the conditions applied, fallback_recipients will get notified.

    MonitorNotificationRuleConditionalRecipientsCondition, MonitorNotificationRuleConditionalRecipientsConditionArgs

    Recipients List<string>
    List of recipients to notify.
    Scope string
    The scope to which the monitor applied.
    Recipients []string
    List of recipients to notify.
    Scope string
    The scope to which the monitor applied.
    recipients List<String>
    List of recipients to notify.
    scope String
    The scope to which the monitor applied.
    recipients string[]
    List of recipients to notify.
    scope string
    The scope to which the monitor applied.
    recipients Sequence[str]
    List of recipients to notify.
    scope str
    The scope to which the monitor applied.
    recipients List<String>
    List of recipients to notify.
    scope String
    The scope to which the monitor applied.

    MonitorNotificationRuleFilter, MonitorNotificationRuleFilterArgs

    Scope string
    The scope to which the monitor applied.
    Tags List<string>
    All tags that target monitors must match.
    Scope string
    The scope to which the monitor applied.
    Tags []string
    All tags that target monitors must match.
    scope String
    The scope to which the monitor applied.
    tags List<String>
    All tags that target monitors must match.
    scope string
    The scope to which the monitor applied.
    tags string[]
    All tags that target monitors must match.
    scope str
    The scope to which the monitor applied.
    tags Sequence[str]
    All tags that target monitors must match.
    scope String
    The scope to which the monitor applied.
    tags List<String>
    All tags that target monitors must match.

    Import

    The pulumi import command can be used, for example:

    $ pulumi import datadog:index/monitorNotificationRule:MonitorNotificationRule new_list "00e000000-0000-1234-0000-000000000000"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Datadog pulumi/pulumi-datadog
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the datadog Terraform Provider.
    datadog logo
    Datadog v4.62.0 published on Friday, Jan 16, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate