1. Packages
  2. PagerDuty
  3. API Docs
  4. IncidentCustomFieldOption
PagerDuty v4.11.4 published on Wednesday, Apr 17, 2024 by Pulumi

pagerduty.IncidentCustomFieldOption

Explore with Pulumi AI

pagerduty logo
PagerDuty v4.11.4 published on Wednesday, Apr 17, 2024 by Pulumi

    A Incident Custom Field Option is a specific value that can be used for an Incident Custom Field that only allow values from a set of fixed options, i.e. has the field_type of single_value_fixed or multi_value_fixed.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as pagerduty from "@pulumi/pagerduty";
    
    const sreEnvironment = new pagerduty.IncidentCustomField("sreEnvironment", {
        displayName: "Environment",
        dataType: "string",
        fieldType: "single_value_fixed",
    });
    const devEnvironment = new pagerduty.IncidentCustomFieldOption("devEnvironment", {
        field: sreEnvironment.id,
        dataType: "string",
        value: "dev",
    });
    const stageEnvironment = new pagerduty.IncidentCustomFieldOption("stageEnvironment", {
        field: sreEnvironment.id,
        dataType: "string",
        value: "stage",
    });
    const prodEnvironment = new pagerduty.IncidentCustomFieldOption("prodEnvironment", {
        field: sreEnvironment.id,
        dataType: "string",
        value: "prod",
    });
    
    import pulumi
    import pulumi_pagerduty as pagerduty
    
    sre_environment = pagerduty.IncidentCustomField("sreEnvironment",
        display_name="Environment",
        data_type="string",
        field_type="single_value_fixed")
    dev_environment = pagerduty.IncidentCustomFieldOption("devEnvironment",
        field=sre_environment.id,
        data_type="string",
        value="dev")
    stage_environment = pagerduty.IncidentCustomFieldOption("stageEnvironment",
        field=sre_environment.id,
        data_type="string",
        value="stage")
    prod_environment = pagerduty.IncidentCustomFieldOption("prodEnvironment",
        field=sre_environment.id,
        data_type="string",
        value="prod")
    
    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 {
    		sreEnvironment, err := pagerduty.NewIncidentCustomField(ctx, "sreEnvironment", &pagerduty.IncidentCustomFieldArgs{
    			DisplayName: pulumi.String("Environment"),
    			DataType:    pulumi.String("string"),
    			FieldType:   pulumi.String("single_value_fixed"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewIncidentCustomFieldOption(ctx, "devEnvironment", &pagerduty.IncidentCustomFieldOptionArgs{
    			Field:    sreEnvironment.ID(),
    			DataType: pulumi.String("string"),
    			Value:    pulumi.String("dev"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewIncidentCustomFieldOption(ctx, "stageEnvironment", &pagerduty.IncidentCustomFieldOptionArgs{
    			Field:    sreEnvironment.ID(),
    			DataType: pulumi.String("string"),
    			Value:    pulumi.String("stage"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewIncidentCustomFieldOption(ctx, "prodEnvironment", &pagerduty.IncidentCustomFieldOptionArgs{
    			Field:    sreEnvironment.ID(),
    			DataType: pulumi.String("string"),
    			Value:    pulumi.String("prod"),
    		})
    		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 sreEnvironment = new Pagerduty.IncidentCustomField("sreEnvironment", new()
        {
            DisplayName = "Environment",
            DataType = "string",
            FieldType = "single_value_fixed",
        });
    
        var devEnvironment = new Pagerduty.IncidentCustomFieldOption("devEnvironment", new()
        {
            Field = sreEnvironment.Id,
            DataType = "string",
            Value = "dev",
        });
    
        var stageEnvironment = new Pagerduty.IncidentCustomFieldOption("stageEnvironment", new()
        {
            Field = sreEnvironment.Id,
            DataType = "string",
            Value = "stage",
        });
    
        var prodEnvironment = new Pagerduty.IncidentCustomFieldOption("prodEnvironment", new()
        {
            Field = sreEnvironment.Id,
            DataType = "string",
            Value = "prod",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.pagerduty.IncidentCustomField;
    import com.pulumi.pagerduty.IncidentCustomFieldArgs;
    import com.pulumi.pagerduty.IncidentCustomFieldOption;
    import com.pulumi.pagerduty.IncidentCustomFieldOptionArgs;
    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 IncidentCustomField("sreEnvironment", IncidentCustomFieldArgs.builder()        
                .displayName("Environment")
                .dataType("string")
                .fieldType("single_value_fixed")
                .build());
    
            var devEnvironment = new IncidentCustomFieldOption("devEnvironment", IncidentCustomFieldOptionArgs.builder()        
                .field(sreEnvironment.id())
                .dataType("string")
                .value("dev")
                .build());
    
            var stageEnvironment = new IncidentCustomFieldOption("stageEnvironment", IncidentCustomFieldOptionArgs.builder()        
                .field(sreEnvironment.id())
                .dataType("string")
                .value("stage")
                .build());
    
            var prodEnvironment = new IncidentCustomFieldOption("prodEnvironment", IncidentCustomFieldOptionArgs.builder()        
                .field(sreEnvironment.id())
                .dataType("string")
                .value("prod")
                .build());
    
        }
    }
    
    resources:
      sreEnvironment:
        type: pagerduty:IncidentCustomField
        properties:
          displayName: Environment
          dataType: string
          fieldType: single_value_fixed
      devEnvironment:
        type: pagerduty:IncidentCustomFieldOption
        properties:
          field: ${sreEnvironment.id}
          dataType: string
          value: dev
      stageEnvironment:
        type: pagerduty:IncidentCustomFieldOption
        properties:
          field: ${sreEnvironment.id}
          dataType: string
          value: stage
      prodEnvironment:
        type: pagerduty:IncidentCustomFieldOption
        properties:
          field: ${sreEnvironment.id}
          dataType: string
          value: prod
    

    Create IncidentCustomFieldOption Resource

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

    Constructor syntax

    new IncidentCustomFieldOption(name: string, args: IncidentCustomFieldOptionArgs, opts?: CustomResourceOptions);
    @overload
    def IncidentCustomFieldOption(resource_name: str,
                                  args: IncidentCustomFieldOptionArgs,
                                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def IncidentCustomFieldOption(resource_name: str,
                                  opts: Optional[ResourceOptions] = None,
                                  data_type: Optional[str] = None,
                                  field: Optional[str] = None,
                                  value: Optional[str] = None)
    func NewIncidentCustomFieldOption(ctx *Context, name string, args IncidentCustomFieldOptionArgs, opts ...ResourceOption) (*IncidentCustomFieldOption, error)
    public IncidentCustomFieldOption(string name, IncidentCustomFieldOptionArgs args, CustomResourceOptions? opts = null)
    public IncidentCustomFieldOption(String name, IncidentCustomFieldOptionArgs args)
    public IncidentCustomFieldOption(String name, IncidentCustomFieldOptionArgs args, CustomResourceOptions options)
    
    type: pagerduty:IncidentCustomFieldOption
    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 IncidentCustomFieldOptionArgs
    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 IncidentCustomFieldOptionArgs
    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 IncidentCustomFieldOptionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IncidentCustomFieldOptionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IncidentCustomFieldOptionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var incidentCustomFieldOptionResource = new Pagerduty.IncidentCustomFieldOption("incidentCustomFieldOptionResource", new()
    {
        DataType = "string",
        Field = "string",
        Value = "string",
    });
    
    example, err := pagerduty.NewIncidentCustomFieldOption(ctx, "incidentCustomFieldOptionResource", &pagerduty.IncidentCustomFieldOptionArgs{
    	DataType: pulumi.String("string"),
    	Field:    pulumi.String("string"),
    	Value:    pulumi.String("string"),
    })
    
    var incidentCustomFieldOptionResource = new IncidentCustomFieldOption("incidentCustomFieldOptionResource", IncidentCustomFieldOptionArgs.builder()        
        .dataType("string")
        .field("string")
        .value("string")
        .build());
    
    incident_custom_field_option_resource = pagerduty.IncidentCustomFieldOption("incidentCustomFieldOptionResource",
        data_type="string",
        field="string",
        value="string")
    
    const incidentCustomFieldOptionResource = new pagerduty.IncidentCustomFieldOption("incidentCustomFieldOptionResource", {
        dataType: "string",
        field: "string",
        value: "string",
    });
    
    type: pagerduty:IncidentCustomFieldOption
    properties:
        dataType: string
        field: string
        value: string
    

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

    DataType string
    The datatype of the field option. Only string is allowed here at present.
    Field string
    The ID of the field.
    Value string
    The allowed value.
    DataType string
    The datatype of the field option. Only string is allowed here at present.
    Field string
    The ID of the field.
    Value string
    The allowed value.
    dataType String
    The datatype of the field option. Only string is allowed here at present.
    field String
    The ID of the field.
    value String
    The allowed value.
    dataType string
    The datatype of the field option. Only string is allowed here at present.
    field string
    The ID of the field.
    value string
    The allowed value.
    data_type str
    The datatype of the field option. Only string is allowed here at present.
    field str
    The ID of the field.
    value str
    The allowed value.
    dataType String
    The datatype of the field option. Only string is allowed here at present.
    field String
    The ID of the field.
    value String
    The allowed value.

    Outputs

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

    Get an existing IncidentCustomFieldOption 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?: IncidentCustomFieldOptionState, opts?: CustomResourceOptions): IncidentCustomFieldOption
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            data_type: Optional[str] = None,
            field: Optional[str] = None,
            value: Optional[str] = None) -> IncidentCustomFieldOption
    func GetIncidentCustomFieldOption(ctx *Context, name string, id IDInput, state *IncidentCustomFieldOptionState, opts ...ResourceOption) (*IncidentCustomFieldOption, error)
    public static IncidentCustomFieldOption Get(string name, Input<string> id, IncidentCustomFieldOptionState? state, CustomResourceOptions? opts = null)
    public static IncidentCustomFieldOption get(String name, Output<String> id, IncidentCustomFieldOptionState 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:
    DataType string
    The datatype of the field option. Only string is allowed here at present.
    Field string
    The ID of the field.
    Value string
    The allowed value.
    DataType string
    The datatype of the field option. Only string is allowed here at present.
    Field string
    The ID of the field.
    Value string
    The allowed value.
    dataType String
    The datatype of the field option. Only string is allowed here at present.
    field String
    The ID of the field.
    value String
    The allowed value.
    dataType string
    The datatype of the field option. Only string is allowed here at present.
    field string
    The ID of the field.
    value string
    The allowed value.
    data_type str
    The datatype of the field option. Only string is allowed here at present.
    field str
    The ID of the field.
    value str
    The allowed value.
    dataType String
    The datatype of the field option. Only string is allowed here at present.
    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
    PagerDuty v4.11.4 published on Wednesday, Apr 17, 2024 by Pulumi