1. Packages
  2. Ns1 Provider
  3. API Docs
  4. Alert
NS1 v3.5.0 published on Wednesday, Dec 18, 2024 by Pulumi

ns1.Alert

Explore with Pulumi AI

ns1 logo
NS1 v3.5.0 published on Wednesday, Dec 18, 2024 by Pulumi

    Provides a NS1 Alert resource. This can be used to create, modify, and delete alerts.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ns1 from "@pulumi/ns1";
    
    const example = new ns1.Alert("example", {
        name: "Example Alert",
        type: "zone",
        subtype: "transfer_failed",
        notificationLists: [],
        zoneNames: [],
        recordIds: [],
    });
    
    import pulumi
    import pulumi_ns1 as ns1
    
    example = ns1.Alert("example",
        name="Example Alert",
        type="zone",
        subtype="transfer_failed",
        notification_lists=[],
        zone_names=[],
        record_ids=[])
    
    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.NewAlert(ctx, "example", &ns1.AlertArgs{
    			Name:              pulumi.String("Example Alert"),
    			Type:              pulumi.String("zone"),
    			Subtype:           pulumi.String("transfer_failed"),
    			NotificationLists: pulumi.StringArray{},
    			ZoneNames:         pulumi.StringArray{},
    			RecordIds:         pulumi.StringArray{},
    		})
    		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 example = new Ns1.Alert("example", new()
        {
            Name = "Example Alert",
            Type = "zone",
            Subtype = "transfer_failed",
            NotificationLists = new[] {},
            ZoneNames = new[] {},
            RecordIds = new[] {},
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ns1.Alert;
    import com.pulumi.ns1.AlertArgs;
    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 example = new Alert("example", AlertArgs.builder()
                .name("Example Alert")
                .type("zone")
                .subtype("transfer_failed")
                .notificationLists()
                .zoneNames()
                .recordIds()
                .build());
    
        }
    }
    
    resources:
      example:
        type: ns1:Alert
        properties:
          name: Example Alert
          type: zone
          subtype: transfer_failed
          notificationLists: []
          zoneNames: []
          recordIds: []
    

    NS1 Documentation

    Alerts Api Doc

    Create Alert Resource

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

    Constructor syntax

    new Alert(name: string, args: AlertArgs, opts?: CustomResourceOptions);
    @overload
    def Alert(resource_name: str,
              args: AlertArgs,
              opts: Optional[ResourceOptions] = None)
    
    @overload
    def Alert(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              subtype: Optional[str] = None,
              type: Optional[str] = None,
              name: Optional[str] = None,
              notification_lists: Optional[Sequence[str]] = None,
              record_ids: Optional[Sequence[str]] = None,
              zone_names: Optional[Sequence[str]] = None)
    func NewAlert(ctx *Context, name string, args AlertArgs, opts ...ResourceOption) (*Alert, error)
    public Alert(string name, AlertArgs args, CustomResourceOptions? opts = null)
    public Alert(String name, AlertArgs args)
    public Alert(String name, AlertArgs args, CustomResourceOptions options)
    
    type: ns1:Alert
    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 AlertArgs
    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 AlertArgs
    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 AlertArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlertArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlertArgs
    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 alertResource = new Ns1.Alert("alertResource", new()
    {
        Subtype = "string",
        Type = "string",
        Name = "string",
        NotificationLists = new[]
        {
            "string",
        },
        RecordIds = new[]
        {
            "string",
        },
        ZoneNames = new[]
        {
            "string",
        },
    });
    
    example, err := ns1.NewAlert(ctx, "alertResource", &ns1.AlertArgs{
    	Subtype: pulumi.String("string"),
    	Type:    pulumi.String("string"),
    	Name:    pulumi.String("string"),
    	NotificationLists: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	RecordIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ZoneNames: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var alertResource = new Alert("alertResource", AlertArgs.builder()
        .subtype("string")
        .type("string")
        .name("string")
        .notificationLists("string")
        .recordIds("string")
        .zoneNames("string")
        .build());
    
    alert_resource = ns1.Alert("alertResource",
        subtype="string",
        type="string",
        name="string",
        notification_lists=["string"],
        record_ids=["string"],
        zone_names=["string"])
    
    const alertResource = new ns1.Alert("alertResource", {
        subtype: "string",
        type: "string",
        name: "string",
        notificationLists: ["string"],
        recordIds: ["string"],
        zoneNames: ["string"],
    });
    
    type: ns1:Alert
    properties:
        name: string
        notificationLists:
            - string
        recordIds:
            - string
        subtype: string
        type: string
        zoneNames:
            - string
    

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

    Subtype string
    The type of the alert.
    Type string
    The type of the alert.
    Name string
    The free-form display name for the alert.
    NotificationLists List<string>
    A list of id's for notification lists whose notifiers will be triggered by the alert.
    RecordIds List<string>
    A list of record id's this alert applies to.
    ZoneNames List<string>
    A list of zones this alert applies to.
    Subtype string
    The type of the alert.
    Type string
    The type of the alert.
    Name string
    The free-form display name for the alert.
    NotificationLists []string
    A list of id's for notification lists whose notifiers will be triggered by the alert.
    RecordIds []string
    A list of record id's this alert applies to.
    ZoneNames []string
    A list of zones this alert applies to.
    subtype String
    The type of the alert.
    type String
    The type of the alert.
    name String
    The free-form display name for the alert.
    notificationLists List<String>
    A list of id's for notification lists whose notifiers will be triggered by the alert.
    recordIds List<String>
    A list of record id's this alert applies to.
    zoneNames List<String>
    A list of zones this alert applies to.
    subtype string
    The type of the alert.
    type string
    The type of the alert.
    name string
    The free-form display name for the alert.
    notificationLists string[]
    A list of id's for notification lists whose notifiers will be triggered by the alert.
    recordIds string[]
    A list of record id's this alert applies to.
    zoneNames string[]
    A list of zones this alert applies to.
    subtype str
    The type of the alert.
    type str
    The type of the alert.
    name str
    The free-form display name for the alert.
    notification_lists Sequence[str]
    A list of id's for notification lists whose notifiers will be triggered by the alert.
    record_ids Sequence[str]
    A list of record id's this alert applies to.
    zone_names Sequence[str]
    A list of zones this alert applies to.
    subtype String
    The type of the alert.
    type String
    The type of the alert.
    name String
    The free-form display name for the alert.
    notificationLists List<String>
    A list of id's for notification lists whose notifiers will be triggered by the alert.
    recordIds List<String>
    A list of record id's this alert applies to.
    zoneNames List<String>
    A list of zones this alert applies to.

    Outputs

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

    CreatedAt int
    (Read Only) The Unix timestamp representing when the alert configuration was created.
    CreatedBy string
    (Read Only) The user or apikey that created this alert.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdatedAt int
    (Read Only) The Unix timestamp representing when the alert configuration was last modified.
    UpdatedBy string
    (Read Only) The user or apikey that last modified this alert.
    CreatedAt int
    (Read Only) The Unix timestamp representing when the alert configuration was created.
    CreatedBy string
    (Read Only) The user or apikey that created this alert.
    Id string
    The provider-assigned unique ID for this managed resource.
    UpdatedAt int
    (Read Only) The Unix timestamp representing when the alert configuration was last modified.
    UpdatedBy string
    (Read Only) The user or apikey that last modified this alert.
    createdAt Integer
    (Read Only) The Unix timestamp representing when the alert configuration was created.
    createdBy String
    (Read Only) The user or apikey that created this alert.
    id String
    The provider-assigned unique ID for this managed resource.
    updatedAt Integer
    (Read Only) The Unix timestamp representing when the alert configuration was last modified.
    updatedBy String
    (Read Only) The user or apikey that last modified this alert.
    createdAt number
    (Read Only) The Unix timestamp representing when the alert configuration was created.
    createdBy string
    (Read Only) The user or apikey that created this alert.
    id string
    The provider-assigned unique ID for this managed resource.
    updatedAt number
    (Read Only) The Unix timestamp representing when the alert configuration was last modified.
    updatedBy string
    (Read Only) The user or apikey that last modified this alert.
    created_at int
    (Read Only) The Unix timestamp representing when the alert configuration was created.
    created_by str
    (Read Only) The user or apikey that created this alert.
    id str
    The provider-assigned unique ID for this managed resource.
    updated_at int
    (Read Only) The Unix timestamp representing when the alert configuration was last modified.
    updated_by str
    (Read Only) The user or apikey that last modified this alert.
    createdAt Number
    (Read Only) The Unix timestamp representing when the alert configuration was created.
    createdBy String
    (Read Only) The user or apikey that created this alert.
    id String
    The provider-assigned unique ID for this managed resource.
    updatedAt Number
    (Read Only) The Unix timestamp representing when the alert configuration was last modified.
    updatedBy String
    (Read Only) The user or apikey that last modified this alert.

    Look up Existing Alert Resource

    Get an existing Alert 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?: AlertState, opts?: CustomResourceOptions): Alert
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            created_at: Optional[int] = None,
            created_by: Optional[str] = None,
            name: Optional[str] = None,
            notification_lists: Optional[Sequence[str]] = None,
            record_ids: Optional[Sequence[str]] = None,
            subtype: Optional[str] = None,
            type: Optional[str] = None,
            updated_at: Optional[int] = None,
            updated_by: Optional[str] = None,
            zone_names: Optional[Sequence[str]] = None) -> Alert
    func GetAlert(ctx *Context, name string, id IDInput, state *AlertState, opts ...ResourceOption) (*Alert, error)
    public static Alert Get(string name, Input<string> id, AlertState? state, CustomResourceOptions? opts = null)
    public static Alert get(String name, Output<String> id, AlertState state, CustomResourceOptions options)
    resources:  _:    type: ns1:Alert    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:
    CreatedAt int
    (Read Only) The Unix timestamp representing when the alert configuration was created.
    CreatedBy string
    (Read Only) The user or apikey that created this alert.
    Name string
    The free-form display name for the alert.
    NotificationLists List<string>
    A list of id's for notification lists whose notifiers will be triggered by the alert.
    RecordIds List<string>
    A list of record id's this alert applies to.
    Subtype string
    The type of the alert.
    Type string
    The type of the alert.
    UpdatedAt int
    (Read Only) The Unix timestamp representing when the alert configuration was last modified.
    UpdatedBy string
    (Read Only) The user or apikey that last modified this alert.
    ZoneNames List<string>
    A list of zones this alert applies to.
    CreatedAt int
    (Read Only) The Unix timestamp representing when the alert configuration was created.
    CreatedBy string
    (Read Only) The user or apikey that created this alert.
    Name string
    The free-form display name for the alert.
    NotificationLists []string
    A list of id's for notification lists whose notifiers will be triggered by the alert.
    RecordIds []string
    A list of record id's this alert applies to.
    Subtype string
    The type of the alert.
    Type string
    The type of the alert.
    UpdatedAt int
    (Read Only) The Unix timestamp representing when the alert configuration was last modified.
    UpdatedBy string
    (Read Only) The user or apikey that last modified this alert.
    ZoneNames []string
    A list of zones this alert applies to.
    createdAt Integer
    (Read Only) The Unix timestamp representing when the alert configuration was created.
    createdBy String
    (Read Only) The user or apikey that created this alert.
    name String
    The free-form display name for the alert.
    notificationLists List<String>
    A list of id's for notification lists whose notifiers will be triggered by the alert.
    recordIds List<String>
    A list of record id's this alert applies to.
    subtype String
    The type of the alert.
    type String
    The type of the alert.
    updatedAt Integer
    (Read Only) The Unix timestamp representing when the alert configuration was last modified.
    updatedBy String
    (Read Only) The user or apikey that last modified this alert.
    zoneNames List<String>
    A list of zones this alert applies to.
    createdAt number
    (Read Only) The Unix timestamp representing when the alert configuration was created.
    createdBy string
    (Read Only) The user or apikey that created this alert.
    name string
    The free-form display name for the alert.
    notificationLists string[]
    A list of id's for notification lists whose notifiers will be triggered by the alert.
    recordIds string[]
    A list of record id's this alert applies to.
    subtype string
    The type of the alert.
    type string
    The type of the alert.
    updatedAt number
    (Read Only) The Unix timestamp representing when the alert configuration was last modified.
    updatedBy string
    (Read Only) The user or apikey that last modified this alert.
    zoneNames string[]
    A list of zones this alert applies to.
    created_at int
    (Read Only) The Unix timestamp representing when the alert configuration was created.
    created_by str
    (Read Only) The user or apikey that created this alert.
    name str
    The free-form display name for the alert.
    notification_lists Sequence[str]
    A list of id's for notification lists whose notifiers will be triggered by the alert.
    record_ids Sequence[str]
    A list of record id's this alert applies to.
    subtype str
    The type of the alert.
    type str
    The type of the alert.
    updated_at int
    (Read Only) The Unix timestamp representing when the alert configuration was last modified.
    updated_by str
    (Read Only) The user or apikey that last modified this alert.
    zone_names Sequence[str]
    A list of zones this alert applies to.
    createdAt Number
    (Read Only) The Unix timestamp representing when the alert configuration was created.
    createdBy String
    (Read Only) The user or apikey that created this alert.
    name String
    The free-form display name for the alert.
    notificationLists List<String>
    A list of id's for notification lists whose notifiers will be triggered by the alert.
    recordIds List<String>
    A list of record id's this alert applies to.
    subtype String
    The type of the alert.
    type String
    The type of the alert.
    updatedAt Number
    (Read Only) The Unix timestamp representing when the alert configuration was last modified.
    updatedBy String
    (Read Only) The user or apikey that last modified this alert.
    zoneNames List<String>
    A list of zones this alert applies to.

    Import

    $ pulumi import ns1:index/alert:Alert <name> <alert_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.5.0 published on Wednesday, Dec 18, 2024 by Pulumi