1. Packages
  2. PagerDuty
  3. API Docs
  4. getIncidentCustomField
PagerDuty v4.13.2 published on Thursday, Jun 27, 2024 by Pulumi

pagerduty.getIncidentCustomField

Explore with Pulumi AI

pagerduty logo
PagerDuty v4.13.2 published on Thursday, Jun 27, 2024 by Pulumi

    Use this data source to get information about a specific Incident Custom Field.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as pagerduty from "@pulumi/pagerduty";
    
    const environment = pagerduty.getIncidentCustomField({
        name: "environment",
    });
    const devEnvironment = new pagerduty.IncidentCustomFieldOption("dev_environment", {
        field: environment.then(environment => environment.id),
        datatype: "string",
        value: "dev",
    });
    
    import pulumi
    import pulumi_pagerduty as pagerduty
    
    environment = pagerduty.get_incident_custom_field(name="environment")
    dev_environment = pagerduty.IncidentCustomFieldOption("dev_environment",
        field=environment.id,
        datatype="string",
        value="dev")
    
    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 {
    		environment, err := pagerduty.LookupIncidentCustomField(ctx, &pagerduty.LookupIncidentCustomFieldArgs{
    			Name: "environment",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewIncidentCustomFieldOption(ctx, "dev_environment", &pagerduty.IncidentCustomFieldOptionArgs{
    			Field:    pulumi.String(environment.Id),
    			Datatype: pulumi.String("string"),
    			Value:    pulumi.String("dev"),
    		})
    		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 environment = Pagerduty.GetIncidentCustomField.Invoke(new()
        {
            Name = "environment",
        });
    
        var devEnvironment = new Pagerduty.IncidentCustomFieldOption("dev_environment", new()
        {
            Field = environment.Apply(getIncidentCustomFieldResult => getIncidentCustomFieldResult.Id),
            Datatype = "string",
            Value = "dev",
        });
    
    });
    
    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.GetIncidentCustomFieldArgs;
    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) {
            final var environment = PagerdutyFunctions.getIncidentCustomField(GetIncidentCustomFieldArgs.builder()
                .name("environment")
                .build());
    
            var devEnvironment = new IncidentCustomFieldOption("devEnvironment", IncidentCustomFieldOptionArgs.builder()
                .field(environment.applyValue(getIncidentCustomFieldResult -> getIncidentCustomFieldResult.id()))
                .datatype("string")
                .value("dev")
                .build());
    
        }
    }
    
    resources:
      devEnvironment:
        type: pagerduty:IncidentCustomFieldOption
        name: dev_environment
        properties:
          field: ${environment.id}
          datatype: string
          value: dev
    variables:
      environment:
        fn::invoke:
          Function: pagerduty:getIncidentCustomField
          Arguments:
            name: environment
    

    Using getIncidentCustomField

    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 getIncidentCustomField(args: GetIncidentCustomFieldArgs, opts?: InvokeOptions): Promise<GetIncidentCustomFieldResult>
    function getIncidentCustomFieldOutput(args: GetIncidentCustomFieldOutputArgs, opts?: InvokeOptions): Output<GetIncidentCustomFieldResult>
    def get_incident_custom_field(name: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetIncidentCustomFieldResult
    def get_incident_custom_field_output(name: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetIncidentCustomFieldResult]
    func LookupIncidentCustomField(ctx *Context, args *LookupIncidentCustomFieldArgs, opts ...InvokeOption) (*LookupIncidentCustomFieldResult, error)
    func LookupIncidentCustomFieldOutput(ctx *Context, args *LookupIncidentCustomFieldOutputArgs, opts ...InvokeOption) LookupIncidentCustomFieldResultOutput

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

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

    The following arguments are supported:

    Name string
    The name of the field.
    Name string
    The name of the field.
    name String
    The name of the field.
    name string
    The name of the field.
    name str
    The name of the field.
    name String
    The name of the field.

    getIncidentCustomField Result

    The following output properties are available:

    DataType string
    Description string
    DisplayName string
    FieldType string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    DataType string
    Description string
    DisplayName string
    FieldType string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    dataType String
    description String
    displayName String
    fieldType String
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    dataType string
    description string
    displayName string
    fieldType string
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    data_type str
    description str
    display_name str
    field_type str
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    dataType String
    description String
    displayName String
    fieldType String
    id String
    The provider-assigned unique ID for this managed resource.
    name String

    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.13.2 published on Thursday, Jun 27, 2024 by Pulumi