opsgenie.IncidentTemplate
Explore with Pulumi AI
Manages an Incident Template within Opsgenie.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opsgenie = Pulumi.Opsgenie;
return await Deployment.RunAsync(() =>
{
var testTeam = new Opsgenie.Team("testTeam", new()
{
Description = "This team deals with all the things",
});
var testService = new Opsgenie.Service("testService", new()
{
TeamId = testTeam.Id,
});
var testIncidentTemplate = new Opsgenie.IncidentTemplate("testIncidentTemplate", new()
{
Message = "Incident Message",
Priority = "P2",
StakeholderProperties = new[]
{
new Opsgenie.Inputs.IncidentTemplateStakeholderPropertyArgs
{
Enable = true,
Message = "Stakeholder Message",
Description = "Stakeholder Description",
},
},
Tags = new[]
{
"tag1",
"tag2",
},
Description = "Incident Description",
Details =
{
{ "key1", "value1" },
{ "key2", "value2" },
},
ImpactedServices = new[]
{
testService.Id,
},
});
});
package main
import (
"github.com/pulumi/pulumi-opsgenie/sdk/go/opsgenie"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
testTeam, err := opsgenie.NewTeam(ctx, "testTeam", &opsgenie.TeamArgs{
Description: pulumi.String("This team deals with all the things"),
})
if err != nil {
return err
}
testService, err := opsgenie.NewService(ctx, "testService", &opsgenie.ServiceArgs{
TeamId: testTeam.ID(),
})
if err != nil {
return err
}
_, err = opsgenie.NewIncidentTemplate(ctx, "testIncidentTemplate", &opsgenie.IncidentTemplateArgs{
Message: pulumi.String("Incident Message"),
Priority: pulumi.String("P2"),
StakeholderProperties: opsgenie.IncidentTemplateStakeholderPropertyArray{
&opsgenie.IncidentTemplateStakeholderPropertyArgs{
Enable: pulumi.Bool(true),
Message: pulumi.String("Stakeholder Message"),
Description: pulumi.String("Stakeholder Description"),
},
},
Tags: pulumi.StringArray{
pulumi.String("tag1"),
pulumi.String("tag2"),
},
Description: pulumi.String("Incident Description"),
Details: pulumi.StringMap{
"key1": pulumi.String("value1"),
"key2": pulumi.String("value2"),
},
ImpactedServices: pulumi.StringArray{
testService.ID(),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opsgenie.Team;
import com.pulumi.opsgenie.TeamArgs;
import com.pulumi.opsgenie.Service;
import com.pulumi.opsgenie.ServiceArgs;
import com.pulumi.opsgenie.IncidentTemplate;
import com.pulumi.opsgenie.IncidentTemplateArgs;
import com.pulumi.opsgenie.inputs.IncidentTemplateStakeholderPropertyArgs;
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 testTeam = new Team("testTeam", TeamArgs.builder()
.description("This team deals with all the things")
.build());
var testService = new Service("testService", ServiceArgs.builder()
.teamId(testTeam.id())
.build());
var testIncidentTemplate = new IncidentTemplate("testIncidentTemplate", IncidentTemplateArgs.builder()
.message("Incident Message")
.priority("P2")
.stakeholderProperties(IncidentTemplateStakeholderPropertyArgs.builder()
.enable(true)
.message("Stakeholder Message")
.description("Stakeholder Description")
.build())
.tags(
"tag1",
"tag2")
.description("Incident Description")
.details(Map.ofEntries(
Map.entry("key1", "value1"),
Map.entry("key2", "value2")
))
.impactedServices(testService.id())
.build());
}
}
import pulumi
import pulumi_opsgenie as opsgenie
test_team = opsgenie.Team("testTeam", description="This team deals with all the things")
test_service = opsgenie.Service("testService", team_id=test_team.id)
test_incident_template = opsgenie.IncidentTemplate("testIncidentTemplate",
message="Incident Message",
priority="P2",
stakeholder_properties=[opsgenie.IncidentTemplateStakeholderPropertyArgs(
enable=True,
message="Stakeholder Message",
description="Stakeholder Description",
)],
tags=[
"tag1",
"tag2",
],
description="Incident Description",
details={
"key1": "value1",
"key2": "value2",
},
impacted_services=[test_service.id])
import * as pulumi from "@pulumi/pulumi";
import * as opsgenie from "@pulumi/opsgenie";
const testTeam = new opsgenie.Team("testTeam", {description: "This team deals with all the things"});
const testService = new opsgenie.Service("testService", {teamId: testTeam.id});
const testIncidentTemplate = new opsgenie.IncidentTemplate("testIncidentTemplate", {
message: "Incident Message",
priority: "P2",
stakeholderProperties: [{
enable: true,
message: "Stakeholder Message",
description: "Stakeholder Description",
}],
tags: [
"tag1",
"tag2",
],
description: "Incident Description",
details: {
key1: "value1",
key2: "value2",
},
impactedServices: [testService.id],
});
resources:
testTeam:
type: opsgenie:Team
properties:
description: This team deals with all the things
testService:
type: opsgenie:Service
properties:
teamId: ${testTeam.id}
testIncidentTemplate:
type: opsgenie:IncidentTemplate
properties:
message: Incident Message
priority: P2
stakeholderProperties:
- enable: true
message: Stakeholder Message
description: Stakeholder Description
tags:
- tag1
- tag2
description: Incident Description
details:
key1: value1
key2: value2
impactedServices:
- ${testService.id}
Create IncidentTemplate Resource
new IncidentTemplate(name: string, args: IncidentTemplateArgs, opts?: CustomResourceOptions);
@overload
def IncidentTemplate(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
details: Optional[Mapping[str, str]] = None,
impacted_services: Optional[Sequence[str]] = None,
message: Optional[str] = None,
name: Optional[str] = None,
priority: Optional[str] = None,
stakeholder_properties: Optional[Sequence[IncidentTemplateStakeholderPropertyArgs]] = None,
tags: Optional[Sequence[str]] = None)
@overload
def IncidentTemplate(resource_name: str,
args: IncidentTemplateArgs,
opts: Optional[ResourceOptions] = None)
func NewIncidentTemplate(ctx *Context, name string, args IncidentTemplateArgs, opts ...ResourceOption) (*IncidentTemplate, error)
public IncidentTemplate(string name, IncidentTemplateArgs args, CustomResourceOptions? opts = null)
public IncidentTemplate(String name, IncidentTemplateArgs args)
public IncidentTemplate(String name, IncidentTemplateArgs args, CustomResourceOptions options)
type: opsgenie:IncidentTemplate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IncidentTemplateArgs
- 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 IncidentTemplateArgs
- 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 IncidentTemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IncidentTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IncidentTemplateArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
IncidentTemplate 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 IncidentTemplate resource accepts the following input properties:
- Message string
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- Priority string
Priority level of the incident. Possible values are
P1
,P2
,P3
,P4
andP5
.- Stakeholder
Properties List<IncidentTemplate Stakeholder Property> - Description string
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- Details Dictionary<string, string>
Map of key-value pairs to use as custom properties of the incident template. This field must not be longer than 8000 characters.
- Impacted
Services List<string> - Name string
Name of the incident template.
- List<string>
Tags of the incident template.
- Message string
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- Priority string
Priority level of the incident. Possible values are
P1
,P2
,P3
,P4
andP5
.- Stakeholder
Properties []IncidentTemplate Stakeholder Property Args - Description string
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- Details map[string]string
Map of key-value pairs to use as custom properties of the incident template. This field must not be longer than 8000 characters.
- Impacted
Services []string - Name string
Name of the incident template.
- []string
Tags of the incident template.
- message String
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- priority String
Priority level of the incident. Possible values are
P1
,P2
,P3
,P4
andP5
.- stakeholder
Properties List<IncidentTemplate Stakeholder Property> - description String
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- details Map<String,String>
Map of key-value pairs to use as custom properties of the incident template. This field must not be longer than 8000 characters.
- impacted
Services List<String> - name String
Name of the incident template.
- List<String>
Tags of the incident template.
- message string
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- priority string
Priority level of the incident. Possible values are
P1
,P2
,P3
,P4
andP5
.- stakeholder
Properties IncidentTemplate Stakeholder Property[] - description string
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- details {[key: string]: string}
Map of key-value pairs to use as custom properties of the incident template. This field must not be longer than 8000 characters.
- impacted
Services string[] - name string
Name of the incident template.
- string[]
Tags of the incident template.
- message str
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- priority str
Priority level of the incident. Possible values are
P1
,P2
,P3
,P4
andP5
.- stakeholder_
properties Sequence[IncidentTemplate Stakeholder Property Args] - description str
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- details Mapping[str, str]
Map of key-value pairs to use as custom properties of the incident template. This field must not be longer than 8000 characters.
- impacted_
services Sequence[str] - name str
Name of the incident template.
- Sequence[str]
Tags of the incident template.
- message String
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- priority String
Priority level of the incident. Possible values are
P1
,P2
,P3
,P4
andP5
.- stakeholder
Properties List<Property Map> - description String
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- details Map<String>
Map of key-value pairs to use as custom properties of the incident template. This field must not be longer than 8000 characters.
- impacted
Services List<String> - name String
Name of the incident template.
- List<String>
Tags of the incident template.
Outputs
All input properties are implicitly available as output properties. Additionally, the IncidentTemplate 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 IncidentTemplate Resource
Get an existing IncidentTemplate 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?: IncidentTemplateState, opts?: CustomResourceOptions): IncidentTemplate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
details: Optional[Mapping[str, str]] = None,
impacted_services: Optional[Sequence[str]] = None,
message: Optional[str] = None,
name: Optional[str] = None,
priority: Optional[str] = None,
stakeholder_properties: Optional[Sequence[IncidentTemplateStakeholderPropertyArgs]] = None,
tags: Optional[Sequence[str]] = None) -> IncidentTemplate
func GetIncidentTemplate(ctx *Context, name string, id IDInput, state *IncidentTemplateState, opts ...ResourceOption) (*IncidentTemplate, error)
public static IncidentTemplate Get(string name, Input<string> id, IncidentTemplateState? state, CustomResourceOptions? opts = null)
public static IncidentTemplate get(String name, Output<String> id, IncidentTemplateState 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
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- Details Dictionary<string, string>
Map of key-value pairs to use as custom properties of the incident template. This field must not be longer than 8000 characters.
- Impacted
Services List<string> - Message string
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- Name string
Name of the incident template.
- Priority string
Priority level of the incident. Possible values are
P1
,P2
,P3
,P4
andP5
.- Stakeholder
Properties List<IncidentTemplate Stakeholder Property> - List<string>
Tags of the incident template.
- Description string
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- Details map[string]string
Map of key-value pairs to use as custom properties of the incident template. This field must not be longer than 8000 characters.
- Impacted
Services []string - Message string
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- Name string
Name of the incident template.
- Priority string
Priority level of the incident. Possible values are
P1
,P2
,P3
,P4
andP5
.- Stakeholder
Properties []IncidentTemplate Stakeholder Property Args - []string
Tags of the incident template.
- description String
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- details Map<String,String>
Map of key-value pairs to use as custom properties of the incident template. This field must not be longer than 8000 characters.
- impacted
Services List<String> - message String
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- name String
Name of the incident template.
- priority String
Priority level of the incident. Possible values are
P1
,P2
,P3
,P4
andP5
.- stakeholder
Properties List<IncidentTemplate Stakeholder Property> - List<String>
Tags of the incident template.
- description string
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- details {[key: string]: string}
Map of key-value pairs to use as custom properties of the incident template. This field must not be longer than 8000 characters.
- impacted
Services string[] - message string
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- name string
Name of the incident template.
- priority string
Priority level of the incident. Possible values are
P1
,P2
,P3
,P4
andP5
.- stakeholder
Properties IncidentTemplate Stakeholder Property[] - string[]
Tags of the incident template.
- description str
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- details Mapping[str, str]
Map of key-value pairs to use as custom properties of the incident template. This field must not be longer than 8000 characters.
- impacted_
services Sequence[str] - message str
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- name str
Name of the incident template.
- priority str
Priority level of the incident. Possible values are
P1
,P2
,P3
,P4
andP5
.- stakeholder_
properties Sequence[IncidentTemplate Stakeholder Property Args] - Sequence[str]
Tags of the incident template.
- description String
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- details Map<String>
Map of key-value pairs to use as custom properties of the incident template. This field must not be longer than 8000 characters.
- impacted
Services List<String> - message String
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- name String
Name of the incident template.
- priority String
Priority level of the incident. Possible values are
P1
,P2
,P3
,P4
andP5
.- stakeholder
Properties List<Property Map> - List<String>
Tags of the incident template.
Supporting Types
IncidentTemplateStakeholderProperty, IncidentTemplateStakeholderPropertyArgs
- Message string
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- Description string
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- Enable bool
Option to enable stakeholder notifications.Default value is true.
- Message string
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- Description string
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- Enable bool
Option to enable stakeholder notifications.Default value is true.
- message String
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- description String
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- enable Boolean
Option to enable stakeholder notifications.Default value is true.
- message string
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- description string
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- enable boolean
Option to enable stakeholder notifications.Default value is true.
- message str
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- description str
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- enable bool
Option to enable stakeholder notifications.Default value is true.
- message String
Message that is to be passed to audience that is generally used to provide a content information about the alert.
- description String
Description that is generally used to provide a detailed information about the alert. This field must not be longer than 15000 characters.
- enable Boolean
Option to enable stakeholder notifications.Default value is true.
Import
Service can be imported using the template_id
, e.g.
$ pulumi import opsgenie:index/incidentTemplate:IncidentTemplate test template_id`
Package Details
- Repository
- Opsgenie pulumi/pulumi-opsgenie
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
opsgenie
Terraform Provider.