MaintenanceWindow

A maintenance window is used to temporarily disable one or more services for a set period of time. No incidents will be triggered and no notifications will be received while a service is disabled by a maintenance window.

Maintenance windows are specified to start at a certain time and end after they have begun. Once started, a maintenance window cannot be deleted; it can only be ended immediately to re-enable the service.

Example Usage

using Pulumi;
using Pagerduty = Pulumi.Pagerduty;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Pagerduty.MaintenanceWindow("example", new Pagerduty.MaintenanceWindowArgs
        {
            StartTime = "2015-11-09T20:00:00-05:00",
            EndTime = "2015-11-09T22:00:00-05:00",
            Services = 
            {
                pagerduty_service.Example.Id,
            },
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := pagerduty.NewMaintenanceWindow(ctx, "example", &pagerduty.MaintenanceWindowArgs{
			StartTime: pulumi.String("2015-11-09T20:00:00-05:00"),
			EndTime:   pulumi.String("2015-11-09T22:00:00-05:00"),
			Services: pulumi.StringArray{
				pulumi.Any(pagerduty_service.Example.Id),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_pagerduty as pagerduty

example = pagerduty.MaintenanceWindow("example",
    start_time="2015-11-09T20:00:00-05:00",
    end_time="2015-11-09T22:00:00-05:00",
    services=[pagerduty_service["example"]["id"]])
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";

const example = new pagerduty.MaintenanceWindow("example", {
    startTime: "2015-11-09T20:00:00-05:00",
    endTime: "2015-11-09T22:00:00-05:00",
    services: [pagerduty_service.example.id],
});

Create a MaintenanceWindow Resource

new MaintenanceWindow(name: string, args: MaintenanceWindowArgs, opts?: CustomResourceOptions);
@overload
def MaintenanceWindow(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      description: Optional[str] = None,
                      end_time: Optional[str] = None,
                      services: Optional[Sequence[str]] = None,
                      start_time: Optional[str] = None)
@overload
def MaintenanceWindow(resource_name: str,
                      args: MaintenanceWindowArgs,
                      opts: Optional[ResourceOptions] = None)
func NewMaintenanceWindow(ctx *Context, name string, args MaintenanceWindowArgs, opts ...ResourceOption) (*MaintenanceWindow, error)
public MaintenanceWindow(string name, MaintenanceWindowArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args MaintenanceWindowArgs
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 MaintenanceWindowArgs
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 MaintenanceWindowArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args MaintenanceWindowArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

MaintenanceWindow Resource Properties

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

Inputs

The MaintenanceWindow resource accepts the following input properties:

EndTime string
The maintenance window’s end time. This is when the services will start creating incidents again. This date must be in the future and after the start_time.
Services List<string>
A list of service IDs to include in the maintenance window.
StartTime string
The maintenance window’s start time. This is when the services will stop creating incidents. If this date is in the past, it will be updated to be the current time.
Description string
A description for the maintenance window.
EndTime string
The maintenance window’s end time. This is when the services will start creating incidents again. This date must be in the future and after the start_time.
Services []string
A list of service IDs to include in the maintenance window.
StartTime string
The maintenance window’s start time. This is when the services will stop creating incidents. If this date is in the past, it will be updated to be the current time.
Description string
A description for the maintenance window.
endTime string
The maintenance window’s end time. This is when the services will start creating incidents again. This date must be in the future and after the start_time.
services string[]
A list of service IDs to include in the maintenance window.
startTime string
The maintenance window’s start time. This is when the services will stop creating incidents. If this date is in the past, it will be updated to be the current time.
description string
A description for the maintenance window.
end_time str
The maintenance window’s end time. This is when the services will start creating incidents again. This date must be in the future and after the start_time.
services Sequence[str]
A list of service IDs to include in the maintenance window.
start_time str
The maintenance window’s start time. This is when the services will stop creating incidents. If this date is in the past, it will be updated to be the current time.
description str
A description for the maintenance window.

Outputs

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

Get an existing MaintenanceWindow 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?: MaintenanceWindowState, opts?: CustomResourceOptions): MaintenanceWindow
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        end_time: Optional[str] = None,
        services: Optional[Sequence[str]] = None,
        start_time: Optional[str] = None) -> MaintenanceWindow
func GetMaintenanceWindow(ctx *Context, name string, id IDInput, state *MaintenanceWindowState, opts ...ResourceOption) (*MaintenanceWindow, error)
public static MaintenanceWindow Get(string name, Input<string> id, MaintenanceWindowState? 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:

Description string
A description for the maintenance window.
EndTime string
The maintenance window’s end time. This is when the services will start creating incidents again. This date must be in the future and after the start_time.
Services List<string>
A list of service IDs to include in the maintenance window.
StartTime string
The maintenance window’s start time. This is when the services will stop creating incidents. If this date is in the past, it will be updated to be the current time.
Description string
A description for the maintenance window.
EndTime string
The maintenance window’s end time. This is when the services will start creating incidents again. This date must be in the future and after the start_time.
Services []string
A list of service IDs to include in the maintenance window.
StartTime string
The maintenance window’s start time. This is when the services will stop creating incidents. If this date is in the past, it will be updated to be the current time.
description string
A description for the maintenance window.
endTime string
The maintenance window’s end time. This is when the services will start creating incidents again. This date must be in the future and after the start_time.
services string[]
A list of service IDs to include in the maintenance window.
startTime string
The maintenance window’s start time. This is when the services will stop creating incidents. If this date is in the past, it will be updated to be the current time.
description str
A description for the maintenance window.
end_time str
The maintenance window’s end time. This is when the services will start creating incidents again. This date must be in the future and after the start_time.
services Sequence[str]
A list of service IDs to include in the maintenance window.
start_time str
The maintenance window’s start time. This is when the services will stop creating incidents. If this date is in the past, it will be updated to be the current time.

Import

Maintenance windows can be imported using the id, e.g.

 $ pulumi import pagerduty:index/maintenanceWindow:MaintenanceWindow main PLBP09X

Package Details

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