1. Packages
  2. NS1
  3. API Docs
  4. NotifyList
NS1 v3.4.2 published on Tuesday, Sep 17, 2024 by Pulumi

ns1.NotifyList

Explore with Pulumi AI

ns1 logo
NS1 v3.4.2 published on Tuesday, Sep 17, 2024 by Pulumi

    Provides a NS1 Notify List resource. This can be used to create, modify, and delete notify lists.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ns1 from "@pulumi/ns1";
    
    const nl = new ns1.NotifyList("nl", {
        name: "my notify list",
        notifications: [
            {
                type: "webhook",
                config: {
                    url: "http://www.mywebhook.com",
                },
            },
            {
                type: "email",
                config: {
                    email: "test@test.com",
                },
            },
        ],
    });
    
    import pulumi
    import pulumi_ns1 as ns1
    
    nl = ns1.NotifyList("nl",
        name="my notify list",
        notifications=[
            {
                "type": "webhook",
                "config": {
                    "url": "http://www.mywebhook.com",
                },
            },
            {
                "type": "email",
                "config": {
                    "email": "test@test.com",
                },
            },
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-ns1/sdk/v3/go/ns1"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ns1.NewNotifyList(ctx, "nl", &ns1.NotifyListArgs{
    			Name: pulumi.String("my notify list"),
    			Notifications: ns1.NotifyListNotificationArray{
    				&ns1.NotifyListNotificationArgs{
    					Type: pulumi.String("webhook"),
    					Config: pulumi.StringMap{
    						"url": pulumi.String("http://www.mywebhook.com"),
    					},
    				},
    				&ns1.NotifyListNotificationArgs{
    					Type: pulumi.String("email"),
    					Config: pulumi.StringMap{
    						"email": pulumi.String("test@test.com"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ns1 = Pulumi.Ns1;
    
    return await Deployment.RunAsync(() => 
    {
        var nl = new Ns1.NotifyList("nl", new()
        {
            Name = "my notify list",
            Notifications = new[]
            {
                new Ns1.Inputs.NotifyListNotificationArgs
                {
                    Type = "webhook",
                    Config = 
                    {
                        { "url", "http://www.mywebhook.com" },
                    },
                },
                new Ns1.Inputs.NotifyListNotificationArgs
                {
                    Type = "email",
                    Config = 
                    {
                        { "email", "test@test.com" },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ns1.NotifyList;
    import com.pulumi.ns1.NotifyListArgs;
    import com.pulumi.ns1.inputs.NotifyListNotificationArgs;
    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 nl = new NotifyList("nl", NotifyListArgs.builder()
                .name("my notify list")
                .notifications(            
                    NotifyListNotificationArgs.builder()
                        .type("webhook")
                        .config(Map.of("url", "http://www.mywebhook.com"))
                        .build(),
                    NotifyListNotificationArgs.builder()
                        .type("email")
                        .config(Map.of("email", "test@test.com"))
                        .build())
                .build());
    
        }
    }
    
    resources:
      nl:
        type: ns1:NotifyList
        properties:
          name: my notify list
          notifications:
            - type: webhook
              config:
                url: http://www.mywebhook.com
            - type: email
              config:
                email: test@test.com
    

    NS1 Documentation

    NotifyList Api Doc

    Create NotifyList Resource

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

    Constructor syntax

    new NotifyList(name: string, args?: NotifyListArgs, opts?: CustomResourceOptions);
    @overload
    def NotifyList(resource_name: str,
                   args: Optional[NotifyListArgs] = None,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def NotifyList(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   name: Optional[str] = None,
                   notifications: Optional[Sequence[NotifyListNotificationArgs]] = None)
    func NewNotifyList(ctx *Context, name string, args *NotifyListArgs, opts ...ResourceOption) (*NotifyList, error)
    public NotifyList(string name, NotifyListArgs? args = null, CustomResourceOptions? opts = null)
    public NotifyList(String name, NotifyListArgs args)
    public NotifyList(String name, NotifyListArgs args, CustomResourceOptions options)
    
    type: ns1:NotifyList
    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 NotifyListArgs
    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 NotifyListArgs
    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 NotifyListArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NotifyListArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NotifyListArgs
    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 notifyListResource = new Ns1.NotifyList("notifyListResource", new()
    {
        Name = "string",
        Notifications = new[]
        {
            new Ns1.Inputs.NotifyListNotificationArgs
            {
                Config = 
                {
                    { "string", "string" },
                },
                Type = "string",
            },
        },
    });
    
    example, err := ns1.NewNotifyList(ctx, "notifyListResource", &ns1.NotifyListArgs{
    	Name: pulumi.String("string"),
    	Notifications: ns1.NotifyListNotificationArray{
    		&ns1.NotifyListNotificationArgs{
    			Config: pulumi.StringMap{
    				"string": pulumi.String("string"),
    			},
    			Type: pulumi.String("string"),
    		},
    	},
    })
    
    var notifyListResource = new NotifyList("notifyListResource", NotifyListArgs.builder()
        .name("string")
        .notifications(NotifyListNotificationArgs.builder()
            .config(Map.of("string", "string"))
            .type("string")
            .build())
        .build());
    
    notify_list_resource = ns1.NotifyList("notifyListResource",
        name="string",
        notifications=[ns1.NotifyListNotificationArgs(
            config={
                "string": "string",
            },
            type="string",
        )])
    
    const notifyListResource = new ns1.NotifyList("notifyListResource", {
        name: "string",
        notifications: [{
            config: {
                string: "string",
            },
            type: "string",
        }],
    });
    
    type: ns1:NotifyList
    properties:
        name: string
        notifications:
            - config:
                string: string
              type: string
    

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

    Name string
    The free-form display name for the notify list.
    Notifications List<NotifyListNotification>
    A list of notifiers. All notifiers in a notification list will receive notifications whenever an event is send to the list (e.g., when a monitoring job fails). Notifiers are documented below.
    Name string
    The free-form display name for the notify list.
    Notifications []NotifyListNotificationArgs
    A list of notifiers. All notifiers in a notification list will receive notifications whenever an event is send to the list (e.g., when a monitoring job fails). Notifiers are documented below.
    name String
    The free-form display name for the notify list.
    notifications List<NotifyListNotification>
    A list of notifiers. All notifiers in a notification list will receive notifications whenever an event is send to the list (e.g., when a monitoring job fails). Notifiers are documented below.
    name string
    The free-form display name for the notify list.
    notifications NotifyListNotification[]
    A list of notifiers. All notifiers in a notification list will receive notifications whenever an event is send to the list (e.g., when a monitoring job fails). Notifiers are documented below.
    name str
    The free-form display name for the notify list.
    notifications Sequence[NotifyListNotificationArgs]
    A list of notifiers. All notifiers in a notification list will receive notifications whenever an event is send to the list (e.g., when a monitoring job fails). Notifiers are documented below.
    name String
    The free-form display name for the notify list.
    notifications List<Property Map>
    A list of notifiers. All notifiers in a notification list will receive notifications whenever an event is send to the list (e.g., when a monitoring job fails). Notifiers are documented below.

    Outputs

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

    Get an existing NotifyList 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?: NotifyListState, opts?: CustomResourceOptions): NotifyList
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            notifications: Optional[Sequence[NotifyListNotificationArgs]] = None) -> NotifyList
    func GetNotifyList(ctx *Context, name string, id IDInput, state *NotifyListState, opts ...ResourceOption) (*NotifyList, error)
    public static NotifyList Get(string name, Input<string> id, NotifyListState? state, CustomResourceOptions? opts = null)
    public static NotifyList get(String name, Output<String> id, NotifyListState 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:
    Name string
    The free-form display name for the notify list.
    Notifications List<NotifyListNotification>
    A list of notifiers. All notifiers in a notification list will receive notifications whenever an event is send to the list (e.g., when a monitoring job fails). Notifiers are documented below.
    Name string
    The free-form display name for the notify list.
    Notifications []NotifyListNotificationArgs
    A list of notifiers. All notifiers in a notification list will receive notifications whenever an event is send to the list (e.g., when a monitoring job fails). Notifiers are documented below.
    name String
    The free-form display name for the notify list.
    notifications List<NotifyListNotification>
    A list of notifiers. All notifiers in a notification list will receive notifications whenever an event is send to the list (e.g., when a monitoring job fails). Notifiers are documented below.
    name string
    The free-form display name for the notify list.
    notifications NotifyListNotification[]
    A list of notifiers. All notifiers in a notification list will receive notifications whenever an event is send to the list (e.g., when a monitoring job fails). Notifiers are documented below.
    name str
    The free-form display name for the notify list.
    notifications Sequence[NotifyListNotificationArgs]
    A list of notifiers. All notifiers in a notification list will receive notifications whenever an event is send to the list (e.g., when a monitoring job fails). Notifiers are documented below.
    name String
    The free-form display name for the notify list.
    notifications List<Property Map>
    A list of notifiers. All notifiers in a notification list will receive notifications whenever an event is send to the list (e.g., when a monitoring job fails). Notifiers are documented below.

    Supporting Types

    NotifyListNotification, NotifyListNotificationArgs

    Config Dictionary<string, string>
    Configuration details for the given notifier type.
    Type string
    The type of notifier. Available notifiers are indicated in /notifytypes endpoint.
    Config map[string]string
    Configuration details for the given notifier type.
    Type string
    The type of notifier. Available notifiers are indicated in /notifytypes endpoint.
    config Map<String,String>
    Configuration details for the given notifier type.
    type String
    The type of notifier. Available notifiers are indicated in /notifytypes endpoint.
    config {[key: string]: string}
    Configuration details for the given notifier type.
    type string
    The type of notifier. Available notifiers are indicated in /notifytypes endpoint.
    config Mapping[str, str]
    Configuration details for the given notifier type.
    type str
    The type of notifier. Available notifiers are indicated in /notifytypes endpoint.
    config Map<String>
    Configuration details for the given notifier type.
    type String
    The type of notifier. Available notifiers are indicated in /notifytypes endpoint.

    Import

    $ pulumi import ns1:index/notifyList:NotifyList <name> <notifylist_id>`
    

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

    Package Details

    Repository
    NS1 pulumi/pulumi-ns1
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ns1 Terraform Provider.
    ns1 logo
    NS1 v3.4.2 published on Tuesday, Sep 17, 2024 by Pulumi