import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Provides a Datadog service level objective resource. This can be used to create and manage Datadog service level objectives. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as datadog from "@pulumi/datadog"; * * // Metric-Based SLO * // Create a new Datadog service level objective * const foo = new datadog.ServiceLevelObjective("foo", { * name: "Example Metric SLO", * type: "metric", * description: "My custom metric SLO", * query: { * numerator: "sum:my.custom.count.metric{type:good_events}.as_count()", * denominator: "sum:my.custom.count.metric{*}.as_count()", * }, * thresholds: [ * { * timeframe: "7d", * target: 99.9, * warning: 99.99, * }, * { * timeframe: "30d", * target: 99.9, * warning: 99.99, * }, * ], * timeframe: "30d", * targetThreshold: 99.9, * warningThreshold: 99.99, * tags: [ * "foo:bar", * "baz", * ], * }); * // Metric-Based SLO using sli_specification.count * // Create a new Datadog service level objective * const metricCountSpecSlo = new datadog.ServiceLevelObjective("metric_count_spec_slo", { * name: "Example Metric Count Spec SLO", * type: "metric", * description: "My custom metric count spec SLO", * sliSpecification: { * count: { * goodEventsFormula: "query1", * badEventsFormula: "query2", * queries: [ * { * metricQuery: { * name: "query1", * query: "sum:my.custom.count.metric{type:good_events}.as_count()", * }, * }, * { * metricQuery: { * name: "query2", * query: "sum:my.custom.count.metric{type:bad_events}.as_count()", * }, * }, * ], * }, * }, * thresholds: [ * { * timeframe: "7d", * target: 99.9, * warning: 99.99, * }, * { * timeframe: "30d", * target: 99.9, * warning: 99.99, * }, * ], * timeframe: "30d", * targetThreshold: 99.9, * warningThreshold: 99.99, * tags: [ * "foo:bar", * "baz", * ], * }); * // Monitor-Based SLO * // Create a new Datadog service level objective * const bar = new datadog.ServiceLevelObjective("bar", { * name: "Example Monitor SLO", * type: "monitor", * description: "My custom monitor SLO", * monitorIds: [ * 1, * 2, * 3, * ], * thresholds: [ * { * timeframe: "7d", * target: 99.9, * warning: 99.99, * }, * { * timeframe: "30d", * target: 99.9, * warning: 99.99, * }, * ], * timeframe: "30d", * targetThreshold: 99.9, * warningThreshold: 99.99, * tags: [ * "foo:bar", * "baz", * ], * }); * const timeSliceSlo = new datadog.ServiceLevelObjective("time_slice_slo", { * name: "Example Time Slice SLO", * type: "time_slice", * description: "My custom time slice SLO", * sliSpecification: { * timeSlice: { * query: { * formula: { * formulaExpression: "query1", * }, * queries: [{ * metricQuery: { * name: "query1", * query: "avg:my.custom.count.metric{*}.as_count()", * }, * }], * }, * comparator: ">", * threshold: 0.9, * }, * }, * thresholds: [{ * timeframe: "7d", * target: 99.9, * warning: 99.99, * }], * timeframe: "7d", * targetThreshold: 99.9, * warningThreshold: 99.99, * tags: [ * "service:myservice", * "team:myteam", * ], * }); * ``` * * ## Import * * The `pulumi import` command can be used, for example: * * Service Level Objectives can be imported using their string ID, e.g. * * ```sh * $ pulumi import datadog:index/serviceLevelObjective:ServiceLevelObjective baz 12345678901234567890123456789012 * ``` */ export declare class ServiceLevelObjective extends pulumi.CustomResource { /** * Get an existing ServiceLevelObjective 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?: ServiceLevelObjectiveState, opts?: pulumi.CustomResourceOptions): ServiceLevelObjective; /** * Returns true if the given object is an instance of ServiceLevelObjective. 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 ServiceLevelObjective; /** * A description of this service level objective. */ readonly description: pulumi.Output; /** * A boolean indicating whether this monitor can be deleted even if it's referenced by other resources (for example, dashboards). */ readonly forceDelete: pulumi.Output; /** * A static set of groups to filter monitor-based SLOs */ readonly groups: pulumi.Output; /** * A static set of monitor IDs to use as part of the SLO */ readonly monitorIds: pulumi.Output; /** * Name of Datadog service level objective */ readonly name: pulumi.Output; /** * The metric query of good / total events. Use this for metric SLOs as an alternative to `sliSpecification`. */ readonly query: pulumi.Output; /** * A generic SLI specification. This is used for both time-slice SLOs and count-based (metric) SLOs. */ readonly sliSpecification: pulumi.Output; /** * A list of tags to associate with your service level objective. This can help you categorize and filter service level objectives in the service level objectives page of the UI. **Note**: it's not currently possible to filter by these tags when querying via the API. If default tags are present at the provider level, they will be added to this resource. */ readonly tags: pulumi.Output; /** * The objective's target in `(0,100)`. This must match the corresponding thresholds of the primary time frame. */ readonly targetThreshold: pulumi.Output; /** * A list of thresholds and targets that define the service level objectives from the provided SLIs. */ readonly thresholds: pulumi.Output; /** * The primary time frame for the objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Valid values are `7d`, `30d`, `90d`, `custom`. */ readonly timeframe: pulumi.Output; /** * The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API [documentation page](https://docs.datadoghq.com/api/v1/service-level-objectives/#create-a-slo-object). Valid values are `metric`, `monitor`, `timeSlice`. */ readonly type: pulumi.Output; /** * Whether or not to validate the SLO. It checks if monitors added to a monitor SLO already exist. */ readonly validate: pulumi.Output; /** * The objective's warning value in `(0,100)`. This must be greater than the target value and match the corresponding thresholds of the primary time frame. */ readonly warningThreshold: pulumi.Output; /** * Create a ServiceLevelObjective 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: ServiceLevelObjectiveArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ServiceLevelObjective resources. */ export interface ServiceLevelObjectiveState { /** * A description of this service level objective. */ description?: pulumi.Input; /** * A boolean indicating whether this monitor can be deleted even if it's referenced by other resources (for example, dashboards). */ forceDelete?: pulumi.Input; /** * A static set of groups to filter monitor-based SLOs */ groups?: pulumi.Input[]>; /** * A static set of monitor IDs to use as part of the SLO */ monitorIds?: pulumi.Input[]>; /** * Name of Datadog service level objective */ name?: pulumi.Input; /** * The metric query of good / total events. Use this for metric SLOs as an alternative to `sliSpecification`. */ query?: pulumi.Input; /** * A generic SLI specification. This is used for both time-slice SLOs and count-based (metric) SLOs. */ sliSpecification?: pulumi.Input; /** * A list of tags to associate with your service level objective. This can help you categorize and filter service level objectives in the service level objectives page of the UI. **Note**: it's not currently possible to filter by these tags when querying via the API. If default tags are present at the provider level, they will be added to this resource. */ tags?: pulumi.Input[]>; /** * The objective's target in `(0,100)`. This must match the corresponding thresholds of the primary time frame. */ targetThreshold?: pulumi.Input; /** * A list of thresholds and targets that define the service level objectives from the provided SLIs. */ thresholds?: pulumi.Input[]>; /** * The primary time frame for the objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Valid values are `7d`, `30d`, `90d`, `custom`. */ timeframe?: pulumi.Input; /** * The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API [documentation page](https://docs.datadoghq.com/api/v1/service-level-objectives/#create-a-slo-object). Valid values are `metric`, `monitor`, `timeSlice`. */ type?: pulumi.Input; /** * Whether or not to validate the SLO. It checks if monitors added to a monitor SLO already exist. */ validate?: pulumi.Input; /** * The objective's warning value in `(0,100)`. This must be greater than the target value and match the corresponding thresholds of the primary time frame. */ warningThreshold?: pulumi.Input; } /** * The set of arguments for constructing a ServiceLevelObjective resource. */ export interface ServiceLevelObjectiveArgs { /** * A description of this service level objective. */ description?: pulumi.Input; /** * A boolean indicating whether this monitor can be deleted even if it's referenced by other resources (for example, dashboards). */ forceDelete?: pulumi.Input; /** * A static set of groups to filter monitor-based SLOs */ groups?: pulumi.Input[]>; /** * A static set of monitor IDs to use as part of the SLO */ monitorIds?: pulumi.Input[]>; /** * Name of Datadog service level objective */ name: pulumi.Input; /** * The metric query of good / total events. Use this for metric SLOs as an alternative to `sliSpecification`. */ query?: pulumi.Input; /** * A generic SLI specification. This is used for both time-slice SLOs and count-based (metric) SLOs. */ sliSpecification?: pulumi.Input; /** * A list of tags to associate with your service level objective. This can help you categorize and filter service level objectives in the service level objectives page of the UI. **Note**: it's not currently possible to filter by these tags when querying via the API. If default tags are present at the provider level, they will be added to this resource. */ tags?: pulumi.Input[]>; /** * The objective's target in `(0,100)`. This must match the corresponding thresholds of the primary time frame. */ targetThreshold?: pulumi.Input; /** * A list of thresholds and targets that define the service level objectives from the provided SLIs. */ thresholds: pulumi.Input[]>; /** * The primary time frame for the objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. Valid values are `7d`, `30d`, `90d`, `custom`. */ timeframe?: pulumi.Input; /** * The type of the service level objective. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API [documentation page](https://docs.datadoghq.com/api/v1/service-level-objectives/#create-a-slo-object). Valid values are `metric`, `monitor`, `timeSlice`. */ type: pulumi.Input; /** * Whether or not to validate the SLO. It checks if monitors added to a monitor SLO already exist. */ validate?: pulumi.Input; /** * The objective's warning value in `(0,100)`. This must be greater than the target value and match the corresponding thresholds of the primary time frame. */ warningThreshold?: pulumi.Input; }