getUser

Use this data source to get information about a specific user 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 foo = new Pagerduty.EscalationPolicy("foo", new Pagerduty.EscalationPolicyArgs
        {
            NumLoops = 2,
            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
		}
		_, err = pagerduty.NewEscalationPolicy(ctx, "foo", &pagerduty.EscalationPolicyArgs{
			NumLoops: pulumi.Int(2),
			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")
foo = pagerduty.EscalationPolicy("foo",
    num_loops=2,
    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 foo = new pagerduty.EscalationPolicy("foo", {
    numLoops: 2,
    rules: [{
        escalationDelayInMinutes: 10,
        targets: [{
            type: "user",
            id: me.then(me => me.id),
        }],
    }],
});

Using getUser

function getUser(args: GetUserArgs, opts?: InvokeOptions): Promise<GetUserResult>
def get_user(email: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GetUserResult
func LookupUser(ctx *Context, args *LookupUserArgs, opts ...InvokeOption) (*LookupUserResult, error)

Note: This function is named LookupUser in the Go SDK.

public static class GetUser {
    public static Task<GetUserResult> InvokeAsync(GetUserArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Email string
The email to use to find a user in the PagerDuty API.
Email string
The email to use to find a user in the PagerDuty API.
email string
The email to use to find a user in the PagerDuty API.
email str
The email to use to find a user in the PagerDuty API.

getUser Result

The following output properties are available:

Email string
Id string
The provider-assigned unique ID for this managed resource.
Name string
The short name of the found user.
Email string
Id string
The provider-assigned unique ID for this managed resource.
Name string
The short name of the found user.
email string
id string
The provider-assigned unique ID for this managed resource.
name string
The short name of the found user.
email str
id str
The provider-assigned unique ID for this managed resource.
name str
The short name of the found user.

Package Details

Repository
https://github.com/pulumi/pulumi-pagerduty
License
Apache-2.0
Notes
This Pulumi package is based on the pagerduty Terraform Provider.