1. Packages
  2. Digitalocean Provider
  3. API Docs
  4. UptimeAlert
DigitalOcean v4.34.0 published on Monday, Oct 21, 2024 by Pulumi

digitalocean.UptimeAlert

Explore with Pulumi AI

digitalocean logo
DigitalOcean v4.34.0 published on Monday, Oct 21, 2024 by Pulumi

    Provides a DigitalOcean Uptime Alerts resource. Uptime Alerts provide the ability to add alerts to your DigitalOcean Uptime Checks when your endpoints are slow, unavailable, or SSL certificates are expiring.

    Create UptimeAlert Resource

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

    Constructor syntax

    new UptimeAlert(name: string, args: UptimeAlertArgs, opts?: CustomResourceOptions);
    @overload
    def UptimeAlert(resource_name: str,
                    args: UptimeAlertArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def UptimeAlert(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    check_id: Optional[str] = None,
                    notifications: Optional[Sequence[UptimeAlertNotificationArgs]] = None,
                    type: Optional[str] = None,
                    comparison: Optional[str] = None,
                    name: Optional[str] = None,
                    period: Optional[str] = None,
                    threshold: Optional[int] = None)
    func NewUptimeAlert(ctx *Context, name string, args UptimeAlertArgs, opts ...ResourceOption) (*UptimeAlert, error)
    public UptimeAlert(string name, UptimeAlertArgs args, CustomResourceOptions? opts = null)
    public UptimeAlert(String name, UptimeAlertArgs args)
    public UptimeAlert(String name, UptimeAlertArgs args, CustomResourceOptions options)
    
    type: digitalocean:UptimeAlert
    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 UptimeAlertArgs
    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 UptimeAlertArgs
    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 UptimeAlertArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UptimeAlertArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UptimeAlertArgs
    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 uptimeAlertResource = new DigitalOcean.UptimeAlert("uptimeAlertResource", new()
    {
        CheckId = "string",
        Notifications = new[]
        {
            new DigitalOcean.Inputs.UptimeAlertNotificationArgs
            {
                Emails = new[]
                {
                    "string",
                },
                Slacks = new[]
                {
                    new DigitalOcean.Inputs.UptimeAlertNotificationSlackArgs
                    {
                        Channel = "string",
                        Url = "string",
                    },
                },
            },
        },
        Type = "string",
        Comparison = "string",
        Name = "string",
        Period = "string",
        Threshold = 0,
    });
    
    example, err := digitalocean.NewUptimeAlert(ctx, "uptimeAlertResource", &digitalocean.UptimeAlertArgs{
    	CheckId: pulumi.String("string"),
    	Notifications: digitalocean.UptimeAlertNotificationArray{
    		&digitalocean.UptimeAlertNotificationArgs{
    			Emails: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			Slacks: digitalocean.UptimeAlertNotificationSlackArray{
    				&digitalocean.UptimeAlertNotificationSlackArgs{
    					Channel: pulumi.String("string"),
    					Url:     pulumi.String("string"),
    				},
    			},
    		},
    	},
    	Type:       pulumi.String("string"),
    	Comparison: pulumi.String("string"),
    	Name:       pulumi.String("string"),
    	Period:     pulumi.String("string"),
    	Threshold:  pulumi.Int(0),
    })
    
    var uptimeAlertResource = new UptimeAlert("uptimeAlertResource", UptimeAlertArgs.builder()
        .checkId("string")
        .notifications(UptimeAlertNotificationArgs.builder()
            .emails("string")
            .slacks(UptimeAlertNotificationSlackArgs.builder()
                .channel("string")
                .url("string")
                .build())
            .build())
        .type("string")
        .comparison("string")
        .name("string")
        .period("string")
        .threshold(0)
        .build());
    
    uptime_alert_resource = digitalocean.UptimeAlert("uptimeAlertResource",
        check_id="string",
        notifications=[{
            "emails": ["string"],
            "slacks": [{
                "channel": "string",
                "url": "string",
            }],
        }],
        type="string",
        comparison="string",
        name="string",
        period="string",
        threshold=0)
    
    const uptimeAlertResource = new digitalocean.UptimeAlert("uptimeAlertResource", {
        checkId: "string",
        notifications: [{
            emails: ["string"],
            slacks: [{
                channel: "string",
                url: "string",
            }],
        }],
        type: "string",
        comparison: "string",
        name: "string",
        period: "string",
        threshold: 0,
    });
    
    type: digitalocean:UptimeAlert
    properties:
        checkId: string
        comparison: string
        name: string
        notifications:
            - emails:
                - string
              slacks:
                - channel: string
                  url: string
        period: string
        threshold: 0
        type: string
    

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

    CheckId string
    A unique identifier for a check
    Notifications List<Pulumi.DigitalOcean.Inputs.UptimeAlertNotification>
    The notification settings for a trigger alert.
    Type string
    The type of health check to perform. Must be one of latency, down, down_global or ssl_expiry.
    Comparison string
    The comparison operator used against the alert's threshold. Must be one of greater_than or less_than.
    Name string
    A human-friendly display name.
    Period string
    Period of time the threshold must be exceeded to trigger the alert. Must be one of 2m, 3m, 5m, 10m, 15m, 30m or 1h.
    Threshold int
    The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
    CheckId string
    A unique identifier for a check
    Notifications []UptimeAlertNotificationArgs
    The notification settings for a trigger alert.
    Type string
    The type of health check to perform. Must be one of latency, down, down_global or ssl_expiry.
    Comparison string
    The comparison operator used against the alert's threshold. Must be one of greater_than or less_than.
    Name string
    A human-friendly display name.
    Period string
    Period of time the threshold must be exceeded to trigger the alert. Must be one of 2m, 3m, 5m, 10m, 15m, 30m or 1h.
    Threshold int
    The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
    checkId String
    A unique identifier for a check
    notifications List<UptimeAlertNotification>
    The notification settings for a trigger alert.
    type String
    The type of health check to perform. Must be one of latency, down, down_global or ssl_expiry.
    comparison String
    The comparison operator used against the alert's threshold. Must be one of greater_than or less_than.
    name String
    A human-friendly display name.
    period String
    Period of time the threshold must be exceeded to trigger the alert. Must be one of 2m, 3m, 5m, 10m, 15m, 30m or 1h.
    threshold Integer
    The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
    checkId string
    A unique identifier for a check
    notifications UptimeAlertNotification[]
    The notification settings for a trigger alert.
    type string
    The type of health check to perform. Must be one of latency, down, down_global or ssl_expiry.
    comparison string
    The comparison operator used against the alert's threshold. Must be one of greater_than or less_than.
    name string
    A human-friendly display name.
    period string
    Period of time the threshold must be exceeded to trigger the alert. Must be one of 2m, 3m, 5m, 10m, 15m, 30m or 1h.
    threshold number
    The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
    check_id str
    A unique identifier for a check
    notifications Sequence[UptimeAlertNotificationArgs]
    The notification settings for a trigger alert.
    type str
    The type of health check to perform. Must be one of latency, down, down_global or ssl_expiry.
    comparison str
    The comparison operator used against the alert's threshold. Must be one of greater_than or less_than.
    name str
    A human-friendly display name.
    period str
    Period of time the threshold must be exceeded to trigger the alert. Must be one of 2m, 3m, 5m, 10m, 15m, 30m or 1h.
    threshold int
    The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
    checkId String
    A unique identifier for a check
    notifications List<Property Map>
    The notification settings for a trigger alert.
    type String
    The type of health check to perform. Must be one of latency, down, down_global or ssl_expiry.
    comparison String
    The comparison operator used against the alert's threshold. Must be one of greater_than or less_than.
    name String
    A human-friendly display name.
    period String
    Period of time the threshold must be exceeded to trigger the alert. Must be one of 2m, 3m, 5m, 10m, 15m, 30m or 1h.
    threshold Number
    The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.

    Outputs

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

    Get an existing UptimeAlert 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?: UptimeAlertState, opts?: CustomResourceOptions): UptimeAlert
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            check_id: Optional[str] = None,
            comparison: Optional[str] = None,
            name: Optional[str] = None,
            notifications: Optional[Sequence[UptimeAlertNotificationArgs]] = None,
            period: Optional[str] = None,
            threshold: Optional[int] = None,
            type: Optional[str] = None) -> UptimeAlert
    func GetUptimeAlert(ctx *Context, name string, id IDInput, state *UptimeAlertState, opts ...ResourceOption) (*UptimeAlert, error)
    public static UptimeAlert Get(string name, Input<string> id, UptimeAlertState? state, CustomResourceOptions? opts = null)
    public static UptimeAlert get(String name, Output<String> id, UptimeAlertState 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:
    CheckId string
    A unique identifier for a check
    Comparison string
    The comparison operator used against the alert's threshold. Must be one of greater_than or less_than.
    Name string
    A human-friendly display name.
    Notifications List<Pulumi.DigitalOcean.Inputs.UptimeAlertNotification>
    The notification settings for a trigger alert.
    Period string
    Period of time the threshold must be exceeded to trigger the alert. Must be one of 2m, 3m, 5m, 10m, 15m, 30m or 1h.
    Threshold int
    The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
    Type string
    The type of health check to perform. Must be one of latency, down, down_global or ssl_expiry.
    CheckId string
    A unique identifier for a check
    Comparison string
    The comparison operator used against the alert's threshold. Must be one of greater_than or less_than.
    Name string
    A human-friendly display name.
    Notifications []UptimeAlertNotificationArgs
    The notification settings for a trigger alert.
    Period string
    Period of time the threshold must be exceeded to trigger the alert. Must be one of 2m, 3m, 5m, 10m, 15m, 30m or 1h.
    Threshold int
    The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
    Type string
    The type of health check to perform. Must be one of latency, down, down_global or ssl_expiry.
    checkId String
    A unique identifier for a check
    comparison String
    The comparison operator used against the alert's threshold. Must be one of greater_than or less_than.
    name String
    A human-friendly display name.
    notifications List<UptimeAlertNotification>
    The notification settings for a trigger alert.
    period String
    Period of time the threshold must be exceeded to trigger the alert. Must be one of 2m, 3m, 5m, 10m, 15m, 30m or 1h.
    threshold Integer
    The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
    type String
    The type of health check to perform. Must be one of latency, down, down_global or ssl_expiry.
    checkId string
    A unique identifier for a check
    comparison string
    The comparison operator used against the alert's threshold. Must be one of greater_than or less_than.
    name string
    A human-friendly display name.
    notifications UptimeAlertNotification[]
    The notification settings for a trigger alert.
    period string
    Period of time the threshold must be exceeded to trigger the alert. Must be one of 2m, 3m, 5m, 10m, 15m, 30m or 1h.
    threshold number
    The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
    type string
    The type of health check to perform. Must be one of latency, down, down_global or ssl_expiry.
    check_id str
    A unique identifier for a check
    comparison str
    The comparison operator used against the alert's threshold. Must be one of greater_than or less_than.
    name str
    A human-friendly display name.
    notifications Sequence[UptimeAlertNotificationArgs]
    The notification settings for a trigger alert.
    period str
    Period of time the threshold must be exceeded to trigger the alert. Must be one of 2m, 3m, 5m, 10m, 15m, 30m or 1h.
    threshold int
    The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
    type str
    The type of health check to perform. Must be one of latency, down, down_global or ssl_expiry.
    checkId String
    A unique identifier for a check
    comparison String
    The comparison operator used against the alert's threshold. Must be one of greater_than or less_than.
    name String
    A human-friendly display name.
    notifications List<Property Map>
    The notification settings for a trigger alert.
    period String
    Period of time the threshold must be exceeded to trigger the alert. Must be one of 2m, 3m, 5m, 10m, 15m, 30m or 1h.
    threshold Number
    The threshold at which the alert will enter a trigger state. The specific threshold is dependent on the alert type.
    type String
    The type of health check to perform. Must be one of latency, down, down_global or ssl_expiry.

    Supporting Types

    UptimeAlertNotification, UptimeAlertNotificationArgs

    Emails List<string>
    List of email addresses to sent notifications to.
    Slacks List<Pulumi.DigitalOcean.Inputs.UptimeAlertNotificationSlack>
    Emails []string
    List of email addresses to sent notifications to.
    Slacks []UptimeAlertNotificationSlack
    emails List<String>
    List of email addresses to sent notifications to.
    slacks List<UptimeAlertNotificationSlack>
    emails string[]
    List of email addresses to sent notifications to.
    slacks UptimeAlertNotificationSlack[]
    emails Sequence[str]
    List of email addresses to sent notifications to.
    slacks Sequence[UptimeAlertNotificationSlack]
    emails List<String>
    List of email addresses to sent notifications to.
    slacks List<Property Map>

    UptimeAlertNotificationSlack, UptimeAlertNotificationSlackArgs

    Channel string
    The Slack channel to send alerts to.
    Url string
    The webhook URL for Slack.
    Channel string
    The Slack channel to send alerts to.
    Url string
    The webhook URL for Slack.
    channel String
    The Slack channel to send alerts to.
    url String
    The webhook URL for Slack.
    channel string
    The Slack channel to send alerts to.
    url string
    The webhook URL for Slack.
    channel str
    The Slack channel to send alerts to.
    url str
    The webhook URL for Slack.
    channel String
    The Slack channel to send alerts to.
    url String
    The webhook URL for Slack.

    Import

    Uptime alerts can be imported using both the ID of the alert’s parent check and

    its own separated by a comma in the format: check_id,alert_id. For example:

    $ pulumi import digitalocean:index/uptimeAlert:UptimeAlert target 94a7d216-d821-11ee-a327-33d3239ffc4b,5a4981aa-9653-4bd1-bef5-d6bff52042e4
    

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

    Package Details

    Repository
    DigitalOcean pulumi/pulumi-digitalocean
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the digitalocean Terraform Provider.
    digitalocean logo
    DigitalOcean v4.34.0 published on Monday, Oct 21, 2024 by Pulumi