PagerDuty / terraform-provider-pagerduty

Terraform PagerDuty provider
https://www.terraform.io/docs/providers/pagerduty/
Mozilla Public License 2.0
204 stars 208 forks source link

pagerduty_service_integration datasource fails with `Unable to locate any service with the name: "<service name ......>"` when paging #884

Closed camielwnzl closed 2 weeks ago

camielwnzl commented 2 weeks ago

Hi there,

Version 3.14.0 breaks the pagerduty_service_integration datasource when more than 25 (page size) services available.

Terraform Version

Terraform v1.2.9 on linux_amd64

Affected Resource(s)

Known affected data sources

Terraform Configuration Files

data "pagerduty_service_integration" "pd_service_integration" {
  service_name        = var.service_name
  integration_summary = var.integration_name
}

Expected Behavior

Service found and integration details made available

Actual Behavior

Terraform plan fails with following error: Error: Unable to locate any service with the name: "<service name ......>"

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform plan

Important Factoids

  1. Functionality worked under version 3.13.1
  2. Seems that no query value is passed to the rest request
    2024-06-17T10:28:21.169Z [DEBUG] provider.terraform-provider-pagerduty_v3.14.0: ---[ REQUEST ]---------------------------------------
    2024-06-17T10:28:21.169Z [DEBUG] provider.terraform-provider-pagerduty_v3.14.0: GET /services? HTTP/1.1
    2024-06-17T10:28:21.169Z [DEBUG] provider.terraform-provider-pagerduty_v3.14.0: Host: api.pagerduty.com
    2024-06-17T10:28:21.169Z [DEBUG] provider.terraform-provider-pagerduty_v3.14.0: User-Agent: (linux amd64) Terraform/1.2.9
    2024-06-17T10:28:21.170Z [DEBUG] provider.terraform-provider-pagerduty_v3.14.0: Accept: application/vnd.pagerduty+json;version=2
    2024-06-17T10:28:21.170Z [DEBUG] provider.terraform-provider-pagerduty_v3.14.0: Authorization: Token token=<supersecret token>
    2024-06-17T10:28:21.170Z [DEBUG] provider.terraform-provider-pagerduty_v3.14.0: Content-Type: application/json
    2024-06-17T10:28:21.170Z [DEBUG] provider.terraform-provider-pagerduty_v3.14.0: Accept-Encoding: gzip
  3. Resulting service not in first page of returned results - so failing
jay-alansari-axomic commented 2 weeks ago

+1 We're also having the same issue with the 3.14.0 release.

dsegurag commented 2 weeks ago

+1 here