import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Use this resource to create, update, and delete New Relic Service Level Indicators and Objectives. * * A New Relic User API key is required to provision this resource. Set the `apiKey` * attribute in the `provider` block or the `NEW_RELIC_API_KEY` environment * variable with your User API key. * * Important: * - Only roles that provide [permissions](https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-user-management/new-relic-one-user-model-understand-user-structure/) to create events to metric rules can create SLI/SLOs. * - Only [Full users](https://docs.newrelic.com/docs/accounts/accounts-billing/new-relic-one-user-management/new-relic-one-user-model-understand-user-structure/#user-type) can view SLI/SLOs. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const foo = new newrelic.ServiceLevel("foo", { * guid: "MXxBUE18QVBQTElDQVRJT058MQ", * name: "Latency", * description: "Proportion of requests that are served faster than a threshold.", * events: { * accountId: "12345678", * facets: ["appName"], * validEvents: { * from: "Transaction", * where: "appName = 'Example application' AND (transactionType='Web')", * }, * goodEvents: { * from: "Transaction", * where: "appName = 'Example application' AND (transactionType= 'Web') AND duration < 0.1", * }, * }, * objective: { * target: 99, * timeWindow: { * rolling: { * count: 7, * unit: "DAY", * }, * }, * }, * }); * ``` * * ## Additional Example * * Service level with tags: * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const mySyntheticMonitorServiceLevel = new newrelic.ServiceLevel("my_synthetic_monitor_service_level", { * guid: "MXxBUE18QVBQTElDQVRJT058MQ", * name: "My synthethic monitor - Success", * description: "Proportion of successful synthetic checks.", * events: { * accountId: "12345678", * validEvents: { * from: "SyntheticCheck", * where: "entityGuid = 'MXxBUE18QVBQTElDQVRJT058MQ'", * }, * goodEvents: { * from: "SyntheticCheck", * where: "entityGuid = 'MXxBUE18QVBQTElDQVRJT058MQ' AND result='SUCCESS'", * }, * }, * objective: { * target: 99, * timeWindow: { * rolling: { * count: 7, * unit: "DAY", * }, * }, * }, * }); * const mySyntheticMonitorServiceLevelTags = new newrelic.EntityTags("my_synthetic_monitor_service_level_tags", { * guid: mySyntheticMonitorServiceLevel.sliGuid, * tags: [ * { * key: "user_journey", * values: [ * "authentication", * "sso", * ], * }, * { * key: "owner", * values: ["identityTeam"], * }, * ], * }); * ``` * * Using `select` for events * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const mySyntheticMonitorDurationServiceLevel = new newrelic.ServiceLevel("my_synthetic_monitor_duration_service_level", { * guid: "MXxBUE18QVBQTElDQVRJT058MQ", * name: "Duration distribution is under 7", * description: "Monitor created to test concurrent request from terraform", * events: { * accountId: "313870", * validEvents: { * from: "Metric", * select: { * attribute: "`query.wallClockTime.negative.distribution`", * "function": "GET_FIELD", * }, * where: "metricName = 'query.wallClockTime.negative.distribution'", * }, * goodEvents: { * from: "Metric", * select: { * attribute: "`query.wallClockTime.negative.distribution`", * "function": "GET_CDF_COUNT", * threshold: 7, * }, * where: "metricName = 'query.wallClockTime.negative.distribution'", * }, * }, * objective: { * target: 49, * timeWindow: { * rolling: { * count: 7, * unit: "DAY", * }, * }, * }, * }); * ``` * * For up-to-date documentation about the tagging resource, please check newrelic.EntityTags * * ## Import * * New Relic Service Levels can be imported using a concatenated string of the format * `::`, where the `guid` is the entity the SLI relates to. * * Example: * * ```sh * $ pulumi import newrelic:index/serviceLevel:ServiceLevel foo 12345678:4321:MXxBUE18QVBQTElDQVRJT058MQ * ``` */ export declare class ServiceLevel extends pulumi.CustomResource { /** * Get an existing ServiceLevel 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, state?: ServiceLevelState, opts?: pulumi.CustomResourceOptions): ServiceLevel; /** * Returns true if the given object is an instance of ServiceLevel. 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 ServiceLevel; /** * The description of the SLI. */ readonly description: pulumi.Output; /** * The events that define the NRDB data for the SLI/SLO calculations. * See Events below for details. */ readonly events: pulumi.Output; /** * The GUID of the entity (e.g, APM Service, Browser application, Workload, etc.) that you want to relate this SLI to. Note that changing the GUID will force a new resource. */ readonly guid: pulumi.Output; /** * A short name for the SLI that will help anyone understand what it is about. */ readonly name: pulumi.Output; /** * The objective of the SLI, only one can be defined. * See Objective below for details. */ readonly objective: pulumi.Output; /** * The unique entity identifier of the Service Level Indicator in New Relic. */ readonly sliGuid: pulumi.Output; /** * The unique entity identifier of the Service Level Indicator. */ readonly sliId: pulumi.Output; /** * Create a ServiceLevel 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: ServiceLevelArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ServiceLevel resources. */ export interface ServiceLevelState { /** * The description of the SLI. */ description?: pulumi.Input; /** * The events that define the NRDB data for the SLI/SLO calculations. * See Events below for details. */ events?: pulumi.Input; /** * The GUID of the entity (e.g, APM Service, Browser application, Workload, etc.) that you want to relate this SLI to. Note that changing the GUID will force a new resource. */ guid?: pulumi.Input; /** * A short name for the SLI that will help anyone understand what it is about. */ name?: pulumi.Input; /** * The objective of the SLI, only one can be defined. * See Objective below for details. */ objective?: pulumi.Input; /** * The unique entity identifier of the Service Level Indicator in New Relic. */ sliGuid?: pulumi.Input; /** * The unique entity identifier of the Service Level Indicator. */ sliId?: pulumi.Input; } /** * The set of arguments for constructing a ServiceLevel resource. */ export interface ServiceLevelArgs { /** * The description of the SLI. */ description?: pulumi.Input; /** * The events that define the NRDB data for the SLI/SLO calculations. * See Events below for details. */ events: pulumi.Input; /** * The GUID of the entity (e.g, APM Service, Browser application, Workload, etc.) that you want to relate this SLI to. Note that changing the GUID will force a new resource. */ guid: pulumi.Input; /** * A short name for the SLI that will help anyone understand what it is about. */ name?: pulumi.Input; /** * The objective of the SLI, only one can be defined. * See Objective below for details. */ objective: pulumi.Input; } //# sourceMappingURL=serviceLevel.d.ts.map