![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azure.appinsights.kotlin.AppinsightsFunctions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.appinsights.kotlin
import com.pulumi.azure.appinsights.AppinsightsFunctions.getInsightsPlain
import com.pulumi.azure.appinsights.kotlin.inputs.GetInsightsPlainArgs
import com.pulumi.azure.appinsights.kotlin.inputs.GetInsightsPlainArgsBuilder
import com.pulumi.azure.appinsights.kotlin.outputs.GetInsightsResult
import com.pulumi.azure.appinsights.kotlin.outputs.GetInsightsResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object AppinsightsFunctions {
/**
* Use this data source to access information about an existing Application Insights component.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.appinsights.getInsights({
* name: "production",
* resourceGroupName: "networking",
* });
* export const applicationInsightsInstrumentationKey = example.then(example => example.instrumentationKey);
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.appinsights.get_insights(name="production",
* resource_group_name="networking")
* pulumi.export("applicationInsightsInstrumentationKey", example.instrumentation_key)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.AppInsights.GetInsights.Invoke(new()
* {
* Name = "production",
* ResourceGroupName = "networking",
* });
* return new Dictionary
* {
* ["applicationInsightsInstrumentationKey"] = example.Apply(getInsightsResult => getInsightsResult.InstrumentationKey),
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/appinsights"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := appinsights.LookupInsights(ctx, &appinsights.LookupInsightsArgs{
* Name: "production",
* ResourceGroupName: "networking",
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("applicationInsightsInstrumentationKey", example.InstrumentationKey)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.appinsights.AppinsightsFunctions;
* import com.pulumi.azure.appinsights.inputs.GetInsightsArgs;
* 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 example = AppinsightsFunctions.getInsights(GetInsightsArgs.builder()
* .name("production")
* .resourceGroupName("networking")
* .build());
* ctx.export("applicationInsightsInstrumentationKey", example.applyValue(getInsightsResult -> getInsightsResult.instrumentationKey()));
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:appinsights:getInsights
* Arguments:
* name: production
* resourceGroupName: networking
* outputs:
* applicationInsightsInstrumentationKey: ${example.instrumentationKey}
* ```
*
* @param argument A collection of arguments for invoking getInsights.
* @return A collection of values returned by getInsights.
*/
public suspend fun getInsights(argument: GetInsightsPlainArgs): GetInsightsResult =
toKotlin(getInsightsPlain(argument.toJava()).await())
/**
* @see [getInsights].
* @param name Specifies the name of the Application Insights component.
* @param resourceGroupName Specifies the name of the resource group the Application Insights component is located in.
* @return A collection of values returned by getInsights.
*/
public suspend fun getInsights(name: String, resourceGroupName: String): GetInsightsResult {
val argument = GetInsightsPlainArgs(
name = name,
resourceGroupName = resourceGroupName,
)
return toKotlin(getInsightsPlain(argument.toJava()).await())
}
/**
* @see [getInsights].
* @param argument Builder for [com.pulumi.azure.appinsights.kotlin.inputs.GetInsightsPlainArgs].
* @return A collection of values returned by getInsights.
*/
public suspend fun getInsights(argument: suspend GetInsightsPlainArgsBuilder.() -> Unit): GetInsightsResult {
val builder = GetInsightsPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getInsightsPlain(builtArgument.toJava()).await())
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy