com.pulumi.azure.domainservices.kotlin.DomainservicesFunctions.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.domainservices.kotlin
import com.pulumi.azure.domainservices.DomainservicesFunctions.getServicePlain
import com.pulumi.azure.domainservices.kotlin.inputs.GetServicePlainArgs
import com.pulumi.azure.domainservices.kotlin.inputs.GetServicePlainArgsBuilder
import com.pulumi.azure.domainservices.kotlin.outputs.GetServiceResult
import com.pulumi.azure.domainservices.kotlin.outputs.GetServiceResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
public object DomainservicesFunctions {
/**
* Gets information about an Active Directory Domain Service.
* > **Supported Modes:** At present this data source only supports **User Forest** mode and _not_ **Resource Forest** mode. [Read more](https://docs.microsoft.com/azure/active-directory-domain-services/concepts-resource-forest) about the different operation modes for this service.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.domainservices.getService({
* name: "example-aadds",
* resourceGroupName: "example-aadds-rg",
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.domainservices.get_service(name="example-aadds",
* resource_group_name="example-aadds-rg")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.DomainServices.GetService.Invoke(new()
* {
* Name = "example-aadds",
* ResourceGroupName = "example-aadds-rg",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/domainservices"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := domainservices.LookupService(ctx, &domainservices.LookupServiceArgs{
* Name: "example-aadds",
* ResourceGroupName: "example-aadds-rg",
* }, 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.domainservices.DomainservicesFunctions;
* import com.pulumi.azure.domainservices.inputs.GetServiceArgs;
* 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 = DomainservicesFunctions.getService(GetServiceArgs.builder()
* .name("example-aadds")
* .resourceGroupName("example-aadds-rg")
* .build());
* }
* }
* ```
* ```yaml
* variables:
* example:
* fn::invoke:
* Function: azure:domainservices:getService
* Arguments:
* name: example-aadds
* resourceGroupName: example-aadds-rg
* ```
*
* @param argument A collection of arguments for invoking getService.
* @return A collection of values returned by getService.
*/
public suspend fun getService(argument: GetServicePlainArgs): GetServiceResult =
toKotlin(getServicePlain(argument.toJava()).await())
/**
* @see [getService].
* @param name The display name for your managed Active Directory Domain Service resource. Changing this forces a new resource to be created.
* @param resourceGroupName The name of the Resource Group in which the Domain Service should exist. Changing this forces a new resource to be created.
* @param tags A mapping of tags assigned to the resource.
* @return A collection of values returned by getService.
*/
public suspend fun getService(
name: String,
resourceGroupName: String,
tags: Map? = null,
): GetServiceResult {
val argument = GetServicePlainArgs(
name = name,
resourceGroupName = resourceGroupName,
tags = tags,
)
return toKotlin(getServicePlain(argument.toJava()).await())
}
/**
* @see [getService].
* @param argument Builder for [com.pulumi.azure.domainservices.kotlin.inputs.GetServicePlainArgs].
* @return A collection of values returned by getService.
*/
public suspend fun getService(argument: suspend GetServicePlainArgsBuilder.() -> Unit): GetServiceResult {
val builder = GetServicePlainArgsBuilder()
builder.argument()
val builtArgument = builder.build()
return toKotlin(getServicePlain(builtArgument.toJava()).await())
}
}