pagerduty.getLicense
Explore with Pulumi AI
Use this data source to use a single purchased license to manage PagerDuty user resources. After applying changes to users’ licenses, the current_value
and allocations_available
attributes of licenses will change.
It is preferred to set the
name
anddescription
to their exact values or to set theid
. However, this will require updating your configuration if the accounts products ever change. To avoid errors when account products change, you may set thename
of a license to a valid substring such as"Full User"
or"Stakeholder"
.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";
const invalidRoles = ["owner"];
const fullUser = pagerduty.getLicense({
name: "Full User",
description: "",
});
const example = new pagerduty.User("example", {
name: "Earline Greenholt",
email: "125.greenholt.earline@graham.name",
license: fullUser.then(fullUser => fullUser.id),
role: "user",
});
import pulumi
import pulumi_pagerduty as pagerduty
invalid_roles = ["owner"]
full_user = pagerduty.get_license(name="Full User",
description="")
example = pagerduty.User("example",
name="Earline Greenholt",
email="125.greenholt.earline@graham.name",
license=full_user.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",
}
fullUser, err := pagerduty.GetLicense(ctx, &pagerduty.GetLicenseArgs{
Name: pulumi.StringRef("Full User"),
Description: pulumi.StringRef(""),
}, 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(fullUser.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 fullUser = Pagerduty.GetLicense.Invoke(new()
{
Name = "Full User",
Description = "",
});
var example = new Pagerduty.User("example", new()
{
Name = "Earline Greenholt",
Email = "125.greenholt.earline@graham.name",
License = fullUser.Apply(getLicenseResult => getLicenseResult.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.GetLicenseArgs;
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 fullUser = PagerdutyFunctions.getLicense(GetLicenseArgs.builder()
.name("Full User")
.description("")
.build());
var example = new User("example", UserArgs.builder()
.name("Earline Greenholt")
.email("125.greenholt.earline@graham.name")
.license(fullUser.applyValue(getLicenseResult -> getLicenseResult.id()))
.role("user")
.build());
}
}
resources:
example:
type: pagerduty:User
properties:
name: Earline Greenholt
email: 125.greenholt.earline@graham.name
license: ${fullUser.id}
role: user
variables:
invalidRoles:
- owner
fullUser:
fn::invoke:
Function: pagerduty:getLicense
Arguments:
name: Full User
description:
Using getLicense
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 getLicense(args: GetLicenseArgs, opts?: InvokeOptions): Promise<GetLicenseResult>
function getLicenseOutput(args: GetLicenseOutputArgs, opts?: InvokeOptions): Output<GetLicenseResult>
def get_license(description: Optional[str] = None,
id: Optional[str] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetLicenseResult
def get_license_output(description: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetLicenseResult]
func GetLicense(ctx *Context, args *GetLicenseArgs, opts ...InvokeOption) (*GetLicenseResult, error)
func GetLicenseOutput(ctx *Context, args *GetLicenseOutputArgs, opts ...InvokeOption) GetLicenseResultOutput
> Note: This function is named GetLicense
in the Go SDK.
public static class GetLicense
{
public static Task<GetLicenseResult> InvokeAsync(GetLicenseArgs args, InvokeOptions? opts = null)
public static Output<GetLicenseResult> Invoke(GetLicenseInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetLicenseResult> getLicense(GetLicenseArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: pagerduty:index/getLicense:getLicense
arguments:
# arguments dictionary
The following arguments are supported:
- Description string
- Used to determine if the data config description is a valid substring of a valid license description assigned to the account.
- Id string
- Used to match the data config id with an exact match of a valid license ID assigned to the account.
- Name string
- Used to determine if the data config name is a valid substring of a valid license name assigned to the account.
- Description string
- Used to determine if the data config description is a valid substring of a valid license description assigned to the account.
- Id string
- Used to match the data config id with an exact match of a valid license ID assigned to the account.
- Name string
- Used to determine if the data config name is a valid substring of a valid license name assigned to the account.
- description String
- Used to determine if the data config description is a valid substring of a valid license description assigned to the account.
- id String
- Used to match the data config id with an exact match of a valid license ID assigned to the account.
- name String
- Used to determine if the data config name is a valid substring of a valid license name assigned to the account.
- description string
- Used to determine if the data config description is a valid substring of a valid license description assigned to the account.
- id string
- Used to match the data config id with an exact match of a valid license ID assigned to the account.
- name string
- Used to determine if the data config name is a valid substring of a valid license name assigned to the account.
- description str
- Used to determine if the data config description is a valid substring of a valid license description assigned to the account.
- id str
- Used to match the data config id with an exact match of a valid license ID assigned to the account.
- name str
- Used to determine if the data config name is a valid substring of a valid license name assigned to the account.
- description String
- Used to determine if the data config description is a valid substring of a valid license description assigned to the account.
- id String
- Used to match the data config id with an exact match of a valid license ID assigned to the account.
- name String
- Used to determine if the data config name is a valid substring of a valid license name assigned to the account.
getLicense Result
The following output properties are available:
- Allocations
Available int - Available allocations to assign to users
- Current
Value int - The number of allocations already assigned to users
- Description string
- Html
Url string - Id string
- Name string
- 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
- Html
Url string - Id string
- Name string
- 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
- html
Url String - id String
- name String
- 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
- html
Url string - id string
- name string
- 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
- html_
url str - id str
- name str
- 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
- html
Url String - id String
- name String
- 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.