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

com.pulumi.azure.containerapp.kotlin.ContainerappFunctions.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.containerapp.kotlin

import com.pulumi.azure.containerapp.ContainerappFunctions.getAppPlain
import com.pulumi.azure.containerapp.ContainerappFunctions.getEnvironmentCertificatePlain
import com.pulumi.azure.containerapp.ContainerappFunctions.getEnvironmentPlain
import com.pulumi.azure.containerapp.kotlin.inputs.GetAppPlainArgs
import com.pulumi.azure.containerapp.kotlin.inputs.GetAppPlainArgsBuilder
import com.pulumi.azure.containerapp.kotlin.inputs.GetEnvironmentCertificatePlainArgs
import com.pulumi.azure.containerapp.kotlin.inputs.GetEnvironmentCertificatePlainArgsBuilder
import com.pulumi.azure.containerapp.kotlin.inputs.GetEnvironmentPlainArgs
import com.pulumi.azure.containerapp.kotlin.inputs.GetEnvironmentPlainArgsBuilder
import com.pulumi.azure.containerapp.kotlin.outputs.GetAppResult
import com.pulumi.azure.containerapp.kotlin.outputs.GetEnvironmentCertificateResult
import com.pulumi.azure.containerapp.kotlin.outputs.GetEnvironmentResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.azure.containerapp.kotlin.outputs.GetAppResult.Companion.toKotlin as getAppResultToKotlin
import com.pulumi.azure.containerapp.kotlin.outputs.GetEnvironmentCertificateResult.Companion.toKotlin as getEnvironmentCertificateResultToKotlin
import com.pulumi.azure.containerapp.kotlin.outputs.GetEnvironmentResult.Companion.toKotlin as getEnvironmentResultToKotlin

public object ContainerappFunctions {
    /**
     * Use this data source to access information about an existing Container App.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as azure from "@pulumi/azure";
     * const example = azure.containerapp.getApp({
     *     name: "example-app",
     *     resourceGroupName: "example-resources",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_azure as azure
     * example = azure.containerapp.get_app(name="example-app",
     *     resource_group_name="example-resources")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Azure = Pulumi.Azure;
     * return await Deployment.RunAsync(() =>
     * {
     *     var example = Azure.ContainerApp.GetApp.Invoke(new()
     *     {
     *         Name = "example-app",
     *         ResourceGroupName = "example-resources",
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerapp"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := containerapp.LookupApp(ctx, &containerapp.LookupAppArgs{
     * 			Name:              "example-app",
     * 			ResourceGroupName: "example-resources",
     * 		}, nil)
     * 		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.containerapp.ContainerappFunctions;
     * import com.pulumi.azure.containerapp.inputs.GetAppArgs;
     * 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 = ContainerappFunctions.getApp(GetAppArgs.builder()
     *             .name("example-app")
     *             .resourceGroupName("example-resources")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: azure:containerapp:getApp
     *       Arguments:
     *         name: example-app
     *         resourceGroupName: example-resources
     * ```
     * 
     * @param argument A collection of arguments for invoking getApp.
     * @return A collection of values returned by getApp.
     */
    public suspend fun getApp(argument: GetAppPlainArgs): GetAppResult =
        getAppResultToKotlin(getAppPlain(argument.toJava()).await())

    /**
     * @see [getApp].
     * @param name The name of the Container App.
     * @param resourceGroupName The name of the Resource Group where this Container App exists.
     * @return A collection of values returned by getApp.
     */
    public suspend fun getApp(name: String, resourceGroupName: String): GetAppResult {
        val argument = GetAppPlainArgs(
            name = name,
            resourceGroupName = resourceGroupName,
        )
        return getAppResultToKotlin(getAppPlain(argument.toJava()).await())
    }

