published on Friday, Oct 30, 2026 by zenduty
published on Friday, Oct 30, 2026 by zenduty
zenduty.MaintenanceTemplate defines an alert-matching rule for a team. Alerts matching the rule are suppressed while a maintenance window that uses the template is active.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as zenduty from "@pulumi/zenduty";
const deploys = new zenduty.MaintenanceTemplate("deploys", {
teamId: ops.id,
name: "Deployment noise",
isEnabled: true,
ruleJson: JSON.stringify({
type: "group",
id: "9a99988a-0123-4456-b89a-b1607f326fd8",
children1: {
"898aa9ba-0123-4456-b89a-b16a429f5d94": {
type: "rule",
id: "898aa9ba-0123-4456-b89a-b16a429f5d94",
properties: {
field: "alert.incident_urgency",
operator: "select_equals",
value: ["low"],
valueSrc: ["value"],
operatorOptions: null,
valueType: ["select"],
},
path: [
"9a99988a-0123-4456-b89a-b1607f326fd8",
"898aa9ba-0123-4456-b89a-b16a429f5d94",
],
},
},
properties: {
conjunction: "AND",
not: false,
},
path: ["9a99988a-0123-4456-b89a-b1607f326fd8"],
}),
});
import pulumi
import json
import pulumi_zenduty as zenduty
deploys = zenduty.MaintenanceTemplate("deploys",
team_id=ops["id"],
name="Deployment noise",
is_enabled=True,
rule_json=json.dumps({
"type": "group",
"id": "9a99988a-0123-4456-b89a-b1607f326fd8",
"children1": {
"898aa9ba-0123-4456-b89a-b16a429f5d94": {
"type": "rule",
"id": "898aa9ba-0123-4456-b89a-b16a429f5d94",
"properties": {
"field": "alert.incident_urgency",
"operator": "select_equals",
"value": ["low"],
"valueSrc": ["value"],
"operatorOptions": None,
"valueType": ["select"],
},
"path": [
"9a99988a-0123-4456-b89a-b1607f326fd8",
"898aa9ba-0123-4456-b89a-b16a429f5d94",
],
},
},
"properties": {
"conjunction": "AND",
"not": False,
},
"path": ["9a99988a-0123-4456-b89a-b1607f326fd8"],
}))
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-terraform-provider/sdks/go/zenduty/v2/zenduty"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"type": "group",
"id": "9a99988a-0123-4456-b89a-b1607f326fd8",
"children1": map[string]interface{}{
"898aa9ba-0123-4456-b89a-b16a429f5d94": map[string]interface{}{
"type": "rule",
"id": "898aa9ba-0123-4456-b89a-b16a429f5d94",
"properties": map[string]interface{}{
"field": "alert.incident_urgency",
"operator": "select_equals",
"value": []string{
"low",
},
"valueSrc": []string{
"value",
},
"operatorOptions": nil,
"valueType": []string{
"select",
},
},
"path": []string{
"9a99988a-0123-4456-b89a-b1607f326fd8",
"898aa9ba-0123-4456-b89a-b16a429f5d94",
},
},
},
"properties": map[string]interface{}{
"conjunction": "AND",
"not": false,
},
"path": []string{
"9a99988a-0123-4456-b89a-b1607f326fd8",
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = zenduty.NewMaintenanceTemplate(ctx, "deploys", &zenduty.MaintenanceTemplateArgs{
TeamId: pulumi.Any(ops.Id),
Name: pulumi.String("Deployment noise"),
IsEnabled: pulumi.Bool(true),
RuleJson: pulumi.String(json0),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Zenduty = Pulumi.Zenduty;
return await Deployment.RunAsync(() =>
{
var deploys = new Zenduty.MaintenanceTemplate("deploys", new()
{
TeamId = ops.Id,
Name = "Deployment noise",
IsEnabled = true,
RuleJson = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["type"] = "group",
["id"] = "9a99988a-0123-4456-b89a-b1607f326fd8",
["children1"] = new Dictionary<string, object?>
{
["898aa9ba-0123-4456-b89a-b16a429f5d94"] = new Dictionary<string, object?>
{
["type"] = "rule",
["id"] = "898aa9ba-0123-4456-b89a-b16a429f5d94",
["properties"] = new Dictionary<string, object?>
{
["field"] = "alert.incident_urgency",
["operator"] = "select_equals",
["value"] = new[]
{
"low",
},
["valueSrc"] = new[]
{
"value",
},
["operatorOptions"] = null,
["valueType"] = new[]
{
"select",
},
},
["path"] = new[]
{
"9a99988a-0123-4456-b89a-b1607f326fd8",
"898aa9ba-0123-4456-b89a-b16a429f5d94",
},
},
},
["properties"] = new Dictionary<string, object?>
{
["conjunction"] = "AND",
["not"] = false,
},
["path"] = new[]
{
"9a99988a-0123-4456-b89a-b1607f326fd8",
},
}),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.zenduty.MaintenanceTemplate;
import com.pulumi.zenduty.MaintenanceTemplateArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 deploys = new MaintenanceTemplate("deploys", MaintenanceTemplateArgs.builder()
.teamId(ops.id())
.name("Deployment noise")
.isEnabled(true)
.ruleJson(serializeJson(
jsonObject(
jsonProperty("type", "group"),
jsonProperty("id", "9a99988a-0123-4456-b89a-b1607f326fd8"),
jsonProperty("children1", jsonObject(
jsonProperty("898aa9ba-0123-4456-b89a-b16a429f5d94", jsonObject(
jsonProperty("type", "rule"),
jsonProperty("id", "898aa9ba-0123-4456-b89a-b16a429f5d94"),
jsonProperty("properties", jsonObject(
jsonProperty("field", "alert.incident_urgency"),
jsonProperty("operator", "select_equals"),
jsonProperty("value", jsonArray("low")),
jsonProperty("valueSrc", jsonArray("value")),
jsonProperty("operatorOptions", null),
jsonProperty("valueType", jsonArray("select"))
)),
jsonProperty("path", jsonArray(
"9a99988a-0123-4456-b89a-b1607f326fd8",
"898aa9ba-0123-4456-b89a-b16a429f5d94"
))
))
)),
jsonProperty("properties", jsonObject(
jsonProperty("conjunction", "AND"),
jsonProperty("not", false)
)),
jsonProperty("path", jsonArray("9a99988a-0123-4456-b89a-b1607f326fd8"))
)))
.build());
}
}
resources:
deploys:
type: zenduty:MaintenanceTemplate
properties:
teamId: ${ops.id}
name: Deployment noise
isEnabled: true # same react-query-builder format as zenduty_alertrules rule_json
ruleJson:
fn::toJSON:
type: group
id: 9a99988a-0123-4456-b89a-b1607f326fd8
children1:
898aa9ba-0123-4456-b89a-b16a429f5d94:
type: rule
id: 898aa9ba-0123-4456-b89a-b16a429f5d94
properties:
field: alert.incident_urgency
operator: select_equals
value:
- low
valueSrc:
- value
operatorOptions: null
valueType:
- select
path:
- 9a99988a-0123-4456-b89a-b1607f326fd8
- 898aa9ba-0123-4456-b89a-b16a429f5d94
properties:
conjunction: AND
not: false
path:
- 9a99988a-0123-4456-b89a-b1607f326fd8
Example coming soon!
Create MaintenanceTemplate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MaintenanceTemplate(name: string, args: MaintenanceTemplateArgs, opts?: CustomResourceOptions);@overload
def MaintenanceTemplate(resource_name: str,
args: MaintenanceTemplateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MaintenanceTemplate(resource_name: str,
opts: Optional[ResourceOptions] = None,
rule_json: Optional[str] = None,
team_id: Optional[str] = None,
is_enabled: Optional[bool] = None,
maintenance_template_id: Optional[str] = None,
name: Optional[str] = None)func NewMaintenanceTemplate(ctx *Context, name string, args MaintenanceTemplateArgs, opts ...ResourceOption) (*MaintenanceTemplate, error)public MaintenanceTemplate(string name, MaintenanceTemplateArgs args, CustomResourceOptions? opts = null)
public MaintenanceTemplate(String name, MaintenanceTemplateArgs args)
public MaintenanceTemplate(String name, MaintenanceTemplateArgs args, CustomResourceOptions options)
type: zenduty:MaintenanceTemplate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "zenduty_maintenance_template" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args MaintenanceTemplateArgs
- 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 MaintenanceTemplateArgs
- 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 MaintenanceTemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MaintenanceTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MaintenanceTemplateArgs
- 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 maintenanceTemplateResource = new Zenduty.MaintenanceTemplate("maintenanceTemplateResource", new()
{
RuleJson = "string",
TeamId = "string",
IsEnabled = false,
MaintenanceTemplateId = "string",
Name = "string",
});
example, err := zenduty.NewMaintenanceTemplate(ctx, "maintenanceTemplateResource", &zenduty.MaintenanceTemplateArgs{
RuleJson: pulumi.String("string"),
TeamId: pulumi.String("string"),
IsEnabled: pulumi.Bool(false),
MaintenanceTemplateId: pulumi.String("string"),
Name: pulumi.String("string"),
})
resource "zenduty_maintenance_template" "maintenanceTemplateResource" {
lifecycle {
create_before_destroy = true
}
rule_json = "string"
team_id = "string"
is_enabled = false
maintenance_template_id = "string"
name = "string"
}
var maintenanceTemplateResource = new MaintenanceTemplate("maintenanceTemplateResource", MaintenanceTemplateArgs.builder()
.ruleJson("string")
.teamId("string")
.isEnabled(false)
.maintenanceTemplateId("string")
.name("string")
.build());
maintenance_template_resource = zenduty.MaintenanceTemplate("maintenanceTemplateResource",
rule_json="string",
team_id="string",
is_enabled=False,
maintenance_template_id="string",
name="string")
const maintenanceTemplateResource = new zenduty.MaintenanceTemplate("maintenanceTemplateResource", {
ruleJson: "string",
teamId: "string",
isEnabled: false,
maintenanceTemplateId: "string",
name: "string",
});
type: zenduty:MaintenanceTemplate
properties:
isEnabled: false
maintenanceTemplateId: string
name: string
ruleJson: string
teamId: string
MaintenanceTemplate 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 MaintenanceTemplate resource accepts the following input properties:
- Rule
Json string - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - Team
Id string - The unique_id of the team.
- Is
Enabled bool - Whether the template is active. Defaults to
true. - Maintenance
Template stringId - The unique_id of the maintenance template.
- Name string
- Name of the template, 1 to 50 characters.
- Rule
Json string - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - Team
Id string - The unique_id of the team.
- Is
Enabled bool - Whether the template is active. Defaults to
true. - Maintenance
Template stringId - The unique_id of the maintenance template.
- Name string
- Name of the template, 1 to 50 characters.
- rule_
json string - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - team_
id string - The unique_id of the team.
- is_
enabled bool - Whether the template is active. Defaults to
true. - maintenance_
template_ stringid - The unique_id of the maintenance template.
- name string
- Name of the template, 1 to 50 characters.
- rule
Json String - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - team
Id String - The unique_id of the team.
- is
Enabled Boolean - Whether the template is active. Defaults to
true. - maintenance
Template StringId - The unique_id of the maintenance template.
- name String
- Name of the template, 1 to 50 characters.
- rule
Json string - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - team
Id string - The unique_id of the team.
- is
Enabled boolean - Whether the template is active. Defaults to
true. - maintenance
Template stringId - The unique_id of the maintenance template.
- name string
- Name of the template, 1 to 50 characters.
- rule_
json str - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - team_
id str - The unique_id of the team.
- is_
enabled bool - Whether the template is active. Defaults to
true. - maintenance_
template_ strid - The unique_id of the maintenance template.
- name str
- Name of the template, 1 to 50 characters.
- rule
Json String - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - team
Id String - The unique_id of the team.
- is
Enabled Boolean - Whether the template is active. Defaults to
true. - maintenance
Template StringId - The unique_id of the maintenance template.
- name String
- Name of the template, 1 to 50 characters.
Outputs
All input properties are implicitly available as output properties. Additionally, the MaintenanceTemplate 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 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 MaintenanceTemplate Resource
Get an existing MaintenanceTemplate 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?: MaintenanceTemplateState, opts?: CustomResourceOptions): MaintenanceTemplate@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
is_enabled: Optional[bool] = None,
maintenance_template_id: Optional[str] = None,
name: Optional[str] = None,
rule_json: Optional[str] = None,
team_id: Optional[str] = None) -> MaintenanceTemplatefunc GetMaintenanceTemplate(ctx *Context, name string, id IDInput, state *MaintenanceTemplateState, opts ...ResourceOption) (*MaintenanceTemplate, error)public static MaintenanceTemplate Get(string name, Input<string> id, MaintenanceTemplateState? state, CustomResourceOptions? opts = null)public static MaintenanceTemplate get(String name, Output<String> id, MaintenanceTemplateState state, CustomResourceOptions options)resources: _: type: zenduty:MaintenanceTemplate get: id: ${id}import {
to = zenduty_maintenance_template.example
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.
- Is
Enabled bool - Whether the template is active. Defaults to
true. - Maintenance
Template stringId - The unique_id of the maintenance template.
- Name string
- Name of the template, 1 to 50 characters.
- Rule
Json string - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - Team
Id string - The unique_id of the team.
- Is
Enabled bool - Whether the template is active. Defaults to
true. - Maintenance
Template stringId - The unique_id of the maintenance template.
- Name string
- Name of the template, 1 to 50 characters.
- Rule
Json string - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - Team
Id string - The unique_id of the team.
- is_
enabled bool - Whether the template is active. Defaults to
true. - maintenance_
template_ stringid - The unique_id of the maintenance template.
- name string
- Name of the template, 1 to 50 characters.
- rule_
json string - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - team_
id string - The unique_id of the team.
- is
Enabled Boolean - Whether the template is active. Defaults to
true. - maintenance
Template StringId - The unique_id of the maintenance template.
- name String
- Name of the template, 1 to 50 characters.
- rule
Json String - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - team
Id String - The unique_id of the team.
- is
Enabled boolean - Whether the template is active. Defaults to
true. - maintenance
Template stringId - The unique_id of the maintenance template.
- name string
- Name of the template, 1 to 50 characters.
- rule
Json string - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - team
Id string - The unique_id of the team.
- is_
enabled bool - Whether the template is active. Defaults to
true. - maintenance_
template_ strid - The unique_id of the maintenance template.
- name str
- Name of the template, 1 to 50 characters.
- rule_
json str - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - team_
id str - The unique_id of the team.
- is
Enabled Boolean - Whether the template is active. Defaults to
true. - maintenance
Template StringId - The unique_id of the maintenance template.
- name String
- Name of the template, 1 to 50 characters.
- rule
Json String - The matching rule as JSON, in the same format as
zenduty.Alertrulesrule_json. Usejsonencode(); key order and whitespace differences are ignored. - team
Id String - The unique_id of the team.
Import
hcl
resource “zenduty_maintenance_template” “deploys” {
}
$ pulumi import zenduty:index/maintenanceTemplate:MaintenanceTemplate deploys team_id/maintenance_template_id`
$ terraform state show zenduty_maintenance_template.deploys
* copy the output data and paste inside zenduty_maintenance_template.deploys resource block and remove the id attribute
$ pulumi preview to verify the import
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- zenduty zenduty/terraform-provider-zenduty
- License
- Notes
- This Pulumi package is based on the
zendutyTerraform Provider.
published on Friday, Oct 30, 2026 by zenduty