Provides a Datadog team notification rule resource. This can be used to create and manage notification rules for Datadog teams.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
// Create new team-notification-rule resource
const foo = new datadog.Team("foo", {
description: "Example team",
handle: "example-team",
name: "Example Team",
});
const fooTeamNotificationRule = new datadog.TeamNotificationRule("foo", {
teamId: foo.id,
email: [{
enabled: true,
}],
msTeams: [{
connectorName: "test-teams-handle",
}],
pagerduty: [{
serviceName: "my-service",
}],
slack: [{
channel: "#test-channel",
workspace: "Datadog",
}],
});
import pulumi
import pulumi_datadog as datadog
# Create new team-notification-rule resource
foo = datadog.Team("foo",
description="Example team",
handle="example-team",
name="Example Team")
foo_team_notification_rule = datadog.TeamNotificationRule("foo",
team_id=foo.id,
email=[{
"enabled": True,
}],
ms_teams=[{
"connectorName": "test-teams-handle",
}],
pagerduty=[{
"serviceName": "my-service",
}],
slack=[{
"channel": "#test-channel",
"workspace": "Datadog",
}])
package main
import (
"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create new team-notification-rule resource
foo, err := datadog.NewTeam(ctx, "foo", &datadog.TeamArgs{
Description: pulumi.String("Example team"),
Handle: pulumi.String("example-team"),
Name: pulumi.String("Example Team"),
})
if err != nil {
return err
}
_, err = datadog.NewTeamNotificationRule(ctx, "foo", &datadog.TeamNotificationRuleArgs{
TeamId: foo.ID(),
Email: datadog.TeamNotificationRuleEmailArgs{
map[string]interface{}{
"enabled": true,
},
},
MsTeams: datadog.TeamNotificationRuleMsTeamsArgs{
map[string]interface{}{
"connectorName": "test-teams-handle",
},
},
Pagerduty: datadog.TeamNotificationRulePagerdutyArgs{
map[string]interface{}{
"serviceName": "my-service",
},
},
Slack: datadog.TeamNotificationRuleSlackArgs{
map[string]interface{}{
"channel": "#test-channel",
"workspace": "Datadog",
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Datadog = Pulumi.Datadog;
return await Deployment.RunAsync(() =>
{
// Create new team-notification-rule resource
var foo = new Datadog.Team("foo", new()
{
Description = "Example team",
Handle = "example-team",
Name = "Example Team",
});
var fooTeamNotificationRule = new Datadog.TeamNotificationRule("foo", new()
{
TeamId = foo.Id,
Email = new[]
{
{
{ "enabled", true },
},
},
MsTeams = new[]
{
{
{ "connectorName", "test-teams-handle" },
},
},
Pagerduty = new[]
{
{
{ "serviceName", "my-service" },
},
},
Slack = new[]
{
{
{ "channel", "#test-channel" },
{ "workspace", "Datadog" },
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.datadog.Team;
import com.pulumi.datadog.TeamArgs;
import com.pulumi.datadog.TeamNotificationRule;
import com.pulumi.datadog.TeamNotificationRuleArgs;
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) {
// Create new team-notification-rule resource
var foo = new Team("foo", TeamArgs.builder()
.description("Example team")
.handle("example-team")
.name("Example Team")
.build());
var fooTeamNotificationRule = new TeamNotificationRule("fooTeamNotificationRule", TeamNotificationRuleArgs.builder()
.teamId(foo.id())
.email(TeamNotificationRuleEmailArgs.builder()
.enabled(true)
.build())
.msTeams(TeamNotificationRuleMsTeamsArgs.builder()
.connectorName("test-teams-handle")
.build())
.pagerduty(TeamNotificationRulePagerdutyArgs.builder()
.serviceName("my-service")
.build())
.slack(TeamNotificationRuleSlackArgs.builder()
.channel("#test-channel")
.workspace("Datadog")
.build())
.build());
}
}
resources:
# Create new team-notification-rule resource
foo:
type: datadog:Team
properties:
description: Example team
handle: example-team
name: Example Team
fooTeamNotificationRule:
type: datadog:TeamNotificationRule
name: foo
properties:
teamId: ${foo.id}
email:
- enabled: true
msTeams:
- connectorName: test-teams-handle
pagerduty:
- serviceName: my-service
slack:
- channel: '#test-channel'
workspace: Datadog
Create TeamNotificationRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TeamNotificationRule(name: string, args: TeamNotificationRuleArgs, opts?: CustomResourceOptions);@overload
def TeamNotificationRule(resource_name: str,
args: TeamNotificationRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TeamNotificationRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
team_id: Optional[str] = None,
email: Optional[TeamNotificationRuleEmailArgs] = None,
ms_teams: Optional[TeamNotificationRuleMsTeamsArgs] = None,
pagerduty: Optional[TeamNotificationRulePagerdutyArgs] = None,
slack: Optional[TeamNotificationRuleSlackArgs] = None)func NewTeamNotificationRule(ctx *Context, name string, args TeamNotificationRuleArgs, opts ...ResourceOption) (*TeamNotificationRule, error)public TeamNotificationRule(string name, TeamNotificationRuleArgs args, CustomResourceOptions? opts = null)
public TeamNotificationRule(String name, TeamNotificationRuleArgs args)
public TeamNotificationRule(String name, TeamNotificationRuleArgs args, CustomResourceOptions options)
type: datadog:TeamNotificationRule
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 TeamNotificationRuleArgs
- 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 TeamNotificationRuleArgs
- 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 TeamNotificationRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TeamNotificationRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TeamNotificationRuleArgs
- 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 teamNotificationRuleResource = new Datadog.TeamNotificationRule("teamNotificationRuleResource", new()
{
TeamId = "string",
Email = new Datadog.Inputs.TeamNotificationRuleEmailArgs
{
Enabled = false,
},
MsTeams = new Datadog.Inputs.TeamNotificationRuleMsTeamsArgs
{
ConnectorName = "string",
},
Pagerduty = new Datadog.Inputs.TeamNotificationRulePagerdutyArgs
{
ServiceName = "string",
},
Slack = new Datadog.Inputs.TeamNotificationRuleSlackArgs
{
Channel = "string",
Workspace = "string",
},
});
example, err := datadog.NewTeamNotificationRule(ctx, "teamNotificationRuleResource", &datadog.TeamNotificationRuleArgs{
TeamId: pulumi.String("string"),
Email: &datadog.TeamNotificationRuleEmailArgs{
Enabled: pulumi.Bool(false),
},
MsTeams: &datadog.TeamNotificationRuleMsTeamsArgs{
ConnectorName: pulumi.String("string"),
},
Pagerduty: &datadog.TeamNotificationRulePagerdutyArgs{
ServiceName: pulumi.String("string"),
},
Slack: &datadog.TeamNotificationRuleSlackArgs{
Channel: pulumi.String("string"),
Workspace: pulumi.String("string"),
},
})
var teamNotificationRuleResource = new TeamNotificationRule("teamNotificationRuleResource", TeamNotificationRuleArgs.builder()
.teamId("string")
.email(TeamNotificationRuleEmailArgs.builder()
.enabled(false)
.build())
.msTeams(TeamNotificationRuleMsTeamsArgs.builder()
.connectorName("string")
.build())
.pagerduty(TeamNotificationRulePagerdutyArgs.builder()
.serviceName("string")
.build())
.slack(TeamNotificationRuleSlackArgs.builder()
.channel("string")
.workspace("string")
.build())
.build());
team_notification_rule_resource = datadog.TeamNotificationRule("teamNotificationRuleResource",
team_id="string",
email={
"enabled": False,
},
ms_teams={
"connector_name": "string",
},
pagerduty={
"service_name": "string",
},
slack={
"channel": "string",
"workspace": "string",
})
const teamNotificationRuleResource = new datadog.TeamNotificationRule("teamNotificationRuleResource", {
teamId: "string",
email: {
enabled: false,
},
msTeams: {
connectorName: "string",
},
pagerduty: {
serviceName: "string",
},
slack: {
channel: "string",
workspace: "string",
},
});
type: datadog:TeamNotificationRule
properties:
email:
enabled: false
msTeams:
connectorName: string
pagerduty:
serviceName: string
slack:
channel: string
workspace: string
teamId: string
TeamNotificationRule 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 TeamNotificationRule resource accepts the following input properties:
- Team
Id string - The ID of the team that this notification rule belongs to.
- Email
Team
Notification Rule Email - The email notification settings.
- Ms
Teams TeamNotification Rule Ms Teams - The MS Teams notification settings.
- Pagerduty
Team
Notification Rule Pagerduty - The PagerDuty notification settings.
- Slack
Team
Notification Rule Slack - The Slack notification settings.
- Team
Id string - The ID of the team that this notification rule belongs to.
- Email
Team
Notification Rule Email Args - The email notification settings.
- Ms
Teams TeamNotification Rule Ms Teams Args - The MS Teams notification settings.
- Pagerduty
Team
Notification Rule Pagerduty Args - The PagerDuty notification settings.
- Slack
Team
Notification Rule Slack Args - The Slack notification settings.
- team
Id String - The ID of the team that this notification rule belongs to.
- email
Team
Notification Rule Email - The email notification settings.
- ms
Teams TeamNotification Rule Ms Teams - The MS Teams notification settings.
- pagerduty
Team
Notification Rule Pagerduty - The PagerDuty notification settings.
- slack
Team
Notification Rule Slack - The Slack notification settings.
- team
Id string - The ID of the team that this notification rule belongs to.
- email
Team
Notification Rule Email - The email notification settings.
- ms
Teams TeamNotification Rule Ms Teams - The MS Teams notification settings.
- pagerduty
Team
Notification Rule Pagerduty - The PagerDuty notification settings.
- slack
Team
Notification Rule Slack - The Slack notification settings.
- team_
id str - The ID of the team that this notification rule belongs to.
- email
Team
Notification Rule Email Args - The email notification settings.
- ms_
teams TeamNotification Rule Ms Teams Args - The MS Teams notification settings.
- pagerduty
Team
Notification Rule Pagerduty Args - The PagerDuty notification settings.
- slack
Team
Notification Rule Slack Args - The Slack notification settings.
- team
Id String - The ID of the team that this notification rule belongs to.
- email Property Map
- The email notification settings.
- ms
Teams Property Map - The MS Teams notification settings.
- pagerduty Property Map
- The PagerDuty notification settings.
- slack Property Map
- The Slack notification settings.
Outputs
All input properties are implicitly available as output properties. Additionally, the TeamNotificationRule 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 TeamNotificationRule Resource
Get an existing TeamNotificationRule 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?: TeamNotificationRuleState, opts?: CustomResourceOptions): TeamNotificationRule@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
email: Optional[TeamNotificationRuleEmailArgs] = None,
ms_teams: Optional[TeamNotificationRuleMsTeamsArgs] = None,
pagerduty: Optional[TeamNotificationRulePagerdutyArgs] = None,
slack: Optional[TeamNotificationRuleSlackArgs] = None,
team_id: Optional[str] = None) -> TeamNotificationRulefunc GetTeamNotificationRule(ctx *Context, name string, id IDInput, state *TeamNotificationRuleState, opts ...ResourceOption) (*TeamNotificationRule, error)public static TeamNotificationRule Get(string name, Input<string> id, TeamNotificationRuleState? state, CustomResourceOptions? opts = null)public static TeamNotificationRule get(String name, Output<String> id, TeamNotificationRuleState state, CustomResourceOptions options)resources: _: type: datadog:TeamNotificationRule get: 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.
- Email
Team
Notification Rule Email - The email notification settings.
- Ms
Teams TeamNotification Rule Ms Teams - The MS Teams notification settings.
- Pagerduty
Team
Notification Rule Pagerduty - The PagerDuty notification settings.
- Slack
Team
Notification Rule Slack - The Slack notification settings.
- Team
Id string - The ID of the team that this notification rule belongs to.
- Email
Team
Notification Rule Email Args - The email notification settings.
- Ms
Teams TeamNotification Rule Ms Teams Args - The MS Teams notification settings.
- Pagerduty
Team
Notification Rule Pagerduty Args - The PagerDuty notification settings.
- Slack
Team
Notification Rule Slack Args - The Slack notification settings.
- Team
Id string - The ID of the team that this notification rule belongs to.
- email
Team
Notification Rule Email - The email notification settings.
- ms
Teams TeamNotification Rule Ms Teams - The MS Teams notification settings.
- pagerduty
Team
Notification Rule Pagerduty - The PagerDuty notification settings.
- slack
Team
Notification Rule Slack - The Slack notification settings.
- team
Id String - The ID of the team that this notification rule belongs to.
- email
Team
Notification Rule Email - The email notification settings.
- ms
Teams TeamNotification Rule Ms Teams - The MS Teams notification settings.
- pagerduty
Team
Notification Rule Pagerduty - The PagerDuty notification settings.
- slack
Team
Notification Rule Slack - The Slack notification settings.
- team
Id string - The ID of the team that this notification rule belongs to.
- email
Team
Notification Rule Email Args - The email notification settings.
- ms_
teams TeamNotification Rule Ms Teams Args - The MS Teams notification settings.
- pagerduty
Team
Notification Rule Pagerduty Args - The PagerDuty notification settings.
- slack
Team
Notification Rule Slack Args - The Slack notification settings.
- team_
id str - The ID of the team that this notification rule belongs to.
- email Property Map
- The email notification settings.
- ms
Teams Property Map - The MS Teams notification settings.
- pagerduty Property Map
- The PagerDuty notification settings.
- slack Property Map
- The Slack notification settings.
- team
Id String - The ID of the team that this notification rule belongs to.
Supporting Types
TeamNotificationRuleEmail, TeamNotificationRuleEmailArgs
- Enabled bool
- Whether to send email notifications to team members when alerts are triggered.
- Enabled bool
- Whether to send email notifications to team members when alerts are triggered.
- enabled Boolean
- Whether to send email notifications to team members when alerts are triggered.
- enabled boolean
- Whether to send email notifications to team members when alerts are triggered.
- enabled bool
- Whether to send email notifications to team members when alerts are triggered.
- enabled Boolean
- Whether to send email notifications to team members when alerts are triggered.
TeamNotificationRuleMsTeams, TeamNotificationRuleMsTeamsArgs
- Connector
Name string - MS Teams connector name used to route notifications to the appropriate channel.
- Connector
Name string - MS Teams connector name used to route notifications to the appropriate channel.
- connector
Name String - MS Teams connector name used to route notifications to the appropriate channel.
- connector
Name string - MS Teams connector name used to route notifications to the appropriate channel.
- connector_
name str - MS Teams connector name used to route notifications to the appropriate channel.
- connector
Name String - MS Teams connector name used to route notifications to the appropriate channel.
TeamNotificationRulePagerduty, TeamNotificationRulePagerdutyArgs
- Service
Name string - PagerDuty service name to send incident notifications to. The service name can be found in your PagerDuty service settings.
- Service
Name string - PagerDuty service name to send incident notifications to. The service name can be found in your PagerDuty service settings.
- service
Name String - PagerDuty service name to send incident notifications to. The service name can be found in your PagerDuty service settings.
- service
Name string - PagerDuty service name to send incident notifications to. The service name can be found in your PagerDuty service settings.
- service_
name str - PagerDuty service name to send incident notifications to. The service name can be found in your PagerDuty service settings.
- service
Name String - PagerDuty service name to send incident notifications to. The service name can be found in your PagerDuty service settings.
TeamNotificationRuleSlack, TeamNotificationRuleSlackArgs
Import
The pulumi import command can be used, for example:
This resource is imported using team_id and rule_id separated by :.
$ pulumi import datadog:index/teamNotificationRule:TeamNotificationRule foo "${team_id}:${rule_id}"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Datadog pulumi/pulumi-datadog
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
datadogTerraform Provider.
