UNPKG

@pulumi/pagerduty

Version:

A Pulumi package for creating and managing pagerduty cloud resources.

245 lines (244 loc) • 9.28 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * A [service custom field](https://developer.pagerduty.com/api-reference/6075929031f7d-create-a-field) * allows you to extend PagerDuty Services with custom data fields to provide * additional context and support features such as customized filtering, search, * and analytics. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pagerduty from "@pulumi/pagerduty"; * * // Simple string field * const environment = new pagerduty.ServiceCustomField("environment", { * name: "environment", * displayName: "Environment", * dataType: "string", * fieldType: "single_value", * description: "The environment this service runs in", * }); * // Field with fixed options * const deploymentTier = new pagerduty.ServiceCustomField("deployment_tier", { * name: "deployment_tier", * displayName: "Deployment Tier", * dataType: "string", * fieldType: "single_value_fixed", * description: "The deployment tier of the service", * fieldOptions: [ * { * value: "production", * dataType: "string", * }, * { * value: "staging", * dataType: "string", * }, * { * value: "development", * dataType: "string", * }, * ], * }); * // Multi-value field with fixed options * const regions = new pagerduty.ServiceCustomField("regions", { * name: "regions", * displayName: "AWS Regions", * dataType: "string", * fieldType: "multi_value_fixed", * description: "AWS regions where this service is deployed", * fieldOptions: [ * { * value: "us-east-1", * dataType: "string", * }, * { * value: "us-west-1", * dataType: "string", * }, * ], * }); * // Boolean field * const critical = new pagerduty.ServiceCustomField("critical", { * name: "is_critical", * displayName: "Is Critical", * dataType: "boolean", * fieldType: "single_value", * description: "Whether this is a critical service", * }); * // Integer field * const priority = new pagerduty.ServiceCustomField("priority", { * name: "priority_level", * displayName: "Priority Level", * dataType: "integer", * fieldType: "single_value", * description: "Service priority level", * }); * ``` * * ## Import * * Service custom fields can be imported using the field ID, e.g. * * ```sh * $ pulumi import pagerduty:index/serviceCustomField:ServiceCustomField example P123456 * ``` */ export declare class ServiceCustomField extends pulumi.CustomResource { /** * Get an existing ServiceCustomField resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ServiceCustomFieldState, opts?: pulumi.CustomResourceOptions): ServiceCustomField; /** * Returns true if the given object is an instance of ServiceCustomField. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is ServiceCustomField; /** * The kind of data the custom field is allowed to contain. Can be one of: `string`, `integer`, `float`, `boolean`, `datetime`, or `url`. */ readonly dataType: pulumi.Output<string>; /** * Default value for the field. */ readonly defaultValue: pulumi.Output<string | undefined>; /** * A description of the data this field contains. */ readonly description: pulumi.Output<string | undefined>; /** * The human-readable name of the field. Must be unique across an account. */ readonly displayName: pulumi.Output<string>; /** * Whether the field is enabled. Defaults to `true`. */ readonly enabled: pulumi.Output<boolean>; /** * Configuration block for defining options for `singleValueFixed` or `multiValueFixed` field types. Can be specified multiple times for multiple options. */ readonly fieldOptions: pulumi.Output<outputs.ServiceCustomFieldFieldOption[] | undefined>; /** * The type of field. Must be one of: `singleValue`, `singleValueFixed`, `multiValue`, or `multiValueFixed`. */ readonly fieldType: pulumi.Output<string>; /** * The name of the field. May include ASCII characters, specifically lowercase letters, digits, and underscores. Must be unique and cannot be changed once created. */ readonly name: pulumi.Output<string>; /** * The API show URL at which the object is accessible */ readonly self: pulumi.Output<string>; /** * A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to display_name */ readonly summary: pulumi.Output<string>; /** * API object type */ readonly type: pulumi.Output<string>; /** * Create a ServiceCustomField resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ServiceCustomFieldArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ServiceCustomField resources. */ export interface ServiceCustomFieldState { /** * The kind of data the custom field is allowed to contain. Can be one of: `string`, `integer`, `float`, `boolean`, `datetime`, or `url`. */ dataType?: pulumi.Input<string>; /** * Default value for the field. */ defaultValue?: pulumi.Input<string>; /** * A description of the data this field contains. */ description?: pulumi.Input<string>; /** * The human-readable name of the field. Must be unique across an account. */ displayName?: pulumi.Input<string>; /** * Whether the field is enabled. Defaults to `true`. */ enabled?: pulumi.Input<boolean>; /** * Configuration block for defining options for `singleValueFixed` or `multiValueFixed` field types. Can be specified multiple times for multiple options. */ fieldOptions?: pulumi.Input<pulumi.Input<inputs.ServiceCustomFieldFieldOption>[]>; /** * The type of field. Must be one of: `singleValue`, `singleValueFixed`, `multiValue`, or `multiValueFixed`. */ fieldType?: pulumi.Input<string>; /** * The name of the field. May include ASCII characters, specifically lowercase letters, digits, and underscores. Must be unique and cannot be changed once created. */ name?: pulumi.Input<string>; /** * The API show URL at which the object is accessible */ self?: pulumi.Input<string>; /** * A short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to display_name */ summary?: pulumi.Input<string>; /** * API object type */ type?: pulumi.Input<string>; } /** * The set of arguments for constructing a ServiceCustomField resource. */ export interface ServiceCustomFieldArgs { /** * The kind of data the custom field is allowed to contain. Can be one of: `string`, `integer`, `float`, `boolean`, `datetime`, or `url`. */ dataType: pulumi.Input<string>; /** * Default value for the field. */ defaultValue?: pulumi.Input<string>; /** * A description of the data this field contains. */ description?: pulumi.Input<string>; /** * The human-readable name of the field. Must be unique across an account. */ displayName: pulumi.Input<string>; /** * Whether the field is enabled. Defaults to `true`. */ enabled?: pulumi.Input<boolean>; /** * Configuration block for defining options for `singleValueFixed` or `multiValueFixed` field types. Can be specified multiple times for multiple options. */ fieldOptions?: pulumi.Input<pulumi.Input<inputs.ServiceCustomFieldFieldOption>[]>; /** * The type of field. Must be one of: `singleValue`, `singleValueFixed`, `multiValue`, or `multiValueFixed`. */ fieldType: pulumi.Input<string>; /** * The name of the field. May include ASCII characters, specifically lowercase letters, digits, and underscores. Must be unique and cannot be changed once created. */ name?: pulumi.Input<string>; }