UNPKG

@pulumi/pagerduty

Version:

A Pulumi package for creating and managing pagerduty cloud resources.

151 lines (150 loc) 5.31 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as pagerduty from "@pulumi/pagerduty"; * * // First, create service custom fields * const environment = new pagerduty.ServiceCustomField("environment", { * name: "environment", * displayName: "Environment", * dataType: "string", * fieldType: "single_value", * description: "The environment this service runs in", * }); * const region = new pagerduty.ServiceCustomField("region", { * name: "region", * displayName: "Region", * dataType: "string", * fieldType: "single_value", * description: "The region this service is deployed in", * }); * const isCritical = new pagerduty.ServiceCustomField("is_critical", { * name: "is_critical", * displayName: "Is Critical", * dataType: "boolean", * fieldType: "single_value", * description: "Whether this service is critical", * }); * 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", * }, * ], * }); * // Create a service * const example = new pagerduty.Service("example", { * name: "Example Service", * autoResolveTimeout: "14400", * acknowledgementTimeout: "600", * escalationPolicy: examplePagerdutyEscalationPolicy.id, * }); * // Set custom field values on the service * const exampleServiceCustomFieldValue = new pagerduty.ServiceCustomFieldValue("example", { * serviceId: example.id, * customFields: [ * { * name: environment.name, * value: JSON.stringify("production"), * }, * { * name: region.name, * value: JSON.stringify("us-east-1"), * }, * { * name: isCritical.name, * value: JSON.stringify(true), * }, * { * name: regions.name, * value: JSON.stringify([ * "us-east-1", * "us-west-1", * ]), * }, * ], * }); * ``` * * ## Import * * Service custom field values can be imported using the service ID, e.g. * * ```sh * $ pulumi import pagerduty:index/serviceCustomFieldValue:ServiceCustomFieldValue example PXYZ123 * ``` */ export declare class ServiceCustomFieldValue extends pulumi.CustomResource { /** * Get an existing ServiceCustomFieldValue 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?: ServiceCustomFieldValueState, opts?: pulumi.CustomResourceOptions): ServiceCustomFieldValue; /** * Returns true if the given object is an instance of ServiceCustomFieldValue. 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 ServiceCustomFieldValue; /** * The custom field values to set for the service. */ readonly customFields: pulumi.Output<outputs.ServiceCustomFieldValueCustomField[]>; /** * The ID of the service to set custom field values for. */ readonly serviceId: pulumi.Output<string>; /** * Create a ServiceCustomFieldValue 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: ServiceCustomFieldValueArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ServiceCustomFieldValue resources. */ export interface ServiceCustomFieldValueState { /** * The custom field values to set for the service. */ customFields?: pulumi.Input<pulumi.Input<inputs.ServiceCustomFieldValueCustomField>[]>; /** * The ID of the service to set custom field values for. */ serviceId?: pulumi.Input<string>; } /** * The set of arguments for constructing a ServiceCustomFieldValue resource. */ export interface ServiceCustomFieldValueArgs { /** * The custom field values to set for the service. */ customFields: pulumi.Input<pulumi.Input<inputs.ServiceCustomFieldValueCustomField>[]>; /** * The ID of the service to set custom field values for. */ serviceId: pulumi.Input<string>; }