pagerduty_licenses

Use this data source to get information about the purchased licenses that you can use for other managing PagerDuty user resources. To reference a unique license, see pagerduty_license data source. After applying changes to users' licenses, the current_value and allocations_available attributes of licenses will change.

Example Usage

locals {
  invalid_roles = ["owner"]
}

data "pagerduty_licenses" "licenses" {}

resource "pagerduty_user" "example" {
  name  = "Earline Greenholt"
  email = "125.greenholt.earline@graham.name"

  license = data.pagerduty_licenses.licenses.licenses[0].id

  # Role must be included in the assigned license's allowed_roles list.
  # Role may be dynamically referenced from data.pagerduty_licenses.licenses with the following:
  # tolist(setsubtract(data.pagerduty_licenses.licenses.licenses[0].valid_roles, local.invalid_roles))[0]
  role = "user"
}

Argument Reference

The following arguments are supported:

Attributes Reference

Licenses (licenses) is a list of objects that support the following: