grafana.OncallRoute
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumi/grafana";
import * as grafana from "@pulumiverse/grafana";
const exampleSlackChannel = grafana.getOnCallSlackChannel({
name: "example_slack_channel",
});
const _default = new grafana.OncallEscalationChain("default", {});
const exampleIntegration = new grafana.OncallIntegration("exampleIntegration", {
type: "grafana",
defaultRoute: {},
});
const exampleRoute = new grafana.OncallRoute("exampleRoute", {
integrationId: exampleIntegration.id,
escalationChainId: _default.id,
routingRegex: "us-(east|west)",
position: 0,
slack: {
channelId: exampleSlackChannel.then(exampleSlackChannel => exampleSlackChannel.slackId),
enabled: true,
},
telegram: {
id: "ONCALLTELEGRAMID",
enabled: true,
},
msteams: {
id: "ONCALLMSTEAMSID",
enabled: false,
},
});
import pulumi
import pulumi_grafana as grafana
import pulumiverse_grafana as grafana
example_slack_channel = grafana.get_on_call_slack_channel(name="example_slack_channel")
default = grafana.OncallEscalationChain("default")
example_integration = grafana.OncallIntegration("exampleIntegration",
type="grafana",
default_route=grafana.OncallIntegrationDefaultRouteArgs())
example_route = grafana.OncallRoute("exampleRoute",
integration_id=example_integration.id,
escalation_chain_id=default.id,
routing_regex="us-(east|west)",
position=0,
slack=grafana.OncallRouteSlackArgs(
channel_id=example_slack_channel.slack_id,
enabled=True,
),
telegram=grafana.OncallRouteTelegramArgs(
id="ONCALLTELEGRAMID",
enabled=True,
),
msteams=grafana.OncallRouteMsteamsArgs(
id="ONCALLMSTEAMSID",
enabled=False,
))
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleSlackChannel, err := grafana.GetOnCallSlackChannel(ctx, &grafana.GetOnCallSlackChannelArgs{
Name: "example_slack_channel",
}, nil)
if err != nil {
return err
}
_, err = grafana.NewOncallEscalationChain(ctx, "default", nil)
if err != nil {
return err
}
exampleIntegration, err := grafana.NewOncallIntegration(ctx, "exampleIntegration", &grafana.OncallIntegrationArgs{
Type: pulumi.String("grafana"),
DefaultRoute: nil,
})
if err != nil {
return err
}
_, err = grafana.NewOncallRoute(ctx, "exampleRoute", &grafana.OncallRouteArgs{
IntegrationId: exampleIntegration.ID(),
EscalationChainId: _default.ID(),
RoutingRegex: pulumi.String("us-(east|west)"),
Position: pulumi.Int(0),
Slack: &grafana.OncallRouteSlackArgs{
ChannelId: pulumi.String(exampleSlackChannel.SlackId),
Enabled: pulumi.Bool(true),
},
Telegram: &grafana.OncallRouteTelegramArgs{
Id: pulumi.String("ONCALLTELEGRAMID"),
Enabled: pulumi.Bool(true),
},
Msteams: &grafana.OncallRouteMsteamsArgs{
Id: pulumi.String("ONCALLMSTEAMSID"),
Enabled: pulumi.Bool(false),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Pulumi.Grafana;
using Grafana = Pulumiverse.Grafana;
return await Deployment.RunAsync(() =>
{
var exampleSlackChannel = Grafana.GetOnCallSlackChannel.Invoke(new()
{
Name = "example_slack_channel",
});
var @default = new Grafana.OncallEscalationChain("default");
var exampleIntegration = new Grafana.OncallIntegration("exampleIntegration", new()
{
Type = "grafana",
DefaultRoute = null,
});
var exampleRoute = new Grafana.OncallRoute("exampleRoute", new()
{
IntegrationId = exampleIntegration.Id,
EscalationChainId = @default.Id,
RoutingRegex = "us-(east|west)",
Position = 0,
Slack = new Grafana.Inputs.OncallRouteSlackArgs
{
ChannelId = exampleSlackChannel.Apply(getOnCallSlackChannelResult => getOnCallSlackChannelResult.SlackId),
Enabled = true,
},
Telegram = new Grafana.Inputs.OncallRouteTelegramArgs
{
Id = "ONCALLTELEGRAMID",
Enabled = true,
},
Msteams = new Grafana.Inputs.OncallRouteMsteamsArgs
{
Id = "ONCALLMSTEAMSID",
Enabled = false,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.GrafanaFunctions;
import com.pulumi.grafana.inputs.GetOnCallSlackChannelArgs;
import com.pulumi.grafana.OncallEscalationChain;
import com.pulumi.grafana.OncallIntegration;
import com.pulumi.grafana.OncallIntegrationArgs;
import com.pulumi.grafana.inputs.OncallIntegrationDefaultRouteArgs;
import com.pulumi.grafana.OncallRoute;
import com.pulumi.grafana.OncallRouteArgs;
import com.pulumi.grafana.inputs.OncallRouteSlackArgs;
import com.pulumi.grafana.inputs.OncallRouteTelegramArgs;
import com.pulumi.grafana.inputs.OncallRouteMsteamsArgs;
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) {
final var exampleSlackChannel = GrafanaFunctions.getOnCallSlackChannel(GetOnCallSlackChannelArgs.builder()
.name("example_slack_channel")
.build());
var default_ = new OncallEscalationChain("default");
var exampleIntegration = new OncallIntegration("exampleIntegration", OncallIntegrationArgs.builder()
.type("grafana")
.defaultRoute()
.build());
var exampleRoute = new OncallRoute("exampleRoute", OncallRouteArgs.builder()
.integrationId(exampleIntegration.id())
.escalationChainId(default_.id())
.routingRegex("us-(east|west)")
.position(0)
.slack(OncallRouteSlackArgs.builder()
.channelId(exampleSlackChannel.applyValue(getOnCallSlackChannelResult -> getOnCallSlackChannelResult.slackId()))
.enabled(true)
.build())
.telegram(OncallRouteTelegramArgs.builder()
.id("ONCALLTELEGRAMID")
.enabled(true)
.build())
.msteams(OncallRouteMsteamsArgs.builder()
.id("ONCALLMSTEAMSID")
.enabled(false)
.build())
.build());
}
}
resources:
default:
type: grafana:OncallEscalationChain
exampleIntegration:
type: grafana:OncallIntegration
properties:
type: grafana
defaultRoute: {}
exampleRoute:
type: grafana:OncallRoute
properties:
integrationId: ${exampleIntegration.id}
escalationChainId: ${default.id}
routingRegex: us-(east|west)
position: 0
slack:
channelId: ${exampleSlackChannel.slackId}
enabled: true
telegram:
id: ONCALLTELEGRAMID
enabled: true
msteams:
id: ONCALLMSTEAMSID
enabled: false
variables:
exampleSlackChannel:
fn::invoke:
Function: grafana:getOnCallSlackChannel
Arguments:
name: example_slack_channel
Create OncallRoute Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new OncallRoute(name: string, args: OncallRouteArgs, opts?: CustomResourceOptions);
@overload
def OncallRoute(resource_name: str,
args: OncallRouteArgs,
opts: Optional[ResourceOptions] = None)
@overload
def OncallRoute(resource_name: str,
opts: Optional[ResourceOptions] = None,
escalation_chain_id: Optional[str] = None,
integration_id: Optional[str] = None,
position: Optional[int] = None,
routing_regex: Optional[str] = None,
msteams: Optional[OncallRouteMsteamsArgs] = None,
routing_type: Optional[str] = None,
slack: Optional[OncallRouteSlackArgs] = None,
telegram: Optional[OncallRouteTelegramArgs] = None)
func NewOncallRoute(ctx *Context, name string, args OncallRouteArgs, opts ...ResourceOption) (*OncallRoute, error)
public OncallRoute(string name, OncallRouteArgs args, CustomResourceOptions? opts = null)
public OncallRoute(String name, OncallRouteArgs args)
public OncallRoute(String name, OncallRouteArgs args, CustomResourceOptions options)
type: grafana:OncallRoute
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 OncallRouteArgs
- 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 OncallRouteArgs
- 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 OncallRouteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args OncallRouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args OncallRouteArgs
- 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 oncallRouteResource = new Grafana.OncallRoute("oncallRouteResource", new()
{
EscalationChainId = "string",
IntegrationId = "string",
Position = 0,
RoutingRegex = "string",
Msteams = new Grafana.Inputs.OncallRouteMsteamsArgs
{
Enabled = false,
Id = "string",
},
RoutingType = "string",
Slack = new Grafana.Inputs.OncallRouteSlackArgs
{
ChannelId = "string",
Enabled = false,
},
Telegram = new Grafana.Inputs.OncallRouteTelegramArgs
{
Enabled = false,
Id = "string",
},
});
example, err := grafana.NewOncallRoute(ctx, "oncallRouteResource", &grafana.OncallRouteArgs{
EscalationChainId: pulumi.String("string"),
IntegrationId: pulumi.String("string"),
Position: pulumi.Int(0),
RoutingRegex: pulumi.String("string"),
Msteams: &grafana.OncallRouteMsteamsArgs{
Enabled: pulumi.Bool(false),
Id: pulumi.String("string"),
},
RoutingType: pulumi.String("string"),
Slack: &grafana.OncallRouteSlackArgs{
ChannelId: pulumi.String("string"),
Enabled: pulumi.Bool(false),
},
Telegram: &grafana.OncallRouteTelegramArgs{
Enabled: pulumi.Bool(false),
Id: pulumi.String("string"),
},
})
var oncallRouteResource = new OncallRoute("oncallRouteResource", OncallRouteArgs.builder()
.escalationChainId("string")
.integrationId("string")
.position(0)
.routingRegex("string")
.msteams(OncallRouteMsteamsArgs.builder()
.enabled(false)
.id("string")
.build())
.routingType("string")
.slack(OncallRouteSlackArgs.builder()
.channelId("string")
.enabled(false)
.build())
.telegram(OncallRouteTelegramArgs.builder()
.enabled(false)
.id("string")
.build())
.build());
oncall_route_resource = grafana.OncallRoute("oncallRouteResource",
escalation_chain_id="string",
integration_id="string",
position=0,
routing_regex="string",
msteams=grafana.OncallRouteMsteamsArgs(
enabled=False,
id="string",
),
routing_type="string",
slack=grafana.OncallRouteSlackArgs(
channel_id="string",
enabled=False,
),
telegram=grafana.OncallRouteTelegramArgs(
enabled=False,
id="string",
))
const oncallRouteResource = new grafana.OncallRoute("oncallRouteResource", {
escalationChainId: "string",
integrationId: "string",
position: 0,
routingRegex: "string",
msteams: {
enabled: false,
id: "string",
},
routingType: "string",
slack: {
channelId: "string",
enabled: false,
},
telegram: {
enabled: false,
id: "string",
},
});
type: grafana:OncallRoute
properties:
escalationChainId: string
integrationId: string
msteams:
enabled: false
id: string
position: 0
routingRegex: string
routingType: string
slack:
channelId: string
enabled: false
telegram:
enabled: false
id: string
OncallRoute 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 OncallRoute resource accepts the following input properties:
- Escalation
Chain stringId - The ID of the escalation chain.
- Integration
Id string - The ID of the integration.
- Position int
- The position of the route (starts from 0).
- Routing
Regex string - Python Regex query. Route is chosen for an alert if there is a match inside the alert payload.
- Msteams
Pulumiverse.
Grafana. Inputs. Oncall Route Msteams - MS teams-specific settings for a route.
- Routing
Type string - The type of route. Can be jinja2, regex Defaults to
regex
. - Slack
Pulumiverse.
Grafana. Inputs. Oncall Route Slack - Slack-specific settings for a route.
- Telegram
Pulumiverse.
Grafana. Inputs. Oncall Route Telegram - Telegram-specific settings for a route.
- Escalation
Chain stringId - The ID of the escalation chain.
- Integration
Id string - The ID of the integration.
- Position int
- The position of the route (starts from 0).
- Routing
Regex string - Python Regex query. Route is chosen for an alert if there is a match inside the alert payload.
- Msteams
Oncall
Route Msteams Args - MS teams-specific settings for a route.
- Routing
Type string - The type of route. Can be jinja2, regex Defaults to
regex
. - Slack
Oncall
Route Slack Args - Slack-specific settings for a route.
- Telegram
Oncall
Route Telegram Args - Telegram-specific settings for a route.
- escalation
Chain StringId - The ID of the escalation chain.
- integration
Id String - The ID of the integration.
- position Integer
- The position of the route (starts from 0).
- routing
Regex String - Python Regex query. Route is chosen for an alert if there is a match inside the alert payload.
- msteams
Oncall
Route Msteams - MS teams-specific settings for a route.
- routing
Type String - The type of route. Can be jinja2, regex Defaults to
regex
. - slack
Oncall
Route Slack - Slack-specific settings for a route.
- telegram
Oncall
Route Telegram - Telegram-specific settings for a route.
- escalation
Chain stringId - The ID of the escalation chain.
- integration
Id string - The ID of the integration.
- position number
- The position of the route (starts from 0).
- routing
Regex string - Python Regex query. Route is chosen for an alert if there is a match inside the alert payload.
- msteams
Oncall
Route Msteams - MS teams-specific settings for a route.
- routing
Type string - The type of route. Can be jinja2, regex Defaults to
regex
. - slack
Oncall
Route Slack - Slack-specific settings for a route.
- telegram
Oncall
Route Telegram - Telegram-specific settings for a route.
- escalation_
chain_ strid - The ID of the escalation chain.
- integration_
id str - The ID of the integration.
- position int
- The position of the route (starts from 0).
- routing_
regex str - Python Regex query. Route is chosen for an alert if there is a match inside the alert payload.
- msteams
Oncall
Route Msteams Args - MS teams-specific settings for a route.
- routing_
type str - The type of route. Can be jinja2, regex Defaults to
regex
. - slack
Oncall
Route Slack Args - Slack-specific settings for a route.
- telegram
Oncall
Route Telegram Args - Telegram-specific settings for a route.
- escalation
Chain StringId - The ID of the escalation chain.
- integration
Id String - The ID of the integration.
- position Number
- The position of the route (starts from 0).
- routing
Regex String - Python Regex query. Route is chosen for an alert if there is a match inside the alert payload.
- msteams Property Map
- MS teams-specific settings for a route.
- routing
Type String - The type of route. Can be jinja2, regex Defaults to
regex
. - slack Property Map
- Slack-specific settings for a route.
- telegram Property Map
- Telegram-specific settings for a route.
Outputs
All input properties are implicitly available as output properties. Additionally, the OncallRoute 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 OncallRoute Resource
Get an existing OncallRoute 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?: OncallRouteState, opts?: CustomResourceOptions): OncallRoute
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
escalation_chain_id: Optional[str] = None,
integration_id: Optional[str] = None,
msteams: Optional[OncallRouteMsteamsArgs] = None,
position: Optional[int] = None,
routing_regex: Optional[str] = None,
routing_type: Optional[str] = None,
slack: Optional[OncallRouteSlackArgs] = None,
telegram: Optional[OncallRouteTelegramArgs] = None) -> OncallRoute
func GetOncallRoute(ctx *Context, name string, id IDInput, state *OncallRouteState, opts ...ResourceOption) (*OncallRoute, error)
public static OncallRoute Get(string name, Input<string> id, OncallRouteState? state, CustomResourceOptions? opts = null)
public static OncallRoute get(String name, Output<String> id, OncallRouteState 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.
- Escalation
Chain stringId - The ID of the escalation chain.
- Integration
Id string - The ID of the integration.
- Msteams
Pulumiverse.
Grafana. Inputs. Oncall Route Msteams - MS teams-specific settings for a route.
- Position int
- The position of the route (starts from 0).
- Routing
Regex string - Python Regex query. Route is chosen for an alert if there is a match inside the alert payload.
- Routing
Type string - The type of route. Can be jinja2, regex Defaults to
regex
. - Slack
Pulumiverse.
Grafana. Inputs. Oncall Route Slack - Slack-specific settings for a route.
- Telegram
Pulumiverse.
Grafana. Inputs. Oncall Route Telegram - Telegram-specific settings for a route.
- Escalation
Chain stringId - The ID of the escalation chain.
- Integration
Id string - The ID of the integration.
- Msteams
Oncall
Route Msteams Args - MS teams-specific settings for a route.
- Position int
- The position of the route (starts from 0).
- Routing
Regex string - Python Regex query. Route is chosen for an alert if there is a match inside the alert payload.
- Routing
Type string - The type of route. Can be jinja2, regex Defaults to
regex
. - Slack
Oncall
Route Slack Args - Slack-specific settings for a route.
- Telegram
Oncall
Route Telegram Args - Telegram-specific settings for a route.
- escalation
Chain StringId - The ID of the escalation chain.
- integration
Id String - The ID of the integration.
- msteams
Oncall
Route Msteams - MS teams-specific settings for a route.
- position Integer
- The position of the route (starts from 0).
- routing
Regex String - Python Regex query. Route is chosen for an alert if there is a match inside the alert payload.
- routing
Type String - The type of route. Can be jinja2, regex Defaults to
regex
. - slack
Oncall
Route Slack - Slack-specific settings for a route.
- telegram
Oncall
Route Telegram - Telegram-specific settings for a route.
- escalation
Chain stringId - The ID of the escalation chain.
- integration
Id string - The ID of the integration.
- msteams
Oncall
Route Msteams - MS teams-specific settings for a route.
- position number
- The position of the route (starts from 0).
- routing
Regex string - Python Regex query. Route is chosen for an alert if there is a match inside the alert payload.
- routing
Type string - The type of route. Can be jinja2, regex Defaults to
regex
. - slack
Oncall
Route Slack - Slack-specific settings for a route.
- telegram
Oncall
Route Telegram - Telegram-specific settings for a route.
- escalation_
chain_ strid - The ID of the escalation chain.
- integration_
id str - The ID of the integration.
- msteams
Oncall
Route Msteams Args - MS teams-specific settings for a route.
- position int
- The position of the route (starts from 0).
- routing_
regex str - Python Regex query. Route is chosen for an alert if there is a match inside the alert payload.
- routing_
type str - The type of route. Can be jinja2, regex Defaults to
regex
. - slack
Oncall
Route Slack Args - Slack-specific settings for a route.
- telegram
Oncall
Route Telegram Args - Telegram-specific settings for a route.
- escalation
Chain StringId - The ID of the escalation chain.
- integration
Id String - The ID of the integration.
- msteams Property Map
- MS teams-specific settings for a route.
- position Number
- The position of the route (starts from 0).
- routing
Regex String - Python Regex query. Route is chosen for an alert if there is a match inside the alert payload.
- routing
Type String - The type of route. Can be jinja2, regex Defaults to
regex
. - slack Property Map
- Slack-specific settings for a route.
- telegram Property Map
- Telegram-specific settings for a route.
Supporting Types
OncallRouteMsteams, OncallRouteMsteamsArgs
OncallRouteSlack, OncallRouteSlackArgs
- channel_
id str - Slack channel id. Alerts will be directed to this channel in Slack.
- enabled bool
- Enable notification in Slack. Defaults to
true
.
OncallRouteTelegram, OncallRouteTelegramArgs
Import
$ pulumi import grafana:index/oncallRoute:OncallRoute name "{{ id }}"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- grafana pulumiverse/pulumi-grafana
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
grafana
Terraform Provider.