All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.appinsights.kotlin.SmartDetectionRuleArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.appinsights.kotlin

import com.pulumi.azure.appinsights.SmartDetectionRuleArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages an Application Insights Smart Detection Rule.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "tf-test",
 *     location: "West Europe",
 * });
 * const exampleInsights = new azure.appinsights.Insights("example", {
 *     name: "tf-test-appinsights",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     applicationType: "web",
 * });
 * const exampleSmartDetectionRule = new azure.appinsights.SmartDetectionRule("example", {
 *     name: "Slow server response time",
 *     applicationInsightsId: exampleInsights.id,
 *     enabled: false,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="tf-test",
 *     location="West Europe")
 * example_insights = azure.appinsights.Insights("example",
 *     name="tf-test-appinsights",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     application_type="web")
 * example_smart_detection_rule = azure.appinsights.SmartDetectionRule("example",
 *     name="Slow server response time",
 *     application_insights_id=example_insights.id,
 *     enabled=False)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "tf-test",
 *         Location = "West Europe",
 *     });
 *     var exampleInsights = new Azure.AppInsights.Insights("example", new()
 *     {
 *         Name = "tf-test-appinsights",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         ApplicationType = "web",
 *     });
 *     var exampleSmartDetectionRule = new Azure.AppInsights.SmartDetectionRule("example", new()
 *     {
 *         Name = "Slow server response time",
 *         ApplicationInsightsId = exampleInsights.Id,
 *         Enabled = false,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("tf-test"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleInsights, err := appinsights.NewInsights(ctx, "example", &appinsights.InsightsArgs{
 * 			Name:              pulumi.String("tf-test-appinsights"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			ApplicationType:   pulumi.String("web"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appinsights.NewSmartDetectionRule(ctx, "example", &appinsights.SmartDetectionRuleArgs{
 * 			Name:                  pulumi.String("Slow server response time"),
 * 			ApplicationInsightsId: exampleInsights.ID(),
 * 			Enabled:               pulumi.Bool(false),
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.appinsights.Insights;
 * import com.pulumi.azure.appinsights.InsightsArgs;
 * import com.pulumi.azure.appinsights.SmartDetectionRule;
 * import com.pulumi.azure.appinsights.SmartDetectionRuleArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("tf-test")
 *             .location("West Europe")
 *             .build());
 *         var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
 *             .name("tf-test-appinsights")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .applicationType("web")
 *             .build());
 *         var exampleSmartDetectionRule = new SmartDetectionRule("exampleSmartDetectionRule", SmartDetectionRuleArgs.builder()
 *             .name("Slow server response time")
 *             .applicationInsightsId(exampleInsights.id())
 *             .enabled(false)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: tf-test
 *       location: West Europe
 *   exampleInsights:
 *     type: azure:appinsights:Insights
 *     name: example
 *     properties:
 *       name: tf-test-appinsights
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       applicationType: web
 *   exampleSmartDetectionRule:
 *     type: azure:appinsights:SmartDetectionRule
 *     name: example
 *     properties:
 *       name: Slow server response time
 *       applicationInsightsId: ${exampleInsights.id}
 *       enabled: false
 * ```
 * 
 * ## Import
 * Application Insights Smart Detection Rules can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appinsights/smartDetectionRule:SmartDetectionRule rule1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Insights/components/mycomponent1/proactiveDetectionConfigs/myrule1
 * ```
 * @property additionalEmailRecipients Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.
 * > **Note:** At least one read or write permission must be defined.
 * @property applicationInsightsId The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
 * @property enabled Is the Application Insights Smart Detection Rule enabled? Defaults to `true`.
 * @property name Specifies the name of the Application Insights Smart Detection Rule. Valid values include `Slow page load time`, `Slow server response time`, `Potential memory leak detected`, `Potential security issue detected`, `Long dependency duration`, `Degradation in server response time`, `Degradation in dependency duration`, `Degradation in trace severity ratio`, `Abnormal rise in exception volume`, `Abnormal rise in daily data volume`. Changing this forces a new resource to be created.
 * @property sendEmailsToSubscriptionOwners Do emails get sent to subscription owners? Defaults to `true`.
 */
public data class SmartDetectionRuleArgs(
    public val additionalEmailRecipients: Output>? = null,
    public val applicationInsightsId: Output? = null,
    public val enabled: Output? = null,
    public val name: Output? = null,
    public val sendEmailsToSubscriptionOwners: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.appinsights.SmartDetectionRuleArgs =
        com.pulumi.azure.appinsights.SmartDetectionRuleArgs.builder()
            .additionalEmailRecipients(
                additionalEmailRecipients?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0
                    })
                }),
            )
            .applicationInsightsId(applicationInsightsId?.applyValue({ args0 -> args0 }))
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .sendEmailsToSubscriptionOwners(
                sendEmailsToSubscriptionOwners?.applyValue({ args0 ->
                    args0
                }),
            ).build()
}

/**
 * Builder for [SmartDetectionRuleArgs].
 */
@PulumiTagMarker
public class SmartDetectionRuleArgsBuilder internal constructor() {
    private var additionalEmailRecipients: Output>? = null

    private var applicationInsightsId: Output? = null

    private var enabled: Output? = null

    private var name: Output? = null

    private var sendEmailsToSubscriptionOwners: Output? = null

    /**
     * @param value Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.
     * > **Note:** At least one read or write permission must be defined.
     */
    @JvmName("aiwncowixoyribwn")
    public suspend fun additionalEmailRecipients(`value`: Output>) {
        this.additionalEmailRecipients = value
    }

    @JvmName("gnnukybgpmxtiqaw")
    public suspend fun additionalEmailRecipients(vararg values: Output) {
        this.additionalEmailRecipients = Output.all(values.asList())
    }

    /**
     * @param values Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.
     * > **Note:** At least one read or write permission must be defined.
     */
    @JvmName("gffhsqvdrtrmdlym")
    public suspend fun additionalEmailRecipients(values: List>) {
        this.additionalEmailRecipients = Output.all(values)
    }

    /**
     * @param value The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
     */
    @JvmName("vbwskkycptvnaxtb")
    public suspend fun applicationInsightsId(`value`: Output) {
        this.applicationInsightsId = value
    }

    /**
     * @param value Is the Application Insights Smart Detection Rule enabled? Defaults to `true`.
     */
    @JvmName("awafmyavsgyyrksp")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value Specifies the name of the Application Insights Smart Detection Rule. Valid values include `Slow page load time`, `Slow server response time`, `Potential memory leak detected`, `Potential security issue detected`, `Long dependency duration`, `Degradation in server response time`, `Degradation in dependency duration`, `Degradation in trace severity ratio`, `Abnormal rise in exception volume`, `Abnormal rise in daily data volume`. Changing this forces a new resource to be created.
     */
    @JvmName("nifjcjpanihyfnpy")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Do emails get sent to subscription owners? Defaults to `true`.
     */
    @JvmName("iymeybwyiynpnldi")
    public suspend fun sendEmailsToSubscriptionOwners(`value`: Output) {
        this.sendEmailsToSubscriptionOwners = value
    }

    /**
     * @param value Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.
     * > **Note:** At least one read or write permission must be defined.
     */
    @JvmName("pwplwuexjdaiiirr")
    public suspend fun additionalEmailRecipients(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.additionalEmailRecipients = mapped
    }

    /**
     * @param values Specifies a list of additional recipients that will be sent emails on this Application Insights Smart Detection Rule.
     * > **Note:** At least one read or write permission must be defined.
     */
    @JvmName("nnewwqqskjjuojjk")
    public suspend fun additionalEmailRecipients(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.additionalEmailRecipients = mapped
    }

    /**
     * @param value The ID of the Application Insights component on which the Smart Detection Rule operates. Changing this forces a new resource to be created.
     */
    @JvmName("lamhurgksxfmheug")
    public suspend fun applicationInsightsId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.applicationInsightsId = mapped
    }

    /**
     * @param value Is the Application Insights Smart Detection Rule enabled? Defaults to `true`.
     */
    @JvmName("ftjytrfcuoetnhua")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value Specifies the name of the Application Insights Smart Detection Rule. Valid values include `Slow page load time`, `Slow server response time`, `Potential memory leak detected`, `Potential security issue detected`, `Long dependency duration`, `Degradation in server response time`, `Degradation in dependency duration`, `Degradation in trace severity ratio`, `Abnormal rise in exception volume`, `Abnormal rise in daily data volume`. Changing this forces a new resource to be created.
     */
    @JvmName("iqysovkuupgxsqqo")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Do emails get sent to subscription owners? Defaults to `true`.
     */
    @JvmName("dgsypkolunrtphqw")
    public suspend fun sendEmailsToSubscriptionOwners(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sendEmailsToSubscriptionOwners = mapped
    }

    internal fun build(): SmartDetectionRuleArgs = SmartDetectionRuleArgs(
        additionalEmailRecipients = additionalEmailRecipients,
        applicationInsightsId = applicationInsightsId,
        enabled = enabled,
        name = name,
        sendEmailsToSubscriptionOwners = sendEmailsToSubscriptionOwners,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy