pagerduty.CustomFieldSchemaAssignment

A Custom Field Schema Assignment is a relationship between a Custom Field Schema and 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 csImpact = new Pagerduty.CustomField("csImpact", new()
    {
        Datatype = "string",
    });

    var mySchema = new Pagerduty.CustomFieldSchema("mySchema", new()
    {
        Title = "My Schema",
        Description = "Fields used on incidents",
    });

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

    var assignment = new Pagerduty.CustomFieldSchemaAssignment("assignment", new()
    {
        Schema = mySchema.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 {
		_, err := pagerduty.NewCustomField(ctx, "csImpact", &pagerduty.CustomFieldArgs{
			Datatype: pulumi.String("string"),
		})
		if err != nil {
			return err
		}
		mySchema, err := pagerduty.NewCustomFieldSchema(ctx, "mySchema", &pagerduty.CustomFieldSchemaArgs{
			Title:       pulumi.String("My Schema"),
			Description: pulumi.String("Fields used on incidents"),
		})
		if err != nil {
			return err
		}
		firstService, err := pagerduty.LookupService(ctx, &pagerduty.LookupServiceArgs{
			Name: "My First Service",
		}, nil)
		if err != nil {
			return err
		}
		_, err = pagerduty.NewCustomFieldSchemaAssignment(ctx, "assignment", &pagerduty.CustomFieldSchemaAssignmentArgs{
			Schema:  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.CustomField;
import com.pulumi.pagerduty.CustomFieldArgs;
import com.pulumi.pagerduty.CustomFieldSchema;
import com.pulumi.pagerduty.CustomFieldSchemaArgs;
import com.pulumi.pagerduty.PagerdutyFunctions;
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) {
        var csImpact = new CustomField("csImpact", CustomFieldArgs.builder()        
            .datatype("string")
            .build());

        var mySchema = new CustomFieldSchema("mySchema", CustomFieldSchemaArgs.builder()        
            .title("My Schema")
            .description("Fields used on incidents")
            .build());

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

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

    }
}
import pulumi
import pulumi_pagerduty as pagerduty

cs_impact = pagerduty.CustomField("csImpact", datatype="string")
my_schema = pagerduty.CustomFieldSchema("mySchema",
    title="My Schema",
    description="Fields used on incidents")
first_service = pagerduty.get_service(name="My First Service")
assignment = pagerduty.CustomFieldSchemaAssignment("assignment",
    schema=my_schema.id,
    service=first_service.id)
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";

const csImpact = new pagerduty.CustomField("csImpact", {datatype: "string"});
const mySchema = new pagerduty.CustomFieldSchema("mySchema", {
    title: "My Schema",
    description: "Fields used on incidents",
});
const firstService = pagerduty.getService({
    name: "My First Service",
});
const assignment = new pagerduty.CustomFieldSchemaAssignment("assignment", {
    schema: mySchema.id,
    service: firstService.then(firstService => firstService.id),
});
resources:
  csImpact:
    type: pagerduty:CustomField
    properties:
      datatype: string
  mySchema:
    type: pagerduty:CustomFieldSchema
    properties:
      title: My Schema
      description: Fields used on incidents
  assignment:
    type: pagerduty:CustomFieldSchemaAssignment
    properties:
      schema: ${mySchema.id}
      service: ${firstService.id}
variables:
  firstService:
    fn::invoke:
      Function: pagerduty:getService
      Arguments:
        name: My First Service

Create CustomFieldSchemaAssignment Resource

new CustomFieldSchemaAssignment(name: string, args: CustomFieldSchemaAssignmentArgs, opts?: CustomResourceOptions);
@overload
def CustomFieldSchemaAssignment(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                schema: Optional[str] = None,
                                service: Optional[str] = None)
@overload
def CustomFieldSchemaAssignment(resource_name: str,
                                args: CustomFieldSchemaAssignmentArgs,
                                opts: Optional[ResourceOptions] = None)
func NewCustomFieldSchemaAssignment(ctx *Context, name string, args CustomFieldSchemaAssignmentArgs, opts ...ResourceOption) (*CustomFieldSchemaAssignment, error)
public CustomFieldSchemaAssignment(string name, CustomFieldSchemaAssignmentArgs args, CustomResourceOptions? opts = null)
public CustomFieldSchemaAssignment(String name, CustomFieldSchemaAssignmentArgs args)
public CustomFieldSchemaAssignment(String name, CustomFieldSchemaAssignmentArgs args, CustomResourceOptions options)
type: pagerduty:CustomFieldSchemaAssignment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args CustomFieldSchemaAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args CustomFieldSchemaAssignmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args CustomFieldSchemaAssignmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args CustomFieldSchemaAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args CustomFieldSchemaAssignmentArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

CustomFieldSchemaAssignment Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The CustomFieldSchemaAssignment resource accepts the following input properties:

Schema string

The id of the field schema.

Service string

The id of the service.

Schema string

The id of the field schema.

Service string

The id of the service.

schema String

The id of the field schema.

service String

The id of the service.

schema string

The id of the field schema.

service string

The id of the service.

schema str

The id of the field schema.

service str

The id of the service.

schema String

The id of the field schema.

service String

The id of the service.

Outputs

All input properties are implicitly available as output properties. Additionally, the CustomFieldSchemaAssignment resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing CustomFieldSchemaAssignment Resource

Get an existing CustomFieldSchemaAssignment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: CustomFieldSchemaAssignmentState, opts?: CustomResourceOptions): CustomFieldSchemaAssignment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        schema: Optional[str] = None,
        service: Optional[str] = None) -> CustomFieldSchemaAssignment
func GetCustomFieldSchemaAssignment(ctx *Context, name string, id IDInput, state *CustomFieldSchemaAssignmentState, opts ...ResourceOption) (*CustomFieldSchemaAssignment, error)
public static CustomFieldSchemaAssignment Get(string name, Input<string> id, CustomFieldSchemaAssignmentState? state, CustomResourceOptions? opts = null)
public static CustomFieldSchemaAssignment get(String name, Output<String> id, CustomFieldSchemaAssignmentState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Schema string

The id of the field schema.

Service string

The id of the service.

Schema string

The id of the field schema.

Service string

The id of the service.

schema String

The id of the field schema.

service String

The id of the service.

schema string

The id of the field schema.

service string

The id of the service.

schema str

The id of the field schema.

service str

The id of the service.

schema String

The id of the field schema.

service String

The id of the service.

Package Details

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

This Pulumi package is based on the pagerduty Terraform Provider.