Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.gcp.monitoring.kotlin.SloArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.monitoring.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.monitoring.SloArgs.builder
import com.pulumi.gcp.monitoring.kotlin.inputs.SloBasicSliArgs
import com.pulumi.gcp.monitoring.kotlin.inputs.SloBasicSliArgsBuilder
import com.pulumi.gcp.monitoring.kotlin.inputs.SloRequestBasedSliArgs
import com.pulumi.gcp.monitoring.kotlin.inputs.SloRequestBasedSliArgsBuilder
import com.pulumi.gcp.monitoring.kotlin.inputs.SloWindowsBasedSliArgs
import com.pulumi.gcp.monitoring.kotlin.inputs.SloWindowsBasedSliArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Double
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* A Service-Level Objective (SLO) describes the level of desired good
* service. It consists of a service-level indicator (SLI), a performance
* goal, and a period over which the objective is to be evaluated against
* that goal. The SLO can use SLIs defined in a number of different manners.
* Typical SLOs might include "99% of requests in each rolling week have
* latency below 200 milliseconds" or "99.5% of requests in each calendar
* month return successfully."
* To get more information about Slo, see:
* * [API documentation](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services.serviceLevelObjectives)
* * How-to Guides
* * [Monitoring API Documentation](https://cloud.google.com/monitoring/api/v3/)
* * [Service Monitoring](https://cloud.google.com/monitoring/service-monitoring)
* ## Example Usage
* ### Monitoring Slo Appengine
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const default = gcp.monitoring.getAppEngineService({
* moduleId: "default",
* });
* const appengSlo = new gcp.monitoring.Slo("appeng_slo", {
* service: _default.then(_default => _default.serviceId),
* sloId: "ae-slo",
* displayName: "Test SLO for App Engine",
* goal: 0.9,
* calendarPeriod: "DAY",
* basicSli: {
* latency: {
* threshold: "1s",
* },
* },
* userLabels: {
* my_key: "my_value",
* my_other_key: "my_other_value",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.monitoring.get_app_engine_service(module_id="default")
* appeng_slo = gcp.monitoring.Slo("appeng_slo",
* service=default.service_id,
* slo_id="ae-slo",
* display_name="Test SLO for App Engine",
* goal=0.9,
* calendar_period="DAY",
* basic_sli={
* "latency": {
* "threshold": "1s",
* },
* },
* user_labels={
* "my_key": "my_value",
* "my_other_key": "my_other_value",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = Gcp.Monitoring.GetAppEngineService.Invoke(new()
* {
* ModuleId = "default",
* });
* var appengSlo = new Gcp.Monitoring.Slo("appeng_slo", new()
* {
* Service = @default.Apply(@default => @default.Apply(getAppEngineServiceResult => getAppEngineServiceResult.ServiceId)),
* SloId = "ae-slo",
* DisplayName = "Test SLO for App Engine",
* Goal = 0.9,
* CalendarPeriod = "DAY",
* BasicSli = new Gcp.Monitoring.Inputs.SloBasicSliArgs
* {
* Latency = new Gcp.Monitoring.Inputs.SloBasicSliLatencyArgs
* {
* Threshold = "1s",
* },
* },
* UserLabels =
* {
* { "my_key", "my_value" },
* { "my_other_key", "my_other_value" },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/monitoring"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _default, err := monitoring.GetAppEngineService(ctx, &monitoring.GetAppEngineServiceArgs{
* ModuleId: "default",
* }, nil)
* if err != nil {
* return err
* }
* _, err = monitoring.NewSlo(ctx, "appeng_slo", &monitoring.SloArgs{
* Service: pulumi.String(_default.ServiceId),
* SloId: pulumi.String("ae-slo"),
* DisplayName: pulumi.String("Test SLO for App Engine"),
* Goal: pulumi.Float64(0.9),
* CalendarPeriod: pulumi.String("DAY"),
* BasicSli: &monitoring.SloBasicSliArgs{
* Latency: &monitoring.SloBasicSliLatencyArgs{
* Threshold: pulumi.String("1s"),
* },
* },
* UserLabels: pulumi.StringMap{
* "my_key": pulumi.String("my_value"),
* "my_other_key": pulumi.String("my_other_value"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.monitoring.MonitoringFunctions;
* import com.pulumi.gcp.monitoring.inputs.GetAppEngineServiceArgs;
* import com.pulumi.gcp.monitoring.Slo;
* import com.pulumi.gcp.monitoring.SloArgs;
* import com.pulumi.gcp.monitoring.inputs.SloBasicSliArgs;
* import com.pulumi.gcp.monitoring.inputs.SloBasicSliLatencyArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var default = MonitoringFunctions.getAppEngineService(GetAppEngineServiceArgs.builder()
* .moduleId("default")
* .build());
* var appengSlo = new Slo("appengSlo", SloArgs.builder()
* .service(default_.serviceId())
* .sloId("ae-slo")
* .displayName("Test SLO for App Engine")
* .goal(0.9)
* .calendarPeriod("DAY")
* .basicSli(SloBasicSliArgs.builder()
* .latency(SloBasicSliLatencyArgs.builder()
* .threshold("1s")
* .build())
* .build())
* .userLabels(Map.ofEntries(
* Map.entry("my_key", "my_value"),
* Map.entry("my_other_key", "my_other_value")
* ))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* appengSlo:
* type: gcp:monitoring:Slo
* name: appeng_slo
* properties:
* service: ${default.serviceId}
* sloId: ae-slo
* displayName: Test SLO for App Engine
* goal: 0.9
* calendarPeriod: DAY
* basicSli:
* latency:
* threshold: 1s
* userLabels:
* my_key: my_value
* my_other_key: my_other_value
* variables:
* default:
* fn::invoke:
* Function: gcp:monitoring:getAppEngineService
* Arguments:
* moduleId: default
* ```
*
* ### Monitoring Slo Request Based
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const customsrv = new gcp.monitoring.CustomService("customsrv", {
* serviceId: "custom-srv-request-slos",
* displayName: "My Custom Service",
* });
* const requestBasedSlo = new gcp.monitoring.Slo("request_based_slo", {
* service: customsrv.serviceId,
* sloId: "consumed-api-slo",
* displayName: "Test SLO with request based SLI (good total ratio)",
* goal: 0.9,
* rollingPeriodDays: 30,
* requestBasedSli: {
* distributionCut: {
* distributionFilter: "metric.type=\"serviceruntime.googleapis.com/api/request_latencies\" resource.type=\"api\" ",
* range: {
* max: 0.5,
* },
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* customsrv = gcp.monitoring.CustomService("customsrv",
* service_id="custom-srv-request-slos",
* display_name="My Custom Service")
* request_based_slo = gcp.monitoring.Slo("request_based_slo",
* service=customsrv.service_id,
* slo_id="consumed-api-slo",
* display_name="Test SLO with request based SLI (good total ratio)",
* goal=0.9,
* rolling_period_days=30,
* request_based_sli={
* "distribution_cut": {
* "distribution_filter": "metric.type=\"serviceruntime.googleapis.com/api/request_latencies\" resource.type=\"api\" ",
* "range": {
* "max": 0.5,
* },
* },
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var customsrv = new Gcp.Monitoring.CustomService("customsrv", new()
* {
* ServiceId = "custom-srv-request-slos",
* DisplayName = "My Custom Service",
* });
* var requestBasedSlo = new Gcp.Monitoring.Slo("request_based_slo", new()
* {
* Service = customsrv.ServiceId,
* SloId = "consumed-api-slo",
* DisplayName = "Test SLO with request based SLI (good total ratio)",
* Goal = 0.9,
* RollingPeriodDays = 30,
* RequestBasedSli = new Gcp.Monitoring.Inputs.SloRequestBasedSliArgs
* {
* DistributionCut = new Gcp.Monitoring.Inputs.SloRequestBasedSliDistributionCutArgs
* {
* DistributionFilter = "metric.type=\"serviceruntime.googleapis.com/api/request_latencies\" resource.type=\"api\" ",
* Range = new Gcp.Monitoring.Inputs.SloRequestBasedSliDistributionCutRangeArgs
* {
* Max = 0.5,
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/monitoring"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* customsrv, err := monitoring.NewCustomService(ctx, "customsrv", &monitoring.CustomServiceArgs{
* ServiceId: pulumi.String("custom-srv-request-slos"),
* DisplayName: pulumi.String("My Custom Service"),
* })
* if err != nil {
* return err
* }
* _, err = monitoring.NewSlo(ctx, "request_based_slo", &monitoring.SloArgs{
* Service: customsrv.ServiceId,
* SloId: pulumi.String("consumed-api-slo"),
* DisplayName: pulumi.String("Test SLO with request based SLI (good total ratio)"),
* Goal: pulumi.Float64(0.9),
* RollingPeriodDays: pulumi.Int(30),
* RequestBasedSli: &monitoring.SloRequestBasedSliArgs{
* DistributionCut: &monitoring.SloRequestBasedSliDistributionCutArgs{
* DistributionFilter: pulumi.String("metric.type=\"serviceruntime.googleapis.com/api/request_latencies\" resource.type=\"api\" "),
* Range: &monitoring.SloRequestBasedSliDistributionCutRangeArgs{
* Max: pulumi.Float64(0.5),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.monitoring.CustomService;
* import com.pulumi.gcp.monitoring.CustomServiceArgs;
* import com.pulumi.gcp.monitoring.Slo;
* import com.pulumi.gcp.monitoring.SloArgs;
* import com.pulumi.gcp.monitoring.inputs.SloRequestBasedSliArgs;
* import com.pulumi.gcp.monitoring.inputs.SloRequestBasedSliDistributionCutArgs;
* import com.pulumi.gcp.monitoring.inputs.SloRequestBasedSliDistributionCutRangeArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var customsrv = new CustomService("customsrv", CustomServiceArgs.builder()
* .serviceId("custom-srv-request-slos")
* .displayName("My Custom Service")
* .build());
* var requestBasedSlo = new Slo("requestBasedSlo", SloArgs.builder()
* .service(customsrv.serviceId())
* .sloId("consumed-api-slo")
* .displayName("Test SLO with request based SLI (good total ratio)")
* .goal(0.9)
* .rollingPeriodDays(30)
* .requestBasedSli(SloRequestBasedSliArgs.builder()
* .distributionCut(SloRequestBasedSliDistributionCutArgs.builder()
* .distributionFilter("metric.type=\"serviceruntime.googleapis.com/api/request_latencies\" resource.type=\"api\" ")
* .range(SloRequestBasedSliDistributionCutRangeArgs.builder()
* .max(0.5)
* .build())
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* customsrv:
* type: gcp:monitoring:CustomService
* properties:
* serviceId: custom-srv-request-slos
* displayName: My Custom Service
* requestBasedSlo:
* type: gcp:monitoring:Slo
* name: request_based_slo
* properties:
* service: ${customsrv.serviceId}
* sloId: consumed-api-slo
* displayName: Test SLO with request based SLI (good total ratio)
* goal: 0.9
* rollingPeriodDays: 30
* requestBasedSli:
* distributionCut:
* distributionFilter: 'metric.type="serviceruntime.googleapis.com/api/request_latencies" resource.type="api" '
* range:
* max: 0.5
* ```
*
* ### Monitoring Slo Windows Based Good Bad Metric Filter
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as std from "@pulumi/std";
* const customsrv = new gcp.monitoring.CustomService("customsrv", {
* serviceId: "custom-srv-windows-slos",
* displayName: "My Custom Service",
* });
* const windowsBased = new gcp.monitoring.Slo("windows_based", {
* service: customsrv.serviceId,
* displayName: "Test SLO with window based SLI",
* goal: 0.95,
* calendarPeriod: "FORTNIGHT",
* windowsBasedSli: {
* windowPeriod: "400s",
* goodBadMetricFilter: std.join({
* separator: " AND ",
* input: [
* "metric.type=\"monitoring.googleapis.com/uptime_check/check_passed\"",
* "resource.type=\"uptime_url\"",
* ],
* }).then(invoke => invoke.result),
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* import pulumi_std as std
* customsrv = gcp.monitoring.CustomService("customsrv",
* service_id="custom-srv-windows-slos",
* display_name="My Custom Service")
* windows_based = gcp.monitoring.Slo("windows_based",
* service=customsrv.service_id,
* display_name="Test SLO with window based SLI",
* goal=0.95,
* calendar_period="FORTNIGHT",
* windows_based_sli={
* "window_period": "400s",
* "good_bad_metric_filter": std.join(separator=" AND ",
* input=[
* "metric.type=\"monitoring.googleapis.com/uptime_check/check_passed\"",
* "resource.type=\"uptime_url\"",
* ]).result,
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* using Std = Pulumi.Std;
* return await Deployment.RunAsync(() =>
* {
* var customsrv = new Gcp.Monitoring.CustomService("customsrv", new()
* {
* ServiceId = "custom-srv-windows-slos",
* DisplayName = "My Custom Service",
* });
* var windowsBased = new Gcp.Monitoring.Slo("windows_based", new()
* {
* Service = customsrv.ServiceId,
* DisplayName = "Test SLO with window based SLI",
* Goal = 0.95,
* CalendarPeriod = "FORTNIGHT",
* WindowsBasedSli = new Gcp.Monitoring.Inputs.SloWindowsBasedSliArgs
* {
* WindowPeriod = "400s",
* GoodBadMetricFilter = Std.Join.Invoke(new()
* {
* Separator = " AND ",
* Input = new[]
* {
* "metric.type=\"monitoring.googleapis.com/uptime_check/check_passed\"",
* "resource.type=\"uptime_url\"",
* },
* }).Apply(invoke => invoke.Result),
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/monitoring"
* "github.com/pulumi/pulumi-std/sdk/go/std"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* customsrv, err := monitoring.NewCustomService(ctx, "customsrv", &monitoring.CustomServiceArgs{
* ServiceId: pulumi.String("custom-srv-windows-slos"),
* DisplayName: pulumi.String("My Custom Service"),
* })
* if err != nil {
* return err
* }
* invokeJoin, err := std.Join(ctx, &std.JoinArgs{
* Separator: " AND ",
* Input: []string{
* "metric.type=\"monitoring.googleapis.com/uptime_check/check_passed\"",
* "resource.type=\"uptime_url\"",
* },
* }, nil)
* if err != nil {
* return err
* }
* _, err = monitoring.NewSlo(ctx, "windows_based", &monitoring.SloArgs{
* Service: customsrv.ServiceId,
* DisplayName: pulumi.String("Test SLO with window based SLI"),
* Goal: pulumi.Float64(0.95),
* CalendarPeriod: pulumi.String("FORTNIGHT"),
* WindowsBasedSli: &monitoring.SloWindowsBasedSliArgs{
* WindowPeriod: pulumi.String("400s"),
* GoodBadMetricFilter: pulumi.String(invokeJoin.Result),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.monitoring.CustomService;
* import com.pulumi.gcp.monitoring.CustomServiceArgs;
* import com.pulumi.gcp.monitoring.Slo;
* import com.pulumi.gcp.monitoring.SloArgs;
* import com.pulumi.gcp.monitoring.inputs.SloWindowsBasedSliArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var customsrv = new CustomService("customsrv", CustomServiceArgs.builder()
* .serviceId("custom-srv-windows-slos")
* .displayName("My Custom Service")
* .build());
* var windowsBased = new Slo("windowsBased", SloArgs.builder()
* .service(customsrv.serviceId())
* .displayName("Test SLO with window based SLI")
* .goal(0.95)
* .calendarPeriod("FORTNIGHT")
* .windowsBasedSli(SloWindowsBasedSliArgs.builder()
* .windowPeriod("400s")
* .goodBadMetricFilter(StdFunctions.join(JoinArgs.builder()
* .separator(" AND ")
* .input(
* "metric.type=\"monitoring.googleapis.com/uptime_check/check_passed\"",
* "resource.type=\"uptime_url\"")
* .build()).result())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* customsrv:
* type: gcp:monitoring:CustomService
* properties:
* serviceId: custom-srv-windows-slos
* displayName: My Custom Service
* windowsBased:
* type: gcp:monitoring:Slo
* name: windows_based
* properties:
* service: ${customsrv.serviceId}
* displayName: Test SLO with window based SLI
* goal: 0.95
* calendarPeriod: FORTNIGHT
* windowsBasedSli:
* windowPeriod: 400s
* goodBadMetricFilter:
* fn::invoke:
* Function: std:join
* Arguments:
* separator: ' AND '
* input:
* - metric.type="monitoring.googleapis.com/uptime_check/check_passed"
* - resource.type="uptime_url"
* Return: result
* ```
*
* ### Monitoring Slo Windows Based Metric Mean
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as std from "@pulumi/std";
* const customsrv = new gcp.monitoring.CustomService("customsrv", {
* serviceId: "custom-srv-windows-slos",
* displayName: "My Custom Service",
* });
* const windowsBased = new gcp.monitoring.Slo("windows_based", {
* service: customsrv.serviceId,
* displayName: "Test SLO with window based SLI",
* goal: 0.9,
* rollingPeriodDays: 20,
* windowsBasedSli: {
* windowPeriod: "600s",
* metricMeanInRange: {
* timeSeries: std.join({
* separator: " AND ",
* input: [
* "metric.type=\"agent.googleapis.com/cassandra/client_request/latency/95p\"",
* "resource.type=\"gce_instance\"",
* ],
* }).then(invoke => invoke.result),
* range: {
* max: 5,
* },
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* import pulumi_std as std
* customsrv = gcp.monitoring.CustomService("customsrv",
* service_id="custom-srv-windows-slos",
* display_name="My Custom Service")
* windows_based = gcp.monitoring.Slo("windows_based",
* service=customsrv.service_id,
* display_name="Test SLO with window based SLI",
* goal=0.9,
* rolling_period_days=20,
* windows_based_sli={
* "window_period": "600s",
* "metric_mean_in_range": {
* "time_series": std.join(separator=" AND ",
* input=[
* "metric.type=\"agent.googleapis.com/cassandra/client_request/latency/95p\"",
* "resource.type=\"gce_instance\"",
* ]).result,
* "range": {
* "max": 5,
* },
* },
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* using Std = Pulumi.Std;
* return await Deployment.RunAsync(() =>
* {
* var customsrv = new Gcp.Monitoring.CustomService("customsrv", new()
* {
* ServiceId = "custom-srv-windows-slos",
* DisplayName = "My Custom Service",
* });
* var windowsBased = new Gcp.Monitoring.Slo("windows_based", new()
* {
* Service = customsrv.ServiceId,
* DisplayName = "Test SLO with window based SLI",
* Goal = 0.9,
* RollingPeriodDays = 20,
* WindowsBasedSli = new Gcp.Monitoring.Inputs.SloWindowsBasedSliArgs
* {
* WindowPeriod = "600s",
* MetricMeanInRange = new Gcp.Monitoring.Inputs.SloWindowsBasedSliMetricMeanInRangeArgs
* {
* TimeSeries = Std.Join.Invoke(new()
* {
* Separator = " AND ",
* Input = new[]
* {
* "metric.type=\"agent.googleapis.com/cassandra/client_request/latency/95p\"",
* "resource.type=\"gce_instance\"",
* },
* }).Apply(invoke => invoke.Result),
* Range = new Gcp.Monitoring.Inputs.SloWindowsBasedSliMetricMeanInRangeRangeArgs
* {
* Max = 5,
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/monitoring"
* "github.com/pulumi/pulumi-std/sdk/go/std"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* customsrv, err := monitoring.NewCustomService(ctx, "customsrv", &monitoring.CustomServiceArgs{
* ServiceId: pulumi.String("custom-srv-windows-slos"),
* DisplayName: pulumi.String("My Custom Service"),
* })
* if err != nil {
* return err
* }
* invokeJoin, err := std.Join(ctx, &std.JoinArgs{
* Separator: " AND ",
* Input: []string{
* "metric.type=\"agent.googleapis.com/cassandra/client_request/latency/95p\"",
* "resource.type=\"gce_instance\"",
* },
* }, nil)
* if err != nil {
* return err
* }
* _, err = monitoring.NewSlo(ctx, "windows_based", &monitoring.SloArgs{
* Service: customsrv.ServiceId,
* DisplayName: pulumi.String("Test SLO with window based SLI"),
* Goal: pulumi.Float64(0.9),
* RollingPeriodDays: pulumi.Int(20),
* WindowsBasedSli: &monitoring.SloWindowsBasedSliArgs{
* WindowPeriod: pulumi.String("600s"),
* MetricMeanInRange: &monitoring.SloWindowsBasedSliMetricMeanInRangeArgs{
* TimeSeries: pulumi.String(invokeJoin.Result),
* Range: &monitoring.SloWindowsBasedSliMetricMeanInRangeRangeArgs{
* Max: pulumi.Float64(5),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.monitoring.CustomService;
* import com.pulumi.gcp.monitoring.CustomServiceArgs;
* import com.pulumi.gcp.monitoring.Slo;
* import com.pulumi.gcp.monitoring.SloArgs;
* import com.pulumi.gcp.monitoring.inputs.SloWindowsBasedSliArgs;
* import com.pulumi.gcp.monitoring.inputs.SloWindowsBasedSliMetricMeanInRangeArgs;
* import com.pulumi.gcp.monitoring.inputs.SloWindowsBasedSliMetricMeanInRangeRangeArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var customsrv = new CustomService("customsrv", CustomServiceArgs.builder()
* .serviceId("custom-srv-windows-slos")
* .displayName("My Custom Service")
* .build());
* var windowsBased = new Slo("windowsBased", SloArgs.builder()
* .service(customsrv.serviceId())
* .displayName("Test SLO with window based SLI")
* .goal(0.9)
* .rollingPeriodDays(20)
* .windowsBasedSli(SloWindowsBasedSliArgs.builder()
* .windowPeriod("600s")
* .metricMeanInRange(SloWindowsBasedSliMetricMeanInRangeArgs.builder()
* .timeSeries(StdFunctions.join(JoinArgs.builder()
* .separator(" AND ")
* .input(
* "metric.type=\"agent.googleapis.com/cassandra/client_request/latency/95p\"",
* "resource.type=\"gce_instance\"")
* .build()).result())
* .range(SloWindowsBasedSliMetricMeanInRangeRangeArgs.builder()
* .max(5)
* .build())
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* customsrv:
* type: gcp:monitoring:CustomService
* properties:
* serviceId: custom-srv-windows-slos
* displayName: My Custom Service
* windowsBased:
* type: gcp:monitoring:Slo
* name: windows_based
* properties:
* service: ${customsrv.serviceId}
* displayName: Test SLO with window based SLI
* goal: 0.9
* rollingPeriodDays: 20
* windowsBasedSli:
* windowPeriod: 600s
* metricMeanInRange:
* timeSeries:
* fn::invoke:
* Function: std:join
* Arguments:
* separator: ' AND '
* input:
* - metric.type="agent.googleapis.com/cassandra/client_request/latency/95p"
* - resource.type="gce_instance"
* Return: result
* range:
* max: 5
* ```
*
* ### Monitoring Slo Windows Based Metric Sum
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as std from "@pulumi/std";
* const customsrv = new gcp.monitoring.CustomService("customsrv", {
* serviceId: "custom-srv-windows-slos",
* displayName: "My Custom Service",
* });
* const windowsBased = new gcp.monitoring.Slo("windows_based", {
* service: customsrv.serviceId,
* displayName: "Test SLO with window based SLI",
* goal: 0.9,
* rollingPeriodDays: 20,
* windowsBasedSli: {
* windowPeriod: "400s",
* metricSumInRange: {
* timeSeries: std.join({
* separator: " AND ",
* input: [
* "metric.type=\"monitoring.googleapis.com/uptime_check/request_latency\"",
* "resource.type=\"uptime_url\"",
* ],
* }).then(invoke => invoke.result),
* range: {
* max: 5000,
* },
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* import pulumi_std as std
* customsrv = gcp.monitoring.CustomService("customsrv",
* service_id="custom-srv-windows-slos",
* display_name="My Custom Service")
* windows_based = gcp.monitoring.Slo("windows_based",
* service=customsrv.service_id,
* display_name="Test SLO with window based SLI",
* goal=0.9,
* rolling_period_days=20,
* windows_based_sli={
* "window_period": "400s",
* "metric_sum_in_range": {
* "time_series": std.join(separator=" AND ",
* input=[
* "metric.type=\"monitoring.googleapis.com/uptime_check/request_latency\"",
* "resource.type=\"uptime_url\"",
* ]).result,
* "range": {
* "max": 5000,
* },
* },
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* using Std = Pulumi.Std;
* return await Deployment.RunAsync(() =>
* {
* var customsrv = new Gcp.Monitoring.CustomService("customsrv", new()
* {
* ServiceId = "custom-srv-windows-slos",
* DisplayName = "My Custom Service",
* });
* var windowsBased = new Gcp.Monitoring.Slo("windows_based", new()
* {
* Service = customsrv.ServiceId,
* DisplayName = "Test SLO with window based SLI",
* Goal = 0.9,
* RollingPeriodDays = 20,
* WindowsBasedSli = new Gcp.Monitoring.Inputs.SloWindowsBasedSliArgs
* {
* WindowPeriod = "400s",
* MetricSumInRange = new Gcp.Monitoring.Inputs.SloWindowsBasedSliMetricSumInRangeArgs
* {
* TimeSeries = Std.Join.Invoke(new()
* {
* Separator = " AND ",
* Input = new[]
* {
* "metric.type=\"monitoring.googleapis.com/uptime_check/request_latency\"",
* "resource.type=\"uptime_url\"",
* },
* }).Apply(invoke => invoke.Result),
* Range = new Gcp.Monitoring.Inputs.SloWindowsBasedSliMetricSumInRangeRangeArgs
* {
* Max = 5000,
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/monitoring"
* "github.com/pulumi/pulumi-std/sdk/go/std"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* customsrv, err := monitoring.NewCustomService(ctx, "customsrv", &monitoring.CustomServiceArgs{
* ServiceId: pulumi.String("custom-srv-windows-slos"),
* DisplayName: pulumi.String("My Custom Service"),
* })
* if err != nil {
* return err
* }
* invokeJoin, err := std.Join(ctx, &std.JoinArgs{
* Separator: " AND ",
* Input: []string{
* "metric.type=\"monitoring.googleapis.com/uptime_check/request_latency\"",
* "resource.type=\"uptime_url\"",
* },
* }, nil)
* if err != nil {
* return err
* }
* _, err = monitoring.NewSlo(ctx, "windows_based", &monitoring.SloArgs{
* Service: customsrv.ServiceId,
* DisplayName: pulumi.String("Test SLO with window based SLI"),
* Goal: pulumi.Float64(0.9),
* RollingPeriodDays: pulumi.Int(20),
* WindowsBasedSli: &monitoring.SloWindowsBasedSliArgs{
* WindowPeriod: pulumi.String("400s"),
* MetricSumInRange: &monitoring.SloWindowsBasedSliMetricSumInRangeArgs{
* TimeSeries: pulumi.String(invokeJoin.Result),
* Range: &monitoring.SloWindowsBasedSliMetricSumInRangeRangeArgs{
* Max: pulumi.Float64(5000),
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.monitoring.CustomService;
* import com.pulumi.gcp.monitoring.CustomServiceArgs;
* import com.pulumi.gcp.monitoring.Slo;
* import com.pulumi.gcp.monitoring.SloArgs;
* import com.pulumi.gcp.monitoring.inputs.SloWindowsBasedSliArgs;
* import com.pulumi.gcp.monitoring.inputs.SloWindowsBasedSliMetricSumInRangeArgs;
* import com.pulumi.gcp.monitoring.inputs.SloWindowsBasedSliMetricSumInRangeRangeArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var customsrv = new CustomService("customsrv", CustomServiceArgs.builder()
* .serviceId("custom-srv-windows-slos")
* .displayName("My Custom Service")
* .build());
* var windowsBased = new Slo("windowsBased", SloArgs.builder()
* .service(customsrv.serviceId())
* .displayName("Test SLO with window based SLI")
* .goal(0.9)
* .rollingPeriodDays(20)
* .windowsBasedSli(SloWindowsBasedSliArgs.builder()
* .windowPeriod("400s")
* .metricSumInRange(SloWindowsBasedSliMetricSumInRangeArgs.builder()
* .timeSeries(StdFunctions.join(JoinArgs.builder()
* .separator(" AND ")
* .input(
* "metric.type=\"monitoring.googleapis.com/uptime_check/request_latency\"",
* "resource.type=\"uptime_url\"")
* .build()).result())
* .range(SloWindowsBasedSliMetricSumInRangeRangeArgs.builder()
* .max(5000)
* .build())
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* customsrv:
* type: gcp:monitoring:CustomService
* properties:
* serviceId: custom-srv-windows-slos
* displayName: My Custom Service
* windowsBased:
* type: gcp:monitoring:Slo
* name: windows_based
* properties:
* service: ${customsrv.serviceId}
* displayName: Test SLO with window based SLI
* goal: 0.9
* rollingPeriodDays: 20
* windowsBasedSli:
* windowPeriod: 400s
* metricSumInRange:
* timeSeries:
* fn::invoke:
* Function: std:join
* Arguments:
* separator: ' AND '
* input:
* - metric.type="monitoring.googleapis.com/uptime_check/request_latency"
* - resource.type="uptime_url"
* Return: result
* range:
* max: 5000
* ```
*
* ### Monitoring Slo Windows Based Ratio Threshold
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* import * as std from "@pulumi/std";
* const customsrv = new gcp.monitoring.CustomService("customsrv", {
* serviceId: "custom-srv-windows-slos",
* displayName: "My Custom Service",
* });
* const windowsBased = new gcp.monitoring.Slo("windows_based", {
* service: customsrv.serviceId,
* displayName: "Test SLO with window based SLI",
* goal: 0.9,
* rollingPeriodDays: 20,
* windowsBasedSli: {
* windowPeriod: "100s",
* goodTotalRatioThreshold: {
* threshold: 0.1,
* performance: {
* distributionCut: {
* distributionFilter: std.join({
* separator: " AND ",
* input: [
* "metric.type=\"serviceruntime.googleapis.com/api/request_latencies\"",
* "resource.type=\"consumed_api\"",
* ],
* }).then(invoke => invoke.result),
* range: {
* min: 1,
* max: 9,
* },
* },
* },
* },
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* import pulumi_std as std
* customsrv = gcp.monitoring.CustomService("customsrv",
* service_id="custom-srv-windows-slos",
* display_name="My Custom Service")
* windows_based = gcp.monitoring.Slo("windows_based",
* service=customsrv.service_id,
* display_name="Test SLO with window based SLI",
* goal=0.9,
* rolling_period_days=20,
* windows_based_sli={
* "window_period": "100s",
* "good_total_ratio_threshold": {
* "threshold": 0.1,
* "performance": {
* "distribution_cut": {
* "distribution_filter": std.join(separator=" AND ",
* input=[
* "metric.type=\"serviceruntime.googleapis.com/api/request_latencies\"",
* "resource.type=\"consumed_api\"",
* ]).result,
* "range": {
* "min": 1,
* "max": 9,
* },
* },
* },
* },
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* using Std = Pulumi.Std;
* return await Deployment.RunAsync(() =>
* {
* var customsrv = new Gcp.Monitoring.CustomService("customsrv", new()
* {
* ServiceId = "custom-srv-windows-slos",
* DisplayName = "My Custom Service",
* });
* var windowsBased = new Gcp.Monitoring.Slo("windows_based", new()
* {
* Service = customsrv.ServiceId,
* DisplayName = "Test SLO with window based SLI",
* Goal = 0.9,
* RollingPeriodDays = 20,
* WindowsBasedSli = new Gcp.Monitoring.Inputs.SloWindowsBasedSliArgs
* {
* WindowPeriod = "100s",
* GoodTotalRatioThreshold = new Gcp.Monitoring.Inputs.SloWindowsBasedSliGoodTotalRatioThresholdArgs
* {
* Threshold = 0.1,
* Performance = new Gcp.Monitoring.Inputs.SloWindowsBasedSliGoodTotalRatioThresholdPerformanceArgs
* {
* DistributionCut = new Gcp.Monitoring.Inputs.SloWindowsBasedSliGoodTotalRatioThresholdPerformanceDistributionCutArgs
* {
* DistributionFilter = Std.Join.Invoke(new()
* {
* Separator = " AND ",
* Input = new[]
* {
* "metric.type=\"serviceruntime.googleapis.com/api/request_latencies\"",
* "resource.type=\"consumed_api\"",
* },
* }).Apply(invoke => invoke.Result),
* Range = new Gcp.Monitoring.Inputs.SloWindowsBasedSliGoodTotalRatioThresholdPerformanceDistributionCutRangeArgs
* {
* Min = 1,
* Max = 9,
* },
* },
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/monitoring"
* "github.com/pulumi/pulumi-std/sdk/go/std"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* customsrv, err := monitoring.NewCustomService(ctx, "customsrv", &monitoring.CustomServiceArgs{
* ServiceId: pulumi.String("custom-srv-windows-slos"),
* DisplayName: pulumi.String("My Custom Service"),
* })
* if err != nil {
* return err
* }
* invokeJoin, err := std.Join(ctx, &std.JoinArgs{
* Separator: " AND ",
* Input: []string{
* "metric.type=\"serviceruntime.googleapis.com/api/request_latencies\"",
* "resource.type=\"consumed_api\"",
* },
* }, nil)
* if err != nil {
* return err
* }
* _, err = monitoring.NewSlo(ctx, "windows_based", &monitoring.SloArgs{
* Service: customsrv.ServiceId,
* DisplayName: pulumi.String("Test SLO with window based SLI"),
* Goal: pulumi.Float64(0.9),
* RollingPeriodDays: pulumi.Int(20),
* WindowsBasedSli: &monitoring.SloWindowsBasedSliArgs{
* WindowPeriod: pulumi.String("100s"),
* GoodTotalRatioThreshold: &monitoring.SloWindowsBasedSliGoodTotalRatioThresholdArgs{
* Threshold: pulumi.Float64(0.1),
* Performance: &monitoring.SloWindowsBasedSliGoodTotalRatioThresholdPerformanceArgs{
* DistributionCut: &monitoring.SloWindowsBasedSliGoodTotalRatioThresholdPerformanceDistributionCutArgs{
* DistributionFilter: pulumi.String(invokeJoin.Result),
* Range: &monitoring.SloWindowsBasedSliGoodTotalRatioThresholdPerformanceDistributionCutRangeArgs{
* Min: pulumi.Float64(1),
* Max: pulumi.Float64(9),
* },
* },
* },
* },
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.gcp.monitoring.CustomService;
* import com.pulumi.gcp.monitoring.CustomServiceArgs;
* import com.pulumi.gcp.monitoring.Slo;
* import com.pulumi.gcp.monitoring.SloArgs;
* import com.pulumi.gcp.monitoring.inputs.SloWindowsBasedSliArgs;
* import com.pulumi.gcp.monitoring.inputs.SloWindowsBasedSliGoodTotalRatioThresholdArgs;
* import com.pulumi.gcp.monitoring.inputs.SloWindowsBasedSliGoodTotalRatioThresholdPerformanceArgs;
* import com.pulumi.gcp.monitoring.inputs.SloWindowsBasedSliGoodTotalRatioThresholdPerformanceDistributionCutArgs;
* import com.pulumi.gcp.monitoring.inputs.SloWindowsBasedSliGoodTotalRatioThresholdPerformanceDistributionCutRangeArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var customsrv = new CustomService("customsrv", CustomServiceArgs.builder()
* .serviceId("custom-srv-windows-slos")
* .displayName("My Custom Service")
* .build());
* var windowsBased = new Slo("windowsBased", SloArgs.builder()
* .service(customsrv.serviceId())
* .displayName("Test SLO with window based SLI")
* .goal(0.9)
* .rollingPeriodDays(20)
* .windowsBasedSli(SloWindowsBasedSliArgs.builder()
* .windowPeriod("100s")
* .goodTotalRatioThreshold(SloWindowsBasedSliGoodTotalRatioThresholdArgs.builder()
* .threshold(0.1)
* .performance(SloWindowsBasedSliGoodTotalRatioThresholdPerformanceArgs.builder()
* .distributionCut(SloWindowsBasedSliGoodTotalRatioThresholdPerformanceDistributionCutArgs.builder()
* .distributionFilter(StdFunctions.join(JoinArgs.builder()
* .separator(" AND ")
* .input(
* "metric.type=\"serviceruntime.googleapis.com/api/request_latencies\"",
* "resource.type=\"consumed_api\"")
* .build()).result())
* .range(SloWindowsBasedSliGoodTotalRatioThresholdPerformanceDistributionCutRangeArgs.builder()
* .min(1)
* .max(9)
* .build())
* .build())
* .build())
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* customsrv:
* type: gcp:monitoring:CustomService
* properties:
* serviceId: custom-srv-windows-slos
* displayName: My Custom Service
* windowsBased:
* type: gcp:monitoring:Slo
* name: windows_based
* properties:
* service: ${customsrv.serviceId}
* displayName: Test SLO with window based SLI
* goal: 0.9
* rollingPeriodDays: 20
* windowsBasedSli:
* windowPeriod: 100s
* goodTotalRatioThreshold:
* threshold: 0.1
* performance:
* distributionCut:
* distributionFilter:
* fn::invoke:
* Function: std:join
* Arguments:
* separator: ' AND '
* input:
* - metric.type="serviceruntime.googleapis.com/api/request_latencies"
* - resource.type="consumed_api"
* Return: result
* range:
* min: 1
* max: 9
* ```
*
* ## Import
* Slo can be imported using any of these accepted formats:
* * `{{name}}`
* When using the `pulumi import` command, Slo can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:monitoring/slo:Slo default {{name}}
* ```
* @property basicSli Basic Service-Level Indicator (SLI) on a well-known service type.
* Performance will be computed on the basis of pre-defined metrics.
* SLIs are used to measure and calculate the quality of the Service's
* performance with respect to a single aspect of service quality.
* Exactly one of the following must be set:
* `basic_sli`, `request_based_sli`, `windows_based_sli`
* Structure is documented below.
* @property calendarPeriod A calendar period, semantically "since the start of the current
* ".
* Possible values are: `DAY`, `WEEK`, `FORTNIGHT`, `MONTH`.
* @property displayName Name used for UI elements listing this SLO.
* @property goal The fraction of service that must be good in order for this objective
* to be met. 0 < goal <= 0.999
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @property requestBasedSli A request-based SLI defines a SLI for which atomic units of
* service are counted directly.
* A SLI describes a good service.
* It is used to measure and calculate the quality of the Service's
* performance with respect to a single aspect of service quality.
* Exactly one of the following must be set:
* `basic_sli`, `request_based_sli`, `windows_based_sli`
* Structure is documented below.
* @property rollingPeriodDays A rolling time period, semantically "in the past X days".
* Must be between 1 to 30 days, inclusive.
* @property service ID of the service to which this SLO belongs.
* - - -
* @property sloId The id to use for this ServiceLevelObjective. If omitted, an id will be generated instead.
* @property userLabels This field is intended to be used for organizing and identifying the AlertPolicy
* objects.The field can contain up to 64 entries. Each key and value is limited
* to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values
* can contain only lowercase letters, numerals, underscores, and dashes. Keys
* must begin with a letter.
* @property windowsBasedSli A windows-based SLI defines the criteria for time windows.
* good_service is defined based off the count of these time windows
* for which the provided service was of good quality.
* A SLI describes a good service. It is used to measure and calculate
* the quality of the Service's performance with respect to a single
* aspect of service quality.
* Exactly one of the following must be set:
* `basic_sli`, `request_based_sli`, `windows_based_sli`
* Structure is documented below.
*/
public data class SloArgs(
public val basicSli: Output? = null,
public val calendarPeriod: Output? = null,
public val displayName: Output? = null,
public val goal: Output? = null,
public val project: Output? = null,
public val requestBasedSli: Output? = null,
public val rollingPeriodDays: Output? = null,
public val service: Output? = null,
public val sloId: Output? = null,
public val userLabels: Output>? = null,
public val windowsBasedSli: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.monitoring.SloArgs =
com.pulumi.gcp.monitoring.SloArgs.builder()
.basicSli(basicSli?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.calendarPeriod(calendarPeriod?.applyValue({ args0 -> args0 }))
.displayName(displayName?.applyValue({ args0 -> args0 }))
.goal(goal?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 }))
.requestBasedSli(requestBasedSli?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.rollingPeriodDays(rollingPeriodDays?.applyValue({ args0 -> args0 }))
.service(service?.applyValue({ args0 -> args0 }))
.sloId(sloId?.applyValue({ args0 -> args0 }))
.userLabels(
userLabels?.applyValue({ args0 ->
args0.map({ args0 ->
args0.key.to(args0.value)
}).toMap()
}),
)
.windowsBasedSli(
windowsBasedSli?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
).build()
}
/**
* Builder for [SloArgs].
*/
@PulumiTagMarker
public class SloArgsBuilder internal constructor() {
private var basicSli: Output? = null
private var calendarPeriod: Output? = null
private var displayName: Output? = null
private var goal: Output? = null
private var project: Output? = null
private var requestBasedSli: Output? = null
private var rollingPeriodDays: Output? = null
private var service: Output? = null
private var sloId: Output? = null
private var userLabels: Output>? = null
private var windowsBasedSli: Output? = null
/**
* @param value Basic Service-Level Indicator (SLI) on a well-known service type.
* Performance will be computed on the basis of pre-defined metrics.
* SLIs are used to measure and calculate the quality of the Service's
* performance with respect to a single aspect of service quality.
* Exactly one of the following must be set:
* `basic_sli`, `request_based_sli`, `windows_based_sli`
* Structure is documented below.
*/
@JvmName("odlymnxtdfucdsar")
public suspend fun basicSli(`value`: Output) {
this.basicSli = value
}
/**
* @param value A calendar period, semantically "since the start of the current
* ".
* Possible values are: `DAY`, `WEEK`, `FORTNIGHT`, `MONTH`.
*/
@JvmName("mmtrjpwawtidcxvc")
public suspend fun calendarPeriod(`value`: Output) {
this.calendarPeriod = value
}
/**
* @param value Name used for UI elements listing this SLO.
*/
@JvmName("vqumfqojalhpkmjd")
public suspend fun displayName(`value`: Output) {
this.displayName = value
}
/**
* @param value The fraction of service that must be good in order for this objective
* to be met. 0 < goal <= 0.999
*/
@JvmName("xkuwgnggseqvdvqu")
public suspend fun goal(`value`: Output) {
this.goal = value
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("begcbipiphnjiynt")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value A request-based SLI defines a SLI for which atomic units of
* service are counted directly.
* A SLI describes a good service.
* It is used to measure and calculate the quality of the Service's
* performance with respect to a single aspect of service quality.
* Exactly one of the following must be set:
* `basic_sli`, `request_based_sli`, `windows_based_sli`
* Structure is documented below.
*/
@JvmName("fllrjbjgqdqrsgtm")
public suspend fun requestBasedSli(`value`: Output) {
this.requestBasedSli = value
}
/**
* @param value A rolling time period, semantically "in the past X days".
* Must be between 1 to 30 days, inclusive.
*/
@JvmName("eoqnmubpxnwqkxxk")
public suspend fun rollingPeriodDays(`value`: Output) {
this.rollingPeriodDays = value
}
/**
* @param value ID of the service to which this SLO belongs.
* - - -
*/
@JvmName("buuulgoibnatqypu")
public suspend fun service(`value`: Output) {
this.service = value
}
/**
* @param value The id to use for this ServiceLevelObjective. If omitted, an id will be generated instead.
*/
@JvmName("jgnnttkwscldrbgi")
public suspend fun sloId(`value`: Output) {
this.sloId = value
}
/**
* @param value This field is intended to be used for organizing and identifying the AlertPolicy
* objects.The field can contain up to 64 entries. Each key and value is limited
* to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values
* can contain only lowercase letters, numerals, underscores, and dashes. Keys
* must begin with a letter.
*/
@JvmName("egctogaycnqlwtct")
public suspend fun userLabels(`value`: Output>) {
this.userLabels = value
}
/**
* @param value A windows-based SLI defines the criteria for time windows.
* good_service is defined based off the count of these time windows
* for which the provided service was of good quality.
* A SLI describes a good service. It is used to measure and calculate
* the quality of the Service's performance with respect to a single
* aspect of service quality.
* Exactly one of the following must be set:
* `basic_sli`, `request_based_sli`, `windows_based_sli`
* Structure is documented below.
*/
@JvmName("yhhgygvbmvyfqops")
public suspend fun windowsBasedSli(`value`: Output) {
this.windowsBasedSli = value
}
/**
* @param value Basic Service-Level Indicator (SLI) on a well-known service type.
* Performance will be computed on the basis of pre-defined metrics.
* SLIs are used to measure and calculate the quality of the Service's
* performance with respect to a single aspect of service quality.
* Exactly one of the following must be set:
* `basic_sli`, `request_based_sli`, `windows_based_sli`
* Structure is documented below.
*/
@JvmName("xxfepbkojfladdoa")
public suspend fun basicSli(`value`: SloBasicSliArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.basicSli = mapped
}
/**
* @param argument Basic Service-Level Indicator (SLI) on a well-known service type.
* Performance will be computed on the basis of pre-defined metrics.
* SLIs are used to measure and calculate the quality of the Service's
* performance with respect to a single aspect of service quality.
* Exactly one of the following must be set:
* `basic_sli`, `request_based_sli`, `windows_based_sli`
* Structure is documented below.
*/
@JvmName("elicarrelqxkpuoc")
public suspend fun basicSli(argument: suspend SloBasicSliArgsBuilder.() -> Unit) {
val toBeMapped = SloBasicSliArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.basicSli = mapped
}
/**
* @param value A calendar period, semantically "since the start of the current
* ".
* Possible values are: `DAY`, `WEEK`, `FORTNIGHT`, `MONTH`.
*/
@JvmName("firjsdipvsooengn")
public suspend fun calendarPeriod(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.calendarPeriod = mapped
}
/**
* @param value Name used for UI elements listing this SLO.
*/
@JvmName("mvlrumlahvoxgmqn")
public suspend fun displayName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.displayName = mapped
}
/**
* @param value The fraction of service that must be good in order for this objective
* to be met. 0 < goal <= 0.999
*/
@JvmName("asexwfynijtalktd")
public suspend fun goal(`value`: Double?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.goal = mapped
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("unwyyknmjhxggfup")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
/**
* @param value A request-based SLI defines a SLI for which atomic units of
* service are counted directly.
* A SLI describes a good service.
* It is used to measure and calculate the quality of the Service's
* performance with respect to a single aspect of service quality.
* Exactly one of the following must be set:
* `basic_sli`, `request_based_sli`, `windows_based_sli`
* Structure is documented below.
*/
@JvmName("qbekcwxfiqjqmbnv")
public suspend fun requestBasedSli(`value`: SloRequestBasedSliArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.requestBasedSli = mapped
}
/**
* @param argument A request-based SLI defines a SLI for which atomic units of
* service are counted directly.
* A SLI describes a good service.
* It is used to measure and calculate the quality of the Service's
* performance with respect to a single aspect of service quality.
* Exactly one of the following must be set:
* `basic_sli`, `request_based_sli`, `windows_based_sli`
* Structure is documented below.
*/
@JvmName("lkrptmutjitcluvj")
public suspend fun requestBasedSli(argument: suspend SloRequestBasedSliArgsBuilder.() -> Unit) {
val toBeMapped = SloRequestBasedSliArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.requestBasedSli = mapped
}
/**
* @param value A rolling time period, semantically "in the past X days".
* Must be between 1 to 30 days, inclusive.
*/
@JvmName("xcnjkjeyawpxhren")
public suspend fun rollingPeriodDays(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.rollingPeriodDays = mapped
}
/**
* @param value ID of the service to which this SLO belongs.
* - - -
*/
@JvmName("aionerfivnineonu")
public suspend fun service(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.service = mapped
}
/**
* @param value The id to use for this ServiceLevelObjective. If omitted, an id will be generated instead.
*/
@JvmName("hmwytqkdxjlpkcgs")
public suspend fun sloId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sloId = mapped
}
/**
* @param value This field is intended to be used for organizing and identifying the AlertPolicy
* objects.The field can contain up to 64 entries. Each key and value is limited
* to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values
* can contain only lowercase letters, numerals, underscores, and dashes. Keys
* must begin with a letter.
*/
@JvmName("cwhhsdngksxjpewc")
public suspend fun userLabels(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.userLabels = mapped
}
/**
* @param values This field is intended to be used for organizing and identifying the AlertPolicy
* objects.The field can contain up to 64 entries. Each key and value is limited
* to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values
* can contain only lowercase letters, numerals, underscores, and dashes. Keys
* must begin with a letter.
*/
@JvmName("ilixhpxegbecoqtd")
public fun userLabels(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.userLabels = mapped
}
/**
* @param value A windows-based SLI defines the criteria for time windows.
* good_service is defined based off the count of these time windows
* for which the provided service was of good quality.
* A SLI describes a good service. It is used to measure and calculate
* the quality of the Service's performance with respect to a single
* aspect of service quality.
* Exactly one of the following must be set:
* `basic_sli`, `request_based_sli`, `windows_based_sli`
* Structure is documented below.
*/
@JvmName("mchndyjwigrphota")
public suspend fun windowsBasedSli(`value`: SloWindowsBasedSliArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.windowsBasedSli = mapped
}
/**
* @param argument A windows-based SLI defines the criteria for time windows.
* good_service is defined based off the count of these time windows
* for which the provided service was of good quality.
* A SLI describes a good service. It is used to measure and calculate
* the quality of the Service's performance with respect to a single
* aspect of service quality.
* Exactly one of the following must be set:
* `basic_sli`, `request_based_sli`, `windows_based_sli`
* Structure is documented below.
*/
@JvmName("gfnbdfjnugtfnwhy")
public suspend fun windowsBasedSli(argument: suspend SloWindowsBasedSliArgsBuilder.() -> Unit) {
val toBeMapped = SloWindowsBasedSliArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.windowsBasedSli = mapped
}
internal fun build(): SloArgs = SloArgs(
basicSli = basicSli,
calendarPeriod = calendarPeriod,
displayName = displayName,
goal = goal,
project = project,
requestBasedSli = requestBasedSli,
rollingPeriodDays = rollingPeriodDays,
service = service,
sloId = sloId,
userLabels = userLabels,
windowsBasedSli = windowsBasedSli,
)
}