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

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

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.appinsights.kotlin

import com.pulumi.azure.appinsights.WebTestArgs.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.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages an Application Insights WebTest.
 * ## 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 exampleWebTest = new azure.appinsights.WebTest("example", {
 *     name: "tf-test-appinsights-webtest",
 *     location: exampleInsights.location,
 *     resourceGroupName: example.name,
 *     applicationInsightsId: exampleInsights.id,
 *     kind: "ping",
 *     frequency: 300,
 *     timeout: 60,
 *     enabled: true,
 *     geoLocations: [
 *         "us-tx-sn1-azr",
 *         "us-il-ch1-azr",
 *     ],
 *     configuration: `
 *   
 *     
 *   
 * 
 * `,
 * });
 * export const webtestId = exampleWebTest.id;
 * export const webtestsSyntheticId = exampleWebTest.syntheticMonitorId;
 * ```
 * ```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_web_test = azure.appinsights.WebTest("example",
 *     name="tf-test-appinsights-webtest",
 *     location=example_insights.location,
 *     resource_group_name=example.name,
 *     application_insights_id=example_insights.id,
 *     kind="ping",
 *     frequency=300,
 *     timeout=60,
 *     enabled=True,
 *     geo_locations=[
 *         "us-tx-sn1-azr",
 *         "us-il-ch1-azr",
 *     ],
 *     configuration="""
 *   
 *     
 *   
 * 
 * """)
 * pulumi.export("webtestId", example_web_test.id)
 * pulumi.export("webtestsSyntheticId", example_web_test.synthetic_monitor_id)
 * ```
 * ```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 exampleWebTest = new Azure.AppInsights.WebTest("example", new()
 *     {
 *         Name = "tf-test-appinsights-webtest",
 *         Location = exampleInsights.Location,
 *         ResourceGroupName = example.Name,
 *         ApplicationInsightsId = exampleInsights.Id,
 *         Kind = "ping",
 *         Frequency = 300,
 *         Timeout = 60,
 *         Enabled = true,
 *         GeoLocations = new[]
 *         {
 *             "us-tx-sn1-azr",
 *             "us-il-ch1-azr",
 *         },
 *         Configuration = @"
 *   
 *     
 *   
 * 
 * ",
 *     });
 *     return new Dictionary
 *     {
 *         ["webtestId"] = exampleWebTest.Id,
 *         ["webtestsSyntheticId"] = exampleWebTest.SyntheticMonitorId,
 *     };
 * });
 * ```
 * ```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
 * 		}
 * 		exampleWebTest, err := appinsights.NewWebTest(ctx, "example", &appinsights.WebTestArgs{
 * 			Name:                  pulumi.String("tf-test-appinsights-webtest"),
 * 			Location:              exampleInsights.Location,
 * 			ResourceGroupName:     example.Name,
 * 			ApplicationInsightsId: exampleInsights.ID(),
 * 			Kind:                  pulumi.String("ping"),
 * 			Frequency:             pulumi.Int(300),
 * 			Timeout:               pulumi.Int(60),
 * 			Enabled:               pulumi.Bool(true),
 * 			GeoLocations: pulumi.StringArray{
 * 				pulumi.String("us-tx-sn1-azr"),
 * 				pulumi.String("us-il-ch1-azr"),
 * 			},
 * 			Configuration: pulumi.String(`
 *   
 *     
 *   
 * 
 * `),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		ctx.Export("webtestId", exampleWebTest.ID())
 * 		ctx.Export("webtestsSyntheticId", exampleWebTest.SyntheticMonitorId)
 * 		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.WebTest;
 * import com.pulumi.azure.appinsights.WebTestArgs;
 * 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 exampleWebTest = new WebTest("exampleWebTest", WebTestArgs.builder()
 *             .name("tf-test-appinsights-webtest")
 *             .location(exampleInsights.location())
 *             .resourceGroupName(example.name())
 *             .applicationInsightsId(exampleInsights.id())
 *             .kind("ping")
 *             .frequency(300)
 *             .timeout(60)
 *             .enabled(true)
 *             .geoLocations(
 *                 "us-tx-sn1-azr",
 *                 "us-il-ch1-azr")
 *             .configuration("""
 * 
 *   
 *     
 *   
 * 
 *             """)
 *             .build());
 *         ctx.export("webtestId", exampleWebTest.id());
 *         ctx.export("webtestsSyntheticId", exampleWebTest.syntheticMonitorId());
 *     }
 * }
 * ```
 * ```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
 *   exampleWebTest:
 *     type: azure:appinsights:WebTest
 *     name: example
 *     properties:
 *       name: tf-test-appinsights-webtest
 *       location: ${exampleInsights.location}
 *       resourceGroupName: ${example.name}
 *       applicationInsightsId: ${exampleInsights.id}
 *       kind: ping
 *       frequency: 300
 *       timeout: 60
 *       enabled: true
 *       geoLocations:
 *         - us-tx-sn1-azr
 *         - us-il-ch1-azr
 *       configuration: |
 *         
 *           
 *             
 *           
 *         
 * outputs:
 *   webtestId: ${exampleWebTest.id}
 *   webtestsSyntheticId: ${exampleWebTest.syntheticMonitorId}
 * ```
 * 
 * ## Import
 * Application Insights Web Tests can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appinsights/webTest:WebTest my_test /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Insights/webTests/my_test
 * ```
 * @property applicationInsightsId The ID of the Application Insights component on which the WebTest operates. Changing this forces a new resource to be created.
 * @property configuration An XML configuration specification for a WebTest ([see here for more information](https://docs.microsoft.com/rest/api/application-insights/webtests/createorupdate/)).
 * @property description Purpose/user defined descriptive test for this WebTest.
 * @property enabled Is the test actively being monitored.
 * @property frequency Interval in seconds between test runs for this WebTest. Valid options are `300`, `600` and `900`. Defaults to `300`.
 * @property geoLocations 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 kind The kind of web test that this web test watches. Choices are `ping` and `multistep`. Changing this forces a new resource to be created.
 * @property location Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. It needs to correlate with location of parent resource (azurerm_application_insights).
 * @property name Specifies the name of the Application Insights WebTest. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the resource group in which to create the Application Insights WebTest. Changing this forces a new resource
 * @property retryEnabled Allow for retries should this WebTest fail.
 * @property tags A mapping of tags to assign to the resource.
 * @property timeout Seconds until this WebTest will timeout and fail. Default is `30`.
 */
public data class WebTestArgs(
    public val applicationInsightsId: Output? = null,
    public val configuration: Output? = null,
    public val description: Output? = null,
    public val enabled: Output? = null,
    public val frequency: Output? = null,
    public val geoLocations: Output>? = null,
    public val kind: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val retryEnabled: Output? = null,
    public val tags: Output>? = null,
    public val timeout: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.appinsights.WebTestArgs =
        com.pulumi.azure.appinsights.WebTestArgs.builder()
            .applicationInsightsId(applicationInsightsId?.applyValue({ args0 -> args0 }))
            .configuration(configuration?.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 }) }))
            .kind(kind?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .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 })).build()
}

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

    private var configuration: Output? = null

    private var description: Output? = null

    private var enabled: Output? = null

    private var frequency: Output? = null

    private var geoLocations: Output>? = null

    private var kind: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var retryEnabled: Output? = null

    private var tags: Output>? = null

    private var timeout: Output? = null

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

    /**
     * @param value An XML configuration specification for a WebTest ([see here for more information](https://docs.microsoft.com/rest/api/application-insights/webtests/createorupdate/)).
     */
    @JvmName("delcvtmrsdwygvvh")
    public suspend fun configuration(`value`: Output) {
        this.configuration = value
    }

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

    /**
     * @param value Is the test actively being monitored.
     */
    @JvmName("ucxuxnqmnjwtsdhb")
    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("sgglsiqhfapugudb")
    public suspend fun frequency(`value`: Output) {
        this.frequency = value
    }

    /**
     * @param value 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("ncgffbnfqobpyocd")
    public suspend fun geoLocations(`value`: Output>) {
        this.geoLocations = value
    }

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

    /**
     * @param values 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("rjugfuiunbrfdhwu")
    public suspend fun geoLocations(values: List>) {
        this.geoLocations = Output.all(values)
    }

    /**
     * @param value The kind of web test that this web test watches. Choices are `ping` and `multistep`. Changing this forces a new resource to be created.
     */
    @JvmName("wimjokaiklwgkfga")
    public suspend fun kind(`value`: Output) {
        this.kind = value
    }

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. It needs to correlate with location of parent resource (azurerm_application_insights).
     */
    @JvmName("lggagpesrsotqwir")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Specifies the name of the Application Insights WebTest. Changing this forces a new resource to be created.
     */
    @JvmName("dlhnkmpijccjncfr")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The name of the resource group in which to create the Application Insights WebTest. Changing this forces a new resource
     */
    @JvmName("pwgqrknbqdrrkwfd")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Allow for retries should this WebTest fail.
     */
    @JvmName("eoletmspuyorirgj")
    public suspend fun retryEnabled(`value`: Output) {
        this.retryEnabled = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("qksvksafacyxchwt")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

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

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

    /**
     * @param value An XML configuration specification for a WebTest ([see here for more information](https://docs.microsoft.com/rest/api/application-insights/webtests/createorupdate/)).
     */
    @JvmName("gbgffbfesjdibtnm")
    public suspend fun configuration(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.configuration = mapped
    }

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

    /**
     * @param value Is the test actively being monitored.
     */
    @JvmName("jfkxaqxcliifubjt")
    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("sahjkjlsfyeuimqs")
    public suspend fun frequency(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.frequency = mapped
    }

    /**
     * @param value 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("txexnpvpvqsmofoh")
    public suspend fun geoLocations(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.geoLocations = mapped
    }

    /**
     * @param values 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("aunqmudankgxrqtv")
    public suspend fun geoLocations(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.geoLocations = mapped
    }

    /**
     * @param value The kind of web test that this web test watches. Choices are `ping` and `multistep`. Changing this forces a new resource to be created.
     */
    @JvmName("umwqxuklkwculhqp")
    public suspend fun kind(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.kind = mapped
    }

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. It needs to correlate with location of parent resource (azurerm_application_insights).
     */
    @JvmName("nbuvoipitcexhhel")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Specifies the name of the Application Insights WebTest. Changing this forces a new resource to be created.
     */
    @JvmName("blaettvanttblxlg")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The name of the resource group in which to create the Application Insights WebTest. Changing this forces a new resource
     */
    @JvmName("slaecbpgtctrwbyb")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Allow for retries should this WebTest fail.
     */
    @JvmName("nhnwbhjeiskifdng")
    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 to assign to the resource.
     */
    @JvmName("vqcasyybpmtfldjr")
    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 to assign to the resource.
     */
    @JvmName("aqvhurtcicvtjwfc")
    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("dgounikgkitglovb")
    public suspend fun timeout(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeout = mapped
    }

    internal fun build(): WebTestArgs = WebTestArgs(
        applicationInsightsId = applicationInsightsId,
        configuration = configuration,
        description = description,
        enabled = enabled,
        frequency = frequency,
        geoLocations = geoLocations,
        kind = kind,
        location = location,
        name = name,
        resourceGroupName = resourceGroupName,
        retryEnabled = retryEnabled,
        tags = tags,
        timeout = timeout,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy