Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/pagerduty: Add pagerduty_user data source #10541

Merged
merged 1 commit into from
Dec 5, 2016
Merged

provider/pagerduty: Add pagerduty_user data source #10541

merged 1 commit into from
Dec 5, 2016

Conversation

paultyng
Copy link
Contributor

@paultyng paultyng commented Dec 5, 2016

This data source allows you to query for a user ID by email address. It doesn't provide any other means to query user data, but could be extended to support others.

data "pagerduty_user" "me" {
  email = "me@example.com"
}

resource "pagerduty_escalation_policy" "foo" {
  name      = "Engineering Escalation Policy"
  num_loops = 2

  rule {
    escalation_delay_in_minutes = 10

    target {
      type = "user"
      id   = "${data.pagerduty_user.me.id}"
    }
  }
}

@stack72
Copy link
Contributor

stack72 commented Dec 5, 2016

Thanks @paultyng

This LGTM!

% make testacc TEST=./builtin/providers/pagerduty                                                       1 ↵
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2016/12/05 22:38:47 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/pagerduty -v  -timeout 120m
=== RUN   TestAccDataSourcePagerDutyUser_Basic
--- PASS: TestAccDataSourcePagerDutyUser_Basic (4.75s)
=== RUN   TestAccPagerDutyVendor_Basic
--- PASS: TestAccPagerDutyVendor_Basic (8.50s)
=== RUN   TestAccPagerDutyEscalationPolicy_import
--- PASS: TestAccPagerDutyEscalationPolicy_import (7.32s)
=== RUN   TestAccPagerDutySchedule_import
--- PASS: TestAccPagerDutySchedule_import (7.40s)
=== RUN   TestAccPagerDutyService_import
--- PASS: TestAccPagerDutyService_import (26.59s)
=== RUN   TestAccPagerDutyTeam_import
--- PASS: TestAccPagerDutyTeam_import (2.96s)
=== RUN   TestAccPagerDutyUser_import
--- PASS: TestAccPagerDutyUser_import (3.79s)
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProviderImpl
--- PASS: TestProviderImpl (0.00s)
=== RUN   TestAccPagerDutyEscalationPolicy_Basic
--- PASS: TestAccPagerDutyEscalationPolicy_Basic (11.91s)
=== RUN   TestAccPagerDutyEscalationPolicyWithTeams_Basic
--- PASS: TestAccPagerDutyEscalationPolicyWithTeams_Basic (12.31s)
=== RUN   TestAccPagerDutySchedule_Basic
--- PASS: TestAccPagerDutySchedule_Basic (9.70s)
=== RUN   TestAccPagerDutySchedule_Multi
--- PASS: TestAccPagerDutySchedule_Multi (7.74s)
=== RUN   TestAccPagerDutyServiceIntegration_Basic
--- PASS: TestAccPagerDutyServiceIntegration_Basic (26.99s)
=== RUN   TestAccPagerDutyService_Basic
--- PASS: TestAccPagerDutyService_Basic (12.23s)
=== RUN   TestAccPagerDutyTeam_Basic
--- PASS: TestAccPagerDutyTeam_Basic (4.20s)
=== RUN   TestAccPagerDutyUser_Basic
--- PASS: TestAccPagerDutyUser_Basic (5.57s)
=== RUN   TestAccPagerDutyUserWithTeams_Basic
--- PASS: TestAccPagerDutyUserWithTeams_Basic (13.44s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/pagerduty	165.430s

@stack72 stack72 merged commit 15cde73 into hashicorp:master Dec 5, 2016
@paultyng paultyng deleted the pt/pagerduty branch December 5, 2016 22:53
gusmat pushed a commit to gusmat/terraform that referenced this pull request Dec 6, 2016
@ghost
Copy link

ghost commented Apr 19, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants