pagerduty.IncidentCustomFieldOption
Explore with Pulumi AI
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("sre_environment", {
name: "environment",
displayName: "Environment",
dataType: "string",
fieldType: "single_value_fixed",
});
const devEnvironment = new pagerduty.IncidentCustomFieldOption("dev_environment", {
field: sreEnvironment.id,
dataType: "string",
value: "dev",
});
const stageEnvironment = new pagerduty.IncidentCustomFieldOption("stage_environment", {
field: sreEnvironment.id,
dataType: "string",
value: "stage",
});
const prodEnvironment = new pagerduty.IncidentCustomFieldOption("prod_environment", {
field: sreEnvironment.id,
dataType: "string",
value: "prod",
});
import pulumi
import pulumi_pagerduty as pagerduty
sre_environment = pagerduty.IncidentCustomField("sre_environment",
name="environment",
display_name="Environment",
data_type="string",
field_type="single_value_fixed")
dev_environment = pagerduty.IncidentCustomFieldOption("dev_environment",
field=sre_environment.id,
data_type="string",
value="dev")
stage_environment = pagerduty.IncidentCustomFieldOption("stage_environment",
field=sre_environment.id,
data_type="string",
value="stage")
prod_environment = pagerduty.IncidentCustomFieldOption("prod_environment",
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, "sre_environment", &pagerduty.IncidentCustomFieldArgs{
Name: pulumi.String("environment"),
DisplayName: pulumi.String("Environment"),
DataType: pulumi.String("string"),
FieldType: pulumi.String("single_value_fixed"),
})
if err != nil {
return err
}
_, err = pagerduty.NewIncidentCustomFieldOption(ctx, "dev_environment", &pagerduty.IncidentCustomFieldOptionArgs{
Field: sreEnvironment.ID(),
DataType: pulumi.String("string"),
Value: pulumi.String("dev"),
})
if err != nil {
return err
}
_, err = pagerduty.NewIncidentCustomFieldOption(ctx, "stage_environment", &pagerduty.IncidentCustomFieldOptionArgs{
Field: sreEnvironment.ID(),
DataType: pulumi.String("string"),
Value: pulumi.String("stage"),
})
if err != nil {
return err
}
_, err = pagerduty.NewIncidentCustomFieldOption(ctx, "prod_environment", &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("sre_environment", new()
{
Name = "environment",
DisplayName = "Environment",
DataType = "string",
FieldType = "single_value_fixed",
});
var devEnvironment = new Pagerduty.IncidentCustomFieldOption("dev_environment", new()
{
Field = sreEnvironment.Id,
DataType = "string",
Value = "dev",
});
var stageEnvironment = new Pagerduty.IncidentCustomFieldOption("stage_environment", new()
{
Field = sreEnvironment.Id,
DataType = "string",
Value = "stage",
});
var prodEnvironment = new Pagerduty.IncidentCustomFieldOption("prod_environment", 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()
.name("environment")
.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
name: sre_environment
properties:
name: environment
displayName: Environment
dataType: string
fieldType: single_value_fixed
devEnvironment:
type: pagerduty:IncidentCustomFieldOption
name: dev_environment
properties:
field: ${sreEnvironment.id}
dataType: string
value: dev
stageEnvironment:
type: pagerduty:IncidentCustomFieldOption
name: stage_environment
properties:
field: ${sreEnvironment.id}
dataType: string
value: stage
prodEnvironment:
type: pagerduty:IncidentCustomFieldOption
name: prod_environment
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.
Constructor 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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The IncidentCustomFieldOption resource accepts the following input properties:
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.
Package Details
- Repository
- PagerDuty pulumi/pulumi-pagerduty
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
pagerduty
Terraform Provider.