Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

Downtime

Provides a Datadog downtime resource. This can be used to create and manage Datadog downtimes.

Example: downtime for a specific monitor

import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";

// Create a new daily 1700-0900 Datadog downtime for a specific monitor id
const foo = new datadog.Downtime("foo", {
    end: 1483365600,
    monitorId: 12345,
    recurrence: {
        period: 1,
        type: "days",
    },
    scopes: ["*"],
    start: 1483308000,
});
import pulumi
import pulumi_datadog as datadog

# Create a new daily 1700-0900 Datadog downtime for a specific monitor id
foo = datadog.Downtime("foo",
    end=1483365600,
    monitor_id=12345,
    recurrence=datadog.DowntimeRecurrenceArgs(
        period=1,
        type="days",
    ),
    scopes=["*"],
    start=1483308000)
using Pulumi;
using Datadog = Pulumi.Datadog;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a new daily 1700-0900 Datadog downtime for a specific monitor id
        var foo = new Datadog.Downtime("foo", new Datadog.DowntimeArgs
        {
            End = 1483365600,
            MonitorId = 12345,
            Recurrence = new Datadog.Inputs.DowntimeRecurrenceArgs
            {
                Period = 1,
                Type = "days",
            },
            Scopes = 
            {
                "*",
            },
            Start = 1483308000,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog"
	"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := datadog.NewDowntime(ctx, "foo", &datadog.DowntimeArgs{
			End:       pulumi.Int(1483365600),
			MonitorId: pulumi.Int(12345),
			Recurrence: &datadog.DowntimeRecurrenceArgs{
				Period: pulumi.Int(1),
				Type:   pulumi.String("days"),
			},
			Scopes: pulumi.StringArray{
				pulumi.String("*"),
			},
			Start: pulumi.Int(1483308000),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Example: downtime for all monitors

import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";

// Create a new daily 1700-0900 Datadog downtime for all monitors
const foo = new datadog.Downtime("foo", {
    end: 1483365600,
    recurrence: {
        period: 1,
        type: "days",
    },
    scopes: ["*"],
    start: 1483308000,
});
import pulumi
import pulumi_datadog as datadog

# Create a new daily 1700-0900 Datadog downtime for all monitors
foo = datadog.Downtime("foo",
    end=1483365600,
    recurrence=datadog.DowntimeRecurrenceArgs(
        period=1,
        type="days",
    ),
    scopes=["*"],
    start=1483308000)
using Pulumi;
using Datadog = Pulumi.Datadog;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a new daily 1700-0900 Datadog downtime for all monitors
        var foo = new Datadog.Downtime("foo", new Datadog.DowntimeArgs
        {
            End = 1483365600,
            Recurrence = new Datadog.Inputs.DowntimeRecurrenceArgs
            {
                Period = 1,
                Type = "days",
            },
            Scopes = 
            {
                "*",
            },
            Start = 1483308000,
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog"
	"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := datadog.NewDowntime(ctx, "foo", &datadog.DowntimeArgs{
			End: pulumi.Int(1483365600),
			Recurrence: &datadog.DowntimeRecurrenceArgs{
				Period: pulumi.Int(1),
				Type:   pulumi.String("days"),
			},
			Scopes: pulumi.StringArray{
				pulumi.String("*"),
			},
			Start: pulumi.Int(1483308000),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Create a Downtime Resource

new Downtime(name: string, args: DowntimeArgs, opts?: CustomResourceOptions);
def Downtime(resource_name: str, opts: Optional[ResourceOptions] = None, active: Optional[bool] = None, disabled: Optional[bool] = None, end: Optional[int] = None, end_date: Optional[str] = None, message: Optional[str] = None, monitor_id: Optional[int] = None, monitor_tags: Optional[Sequence[str]] = None, recurrence: Optional[DowntimeRecurrenceArgs] = None, scopes: Optional[Sequence[str]] = None, start: Optional[int] = None, start_date: Optional[str] = None, timezone: Optional[str] = None)
func NewDowntime(ctx *Context, name string, args DowntimeArgs, opts ...ResourceOption) (*Downtime, error)
public Downtime(string name, DowntimeArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args DowntimeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args DowntimeArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DowntimeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Downtime Resource Properties

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

Inputs

The Downtime resource accepts the following input properties:

Scopes List<string>

specify the group scope to which this downtime applies. For everything use ‘*’

Active bool

When true indicates this downtime is being actively applied

Disabled bool

When true indicates this downtime is not being applied

End int

Optionally specify an end date when this downtime should expire

EndDate string

String representing date and time to end the downtime in RFC3339 format.

Message string

An optional message to provide when creating the downtime, can include notification handles

MonitorId int

When specified, this downtime will only apply to this monitor

MonitorTags List<string>

A list of monitor tags (up to 25), i.e. tags that are applied directly to monitors to which the downtime applies

Recurrence DowntimeRecurrenceArgs

Optional recurring schedule for this downtime

Start int

Specify when this downtime should start

StartDate string

String representing date and time to start the downtime in RFC3339 format.

Timezone string

The timezone for the downtime, default UTC

Scopes []string

specify the group scope to which this downtime applies. For everything use ‘*’

Active bool

When true indicates this downtime is being actively applied

Disabled bool

When true indicates this downtime is not being applied

End int

Optionally specify an end date when this downtime should expire

EndDate string

String representing date and time to end the downtime in RFC3339 format.

Message string

An optional message to provide when creating the downtime, can include notification handles

MonitorId int

When specified, this downtime will only apply to this monitor

MonitorTags []string

A list of monitor tags (up to 25), i.e. tags that are applied directly to monitors to which the downtime applies

Recurrence DowntimeRecurrence

Optional recurring schedule for this downtime

Start int

Specify when this downtime should start

StartDate string

String representing date and time to start the downtime in RFC3339 format.

Timezone string

The timezone for the downtime, default UTC

scopes string[]

specify the group scope to which this downtime applies. For everything use ‘*’

active boolean

When true indicates this downtime is being actively applied

disabled boolean

When true indicates this downtime is not being applied

end number

Optionally specify an end date when this downtime should expire

endDate string

String representing date and time to end the downtime in RFC3339 format.

message string

An optional message to provide when creating the downtime, can include notification handles

monitorId number

When specified, this downtime will only apply to this monitor

monitorTags string[]

A list of monitor tags (up to 25), i.e. tags that are applied directly to monitors to which the downtime applies

recurrence DowntimeRecurrence

Optional recurring schedule for this downtime

start number

Specify when this downtime should start

startDate string

String representing date and time to start the downtime in RFC3339 format.

timezone string

The timezone for the downtime, default UTC

scopes Sequence[str]

specify the group scope to which this downtime applies. For everything use ‘*’

active bool

When true indicates this downtime is being actively applied

disabled bool

When true indicates this downtime is not being applied

end int

Optionally specify an end date when this downtime should expire

end_date str

String representing date and time to end the downtime in RFC3339 format.

message str

An optional message to provide when creating the downtime, can include notification handles

monitor_id int

When specified, this downtime will only apply to this monitor

monitor_tags Sequence[str]

A list of monitor tags (up to 25), i.e. tags that are applied directly to monitors to which the downtime applies

recurrence DowntimeRecurrenceArgs

Optional recurring schedule for this downtime

start int

Specify when this downtime should start

start_date str

String representing date and time to start the downtime in RFC3339 format.

timezone str

The timezone for the downtime, default UTC

Outputs

All input properties are implicitly available as output properties. Additionally, the Downtime 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing Downtime Resource

Get an existing Downtime 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?: DowntimeState, opts?: CustomResourceOptions): Downtime
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, active: Optional[bool] = None, disabled: Optional[bool] = None, end: Optional[int] = None, end_date: Optional[str] = None, message: Optional[str] = None, monitor_id: Optional[int] = None, monitor_tags: Optional[Sequence[str]] = None, recurrence: Optional[DowntimeRecurrenceArgs] = None, scopes: Optional[Sequence[str]] = None, start: Optional[int] = None, start_date: Optional[str] = None, timezone: Optional[str] = None) -> Downtime
func GetDowntime(ctx *Context, name string, id IDInput, state *DowntimeState, opts ...ResourceOption) (*Downtime, error)
public static Downtime Get(string name, Input<string> id, DowntimeState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Active bool

When true indicates this downtime is being actively applied

Disabled bool

When true indicates this downtime is not being applied

End int

Optionally specify an end date when this downtime should expire

EndDate string

String representing date and time to end the downtime in RFC3339 format.

Message string

An optional message to provide when creating the downtime, can include notification handles

MonitorId int

When specified, this downtime will only apply to this monitor

MonitorTags List<string>

A list of monitor tags (up to 25), i.e. tags that are applied directly to monitors to which the downtime applies

Recurrence DowntimeRecurrenceArgs

Optional recurring schedule for this downtime

Scopes List<string>

specify the group scope to which this downtime applies. For everything use ‘*’

Start int

Specify when this downtime should start

StartDate string

String representing date and time to start the downtime in RFC3339 format.

Timezone string

The timezone for the downtime, default UTC

Active bool

When true indicates this downtime is being actively applied

Disabled bool

When true indicates this downtime is not being applied

End int

Optionally specify an end date when this downtime should expire

EndDate string

String representing date and time to end the downtime in RFC3339 format.

Message string

An optional message to provide when creating the downtime, can include notification handles

MonitorId int

When specified, this downtime will only apply to this monitor

MonitorTags []string

A list of monitor tags (up to 25), i.e. tags that are applied directly to monitors to which the downtime applies

Recurrence DowntimeRecurrence

Optional recurring schedule for this downtime

Scopes []string

specify the group scope to which this downtime applies. For everything use ‘*’

Start int

Specify when this downtime should start

StartDate string

String representing date and time to start the downtime in RFC3339 format.

Timezone string

The timezone for the downtime, default UTC

active boolean

When true indicates this downtime is being actively applied

disabled boolean

When true indicates this downtime is not being applied

end number

Optionally specify an end date when this downtime should expire

endDate string

String representing date and time to end the downtime in RFC3339 format.

message string

An optional message to provide when creating the downtime, can include notification handles

monitorId number

When specified, this downtime will only apply to this monitor

monitorTags string[]

A list of monitor tags (up to 25), i.e. tags that are applied directly to monitors to which the downtime applies

recurrence DowntimeRecurrence

Optional recurring schedule for this downtime

scopes string[]

specify the group scope to which this downtime applies. For everything use ‘*’

start number

Specify when this downtime should start

startDate string

String representing date and time to start the downtime in RFC3339 format.

timezone string

The timezone for the downtime, default UTC

active bool

When true indicates this downtime is being actively applied

disabled bool

When true indicates this downtime is not being applied

end int

Optionally specify an end date when this downtime should expire

end_date str

String representing date and time to end the downtime in RFC3339 format.

message str

An optional message to provide when creating the downtime, can include notification handles

monitor_id int

When specified, this downtime will only apply to this monitor

monitor_tags Sequence[str]

A list of monitor tags (up to 25), i.e. tags that are applied directly to monitors to which the downtime applies

recurrence DowntimeRecurrenceArgs

Optional recurring schedule for this downtime

scopes Sequence[str]

specify the group scope to which this downtime applies. For everything use ‘*’

start int

Specify when this downtime should start

start_date str

String representing date and time to start the downtime in RFC3339 format.

timezone str

The timezone for the downtime, default UTC

Supporting Types

DowntimeRecurrence

Type string
Period int
Rrule string
UntilDate int
UntilOccurrences int
WeekDays List<string>
Type string
Period int
Rrule string
UntilDate int
UntilOccurrences int
WeekDays []string
type string
period number
rrule string
untilDate number
untilOccurrences number
weekDays string[]
type str
period int
rrule str
until_date int
until_occurrences int
week_days Sequence[str]

Import

Downtimes can be imported using their numeric ID, e.g.

 $ pulumi import datadog:index/downtime:Downtime bytes_received_localhost 2081

Package Details

Repository
https://github.com/pulumi/pulumi-datadog
License
Apache-2.0
Notes
This Pulumi package is based on the datadog Terraform Provider.