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.
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"
}
The following arguments are supported:
id
- (Optional) Allows to override the default behavior for setting the id
attribute that is required for data sources.licenses
- The list of purchased licenses.licenses
) is a list of objects that support the following:id
- ID of the licensename
- Name of the licensesummary
- Summary of the licensedescription
- Description of the licenserole_group
- The role group for the license that determines the available valid_roles
valid_roles
- List of allowed roles that may be assigned to a user with this licensecurrent_value
- The number of allocations already assigned to usersallocations_available
- Available allocations to assign to users