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

com.pulumi.azure.appinsights.kotlin.StandardWebTestArgs.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.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.appinsights.kotlin

import com.pulumi.azure.appinsights.StandardWebTestArgs.builder
import com.pulumi.azure.appinsights.kotlin.inputs.StandardWebTestRequestArgs
import com.pulumi.azure.appinsights.kotlin.inputs.StandardWebTestRequestArgsBuilder
import com.pulumi.azure.appinsights.kotlin.inputs.StandardWebTestValidationRulesArgs
import com.pulumi.azure.appinsights.kotlin.inputs.StandardWebTestValidationRulesArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages a Application Insights Standard WebTest.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "rg-example",
 *     location: "West Europe",
 * });
 * const exampleInsights = new azure.appinsights.Insights("example", {
 *     name: "example",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     applicationType: "web",
 * });
 * const exampleStandardWebTest = new azure.appinsights.StandardWebTest("example", {
 *     name: "example-test",
 *     resourceGroupName: example.name,
 *     location: "West Europe",
 *     applicationInsightsId: exampleInsights.id,
 *     geoLocations: ["example"],
 *     request: {
 *         url: "http://www.example.com",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="rg-example",
 *     location="West Europe")
 * example_insights = azure.appinsights.Insights("example",
 *     name="example",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     application_type="web")
 * example_standard_web_test = azure.appinsights.StandardWebTest("example",
 *     name="example-test",
 *     resource_group_name=example.name,
 *     location="West Europe",
 *     application_insights_id=example_insights.id,
 *     geo_locations=["example"],
 *     request=azure.appinsights.StandardWebTestRequestArgs(
 *         url="http://www.example.com",
 *     ))
 * ```
 * ```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 = "rg-example",
 *         Location = "West Europe",
 *     });
 *     var exampleInsights = new Azure.AppInsights.Insights("example", new()
 *     {
 *         Name = "example",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         ApplicationType = "web",
 *     });
 *     var exampleStandardWebTest = new Azure.AppInsights.StandardWebTest("example", new()
 *     {
 *         Name = "example-test",
 *         ResourceGroupName = example.Name,
 *         Location = "West Europe",
 *         ApplicationInsightsId = exampleInsights.Id,
 *         GeoLocations = new[]
 *         {
 *             "example",
 *         },
 *         Request = new Azure.AppInsights.Inputs.StandardWebTestRequestArgs
 *         {
 *             Url = "http://www.example.com",
 *         },
 *     });
 * });
 * ```
 * ```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("rg-example"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleInsights, err := appinsights.NewInsights(ctx, "example", &appinsights.InsightsArgs{
 * 			Name:              pulumi.String("example"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			ApplicationType:   pulumi.String("web"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = appinsights.NewStandardWebTest(ctx, "example", &appinsights.StandardWebTestArgs{
 * 			Name:                  pulumi.String("example-test"),
 * 			ResourceGroupName:     example.Name,
 * 			Location:              pulumi.String("West Europe"),
 * 			ApplicationInsightsId: exampleInsights.ID(),
 * 			GeoLocations: pulumi.StringArray{
 * 				pulumi.String("example"),
 * 			},
 * 			Request: &appinsights.StandardWebTestRequestArgs{
 * 				Url: pulumi.String("http://www.example.com"),
 * 			},
 * 		})
 * 		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.StandardWebTest;
 * import com.pulumi.azure.appinsights.StandardWebTestArgs;
 * import com.pulumi.azure.appinsights.inputs.StandardWebTestRequestArgs;
 * 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("rg-example")
 *             .location("West Europe")
 *             .build());
 *         var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
 *             .name("example")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .applicationType("web")
 *             .build());
 *         var exampleStandardWebTest = new StandardWebTest("exampleStandardWebTest", StandardWebTestArgs.builder()
 *             .name("example-test")
 *             .resourceGroupName(example.name())
 *             .location("West Europe")
 *             .applicationInsightsId(exampleInsights.id())
 *             .geoLocations("example")
 *             .request(StandardWebTestRequestArgs.builder()
 *                 .url("http://www.example.com")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: rg-example
 *       location: West Europe
 *   exampleInsights:
 *     type: azure:appinsights:Insights
 *     name: example
 *     properties:
 *       name: example
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       applicationType: web
 *   exampleStandardWebTest:
 *     type: azure:appinsights:StandardWebTest
 *     name: example
 *     properties:
 *       name: example-test
 *       resourceGroupName: ${example.name}
 *       location: West Europe
 *       applicationInsightsId: ${exampleInsights.id}
 *       geoLocations:
 *         - example
 *       request:
 *         url: http://www.example.com
 * ```
 * 
 * ## Import
 * Application Insights Standard WebTests can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appinsights/standardWebTest:StandardWebTest example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Insights/webTests/appinsightswebtest
 * ```
 * @property applicationInsightsId The ID of the Application Insights instance on which the WebTest operates. Changing this forces a new Application Insights Standard WebTest to be created.
 * @property description Purpose/user defined descriptive test for this WebTest.
 * @property enabled Should the WebTest be enabled?
 * @property frequency Interval in seconds between test runs for this WebTest. Valid options are `300`, `600` and `900`. Defaults to `300`.
 * @property geoLocations Specifies a list of where to physically run the tests from to give global coverage for accessibility of your application.
 * > **Note:** [Valid options for geo locations are described here](https://docs.microsoft.com/azure/azure-monitor/app/monitor-web-app-availability#location-population-tags)
 * @property location The Azure Region where the Application Insights Standard WebTest should exist. Changing this forces a new Application Insights Standard WebTest to be created. It needs to correlate with location of the parent resource (azurerm_application_insights)
 * @property name The name which should be used for this Application Insights Standard WebTest. Changing this forces a new Application Insights Standard WebTest to be created.
 * @property request A `request` block as defined below.
 * @property resourceGroupName The name of the Resource Group where the Application Insights Standard WebTest should exist. Changing this forces a new Application Insights Standard WebTest to be created.
 * @property retryEnabled Should the retry on WebTest failure be enabled?
 * @property tags A mapping of tags which should be assigned to the Application Insights Standard WebTest.
 * @property timeout Seconds until this WebTest will timeout and fail. Default is `30`.
 * @property validationRules A `validation_rules` block as defined below.
 */
public data class StandardWebTestArgs(
    public val applicationInsightsId: Output? = null,
    public val description: Output? = null,
    public val enabled: Output? = null,
    public val frequency: Output? = null,
    public val geoLocations: Output>? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val request: Output? = null,
    public val resourceGroupName: Output? = null,
    public val retryEnabled: Output? = null,
    public val tags: Output>? = null,
    public val timeout: Output? = null,
    public val validationRules: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.appinsights.StandardWebTestArgs =
        com.pulumi.azure.appinsights.StandardWebTestArgs.builder()
            .applicationInsightsId(applicationInsightsId?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .frequency(frequency?.applyValue({ args0 -> args0 }))
            .geoLocations(geoLocations?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .request(request?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .retryEnabled(retryEnabled?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .timeout(timeout?.applyValue({ args0 -> args0 }))
            .validationRules(
                validationRules?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [StandardWebTestArgs].
 */
@PulumiTagMarker
public class StandardWebTestArgsBuilder internal constructor() {
    private var applicationInsightsId: Output? = null

    private var description: Output? = null

    private var enabled: Output? = null

    private var frequency: Output? = null

    private var geoLocations: Output>? = null

    private var location: Output? = null

    private var name: Output? = null

    private var request: Output? = null

    private var resourceGroupName: Output? = null

    private var retryEnabled: Output? = null

    private var tags: Output>? = null

    private var timeout: Output? = null

    private var validationRules: Output? = null

    /**
     * @param value The ID of the Application Insights instance on which the WebTest operates. Changing this forces a new Application Insights Standard WebTest to be created.
     */
    @JvmName("efqoqqxfmveiqhjx")
    public suspend fun applicationInsightsId(`value`: Output) {
        this.applicationInsightsId = value
    }

    /**
     * @param value Purpose/user defined descriptive test for this WebTest.
     */
    @JvmName("onwvsamneuxmoumx")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Should the WebTest be enabled?
     */
    @JvmName("dvyjoipabhhyfpvi")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value Interval in seconds between test runs for this WebTest. Valid options are `300`, `600` and `900`. Defaults to `300`.
     */
    @JvmName("gekpmmcxoqyslnaj")
    public suspend fun frequency(`value`: Output) {
        this.frequency = value
    }

    /**
     * @param value Specifies a list of where to physically run the tests from to give global coverage for accessibility of your application.
     * > **Note:** [Valid options for geo locations are described here](https://docs.microsoft.com/azure/azure-monitor/app/monitor-web-app-availability#location-population-tags)
     */
    @JvmName("wmxdhqbtsxdtjstu")
    public suspend fun geoLocations(`value`: Output>) {
        this.geoLocations = value
    }

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

    /**
     * @param values Specifies a list of where to physically run the tests from to give global coverage for accessibility of your application.
     * > **Note:** [Valid options for geo locations are described here](https://docs.microsoft.com/azure/azure-monitor/app/monitor-web-app-availability#location-population-tags)
     */
    @JvmName("lbrronbhlunhqfkb")
    public suspend fun geoLocations(values: List>) {
        this.geoLocations = Output.all(values)
    }

    /**
     * @param value The Azure Region where the Application Insights Standard WebTest should exist. Changing this forces a new Application Insights Standard WebTest to be created. It needs to correlate with location of the parent resource (azurerm_application_insights)
     */
    @JvmName("ltibfuohcfbsxgsk")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value The name which should be used for this Application Insights Standard WebTest. Changing this forces a new Application Insights Standard WebTest to be created.
     */
    @JvmName("pitdrwdwjkkissix")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value A `request` block as defined below.
     */
    @JvmName("dskjuatfdxmnbvyb")
    public suspend fun request(`value`: Output) {
        this.request = value
    }

    /**
     * @param value The name of the Resource Group where the Application Insights Standard WebTest should exist. Changing this forces a new Application Insights Standard WebTest to be created.
     */
    @JvmName("yluxcywxavsurdro")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Should the retry on WebTest failure be enabled?
     */
    @JvmName("hkbrfamlvocqmfmf")
    public suspend fun retryEnabled(`value`: Output) {
        this.retryEnabled = value
    }

    /**
     * @param value A mapping of tags which should be assigned to the Application Insights Standard WebTest.
     */
    @JvmName("lflbogibncsossfq")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Seconds until this WebTest will timeout and fail. Default is `30`.
     */
    @JvmName("ifhvojvsretuduts")
    public suspend fun timeout(`value`: Output) {
        this.timeout = value
    }

    /**
     * @param value A `validation_rules` block as defined below.
     */
    @JvmName("raeqsurhsyfawseo")
    public suspend fun validationRules(`value`: Output) {
        this.validationRules = value
    }

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

    /**
     * @param value Purpose/user defined descriptive test for this WebTest.
     */
    @JvmName("ptvlmsicndhkdwee")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Should the WebTest be enabled?
     */
    @JvmName("djhkuwuuuatrupbh")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value Interval in seconds between test runs for this WebTest. Valid options are `300`, `600` and `900`. Defaults to `300`.
     */
    @JvmName("wkydsmlxdxcybmyl")
    public suspend fun frequency(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.frequency = mapped
    }

    /**
     * @param value Specifies a list of where to physically run the tests from to give global coverage for accessibility of your application.
     * > **Note:** [Valid options for geo locations are described here](https://docs.microsoft.com/azure/azure-monitor/app/monitor-web-app-availability#location-population-tags)
     */
    @JvmName("sirxvvnhpxuvckur")
    public suspend fun geoLocations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.geoLocations = mapped
    }

    /**
     * @param values Specifies a list of where to physically run the tests from to give global coverage for accessibility of your application.
     * > **Note:** [Valid options for geo locations are described here](https://docs.microsoft.com/azure/azure-monitor/app/monitor-web-app-availability#location-population-tags)
     */
    @JvmName("rqyoydmpaceuufhd")
    public suspend fun geoLocations(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.geoLocations = mapped
    }

    /**
     * @param value The Azure Region where the Application Insights Standard WebTest should exist. Changing this forces a new Application Insights Standard WebTest to be created. It needs to correlate with location of the parent resource (azurerm_application_insights)
     */
    @JvmName("wduraiwbnulydefa")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value The name which should be used for this Application Insights Standard WebTest. Changing this forces a new Application Insights Standard WebTest to be created.
     */
    @JvmName("khefmwgobblssoic")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value A `request` block as defined below.
     */
    @JvmName("oequifyqesbinbyl")
    public suspend fun request(`value`: StandardWebTestRequestArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.request = mapped
    }

    /**
     * @param argument A `request` block as defined below.
     */
    @JvmName("sihyxokqanxtospk")
    public suspend fun request(argument: suspend StandardWebTestRequestArgsBuilder.() -> Unit) {
        val toBeMapped = StandardWebTestRequestArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.request = mapped
    }

    /**
     * @param value The name of the Resource Group where the Application Insights Standard WebTest should exist. Changing this forces a new Application Insights Standard WebTest to be created.
     */
    @JvmName("axfhjambqbxotyjo")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Should the retry on WebTest failure be enabled?
     */
    @JvmName("uafriyijtfmuvwib")
    public suspend fun retryEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retryEnabled = mapped
    }

    /**
     * @param value A mapping of tags which should be assigned to the Application Insights Standard WebTest.
     */
    @JvmName("ewqfnwkffxnrkdin")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags which should be assigned to the Application Insights Standard WebTest.
     */
    @JvmName("erbqykvgjmrwlsli")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value Seconds until this WebTest will timeout and fail. Default is `30`.
     */
    @JvmName("xvgxpcilsexymrth")
    public suspend fun timeout(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeout = mapped
    }

    /**
     * @param value A `validation_rules` block as defined below.
     */
    @JvmName("aivksajuhacfeqjd")
    public suspend fun validationRules(`value`: StandardWebTestValidationRulesArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.validationRules = mapped
    }

    /**
     * @param argument A `validation_rules` block as defined below.
     */
    @JvmName("njfqtnrdkbqffgpw")
    public suspend
    fun validationRules(argument: suspend StandardWebTestValidationRulesArgsBuilder.() -> Unit) {
        val toBeMapped = StandardWebTestValidationRulesArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.validationRules = mapped
    }

    internal fun build(): StandardWebTestArgs = StandardWebTestArgs(
        applicationInsightsId = applicationInsightsId,
        description = description,
        enabled = enabled,
        frequency = frequency,
        geoLocations = geoLocations,
        location = location,
        name = name,
        request = request,
        resourceGroupName = resourceGroupName,
        retryEnabled = retryEnabled,
        tags = tags,
        timeout = timeout,
        validationRules = validationRules,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy