com.pulumi.azure.proximity.kotlin.ProximityFunctions.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.proximity.kotlin
import com.pulumi.azure.proximity.ProximityFunctions.getPlacementGroupPlain
import com.pulumi.azure.proximity.kotlin.inputs.GetPlacementGroupPlainArgs
import com.pulumi.azure.proximity.kotlin.inputs.GetPlacementGroupPlainArgsBuilder
import com.pulumi.azure.proximity.kotlin.outputs.GetPlacementGroupResult
import com.pulumi.azure.proximity.kotlin.outputs.GetPlacementGroupResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object ProximityFunctions {
/**
* Use this data source to access information about an existing Proximity Placement Group.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.proximity.getPlacementGroup({
* name: "tf-appsecuritygroup",
* resourceGroupName: "my-resource-group",
* });
* export const proximityPlacementGroupId = example.then(example => example.id);
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.proximity.get_placement_group(name="tf-appsecuritygroup",
* resource_group_name="my-resource-group")
* pulumi.export("proximityPlacementGroupId", example.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.Proximity.GetPlacementGroup.Invoke(new()
* {
* Name = "tf-appsecuritygroup",
* ResourceGroupName = "my-resource-group",
* });
* return new Dictionary
* {
* ["proximityPlacementGroupId"] = example.Apply(getPlacementGroupResult => getPlacementGroupResult.Id),
* };
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/proximity"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := proximity.LookupPlacementGroup(ctx, &proximity.LookupPlacementGroupArgs{
* Name: "tf-appsecuritygroup",
* ResourceGroupName: "my-resource-group",
* }, nil)
* if err != nil {
* return err
* }
* ctx.Export("proximityPlacementGroupId", example.Id)
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.proximity.ProximityFunctions;
* import com.pulumi.azure.proximity.inputs.GetPlacementGroupArgs;
* 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 = ProximityFunctions.getPlacementGroup(GetPlacementGroupArgs.builder()
* .name("tf-appsecuritygroup")
* .resourceGroupName("my-resource-group")
* .build());
* ctx.export("proximityPlacementGroupId", example.applyValue(getPlacementGroupResult -> getPlacementGroupResult.id()));
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:proximity:getPlacementGroup
* Arguments:
* name: tf-appsecuritygroup
* resourceGroupName: my-resource-group
* outputs:
* proximityPlacementGroupId: ${example.id}
* ```
*
* @param argument A collection of arguments for invoking getPlacementGroup.
* @return A collection of values returned by getPlacementGroup.
*/
public suspend fun getPlacementGroup(argument: GetPlacementGroupPlainArgs): GetPlacementGroupResult = toKotlin(getPlacementGroupPlain(argument.toJava()).await())
/**
* @see [getPlacementGroup].
* @param name The name of the Proximity Placement Group.
* @param resourceGroupName The name of the resource group in which the Proximity Placement Group exists.
* @return A collection of values returned by getPlacementGroup.
*/
public suspend fun getPlacementGroup(name: String, resourceGroupName: String): GetPlacementGroupResult {
val argument = GetPlacementGroupPlainArgs(
name = name,
resourceGroupName = resourceGroupName,
)
return toKotlin(getPlacementGroupPlain(argument.toJava()).await())
}
/**
* @see [getPlacementGroup].
* @param argument Builder for [com.pulumi.azure.proximity.kotlin.inputs.GetPlacementGroupPlainArgs].
* @return A collection of values returned by getPlacementGroup.
*/
public suspend fun getPlacementGroup(argument: suspend GetPlacementGroupPlainArgsBuilder.() -> Unit): GetPlacementGroupResult {
val builder = GetPlacementGroupPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getPlacementGroupPlain(builtArgument.toJava()).await())
}
}