pagerduty.getCustomFieldSchema

Use this data source to get information about a specific Custom Field Schema that you can assign to a service.

The Custom Fields feature is currently available in Early Access.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Pagerduty = Pulumi.Pagerduty;

return await Deployment.RunAsync(() => 
{
    var myschema = Pagerduty.GetCustomFieldSchema.Invoke(new()
    {
        Title = "myschema title",
    });

    var firstService = Pagerduty.GetService.Invoke(new()
    {
        Name = "My Service",
    });

    var foo = new Pagerduty.CustomFieldSchemaAssignment("foo", new()
    {
        Schema = myschema.Apply(getCustomFieldSchemaResult => getCustomFieldSchemaResult.Id),
        Service = firstService.Apply(getServiceResult => getServiceResult.Id),
    });

});
package main

import (
	"github.com/pulumi/pulumi-pagerduty/sdk/v3/go/pagerduty"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		myschema, err := pagerduty.LookupCustomFieldSchema(ctx, &pagerduty.LookupCustomFieldSchemaArgs{
			Title: "myschema title",
		}, nil)
		if err != nil {
			return err
		}
		firstService, err := pagerduty.LookupService(ctx, &pagerduty.LookupServiceArgs{
			Name: "My Service",
		}, nil)
		if err != nil {
			return err
		}
		_, err = pagerduty.NewCustomFieldSchemaAssignment(ctx, "foo", &pagerduty.CustomFieldSchemaAssignmentArgs{
			Schema:  *pulumi.String(myschema.Id),
			Service: *pulumi.String(firstService.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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.GetCustomFieldSchemaArgs;
import com.pulumi.pagerduty.inputs.GetServiceArgs;
import com.pulumi.pagerduty.CustomFieldSchemaAssignment;
import com.pulumi.pagerduty.CustomFieldSchemaAssignmentArgs;
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 myschema = PagerdutyFunctions.getCustomFieldSchema(GetCustomFieldSchemaArgs.builder()
            .title("myschema title")
            .build());

        final var firstService = PagerdutyFunctions.getService(GetServiceArgs.builder()
            .name("My Service")
            .build());

        var foo = new CustomFieldSchemaAssignment("foo", CustomFieldSchemaAssignmentArgs.builder()        
            .schema(myschema.applyValue(getCustomFieldSchemaResult -> getCustomFieldSchemaResult.id()))
            .service(firstService.applyValue(getServiceResult -> getServiceResult.id()))
            .build());

    }
}
import pulumi
import pulumi_pagerduty as pagerduty

myschema = pagerduty.get_custom_field_schema(title="myschema title")
first_service = pagerduty.get_service(name="My Service")
foo = pagerduty.CustomFieldSchemaAssignment("foo",
    schema=myschema.id,
    service=first_service.id)
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";

const myschema = pagerduty.getCustomFieldSchema({
    title: "myschema title",
});
const firstService = pagerduty.getService({
    name: "My Service",
});
const foo = new pagerduty.CustomFieldSchemaAssignment("foo", {
    schema: myschema.then(myschema => myschema.id),
    service: firstService.then(firstService => firstService.id),
});
resources:
  foo:
    type: pagerduty:CustomFieldSchemaAssignment
    properties:
      schema: ${myschema.id}
      service: ${firstService.id}
variables:
  myschema:
    fn::invoke:
      Function: pagerduty:getCustomFieldSchema
      Arguments:
        title: myschema title
  firstService:
    fn::invoke:
      Function: pagerduty:getService
      Arguments:
        name: My Service

Using getCustomFieldSchema

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 getCustomFieldSchema(args: GetCustomFieldSchemaArgs, opts?: InvokeOptions): Promise<GetCustomFieldSchemaResult>
function getCustomFieldSchemaOutput(args: GetCustomFieldSchemaOutputArgs, opts?: InvokeOptions): Output<GetCustomFieldSchemaResult>
def get_custom_field_schema(title: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetCustomFieldSchemaResult
def get_custom_field_schema_output(title: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetCustomFieldSchemaResult]
func LookupCustomFieldSchema(ctx *Context, args *LookupCustomFieldSchemaArgs, opts ...InvokeOption) (*LookupCustomFieldSchemaResult, error)
func LookupCustomFieldSchemaOutput(ctx *Context, args *LookupCustomFieldSchemaOutputArgs, opts ...InvokeOption) LookupCustomFieldSchemaResultOutput

> Note: This function is named LookupCustomFieldSchema in the Go SDK.

public static class GetCustomFieldSchema 
{
    public static Task<GetCustomFieldSchemaResult> InvokeAsync(GetCustomFieldSchemaArgs args, InvokeOptions? opts = null)
    public static Output<GetCustomFieldSchemaResult> Invoke(GetCustomFieldSchemaInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetCustomFieldSchemaResult> getCustomFieldSchema(GetCustomFieldSchemaArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: pagerduty:index/getCustomFieldSchema:getCustomFieldSchema
  arguments:
    # arguments dictionary

The following arguments are supported:

Title string

The title of the field schema.

Title string

The title of the field schema.

title String

The title of the field schema.

title string

The title of the field schema.

title str

The title of the field schema.

title String

The title of the field schema.

getCustomFieldSchema Result

The following output properties are available:

Description string
Id string

The provider-assigned unique ID for this managed resource.

Title string
Description string
Id string

The provider-assigned unique ID for this managed resource.

Title string
description String
id String

The provider-assigned unique ID for this managed resource.

title String
description string
id string

The provider-assigned unique ID for this managed resource.

title string
description str
id str

The provider-assigned unique ID for this managed resource.

title str
description String
id String

The provider-assigned unique ID for this managed resource.

title String

Package Details

Repository
PagerDuty pulumi/pulumi-pagerduty
License
Apache-2.0
Notes

This Pulumi package is based on the pagerduty Terraform Provider.