    /**
     * @see [getApp].
     * @param argument Builder for [com.pulumi.azure.containerapp.kotlin.inputs.GetAppPlainArgs].
     * @return A collection of values returned by getApp.
     */
    public suspend fun getApp(argument: suspend GetAppPlainArgsBuilder.() -> Unit): GetAppResult {
        val builder = GetAppPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getAppResultToKotlin(getAppPlain(builtArgument.toJava()).await())
    }

    /**
     * Use this data source to access information about an existing Container App Environment.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as azure from "@pulumi/azure";
     * const example = azure.containerapp.getEnvironment({
     *     name: "example-environment",
     *     resourceGroupName: "example-resources",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_azure as azure
     * example = azure.containerapp.get_environment(name="example-environment",
     *     resource_group_name="example-resources")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Azure = Pulumi.Azure;
     * return await Deployment.RunAsync(() =>
     * {
     *     var example = Azure.ContainerApp.GetEnvironment.Invoke(new()
     *     {
     *         Name = "example-environment",
     *         ResourceGroupName = "example-resources",
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerapp"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := containerapp.LookupEnvironment(ctx, &containerapp.LookupEnvironmentArgs{
     * 			Name:              "example-environment",
     * 			ResourceGroupName: "example-resources",
     * 		}, nil)
     * 		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.containerapp.ContainerappFunctions;
     * import com.pulumi.azure.containerapp.inputs.GetEnvironmentArgs;
     * 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 = ContainerappFunctions.getEnvironment(GetEnvironmentArgs.builder()
     *             .name("example-environment")
     *             .resourceGroupName("example-resources")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: azure:containerapp:getEnvironment
     *       Arguments:
     *         name: example-environment
     *         resourceGroupName: example-resources
     * ```
     * 
     * @param argument A collection of arguments for invoking getEnvironment.
     * @return A collection of values returned by getEnvironment.
     */
    public suspend fun getEnvironment(argument: GetEnvironmentPlainArgs): GetEnvironmentResult =
        getEnvironmentResultToKotlin(getEnvironmentPlain(argument.toJava()).await())

    /**
     * @see [getEnvironment].
     * @param name The name of the Container Apps Managed Environment.
     * @param resourceGroupName The name of the Resource Group where this Container App Environment exists.
     * @return A collection of values returned by getEnvironment.
     */
    public suspend fun getEnvironment(name: String, resourceGroupName: String): GetEnvironmentResult {
        val argument = GetEnvironmentPlainArgs(
            name = name,
            resourceGroupName = resourceGroupName,
        )
        return getEnvironmentResultToKotlin(getEnvironmentPlain(argument.toJava()).await())
    }

    /**
     * @see [getEnvironment].
     * @param argument Builder for [com.pulumi.azure.containerapp.kotlin.inputs.GetEnvironmentPlainArgs].
     * @return A collection of values returned by getEnvironment.
     */
    public suspend fun getEnvironment(argument: suspend GetEnvironmentPlainArgsBuilder.() -> Unit):
        GetEnvironmentResult {
        val builder = GetEnvironmentPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getEnvironmentResultToKotlin(getEnvironmentPlain(builtArgument.toJava()).await())
    }

