1. Packages
  2. Packages
  3. Pagerduty Provider
  4. API Docs
  5. CustomField
Viewing docs for PagerDuty v3.11.2 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
pagerduty logo
Viewing docs for PagerDuty v3.11.2 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    !> This Resource is no longer functional. Documentation is left here for the purpose of documenting migration steps.

    A Custom Field is a resuable element which can be added to Custom Field Schemas.

    Migration

    The incident_custom_field resource provides similar functionality with largely the same arguments and attributes. The key distinction is that while custom fields created by this data source may have only applied to a subset of incidents within the account after being added to a schema and assigned to a service, custom fields managed by the incident_custom_field resource are applied to all incidents in the account.

    Additionally:

    • The separate multi_value and fixed_options arguments have been merged into a single argument named field_type.
    • The datatype argument has been renamed data_type to match the Public API for the Custom Fields on Incidents feature.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Pagerduty = Pulumi.Pagerduty;
    
    return await Deployment.RunAsync(() => 
    {
        var csImpact = new Pagerduty.CustomField("csImpact", new()
        {
            Datatype = "string",
        });
    
        var sreEnvironment = new Pagerduty.CustomField("sreEnvironment", new()
        {
            Datatype = "string",
            FixedOptions = true,
        });
    
    });
    
    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
    		}
    		_, err = pagerduty.NewCustomField(ctx, "sreEnvironment", &pagerduty.CustomFieldArgs{
    			Datatype:     pulumi.String("string"),
    			FixedOptions: pulumi.Bool(true),
    		})
    		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 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 sreEnvironment = new CustomField("sreEnvironment", CustomFieldArgs.builder()        
                .datatype("string")
                .fixedOptions(true)
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as pagerduty from "@pulumi/pagerduty";
    
    const csImpact = new pagerduty.CustomField("csImpact", {datatype: "string"});
    const sreEnvironment = new pagerduty.CustomField("sreEnvironment", {
        datatype: "string",
        fixedOptions: true,
    });
    
    import pulumi
    import pulumi_pagerduty as pagerduty
    
    cs_impact = pagerduty.CustomField("csImpact", datatype="string")
    sre_environment = pagerduty.CustomField("sreEnvironment",
        datatype="string",
        fixed_options=True)
    
    resources:
      csImpact:
        type: pagerduty:CustomField
        properties:
          datatype: string
      sreEnvironment:
        type: pagerduty:CustomField
        properties:
          datatype: string
          fixedOptions: true
    

    Create CustomField Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CustomField(name: string, args: CustomFieldArgs, opts?: CustomResourceOptions);
    @overload
    def CustomField(resource_name: str,
                    args: CustomFieldArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def CustomField(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    datatype: Optional[str] = None,
                    display_name: Optional[str] = None,
                    description: Optional[str] = None,
                    fixed_options: Optional[bool] = None,
                    multi_value: Optional[bool] = None,
                    name: Optional[str] = None)
    func NewCustomField(ctx *Context, name string, args CustomFieldArgs, opts ...ResourceOption) (*CustomField, error)
    public CustomField(string name, CustomFieldArgs args, CustomResourceOptions? opts = null)
    public CustomField(String name, CustomFieldArgs args)
    public CustomField(String name, CustomFieldArgs args, CustomResourceOptions options)
    
    type: pagerduty:CustomField
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CustomFieldArgs
    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 CustomFieldArgs
    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 CustomFieldArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CustomFieldArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CustomFieldArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var customFieldResource = new Pagerduty.CustomField("customFieldResource", new()
    {
        Datatype = "string",
        DisplayName = "string",
        Description = "string",
        FixedOptions = false,
        MultiValue = false,
        Name = "string",
    });
    
    example, err := pagerduty.NewCustomField(ctx, "customFieldResource", &pagerduty.CustomFieldArgs{
    	Datatype:     pulumi.String("string"),
    	DisplayName:  pulumi.String("string"),
    	Description:  pulumi.String("string"),
    	FixedOptions: pulumi.Bool(false),
    	MultiValue:   pulumi.Bool(false),
    	Name:         pulumi.String("string"),
    })
    
    var customFieldResource = new CustomField("customFieldResource", CustomFieldArgs.builder()
        .datatype("string")
        .displayName("string")
        .description("string")
        .fixedOptions(false)
        .multiValue(false)
        .name("string")
        .build());
    
    custom_field_resource = pagerduty.CustomField("customFieldResource",
        datatype="string",
        display_name="string",
        description="string",
        fixed_options=False,
        multi_value=False,
        name="string")
    
    const customFieldResource = new pagerduty.CustomField("customFieldResource", {
        datatype: "string",
        displayName: "string",
        description: "string",
        fixedOptions: false,
        multiValue: false,
        name: "string",
    });
    
    type: pagerduty:CustomField
    properties:
        datatype: string
        description: string
        displayName: string
        fixedOptions: false
        multiValue: false
        name: string
    

    CustomField Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The CustomField resource accepts the following input properties:

    Datatype string
    The datatype of the field. Must be one of string, integer, float, boolean, datetime, or url.
    DisplayName string
    Description string
    FixedOptions bool
    True if the field can only accept values from a set of options.
    MultiValue bool
    True if the field can accept multiple values.
    Name string
    The name of the field.
    Datatype string
    The datatype of the field. Must be one of string, integer, float, boolean, datetime, or url.
    DisplayName string
    Description string
    FixedOptions bool
    True if the field can only accept values from a set of options.
    MultiValue bool
    True if the field can accept multiple values.
    Name string
    The name of the field.
    datatype String
    The datatype of the field. Must be one of string, integer, float, boolean, datetime, or url.
    displayName String
    description String
    fixedOptions Boolean
    True if the field can only accept values from a set of options.
    multiValue Boolean
    True if the field can accept multiple values.
    name String
    The name of the field.
    datatype string
    The datatype of the field. Must be one of string, integer, float, boolean, datetime, or url.
    displayName string
    description string
    fixedOptions boolean
    True if the field can only accept values from a set of options.
    multiValue boolean
    True if the field can accept multiple values.
    name string
    The name of the field.
    datatype str
    The datatype of the field. Must be one of string, integer, float, boolean, datetime, or url.
    display_name str
    description str
    fixed_options bool
    True if the field can only accept values from a set of options.
    multi_value bool
    True if the field can accept multiple values.
    name str
    The name of the field.
    datatype String
    The datatype of the field. Must be one of string, integer, float, boolean, datetime, or url.
    displayName String
    description String
    fixedOptions Boolean
    True if the field can only accept values from a set of options.
    multiValue Boolean
    True if the field can accept multiple values.
    name String
    The name of the field.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CustomField 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 CustomField Resource

    Get an existing CustomField 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?: CustomFieldState, opts?: CustomResourceOptions): CustomField
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            datatype: Optional[str] = None,
            description: Optional[str] = None,
            display_name: Optional[str] = None,
            fixed_options: Optional[bool] = None,
            multi_value: Optional[bool] = None,
            name: Optional[str] = None) -> CustomField
    func GetCustomField(ctx *Context, name string, id IDInput, state *CustomFieldState, opts ...ResourceOption) (*CustomField, error)
    public static CustomField Get(string name, Input<string> id, CustomFieldState? state, CustomResourceOptions? opts = null)
    public static CustomField get(String name, Output<String> id, CustomFieldState state, CustomResourceOptions options)
    resources:  _:    type: pagerduty:CustomField    get:      id: ${id}
    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:
    Datatype string
    The datatype of the field. Must be one of string, integer, float, boolean, datetime, or url.
    Description string
    DisplayName string
    FixedOptions bool
    True if the field can only accept values from a set of options.
    MultiValue bool
    True if the field can accept multiple values.
    Name string
    The name of the field.
    Datatype string
    The datatype of the field. Must be one of string, integer, float, boolean, datetime, or url.
    Description string
    DisplayName string
    FixedOptions bool
    True if the field can only accept values from a set of options.
    MultiValue bool
    True if the field can accept multiple values.
    Name string
    The name of the field.
    datatype String
    The datatype of the field. Must be one of string, integer, float, boolean, datetime, or url.
    description String
    displayName String
    fixedOptions Boolean
    True if the field can only accept values from a set of options.
    multiValue Boolean
    True if the field can accept multiple values.
    name String
    The name of the field.
    datatype string
    The datatype of the field. Must be one of string, integer, float, boolean, datetime, or url.
    description string
    displayName string
    fixedOptions boolean
    True if the field can only accept values from a set of options.
    multiValue boolean
    True if the field can accept multiple values.
    name string
    The name of the field.
    datatype str
    The datatype of the field. Must be one of string, integer, float, boolean, datetime, or url.
    description str
    display_name str
    fixed_options bool
    True if the field can only accept values from a set of options.
    multi_value bool
    True if the field can accept multiple values.
    name str
    The name of the field.
    datatype String
    The datatype of the field. Must be one of string, integer, float, boolean, datetime, or url.
    description String
    displayName String
    fixedOptions Boolean
    True if the field can only accept values from a set of options.
    multiValue Boolean
    True if the field can accept multiple values.
    name String
    The name of the field.

    Import

    Fields can be imported using the id, e.g.

     $ pulumi import pagerduty:index/customField:CustomField sre_environment PLBP09X
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    PagerDuty pulumi/pulumi-pagerduty
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the pagerduty Terraform Provider.
    pagerduty logo
    Viewing docs for PagerDuty v3.11.2 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.