PagerDuty v4.17.0 published on Wednesday, Nov 20, 2024 by Pulumi
pagerduty.getLicenses
Explore with Pulumi AI
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.getLicense
data source. After applying changes to users’ licenses, the current_value
and allocations_available
attributes of licenses will change.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";
const invalidRoles = ["owner"];
const licenses = pagerduty.getLicenses({});
const example = new pagerduty.User("example", {
name: "Earline Greenholt",
email: "125.greenholt.earline@graham.name",
license: licenses.then(licenses => licenses.licenses?.[0]?.id),
role: "user",
});
import pulumi
import pulumi_pagerduty as pagerduty
invalid_roles = ["owner"]
licenses = pagerduty.get_licenses()
example = pagerduty.User("example",
name="Earline Greenholt",
email="125.greenholt.earline@graham.name",
license=licenses.licenses[0].id,
role="user")
package main
import (
"github.com/pulumi/pulumi-pagerduty/sdk/v4/go/pagerduty"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_ := []string{
"owner",
}
licenses, err := pagerduty.GetLicenses(ctx, &pagerduty.GetLicensesArgs{}, nil)
if err != nil {
return err
}
_, err = pagerduty.NewUser(ctx, "example", &pagerduty.UserArgs{
Name: pulumi.String("Earline Greenholt"),
Email: pulumi.String("125.greenholt.earline@graham.name"),
License: pulumi.String(licenses.Licenses[0].Id),
Role: pulumi.String("user"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Pagerduty = Pulumi.Pagerduty;
return await Deployment.RunAsync(() =>
{
var invalidRoles = new[]
{
"owner",
};
var licenses = Pagerduty.GetLicenses.Invoke();
var example = new Pagerduty.User("example", new()
{
Name = "Earline Greenholt",
Email = "125.greenholt.earline@graham.name",
License = licenses.Apply(getLicensesResult => getLicensesResult.Licenses[0]?.Id),
Role = "user",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.pagerduty.PagerdutyFunctions;
import com.pulumi.pagerduty.inputs.GetLicensesArgs;
import com.pulumi.pagerduty.User;
import com.pulumi.pagerduty.UserArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var invalidRoles = "owner";
final var licenses = PagerdutyFunctions.getLicenses();
var example = new User("example", UserArgs.builder()
.name("Earline Greenholt")
.email("125.greenholt.earline@graham.name")
.license(licenses.applyValue(getLicensesResult -> getLicensesResult.licenses()[0].id()))
.role("user")
.build());
}
}
resources:
example:
type: pagerduty:User
properties:
name: Earline Greenholt
email: 125.greenholt.earline@graham.name
license: ${licenses.licenses[0].id}
role: user
variables:
invalidRoles:
- owner
licenses:
fn::invoke:
Function: pagerduty:getLicenses
Arguments: {}
Using getLicenses
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getLicenses(args: GetLicensesArgs, opts?: InvokeOptions): Promise<GetLicensesResult>
function getLicensesOutput(args: GetLicensesOutputArgs, opts?: InvokeOptions): Output<GetLicensesResult>
def get_licenses(id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetLicensesResult
def get_licenses_output(id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetLicensesResult]
func GetLicenses(ctx *Context, args *GetLicensesArgs, opts ...InvokeOption) (*GetLicensesResult, error)
func GetLicensesOutput(ctx *Context, args *GetLicensesOutputArgs, opts ...InvokeOption) GetLicensesResultOutput
> Note: This function is named GetLicenses
in the Go SDK.
public static class GetLicenses
{
public static Task<GetLicensesResult> InvokeAsync(GetLicensesArgs args, InvokeOptions? opts = null)
public static Output<GetLicensesResult> Invoke(GetLicensesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetLicensesResult> getLicenses(GetLicensesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: pagerduty:index/getLicenses:getLicenses
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
- Allows to override the default behavior for setting the
id
attribute that is required for data sources.
- Id string
- Allows to override the default behavior for setting the
id
attribute that is required for data sources.
- id String
- Allows to override the default behavior for setting the
id
attribute that is required for data sources.
- id string
- Allows to override the default behavior for setting the
id
attribute that is required for data sources.
- id str
- Allows to override the default behavior for setting the
id
attribute that is required for data sources.
- id String
- Allows to override the default behavior for setting the
id
attribute that is required for data sources.
getLicenses Result
The following output properties are available:
- Licenses
List<Get
Licenses License> - The list of purchased licenses.
- Id string
- ID of the license
- Licenses
[]Get
Licenses License - The list of purchased licenses.
- Id string
- ID of the license
- licenses
List<Get
Licenses License> - The list of purchased licenses.
- id String
- ID of the license
- licenses
Get
Licenses License[] - The list of purchased licenses.
- id string
- ID of the license
- licenses
Sequence[Get
Licenses License] - The list of purchased licenses.
- id str
- ID of the license
- licenses List<Property Map>
- The list of purchased licenses.
- id String
- ID of the license
Supporting Types
GetLicensesLicense
- Allocations
Available int - Available allocations to assign to users
- Current
Value int - The number of allocations already assigned to users
- Description string
- Description of the license
- Html
Url string - Id string
- Allows to override the default behavior for setting the
id
attribute that is required for data sources. - Name string
- Name of the license
- Role
Group string - The role group for the license that determines the available
valid_roles
- Self string
- Summary string
- Summary of the license
- Type string
- Valid
Roles List<string> - List of allowed roles that may be assigned to a user with this license
- Allocations
Available int - Available allocations to assign to users
- Current
Value int - The number of allocations already assigned to users
- Description string
- Description of the license
- Html
Url string - Id string
- Allows to override the default behavior for setting the
id
attribute that is required for data sources. - Name string
- Name of the license
- Role
Group string - The role group for the license that determines the available
valid_roles
- Self string
- Summary string
- Summary of the license
- Type string
- Valid
Roles []string - List of allowed roles that may be assigned to a user with this license
- allocations
Available Integer - Available allocations to assign to users
- current
Value Integer - The number of allocations already assigned to users
- description String
- Description of the license
- html
Url String - id String
- Allows to override the default behavior for setting the
id
attribute that is required for data sources. - name String
- Name of the license
- role
Group String - The role group for the license that determines the available
valid_roles
- self String
- summary String
- Summary of the license
- type String
- valid
Roles List<String> - List of allowed roles that may be assigned to a user with this license
- allocations
Available number - Available allocations to assign to users
- current
Value number - The number of allocations already assigned to users
- description string
- Description of the license
- html
Url string - id string
- Allows to override the default behavior for setting the
id
attribute that is required for data sources. - name string
- Name of the license
- role
Group string - The role group for the license that determines the available
valid_roles
- self string
- summary string
- Summary of the license
- type string
- valid
Roles string[] - List of allowed roles that may be assigned to a user with this license
- allocations_
available int - Available allocations to assign to users
- current_
value int - The number of allocations already assigned to users
- description str
- Description of the license
- html_
url str - id str
- Allows to override the default behavior for setting the
id
attribute that is required for data sources. - name str
- Name of the license
- role_
group str - The role group for the license that determines the available
valid_roles
- self str
- summary str
- Summary of the license
- type str
- valid_
roles Sequence[str] - List of allowed roles that may be assigned to a user with this license
- allocations
Available Number - Available allocations to assign to users
- current
Value Number - The number of allocations already assigned to users
- description String
- Description of the license
- html
Url String - id String
- Allows to override the default behavior for setting the
id
attribute that is required for data sources. - name String
- Name of the license
- role
Group String - The role group for the license that determines the available
valid_roles
- self String
- summary String
- Summary of the license
- type String
- valid
Roles List<String> - List of allowed roles that may be assigned to a user with this license
Package Details
- Repository
- PagerDuty pulumi/pulumi-pagerduty
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
pagerduty
Terraform Provider.