    /**
     * Use this data source to access information about an existing Container App Environment Certificate.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as azure from "@pulumi/azure";
     * const example = azure.containerapp.getEnvironment({
     *     name: "example-environment",
     *     resourceGroupName: "example-resources",
     * });
     * const exampleGetEnvironmentCertificate = example.then(example => azure.containerapp.getEnvironmentCertificate({
     *     name: "mycertificate",
     *     containerAppEnvironmentId: example.id,
     * }));
     * ```
     * ```python
     * import pulumi
     * import pulumi_azure as azure
     * example = azure.containerapp.get_environment(name="example-environment",
     *     resource_group_name="example-resources")
     * example_get_environment_certificate = azure.containerapp.get_environment_certificate(name="mycertificate",
     *     container_app_environment_id=example.id)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Azure = Pulumi.Azure;
     * return await Deployment.RunAsync(() =>
     * {
     *     var example = Azure.ContainerApp.GetEnvironment.Invoke(new()
     *     {
     *         Name = "example-environment",
     *         ResourceGroupName = "example-resources",
     *     });
     *     var exampleGetEnvironmentCertificate = Azure.ContainerApp.GetEnvironmentCertificate.Invoke(new()
     *     {
     *         Name = "mycertificate",
     *         ContainerAppEnvironmentId = example.Apply(getEnvironmentResult => getEnvironmentResult.Id),
     *     });
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerapp"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		example, err := containerapp.LookupEnvironment(ctx, &containerapp.LookupEnvironmentArgs{
     * 			Name:              "example-environment",
     * 			ResourceGroupName: "example-resources",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		_, err = containerapp.LookupEnvironmentCertificate(ctx, &containerapp.LookupEnvironmentCertificateArgs{
     * 			Name:                      "mycertificate",
     * 			ContainerAppEnvironmentId: example.Id,
     * 		}, nil)
     * 		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.containerapp.ContainerappFunctions;
     * import com.pulumi.azure.containerapp.inputs.GetEnvironmentArgs;
     * import com.pulumi.azure.containerapp.inputs.GetEnvironmentCertificateArgs;
     * 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 = ContainerappFunctions.getEnvironment(GetEnvironmentArgs.builder()
     *             .name("example-environment")
     *             .resourceGroupName("example-resources")
     *             .build());
     *         final var exampleGetEnvironmentCertificate = ContainerappFunctions.getEnvironmentCertificate(GetEnvironmentCertificateArgs.builder()
     *             .name("mycertificate")
     *             .containerAppEnvironmentId(example.applyValue(getEnvironmentResult -> getEnvironmentResult.id()))
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   example:
     *     fn::invoke:
     *       Function: azure:containerapp:getEnvironment
     *       Arguments:
     *         name: example-environment
     *         resourceGroupName: example-resources
     *   exampleGetEnvironmentCertificate:
     *     fn::invoke:
     *       Function: azure:containerapp:getEnvironmentCertificate
     *       Arguments:
     *         name: mycertificate
     *         containerAppEnvironmentId: ${example.id}
     * ```
     * 
     * @param argument A collection of arguments for invoking getEnvironmentCertificate.
     * @return A collection of values returned by getEnvironmentCertificate.
     */
    public suspend fun getEnvironmentCertificate(argument: GetEnvironmentCertificatePlainArgs):
        GetEnvironmentCertificateResult =
        getEnvironmentCertificateResultToKotlin(getEnvironmentCertificatePlain(argument.toJava()).await())

    /**
     * @see [getEnvironmentCertificate].
     * @param containerAppEnvironmentId The ID of the Container App Environment to configure this Certificate on. Changing this forces a new resource to be created.
     * @param name The name of the Container Apps Certificate. Changing this forces a new resource to be created.
     * @return A collection of values returned by getEnvironmentCertificate.
     */
    public suspend fun getEnvironmentCertificate(containerAppEnvironmentId: String, name: String):
        GetEnvironmentCertificateResult {
        val argument = GetEnvironmentCertificatePlainArgs(
            containerAppEnvironmentId = containerAppEnvironmentId,
            name = name,
        )
        return getEnvironmentCertificateResultToKotlin(getEnvironmentCertificatePlain(argument.toJava()).await())
    }

    /**
     * @see [getEnvironmentCertificate].
     * @param argument Builder for [com.pulumi.azure.containerapp.kotlin.inputs.GetEnvironmentCertificatePlainArgs].
     * @return A collection of values returned by getEnvironmentCertificate.
     */
    public suspend
    fun getEnvironmentCertificate(argument: suspend GetEnvironmentCertificatePlainArgsBuilder.() -> Unit):
        GetEnvironmentCertificateResult {
        val builder = GetEnvironmentCertificatePlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getEnvironmentCertificateResultToKotlin(getEnvironmentCertificatePlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy