com.pulumi.azure.management.kotlin.ManagementFunctions.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.management.kotlin
import com.pulumi.azure.management.ManagementFunctions.getGroupPlain
import com.pulumi.azure.management.ManagementFunctions.getGroupTemplateDeploymentPlain
import com.pulumi.azure.management.kotlin.inputs.GetGroupPlainArgs
import com.pulumi.azure.management.kotlin.inputs.GetGroupPlainArgsBuilder
import com.pulumi.azure.management.kotlin.inputs.GetGroupTemplateDeploymentPlainArgs
import com.pulumi.azure.management.kotlin.inputs.GetGroupTemplateDeploymentPlainArgsBuilder
import com.pulumi.azure.management.kotlin.outputs.GetGroupResult
import com.pulumi.azure.management.kotlin.outputs.GetGroupTemplateDeploymentResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.azure.management.kotlin.outputs.GetGroupResult.Companion.toKotlin as getGroupResultToKotlin
import com.pulumi.azure.management.kotlin.outputs.GetGroupTemplateDeploymentResult.Companion.toKotlin as getGroupTemplateDeploymentResultToKotlin
public object ManagementFunctions {
/**
* Use this data source to access information about an existing Management Group.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.management.getGroup({
* name: "00000000-0000-0000-0000-000000000000",
* });
* export const displayName = example.then(example => example.displayName);
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.management.get_group(name="00000000-0000-0000-0000-000000000000")
* pulumi.export("displayName", example.display_name)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.Management.GetGroup.Invoke(new()
* {
* Name = "00000000-0000-0000-0000-000000000000",
* });
* return new Dictionary
* {
* ["displayName"] = example.Apply(getGroupResult => getGroupResult.DisplayName),
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := management.LookupGroup(ctx, &management.LookupGroupArgs{
* Name: pulumi.StringRef("00000000-0000-0000-0000-000000000000"),
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("displayName", example.DisplayName)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.management.ManagementFunctions;
* import com.pulumi.azure.management.inputs.GetGroupArgs;
* 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 = ManagementFunctions.getGroup(GetGroupArgs.builder()
* .name("00000000-0000-0000-0000-000000000000")
* .build());
* ctx.export("displayName", example.applyValue(getGroupResult -> getGroupResult.displayName()));
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:management:getGroup
* Arguments:
* name: 00000000-0000-0000-0000-000000000000
* outputs:
* displayName: ${example.displayName}
* ```
*
* @param argument A collection of arguments for invoking getGroup.
* @return A collection of values returned by getGroup.
*/
public suspend fun getGroup(argument: GetGroupPlainArgs): GetGroupResult =
getGroupResultToKotlin(getGroupPlain(argument.toJava()).await())
/**
* @see [getGroup].
* @param displayName Specifies the display name of this Management Group.
* > **NOTE** Whilst multiple management groups may share the same display name, when filtering, the provider expects a single management group to be found with this name.
* @param name Specifies the name or UUID of this Management Group.
* @return A collection of values returned by getGroup.
*/
public suspend fun getGroup(displayName: String? = null, name: String? = null): GetGroupResult {
val argument = GetGroupPlainArgs(
displayName = displayName,
name = name,
)
return getGroupResultToKotlin(getGroupPlain(argument.toJava()).await())
}
/**
* @see [getGroup].
* @param argument Builder for [com.pulumi.azure.management.kotlin.inputs.GetGroupPlainArgs].
* @return A collection of values returned by getGroup.
*/
public suspend fun getGroup(argument: suspend GetGroupPlainArgsBuilder.() -> Unit): GetGroupResult {
val builder = GetGroupPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getGroupResultToKotlin(getGroupPlain(builtArgument.toJava()).await())
}
/**
* Use this data source to access information about an existing Management Group Template Deployment.
* @param argument A collection of arguments for invoking getGroupTemplateDeployment.
* @return A collection of values returned by getGroupTemplateDeployment.
*/
public suspend fun getGroupTemplateDeployment(argument: GetGroupTemplateDeploymentPlainArgs): GetGroupTemplateDeploymentResult =
getGroupTemplateDeploymentResultToKotlin(getGroupTemplateDeploymentPlain(argument.toJava()).await())
/**
* @see [getGroupTemplateDeployment].
* @param managementGroupId The ID of the Management Group to which this template was applied.
* @param name The name of this Management Group Template Deployment.
* @return A collection of values returned by getGroupTemplateDeployment.
*/
public suspend fun getGroupTemplateDeployment(managementGroupId: String, name: String): GetGroupTemplateDeploymentResult {
val argument = GetGroupTemplateDeploymentPlainArgs(
managementGroupId = managementGroupId,
name = name,
)
return getGroupTemplateDeploymentResultToKotlin(getGroupTemplateDeploymentPlain(argument.toJava()).await())
}
/**
* @see [getGroupTemplateDeployment].
* @param argument Builder for [com.pulumi.azure.management.kotlin.inputs.GetGroupTemplateDeploymentPlainArgs].
* @return A collection of values returned by getGroupTemplateDeployment.
*/
public suspend fun getGroupTemplateDeployment(argument: suspend GetGroupTemplateDeploymentPlainArgsBuilder.() -> Unit): GetGroupTemplateDeploymentResult {
val builder = GetGroupTemplateDeploymentPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return getGroupTemplateDeploymentResultToKotlin(getGroupTemplateDeploymentPlain(builtArgument.toJava()).await())
}
}