getTeam
Use this data source to get information about a specific team that you can use for other PagerDuty resources.
Example Usage
using Pulumi;
using Pagerduty = Pulumi.Pagerduty;
class MyStack : Stack
{
public MyStack()
{
var me = Output.Create(Pagerduty.GetUser.InvokeAsync(new Pagerduty.GetUserArgs
{
Email = "me@example.com",
}));
var devops = Output.Create(Pagerduty.GetTeam.InvokeAsync(new Pagerduty.GetTeamArgs
{
Name = "devops",
}));
var foo = new Pagerduty.EscalationPolicy("foo", new Pagerduty.EscalationPolicyArgs
{
NumLoops = 2,
Teams =
{
devops.Apply(devops => devops.Id),
},
Rules =
{
new Pagerduty.Inputs.EscalationPolicyRuleArgs
{
EscalationDelayInMinutes = 10,
Targets =
{
new Pagerduty.Inputs.EscalationPolicyRuleTargetArgs
{
Type = "user",
Id = me.Apply(me => me.Id),
},
},
},
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-pagerduty/sdk/v2/go/pagerduty"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
me, err := pagerduty.LookupUser(ctx, &pagerduty.LookupUserArgs{
Email: "me@example.com",
}, nil)
if err != nil {
return err
}
devops, err := pagerduty.LookupTeam(ctx, &pagerduty.LookupTeamArgs{
Name: "devops",
}, nil)
if err != nil {
return err
}
_, err = pagerduty.NewEscalationPolicy(ctx, "foo", &pagerduty.EscalationPolicyArgs{
NumLoops: pulumi.Int(2),
Teams: pulumi.StringArray{
pulumi.String(devops.Id),
},
Rules: pagerduty.EscalationPolicyRuleArray{
&pagerduty.EscalationPolicyRuleArgs{
EscalationDelayInMinutes: pulumi.Int(10),
Targets: pagerduty.EscalationPolicyRuleTargetArray{
&pagerduty.EscalationPolicyRuleTargetArgs{
Type: pulumi.String("user"),
Id: pulumi.String(me.Id),
},
},
},
},
})
if err != nil {
return err
}
return nil
})
}
import pulumi
import pulumi_pagerduty as pagerduty
me = pagerduty.get_user(email="me@example.com")
devops = pagerduty.get_team(name="devops")
foo = pagerduty.EscalationPolicy("foo",
num_loops=2,
teams=[devops.id],
rules=[pagerduty.EscalationPolicyRuleArgs(
escalation_delay_in_minutes=10,
targets=[pagerduty.EscalationPolicyRuleTargetArgs(
type="user",
id=me.id,
)],
)])
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";
const me = pagerduty.getUser({
email: "me@example.com",
});
const devops = pagerduty.getTeam({
name: "devops",
});
const foo = new pagerduty.EscalationPolicy("foo", {
numLoops: 2,
teams: [devops.then(devops => devops.id)],
rules: [{
escalationDelayInMinutes: 10,
targets: [{
type: "user",
id: me.then(me => me.id),
}],
}],
});
Using getTeam
function getTeam(args: GetTeamArgs, opts?: InvokeOptions): Promise<GetTeamResult>
def get_team(name: Optional[str] = None,
parent: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetTeamResult
func LookupTeam(ctx *Context, args *LookupTeamArgs, opts ...InvokeOption) (*LookupTeamResult, error)
Note: This function is named
LookupTeam
in the Go SDK.
public static class GetTeam {
public static Task<GetTeamResult> InvokeAsync(GetTeamArgs args, InvokeOptions? opts = null)
}
The following arguments are supported:
getTeam Result
The following output properties are available:
- Description string
- A description of the found team.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the found team.
- Parent string
- ID of the parent team. This is available to accounts with the Team Hierarchy feature enabled. Please contact your account manager for more information.
- Description string
- A description of the found team.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the found team.
- Parent string
- ID of the parent team. This is available to accounts with the Team Hierarchy feature enabled. Please contact your account manager for more information.
- description string
- A description of the found team.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name of the found team.
- parent string
- ID of the parent team. This is available to accounts with the Team Hierarchy feature enabled. Please contact your account manager for more information.
- description str
- A description of the found team.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name of the found team.
- parent str
- ID of the parent team. This is available to accounts with the Team Hierarchy feature enabled. Please contact your account manager for more information.
Package Details
- Repository
- https://github.com/pulumi/pulumi-pagerduty
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
pagerduty
Terraform Provider.