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

com.pulumi.azure.appinsights.kotlin.AnalyticsItemArgs.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.AnalyticsItemArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages an Application Insights Analytics Item component.
 * ## 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 exampleAnalyticsItem = new azure.appinsights.AnalyticsItem("example", {
 *     name: "testquery",
 *     applicationInsightsId: exampleInsights.id,
 *     content: "requests //simple example query",
 *     scope: "shared",
 *     type: "query",
 * });
 * ```
 * ```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_analytics_item = azure.appinsights.AnalyticsItem("example",
 *     name="testquery",
 *     application_insights_id=example_insights.id,
 *     content="requests //simple example query",
 *     scope="shared",
 *     type="query")
 * ```
 * ```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 exampleAnalyticsItem = new Azure.AppInsights.AnalyticsItem("example", new()
 *     {
 *         Name = "testquery",
 *         ApplicationInsightsId = exampleInsights.Id,
 *         Content = "requests //simple example query",
 *         Scope = "shared",
 *         Type = "query",
 *     });
 * });
 * ```
 * ```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.NewAnalyticsItem(ctx, "example", &appinsights.AnalyticsItemArgs{
 * 			Name:                  pulumi.String("testquery"),
 * 			ApplicationInsightsId: exampleInsights.ID(),
 * 			Content:               pulumi.String("requests //simple example query"),
 * 			Scope:                 pulumi.String("shared"),
 * 			Type:                  pulumi.String("query"),
 * 		})
 * 		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.AnalyticsItem;
 * import com.pulumi.azure.appinsights.AnalyticsItemArgs;
 * 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 exampleAnalyticsItem = new AnalyticsItem("exampleAnalyticsItem", AnalyticsItemArgs.builder()
 *             .name("testquery")
 *             .applicationInsightsId(exampleInsights.id())
 *             .content("requests //simple example query")
 *             .scope("shared")
 *             .type("query")
 *             .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
 *   exampleAnalyticsItem:
 *     type: azure:appinsights:AnalyticsItem
 *     name: example
 *     properties:
 *       name: testquery
 *       applicationInsightsId: ${exampleInsights.id}
 *       content: requests //simple example query
 *       scope: shared
 *       type: query
 * ```
 * 
 * ## Import
 * Application Insights Analytics Items can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:appinsights/analyticsItem:AnalyticsItem example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Insights/components/mycomponent1/analyticsItems/11111111-1111-1111-1111-111111111111
 * ```
 * To find the Analytics Item ID you can query the REST API using the [`az rest` CLI command](https://docs.microsoft.com/cli/azure/reference-index?view=azure-cli-latest#az-rest), e.g.
 * az rest --method GET --uri "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/microsoft.insights/components/appinsightstest/analyticsItems?api-version=2015-05-01"
 * @property applicationInsightsId The ID of the Application Insights component on which the Analytics Item exists. Changing this forces a new resource to be created.
 * @property content The content for the Analytics Item, for example the query text if `type` is `query`.
 * @property functionAlias The alias to use for the function. Required when `type` is `function`.
 * @property name Specifies the name of the Application Insights Analytics Item. Changing this forces a new resource to be created.
 * @property scope The scope for the Analytics Item. Can be `shared` or `user`. Changing this forces a new resource to be created. Must be `shared` for functions.
 * @property type The type of Analytics Item to create. Can be one of `query`, `function`, `folder`, `recent`. Changing this forces a new resource to be created.
 */
public data class AnalyticsItemArgs(
    public val applicationInsightsId: Output? = null,
    public val content: Output? = null,
    public val functionAlias: Output? = null,
    public val name: Output? = null,
    public val scope: Output? = null,
    public val type: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.appinsights.AnalyticsItemArgs =
        com.pulumi.azure.appinsights.AnalyticsItemArgs.builder()
            .applicationInsightsId(applicationInsightsId?.applyValue({ args0 -> args0 }))
            .content(content?.applyValue({ args0 -> args0 }))
            .functionAlias(functionAlias?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .scope(scope?.applyValue({ args0 -> args0 }))
            .type(type?.applyValue({ args0 -> args0 })).build()
}

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

    private var content: Output? = null

    private var functionAlias: Output? = null

    private var name: Output? = null

    private var scope: Output? = null

    private var type: Output? = null

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

    /**
     * @param value The content for the Analytics Item, for example the query text if `type` is `query`.
     */
    @JvmName("ofmpjbipfbnwpwms")
    public suspend fun content(`value`: Output) {
        this.content = value
    }

    /**
     * @param value The alias to use for the function. Required when `type` is `function`.
     */
    @JvmName("bpyinvjmmryqobaa")
    public suspend fun functionAlias(`value`: Output) {
        this.functionAlias = value
    }

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

    /**
     * @param value The scope for the Analytics Item. Can be `shared` or `user`. Changing this forces a new resource to be created. Must be `shared` for functions.
     */
    @JvmName("mswvdxxviniwkfiq")
    public suspend fun scope(`value`: Output) {
        this.scope = value
    }

    /**
     * @param value The type of Analytics Item to create. Can be one of `query`, `function`, `folder`, `recent`. Changing this forces a new resource to be created.
     */
    @JvmName("bojloruoylmaqtaw")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

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

    /**
     * @param value The content for the Analytics Item, for example the query text if `type` is `query`.
     */
    @JvmName("fahkgpgsoqupntgf")
    public suspend fun content(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.content = mapped
    }

    /**
     * @param value The alias to use for the function. Required when `type` is `function`.
     */
    @JvmName("pkcltkumkynuyjlt")
    public suspend fun functionAlias(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.functionAlias = mapped
    }

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

    /**
     * @param value The scope for the Analytics Item. Can be `shared` or `user`. Changing this forces a new resource to be created. Must be `shared` for functions.
     */
    @JvmName("rwadpungqjakwkog")
    public suspend fun scope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scope = mapped
    }

    /**
     * @param value The type of Analytics Item to create. Can be one of `query`, `function`, `folder`, `recent`. Changing this forces a new resource to be created.
     */
    @JvmName("lgmykmforsqykirg")
    public suspend fun type(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.type = mapped
    }

    internal fun build(): AnalyticsItemArgs = AnalyticsItemArgs(
        applicationInsightsId = applicationInsightsId,
        content = content,
        functionAlias = functionAlias,
        name = name,
        scope = scope,
        type = type,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy