datadog.OnCallEscalationPolicy
Explore with Pulumi AI
Provides a Datadog On-Call escalation policy resource. This can be used to create and manage Datadog On-Call escalation policies.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
const policyTest = new datadog.OnCallEscalationPolicy("policy_test", {
name: "Policy Name",
resolvePageOnPolicyEnd: true,
retries: 3,
steps: [{
assignment: "round-robin",
escalateAfterSeconds: 300,
targets: [
{
team: "00000000-aba2-0000-0000-000000000000",
},
{
user: "00000000-aba2-0000-0000-000000000000",
},
{
schedule: "00000000-aba2-0000-0000-000000000000",
},
],
}],
});
import pulumi
import pulumi_datadog as datadog
policy_test = datadog.OnCallEscalationPolicy("policy_test",
name="Policy Name",
resolve_page_on_policy_end=True,
retries=3,
steps=[{
"assignment": "round-robin",
"escalate_after_seconds": 300,
"targets": [
{
"team": "00000000-aba2-0000-0000-000000000000",
},
{
"user": "00000000-aba2-0000-0000-000000000000",
},
{
"schedule": "00000000-aba2-0000-0000-000000000000",
},
],
}])
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 {
_, err := datadog.NewOnCallEscalationPolicy(ctx, "policy_test", &datadog.OnCallEscalationPolicyArgs{
Name: pulumi.String("Policy Name"),
ResolvePageOnPolicyEnd: pulumi.Bool(true),
Retries: pulumi.Int(3),
Steps: datadog.OnCallEscalationPolicyStepArray{
&datadog.OnCallEscalationPolicyStepArgs{
Assignment: pulumi.String("round-robin"),
EscalateAfterSeconds: pulumi.Int(300),
Targets: datadog.OnCallEscalationPolicyStepTargetArray{
&datadog.OnCallEscalationPolicyStepTargetArgs{
Team: pulumi.String("00000000-aba2-0000-0000-000000000000"),
},
&datadog.OnCallEscalationPolicyStepTargetArgs{
User: pulumi.String("00000000-aba2-0000-0000-000000000000"),
},
&datadog.OnCallEscalationPolicyStepTargetArgs{
Schedule: pulumi.String("00000000-aba2-0000-0000-000000000000"),
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Datadog = Pulumi.Datadog;
return await Deployment.RunAsync(() =>
{
var policyTest = new Datadog.OnCallEscalationPolicy("policy_test", new()
{
Name = "Policy Name",
ResolvePageOnPolicyEnd = true,
Retries = 3,
Steps = new[]
{
new Datadog.Inputs.OnCallEscalationPolicyStepArgs
{
Assignment = "round-robin",
EscalateAfterSeconds = 300,
Targets = new[]
{
new Datadog.Inputs.OnCallEscalationPolicyStepTargetArgs
{
Team = "00000000-aba2-0000-0000-000000000000",
},
new Datadog.Inputs.OnCallEscalationPolicyStepTargetArgs
{
User = "00000000-aba2-0000-0000-000000000000",
},
new Datadog.Inputs.OnCallEscalationPolicyStepTargetArgs
{
Schedule = "00000000-aba2-0000-0000-000000000000",
},
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.datadog.OnCallEscalationPolicy;
import com.pulumi.datadog.OnCallEscalationPolicyArgs;
import com.pulumi.datadog.inputs.OnCallEscalationPolicyStepArgs;
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 policyTest = new OnCallEscalationPolicy("policyTest", OnCallEscalationPolicyArgs.builder()
.name("Policy Name")
.resolvePageOnPolicyEnd(true)
.retries(3)
.steps(OnCallEscalationPolicyStepArgs.builder()
.assignment("round-robin")
.escalateAfterSeconds(300)
.targets(
OnCallEscalationPolicyStepTargetArgs.builder()
.team("00000000-aba2-0000-0000-000000000000")
.build(),
OnCallEscalationPolicyStepTargetArgs.builder()
.user("00000000-aba2-0000-0000-000000000000")
.build(),
OnCallEscalationPolicyStepTargetArgs.builder()
.schedule("00000000-aba2-0000-0000-000000000000")
.build())
.build())
.build());
}
}
resources:
policyTest:
type: datadog:OnCallEscalationPolicy
name: policy_test
properties:
name: Policy Name
resolvePageOnPolicyEnd: true
retries: 3
steps:
- assignment: round-robin
escalateAfterSeconds: 300
targets:
- team: 00000000-aba2-0000-0000-000000000000
- user: 00000000-aba2-0000-0000-000000000000
- schedule: 00000000-aba2-0000-0000-000000000000
Create OnCallEscalationPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new OnCallEscalationPolicy(name: string, args: OnCallEscalationPolicyArgs, opts?: CustomResourceOptions);
@overload
def OnCallEscalationPolicy(resource_name: str,
args: OnCallEscalationPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def OnCallEscalationPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
resolve_page_on_policy_end: Optional[bool] = None,
retries: Optional[int] = None,
steps: Optional[Sequence[OnCallEscalationPolicyStepArgs]] = None,
teams: Optional[Sequence[str]] = None)
func NewOnCallEscalationPolicy(ctx *Context, name string, args OnCallEscalationPolicyArgs, opts ...ResourceOption) (*OnCallEscalationPolicy, error)
public OnCallEscalationPolicy(string name, OnCallEscalationPolicyArgs args, CustomResourceOptions? opts = null)
public OnCallEscalationPolicy(String name, OnCallEscalationPolicyArgs args)
public OnCallEscalationPolicy(String name, OnCallEscalationPolicyArgs args, CustomResourceOptions options)
type: datadog:OnCallEscalationPolicy
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 OnCallEscalationPolicyArgs
- 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 OnCallEscalationPolicyArgs
- 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 OnCallEscalationPolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args OnCallEscalationPolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args OnCallEscalationPolicyArgs
- 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 onCallEscalationPolicyResource = new Datadog.OnCallEscalationPolicy("onCallEscalationPolicyResource", new()
{
Name = "string",
ResolvePageOnPolicyEnd = false,
Retries = 0,
Steps = new[]
{
new Datadog.Inputs.OnCallEscalationPolicyStepArgs
{
EscalateAfterSeconds = 0,
Assignment = "string",
Id = "string",
Targets = new[]
{
new Datadog.Inputs.OnCallEscalationPolicyStepTargetArgs
{
Schedule = "string",
Team = "string",
User = "string",
},
},
},
},
Teams = new[]
{
"string",
},
});
example, err := datadog.NewOnCallEscalationPolicy(ctx, "onCallEscalationPolicyResource", &datadog.OnCallEscalationPolicyArgs{
Name: pulumi.String("string"),
ResolvePageOnPolicyEnd: pulumi.Bool(false),
Retries: pulumi.Int(0),
Steps: datadog.OnCallEscalationPolicyStepArray{
&datadog.OnCallEscalationPolicyStepArgs{
EscalateAfterSeconds: pulumi.Int(0),
Assignment: pulumi.String("string"),
Id: pulumi.String("string"),
Targets: datadog.OnCallEscalationPolicyStepTargetArray{
&datadog.OnCallEscalationPolicyStepTargetArgs{
Schedule: pulumi.String("string"),
Team: pulumi.String("string"),
User: pulumi.String("string"),
},
},
},
},
Teams: pulumi.StringArray{
pulumi.String("string"),
},
})
var onCallEscalationPolicyResource = new OnCallEscalationPolicy("onCallEscalationPolicyResource", OnCallEscalationPolicyArgs.builder()
.name("string")
.resolvePageOnPolicyEnd(false)
.retries(0)
.steps(OnCallEscalationPolicyStepArgs.builder()
.escalateAfterSeconds(0)
.assignment("string")
.id("string")
.targets(OnCallEscalationPolicyStepTargetArgs.builder()
.schedule("string")
.team("string")
.user("string")
.build())
.build())
.teams("string")
.build());
on_call_escalation_policy_resource = datadog.OnCallEscalationPolicy("onCallEscalationPolicyResource",
name="string",
resolve_page_on_policy_end=False,
retries=0,
steps=[{
"escalate_after_seconds": 0,
"assignment": "string",
"id": "string",
"targets": [{
"schedule": "string",
"team": "string",
"user": "string",
}],
}],
teams=["string"])
const onCallEscalationPolicyResource = new datadog.OnCallEscalationPolicy("onCallEscalationPolicyResource", {
name: "string",
resolvePageOnPolicyEnd: false,
retries: 0,
steps: [{
escalateAfterSeconds: 0,
assignment: "string",
id: "string",
targets: [{
schedule: "string",
team: "string",
user: "string",
}],
}],
teams: ["string"],
});
type: datadog:OnCallEscalationPolicy
properties:
name: string
resolvePageOnPolicyEnd: false
retries: 0
steps:
- assignment: string
escalateAfterSeconds: 0
id: string
targets:
- schedule: string
team: string
user: string
teams:
- string
OnCallEscalationPolicy 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 OnCallEscalationPolicy resource accepts the following input properties:
- Name string
- A human-readable name for the escalation policy.
- Resolve
Page boolOn Policy End - If true, pages will be automatically resolved if unacknowledged after the final step.
- Retries int
- If set, policy will be retried this many times after the final step. Must be in the range 0-10. Value must be between 0 and 10. Defaults to
0
. - Steps
List<On
Call Escalation Policy Step> - List of steps for the escalation policy.
- Teams List<string>
- A list of team ids associated with the escalation policy.
- Name string
- A human-readable name for the escalation policy.
- Resolve
Page boolOn Policy End - If true, pages will be automatically resolved if unacknowledged after the final step.
- Retries int
- If set, policy will be retried this many times after the final step. Must be in the range 0-10. Value must be between 0 and 10. Defaults to
0
. - Steps
[]On
Call Escalation Policy Step Args - List of steps for the escalation policy.
- Teams []string
- A list of team ids associated with the escalation policy.
- name String
- A human-readable name for the escalation policy.
- resolve
Page BooleanOn Policy End - If true, pages will be automatically resolved if unacknowledged after the final step.
- retries Integer
- If set, policy will be retried this many times after the final step. Must be in the range 0-10. Value must be between 0 and 10. Defaults to
0
. - steps
List<On
Call Escalation Policy Step> - List of steps for the escalation policy.
- teams List<String>
- A list of team ids associated with the escalation policy.
- name string
- A human-readable name for the escalation policy.
- resolve
Page booleanOn Policy End - If true, pages will be automatically resolved if unacknowledged after the final step.
- retries number
- If set, policy will be retried this many times after the final step. Must be in the range 0-10. Value must be between 0 and 10. Defaults to
0
. - steps
On
Call Escalation Policy Step[] - List of steps for the escalation policy.
- teams string[]
- A list of team ids associated with the escalation policy.
- name str
- A human-readable name for the escalation policy.
- resolve_
page_ boolon_ policy_ end - If true, pages will be automatically resolved if unacknowledged after the final step.
- retries int
- If set, policy will be retried this many times after the final step. Must be in the range 0-10. Value must be between 0 and 10. Defaults to
0
. - steps
Sequence[On
Call Escalation Policy Step Args] - List of steps for the escalation policy.
- teams Sequence[str]
- A list of team ids associated with the escalation policy.
- name String
- A human-readable name for the escalation policy.
- resolve
Page BooleanOn Policy End - If true, pages will be automatically resolved if unacknowledged after the final step.
- retries Number
- If set, policy will be retried this many times after the final step. Must be in the range 0-10. Value must be between 0 and 10. Defaults to
0
. - steps List<Property Map>
- List of steps for the escalation policy.
- teams List<String>
- A list of team ids associated with the escalation policy.
Outputs
All input properties are implicitly available as output properties. Additionally, the OnCallEscalationPolicy 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 OnCallEscalationPolicy Resource
Get an existing OnCallEscalationPolicy 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?: OnCallEscalationPolicyState, opts?: CustomResourceOptions): OnCallEscalationPolicy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
resolve_page_on_policy_end: Optional[bool] = None,
retries: Optional[int] = None,
steps: Optional[Sequence[OnCallEscalationPolicyStepArgs]] = None,
teams: Optional[Sequence[str]] = None) -> OnCallEscalationPolicy
func GetOnCallEscalationPolicy(ctx *Context, name string, id IDInput, state *OnCallEscalationPolicyState, opts ...ResourceOption) (*OnCallEscalationPolicy, error)
public static OnCallEscalationPolicy Get(string name, Input<string> id, OnCallEscalationPolicyState? state, CustomResourceOptions? opts = null)
public static OnCallEscalationPolicy get(String name, Output<String> id, OnCallEscalationPolicyState state, CustomResourceOptions options)
resources: _: type: datadog:OnCallEscalationPolicy 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.
- Name string
- A human-readable name for the escalation policy.
- Resolve
Page boolOn Policy End - If true, pages will be automatically resolved if unacknowledged after the final step.
- Retries int
- If set, policy will be retried this many times after the final step. Must be in the range 0-10. Value must be between 0 and 10. Defaults to
0
. - Steps
List<On
Call Escalation Policy Step> - List of steps for the escalation policy.
- Teams List<string>
- A list of team ids associated with the escalation policy.
- Name string
- A human-readable name for the escalation policy.
- Resolve
Page boolOn Policy End - If true, pages will be automatically resolved if unacknowledged after the final step.
- Retries int
- If set, policy will be retried this many times after the final step. Must be in the range 0-10. Value must be between 0 and 10. Defaults to
0
. - Steps
[]On
Call Escalation Policy Step Args - List of steps for the escalation policy.
- Teams []string
- A list of team ids associated with the escalation policy.
- name String
- A human-readable name for the escalation policy.
- resolve
Page BooleanOn Policy End - If true, pages will be automatically resolved if unacknowledged after the final step.
- retries Integer
- If set, policy will be retried this many times after the final step. Must be in the range 0-10. Value must be between 0 and 10. Defaults to
0
. - steps
List<On
Call Escalation Policy Step> - List of steps for the escalation policy.
- teams List<String>
- A list of team ids associated with the escalation policy.
- name string
- A human-readable name for the escalation policy.
- resolve
Page booleanOn Policy End - If true, pages will be automatically resolved if unacknowledged after the final step.
- retries number
- If set, policy will be retried this many times after the final step. Must be in the range 0-10. Value must be between 0 and 10. Defaults to
0
. - steps
On
Call Escalation Policy Step[] - List of steps for the escalation policy.
- teams string[]
- A list of team ids associated with the escalation policy.
- name str
- A human-readable name for the escalation policy.
- resolve_
page_ boolon_ policy_ end - If true, pages will be automatically resolved if unacknowledged after the final step.
- retries int
- If set, policy will be retried this many times after the final step. Must be in the range 0-10. Value must be between 0 and 10. Defaults to
0
. - steps
Sequence[On
Call Escalation Policy Step Args] - List of steps for the escalation policy.
- teams Sequence[str]
- A list of team ids associated with the escalation policy.
- name String
- A human-readable name for the escalation policy.
- resolve
Page BooleanOn Policy End - If true, pages will be automatically resolved if unacknowledged after the final step.
- retries Number
- If set, policy will be retried this many times after the final step. Must be in the range 0-10. Value must be between 0 and 10. Defaults to
0
. - steps List<Property Map>
- List of steps for the escalation policy.
- teams List<String>
- A list of team ids associated with the escalation policy.
Supporting Types
OnCallEscalationPolicyStep, OnCallEscalationPolicyStepArgs
- Escalate
After intSeconds - Defines how many seconds to wait before escalating to the next step. Value must be between 60 and 36000.
- Assignment string
- Specifies how this escalation step will assign targets. Can be
default
(page all targets at once) orround-robin
. Valid values areassignment
,round-robin
. Defaults to"default"
. - Id string
- The ID of this step.
- Targets
List<On
Call Escalation Policy Step Target> - List of targets for the step.
- Escalate
After intSeconds - Defines how many seconds to wait before escalating to the next step. Value must be between 60 and 36000.
- Assignment string
- Specifies how this escalation step will assign targets. Can be
default
(page all targets at once) orround-robin
. Valid values areassignment
,round-robin
. Defaults to"default"
. - Id string
- The ID of this step.
- Targets
[]On
Call Escalation Policy Step Target - List of targets for the step.
- escalate
After IntegerSeconds - Defines how many seconds to wait before escalating to the next step. Value must be between 60 and 36000.
- assignment String
- Specifies how this escalation step will assign targets. Can be
default
(page all targets at once) orround-robin
. Valid values areassignment
,round-robin
. Defaults to"default"
. - id String
- The ID of this step.
- targets
List<On
Call Escalation Policy Step Target> - List of targets for the step.
- escalate
After numberSeconds - Defines how many seconds to wait before escalating to the next step. Value must be between 60 and 36000.
- assignment string
- Specifies how this escalation step will assign targets. Can be
default
(page all targets at once) orround-robin
. Valid values areassignment
,round-robin
. Defaults to"default"
. - id string
- The ID of this step.
- targets
On
Call Escalation Policy Step Target[] - List of targets for the step.
- escalate_
after_ intseconds - Defines how many seconds to wait before escalating to the next step. Value must be between 60 and 36000.
- assignment str
- Specifies how this escalation step will assign targets. Can be
default
(page all targets at once) orround-robin
. Valid values areassignment
,round-robin
. Defaults to"default"
. - id str
- The ID of this step.
- targets
Sequence[On
Call Escalation Policy Step Target] - List of targets for the step.
- escalate
After NumberSeconds - Defines how many seconds to wait before escalating to the next step. Value must be between 60 and 36000.
- assignment String
- Specifies how this escalation step will assign targets. Can be
default
(page all targets at once) orround-robin
. Valid values areassignment
,round-robin
. Defaults to"default"
. - id String
- The ID of this step.
- targets List<Property Map>
- List of targets for the step.
OnCallEscalationPolicyStepTarget, OnCallEscalationPolicyStepTargetArgs
Import
Import an existing on_call_schedule
$ pulumi import datadog:index/onCallEscalationPolicy:OnCallEscalationPolicy test "b03a07d5-49da-43e9-83b4-5d84969b588b"
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
datadog
Terraform Provider.