com.pulumi.azure.expressroute.kotlin.ExpressrouteFunctions.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.expressroute.kotlin
import com.pulumi.azure.expressroute.ExpressrouteFunctions.getCircuitPeeringPlain
import com.pulumi.azure.expressroute.kotlin.inputs.GetCircuitPeeringPlainArgs
import com.pulumi.azure.expressroute.kotlin.inputs.GetCircuitPeeringPlainArgsBuilder
import com.pulumi.azure.expressroute.kotlin.outputs.GetCircuitPeeringResult
import com.pulumi.azure.expressroute.kotlin.outputs.GetCircuitPeeringResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
public object ExpressrouteFunctions {
/**
* Use this data source to access information about an existing ExpressRoute Circuit Peering.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.expressroute.getCircuitPeering({
* peeringType: "example-peering",
* expressRouteCircuitName: "example-expressroute",
* resourceGroupName: "example-resources",
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.expressroute.get_circuit_peering(peering_type="example-peering",
* express_route_circuit_name="example-expressroute",
* 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.ExpressRoute.GetCircuitPeering.Invoke(new()
* {
* PeeringType = "example-peering",
* ExpressRouteCircuitName = "example-expressroute",
* ResourceGroupName = "example-resources",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/expressroute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := expressroute.GetCircuitPeering(ctx, &expressroute.GetCircuitPeeringArgs{
* PeeringType: "example-peering",
* ExpressRouteCircuitName: "example-expressroute",
* 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.expressroute.ExpressrouteFunctions;
* import com.pulumi.azure.expressroute.inputs.GetCircuitPeeringArgs;
* 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 = ExpressrouteFunctions.getCircuitPeering(GetCircuitPeeringArgs.builder()
* .peeringType("example-peering")
* .expressRouteCircuitName("example-expressroute")
* .resourceGroupName("example-resources")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:expressroute:getCircuitPeering
* Arguments:
* peeringType: example-peering
* expressRouteCircuitName: example-expressroute
* resourceGroupName: example-resources
* ```
*
* @param argument A collection of arguments for invoking getCircuitPeering.
* @return A collection of values returned by getCircuitPeering.
*/
public suspend fun getCircuitPeering(argument: GetCircuitPeeringPlainArgs): GetCircuitPeeringResult = toKotlin(getCircuitPeeringPlain(argument.toJava()).await())
/**
* @see [getCircuitPeering].
* @param expressRouteCircuitName The name of the ExpressRoute Circuit in which to create the Peering. Changing this forces a new resource to be created.
* @param peeringType The type of the ExpressRoute Circuit Peering. Acceptable values include `AzurePrivatePeering`, `AzurePublicPeering` and `MicrosoftPeering`.
* @param resourceGroupName The name of the resource group in which to create the Express Route Circuit Peering. Changing this forces a new resource to be created.
* @return A collection of values returned by getCircuitPeering.
*/
public suspend fun getCircuitPeering(
expressRouteCircuitName: String,
peeringType: String,
resourceGroupName: String,
): GetCircuitPeeringResult {
val argument = GetCircuitPeeringPlainArgs(
expressRouteCircuitName = expressRouteCircuitName,
peeringType = peeringType,
resourceGroupName = resourceGroupName,
)
return toKotlin(getCircuitPeeringPlain(argument.toJava()).await())
}
/**
* @see [getCircuitPeering].
* @param argument Builder for [com.pulumi.azure.expressroute.kotlin.inputs.GetCircuitPeeringPlainArgs].
* @return A collection of values returned by getCircuitPeering.
*/
public suspend fun getCircuitPeering(argument: suspend GetCircuitPeeringPlainArgsBuilder.() -> Unit): GetCircuitPeeringResult {
val builder = GetCircuitPeeringPlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getCircuitPeeringPlain(builtArgument.toJava()).await())
}
}