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

Add api_limit field to provider configuration #872

Closed jordynsamuel closed 1 month ago

jordynsamuel commented 1 month ago

Assuming a service named hello, and 25 other services in the pattern *hello, when using the following data block:

data "pagerduty_service" "hello" {
    name = "hello"
}

It will fail with the message:

Error: Unable to locate any service with the name: hello

This is because the API call to locate the service, by default, has a pagination limit of 25, thus the service is excluded since it appears on the 2nd page.

This PR adds an api_limit field to the provider to allow a pagination limit to be set.

It can be used as such:

provider "pagerduty" {
  token = "your_token"
  api_limit = 50 // default 25
}