1. Packages
  2. Packages
  3. Pagerduty Provider
  4. API Docs
  5. CustomFieldOption
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 Option is a specific value that can be used for Custom Fields that only allow values from a set of fixed option.

    Migration

    The incident_custom_field_option resource provides similar functionality with largely the same arguments and attributes. The only significant change is that 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 sreEnvironment = new Pagerduty.CustomField("sreEnvironment", new()
        {
            Datatype = "string",
            FixedOptions = true,
        });
    
        var devEnvironment = new Pagerduty.CustomFieldOption("devEnvironment", new()
        {
            Field = sreEnvironment.Id,
            Datatype = "string",
            Value = "dev",
        });
    
        var stageEnvironment = new Pagerduty.CustomFieldOption("stageEnvironment", new()
        {
            Field = sreEnvironment.Id,
            Datatype = "string",
            Value = "stage",
        });
    
        var prodEnvironment = new Pagerduty.CustomFieldOption("prodEnvironment", new()
        {
            Field = sreEnvironment.Id,
            Datatype = "string",
            Value = "prod",
        });
    
    });
    
    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 {
    		sreEnvironment, err := pagerduty.NewCustomField(ctx, "sreEnvironment", &pagerduty.CustomFieldArgs{
    			Datatype:     pulumi.String("string"),
    			FixedOptions: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewCustomFieldOption(ctx, "devEnvironment", &pagerduty.CustomFieldOptionArgs{
    			Field:    sreEnvironment.ID(),
    			Datatype: pulumi.String("string"),
    			Value:    pulumi.String("dev"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewCustomFieldOption(ctx, "stageEnvironment", &pagerduty.CustomFieldOptionArgs{
    			Field:    sreEnvironment.ID(),
    			Datatype: pulumi.String("string"),
    			Value:    pulumi.String("stage"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewCustomFieldOption(ctx, "prodEnvironment", &pagerduty.CustomFieldOptionArgs{
    			Field:    sreEnvironment.ID(),
    			Datatype: pulumi.String("string"),
    			Value:    pulumi.String("prod"),
    		})
    		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.CustomFieldOption;
    import com.pulumi.pagerduty.CustomFieldOptionArgs;
    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 sreEnvironment = new CustomField("sreEnvironment", CustomFieldArgs.builder()        
                .datatype("string")
                .fixedOptions(true)
                .build());
    
            var devEnvironment = new CustomFieldOption("devEnvironment", CustomFieldOptionArgs.builder()        
                .field(sreEnvironment.id())
                .datatype("string")
                .value("dev")
                .build());
    
            var stageEnvironment = new CustomFieldOption("stageEnvironment", CustomFieldOptionArgs.builder()        
                .field(sreEnvironment.id())
                .datatype("string")
                .value("stage")
                .build());
    
            var prodEnvironment = new CustomFieldOption("prodEnvironment", CustomFieldOptionArgs.builder()        
                .field(sreEnvironment.id())
                .datatype("string")
                .value("prod")
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as pagerduty from "@pulumi/pagerduty";
    
    const sreEnvironment = new pagerduty.CustomField("sreEnvironment", {
        datatype: "string",
        fixedOptions: true,
    });
    const devEnvironment = new pagerduty.CustomFieldOption("devEnvironment", {
        field: sreEnvironment.id,
        datatype: "string",
        value: "dev",
    });
    const stageEnvironment = new pagerduty.CustomFieldOption("stageEnvironment", {
        field: sreEnvironment.id,
        datatype: "string",
        value: "stage",
    });
    const prodEnvironment = new pagerduty.CustomFieldOption("prodEnvironment", {
        field: sreEnvironment.id,
        datatype: "string",
        value: "prod",
    });
    
    import pulumi
    import pulumi_pagerduty as pagerduty
    
    sre_environment = pagerduty.CustomField("sreEnvironment",
        datatype="string",
        fixed_options=True)
    dev_environment = pagerduty.CustomFieldOption("devEnvironment",
        field=sre_environment.id,
        datatype="string",
        value="dev")
    stage_environment = pagerduty.CustomFieldOption("stageEnvironment",
        field=sre_environment.id,
        datatype="string",
        value="stage")
    prod_environment = pagerduty.CustomFieldOption("prodEnvironment",
        field=sre_environment.id,
        datatype="string",
        value="prod")
    
    resources:
      sreEnvironment:
        type: pagerduty:CustomField
        properties:
          datatype: string
          fixedOptions: true
      devEnvironment:
        type: pagerduty:CustomFieldOption
        properties:
          field: ${sreEnvironment.id}
          datatype: string
          value: dev
      stageEnvironment:
        type: pagerduty:CustomFieldOption
        properties:
          field: ${sreEnvironment.id}
          datatype: string
          value: stage
      prodEnvironment:
        type: pagerduty:CustomFieldOption
        properties:
          field: ${sreEnvironment.id}
          datatype: string
          value: prod
    

    Create CustomFieldOption Resource

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

    Constructor syntax

    new CustomFieldOption(name: string, args: CustomFieldOptionArgs, opts?: CustomResourceOptions);
    @overload
    def CustomFieldOption(resource_name: str,
                          args: CustomFieldOptionArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def CustomFieldOption(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          datatype: Optional[str] = None,
                          field: Optional[str] = None,
                          value: Optional[str] = None)
    func NewCustomFieldOption(ctx *Context, name string, args CustomFieldOptionArgs, opts ...ResourceOption) (*CustomFieldOption, error)
    public CustomFieldOption(string name, CustomFieldOptionArgs args, CustomResourceOptions? opts = null)
    public CustomFieldOption(String name, CustomFieldOptionArgs args)
    public CustomFieldOption(String name, CustomFieldOptionArgs args, CustomResourceOptions options)
    
    type: pagerduty:CustomFieldOption
    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 CustomFieldOptionArgs
    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 CustomFieldOptionArgs
    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 CustomFieldOptionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CustomFieldOptionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CustomFieldOptionArgs
    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 customFieldOptionResource = new Pagerduty.CustomFieldOption("customFieldOptionResource", new()
    {
        Datatype = "string",
        Field = "string",
        Value = "string",
    });
    
    example, err := pagerduty.NewCustomFieldOption(ctx, "customFieldOptionResource", &pagerduty.CustomFieldOptionArgs{
    	Datatype: pulumi.String("string"),
    	Field:    pulumi.String("string"),
    	Value:    pulumi.String("string"),
    })
    
    var customFieldOptionResource = new CustomFieldOption("customFieldOptionResource", CustomFieldOptionArgs.builder()
        .datatype("string")
        .field("string")
        .value("string")
        .build());
    
    custom_field_option_resource = pagerduty.CustomFieldOption("customFieldOptionResource",
        datatype="string",
        field="string",
        value="string")
    
    const customFieldOptionResource = new pagerduty.CustomFieldOption("customFieldOptionResource", {
        datatype: "string",
        field: "string",
        value: "string",
    });
    
    type: pagerduty:CustomFieldOption
    properties:
        datatype: string
        field: string
        value: string
    

    CustomFieldOption 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 CustomFieldOption resource accepts the following input properties:

    Datatype string
    The datatype of the field option. Must be one of string, integer, float, boolean, datetime, or url.
    Field string
    The ID of the field.
    Value string
    The allowed value.
    Datatype string
    The datatype of the field option. Must be one of string, integer, float, boolean, datetime, or url.
    Field string
    The ID of the field.
    Value string
    The allowed value.
    datatype String
    The datatype of the field option. Must be one of string, integer, float, boolean, datetime, or url.
    field String
    The ID of the field.
    value String
    The allowed value.
    datatype string
    The datatype of the field option. Must be one of string, integer, float, boolean, datetime, or url.
    field string
    The ID of the field.
    value string
    The allowed value.
    datatype str
    The datatype of the field option. Must be one of string, integer, float, boolean, datetime, or url.
    field str
    The ID of the field.
    value str
    The allowed value.
    datatype String
    The datatype of the field option. Must be one of string, integer, float, boolean, datetime, or url.
    field String
    The ID of the field.
    value String
    The allowed value.

    Outputs

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

    Get an existing CustomFieldOption 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?: CustomFieldOptionState, opts?: CustomResourceOptions): CustomFieldOption
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            datatype: Optional[str] = None,
            field: Optional[str] = None,
            value: Optional[str] = None) -> CustomFieldOption
    func GetCustomFieldOption(ctx *Context, name string, id IDInput, state *CustomFieldOptionState, opts ...ResourceOption) (*CustomFieldOption, error)
    public static CustomFieldOption Get(string name, Input<string> id, CustomFieldOptionState? state, CustomResourceOptions? opts = null)
    public static CustomFieldOption get(String name, Output<String> id, CustomFieldOptionState state, CustomResourceOptions options)
    resources:  _:    type: pagerduty:CustomFieldOption    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 option. Must be one of string, integer, float, boolean, datetime, or url.
    Field string
    The ID of the field.
    Value string
    The allowed value.
    Datatype string
    The datatype of the field option. Must be one of string, integer, float, boolean, datetime, or url.
    Field string
    The ID of the field.
    Value string
    The allowed value.
    datatype String
    The datatype of the field option. Must be one of string, integer, float, boolean, datetime, or url.
    field String
    The ID of the field.
    value String
    The allowed value.
    datatype string
    The datatype of the field option. Must be one of string, integer, float, boolean, datetime, or url.
    field string
    The ID of the field.
    value string
    The allowed value.
    datatype str
    The datatype of the field option. Must be one of string, integer, float, boolean, datetime, or url.
    field str
    The ID of the field.
    value str
    The allowed value.
    datatype String
    The datatype of the field option. Must be one of string, integer, float, boolean, datetime, or url.
    field String
    The ID of the field.
    value String
    The allowed value.

    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.