@pulumi/pagerduty
Version:
A Pulumi package for creating and managing pagerduty cloud resources.
109 lines (108 loc) • 3.72 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as outputs from "./types/output";
/**
* Use this data source to get information about service custom field values in PagerDuty.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pagerduty from "@pulumi/pagerduty";
*
* // Create a service
* const exampleService = new pagerduty.Service("example", {
* name: "Example Service",
* autoResolveTimeout: "14400",
* acknowledgementTimeout: "600",
* escalationPolicy: examplePagerdutyEscalationPolicy.id,
* });
* const example = pagerduty.getServiceCustomFieldValueOutput({
* serviceId: exampleService.id,
* });
* export const environmentValue = example.apply(example => .filter(field => field.name == "environment").map(field => (field.value))[0]);
* // Set custom field values on the service
* const exampleServiceCustomFieldValue = new pagerduty.ServiceCustomFieldValue("example", {
* serviceId: exampleService.id,
* customFields: [
* {
* name: "environment",
* value: JSON.stringify("production"),
* },
* {
* name: "region",
* value: JSON.stringify("us-east-1"),
* },
* ],
* });
* ```
*/
export declare function getServiceCustomFieldValue(args: GetServiceCustomFieldValueArgs, opts?: pulumi.InvokeOptions): Promise<GetServiceCustomFieldValueResult>;
/**
* A collection of arguments for invoking getServiceCustomFieldValue.
*/
export interface GetServiceCustomFieldValueArgs {
/**
* The ID of the service to get custom field values for.
*/
serviceId: string;
}
/**
* A collection of values returned by getServiceCustomFieldValue.
*/
export interface GetServiceCustomFieldValueResult {
/**
* A list of custom field values associated with the service. Each element contains:
*/
readonly customFields: outputs.GetServiceCustomFieldValueCustomField[];
/**
* The ID of the custom field.
*/
readonly id: string;
readonly serviceId: string;
}
/**
* Use this data source to get information about service custom field values in PagerDuty.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as pagerduty from "@pulumi/pagerduty";
*
* // Create a service
* const exampleService = new pagerduty.Service("example", {
* name: "Example Service",
* autoResolveTimeout: "14400",
* acknowledgementTimeout: "600",
* escalationPolicy: examplePagerdutyEscalationPolicy.id,
* });
* const example = pagerduty.getServiceCustomFieldValueOutput({
* serviceId: exampleService.id,
* });
* export const environmentValue = example.apply(example => .filter(field => field.name == "environment").map(field => (field.value))[0]);
* // Set custom field values on the service
* const exampleServiceCustomFieldValue = new pagerduty.ServiceCustomFieldValue("example", {
* serviceId: exampleService.id,
* customFields: [
* {
* name: "environment",
* value: JSON.stringify("production"),
* },
* {
* name: "region",
* value: JSON.stringify("us-east-1"),
* },
* ],
* });
* ```
*/
export declare function getServiceCustomFieldValueOutput(args: GetServiceCustomFieldValueOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetServiceCustomFieldValueResult>;
/**
* A collection of arguments for invoking getServiceCustomFieldValue.
*/
export interface GetServiceCustomFieldValueOutputArgs {
/**
* The ID of the service to get custom field values for.
*/
serviceId: pulumi.Input<string>;
}