pagerduty.MaintenanceWindow
Explore with Pulumi AI
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
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: [examplePagerdutyService.id],
});
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=[example_pagerduty_service["id"]])
package main
import (
"github.com/pulumi/pulumi-pagerduty/sdk/v4/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{
examplePagerdutyService.Id,
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Pagerduty = Pulumi.Pagerduty;
return await Deployment.RunAsync(() =>
{
var example = new Pagerduty.MaintenanceWindow("example", new()
{
StartTime = "2015-11-09T20:00:00-05:00",
EndTime = "2015-11-09T22:00:00-05:00",
Services = new[]
{
examplePagerdutyService.Id,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.pagerduty.MaintenanceWindow;
import com.pulumi.pagerduty.MaintenanceWindowArgs;
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 MaintenanceWindow("example", MaintenanceWindowArgs.builder()
.startTime("2015-11-09T20:00:00-05:00")
.endTime("2015-11-09T22:00:00-05:00")
.services(examplePagerdutyService.id())
.build());
}
}
resources:
example:
type: pagerduty:MaintenanceWindow
properties:
startTime: 2015-11-09T20:00:00-05:00
endTime: 2015-11-09T22:00:00-05:00
services:
- ${examplePagerdutyService.id}
Create MaintenanceWindow Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MaintenanceWindow(name: string, args: MaintenanceWindowArgs, opts?: CustomResourceOptions);
@overload
def MaintenanceWindow(resource_name: str,
args: MaintenanceWindowArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MaintenanceWindow(resource_name: str,
opts: Optional[ResourceOptions] = None,
end_time: Optional[str] = None,
services: Optional[Sequence[str]] = None,
start_time: Optional[str] = None,
description: Optional[str] = None)
func NewMaintenanceWindow(ctx *Context, name string, args MaintenanceWindowArgs, opts ...ResourceOption) (*MaintenanceWindow, error)
public MaintenanceWindow(string name, MaintenanceWindowArgs args, CustomResourceOptions? opts = null)
public MaintenanceWindow(String name, MaintenanceWindowArgs args)
public MaintenanceWindow(String name, MaintenanceWindowArgs args, CustomResourceOptions options)
type: pagerduty:MaintenanceWindow
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 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.
- name String
- The unique name of the resource.
- args MaintenanceWindowArgs
- 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 maintenanceWindowResource = new Pagerduty.MaintenanceWindow("maintenanceWindowResource", new()
{
EndTime = "string",
Services = new[]
{
"string",
},
StartTime = "string",
Description = "string",
});
example, err := pagerduty.NewMaintenanceWindow(ctx, "maintenanceWindowResource", &pagerduty.MaintenanceWindowArgs{
EndTime: pulumi.String("string"),
Services: pulumi.StringArray{
pulumi.String("string"),
},
StartTime: pulumi.String("string"),
Description: pulumi.String("string"),
})
var maintenanceWindowResource = new MaintenanceWindow("maintenanceWindowResource", MaintenanceWindowArgs.builder()
.endTime("string")
.services("string")
.startTime("string")
.description("string")
.build());
maintenance_window_resource = pagerduty.MaintenanceWindow("maintenanceWindowResource",
end_time="string",
services=["string"],
start_time="string",
description="string")
const maintenanceWindowResource = new pagerduty.MaintenanceWindow("maintenanceWindowResource", {
endTime: "string",
services: ["string"],
startTime: "string",
description: "string",
});
type: pagerduty:MaintenanceWindow
properties:
description: string
endTime: string
services:
- string
startTime: string
MaintenanceWindow 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 MaintenanceWindow resource accepts the following input properties:
- End
Time 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.
- Start
Time 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 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.
- Start
Time 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 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.
- start
Time 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 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.
- start
Time 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.
- end
Time 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.
- start
Time 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.
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 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 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)
public static MaintenanceWindow get(String name, Output<String> id, MaintenanceWindowState 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.
- Description string
- A description for the maintenance window.
- End
Time 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.
- Start
Time 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 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.
- Start
Time 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 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.
- start
Time 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 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.
- start
Time 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.
- description String
- A description for the maintenance window.
- end
Time 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.
- start
Time 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.
Import
Maintenance windows can be imported using the id
, e.g.
$ pulumi import pagerduty:index/maintenanceWindow:MaintenanceWindow main PLBP09X
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- PagerDuty pulumi/pulumi-pagerduty
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
pagerduty
Terraform Provider.