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

com.pulumi.azure.mariadb.kotlin.MariadbFunctions.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.mariadb.kotlin

import com.pulumi.azure.mariadb.MariadbFunctions.getMariaDbServerPlain
import com.pulumi.azure.mariadb.kotlin.inputs.GetMariaDbServerPlainArgs
import com.pulumi.azure.mariadb.kotlin.inputs.GetMariaDbServerPlainArgsBuilder
import com.pulumi.azure.mariadb.kotlin.outputs.GetMariaDbServerResult
import com.pulumi.azure.mariadb.kotlin.outputs.GetMariaDbServerResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

public object MariadbFunctions {
    /**
     * Use this data source to access information about an existing MariaDB Server.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as azure from "@pulumi/azure";
     * const dbServer = azure.mariadb.getMariaDbServer({
     *     name: "mariadb-server",
     *     resourceGroupName: example.resourceGroupName,
     * });
     * export const mariadbServerId = exampleAzurermMariadbServer.id;
     * ```
     * ```python
     * import pulumi
     * import pulumi_azure as azure
     * db_server = azure.mariadb.get_maria_db_server(name="mariadb-server",
     *     resource_group_name=example["resourceGroupName"])
     * pulumi.export("mariadbServerId", example_azurerm_mariadb_server["id"])
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Azure = Pulumi.Azure;
     * return await Deployment.RunAsync(() =>
     * {
     *     var dbServer = Azure.MariaDB.GetMariaDbServer.Invoke(new()
     *     {
     *         Name = "mariadb-server",
     *         ResourceGroupName = example.ResourceGroupName,
     *     });
     *     return new Dictionary
     *     {
     *         ["mariadbServerId"] = exampleAzurermMariadbServer.Id,
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/mariadb"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := mariadb.GetMariaDbServer(ctx, &mariadb.GetMariaDbServerArgs{
     * 			Name:              "mariadb-server",
     * 			ResourceGroupName: example.ResourceGroupName,
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("mariadbServerId", exampleAzurermMariadbServer.Id)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.azure.mariadb.MariadbFunctions;
     * import com.pulumi.azure.mariadb.inputs.GetMariaDbServerArgs;
     * 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 dbServer = MariadbFunctions.getMariaDbServer(GetMariaDbServerArgs.builder()
     *             .name("mariadb-server")
     *             .resourceGroupName(example.resourceGroupName())
     *             .build());
     *         ctx.export("mariadbServerId", exampleAzurermMariadbServer.id());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   dbServer:
     *     fn::invoke:
     *       Function: azure:mariadb:getMariaDbServer
     *       Arguments:
     *         name: mariadb-server
     *         resourceGroupName: ${example.resourceGroupName}
     * outputs:
     *   mariadbServerId: ${exampleAzurermMariadbServer.id}
     * ```
     * 
     * @param argument A collection of arguments for invoking getMariaDbServer.
     * @return A collection of values returned by getMariaDbServer.
     */
    public suspend fun getMariaDbServer(argument: GetMariaDbServerPlainArgs): GetMariaDbServerResult =
        toKotlin(getMariaDbServerPlain(argument.toJava()).await())

    /**
     * @see [getMariaDbServer].
     * @param name The name of the MariaDB Server to retrieve information about.
     * @param resourceGroupName The name of the resource group where the MariaDB Server exists.
     * @return A collection of values returned by getMariaDbServer.
     */
    public suspend fun getMariaDbServer(name: String, resourceGroupName: String): GetMariaDbServerResult {
        val argument = GetMariaDbServerPlainArgs(
            name = name,
            resourceGroupName = resourceGroupName,
        )
        return toKotlin(getMariaDbServerPlain(argument.toJava()).await())
    }

    /**
     * @see [getMariaDbServer].
     * @param argument Builder for [com.pulumi.azure.mariadb.kotlin.inputs.GetMariaDbServerPlainArgs].
     * @return A collection of values returned by getMariaDbServer.
     */
    public suspend fun getMariaDbServer(argument: suspend GetMariaDbServerPlainArgsBuilder.() -> Unit): GetMariaDbServerResult {
        val builder = GetMariaDbServerPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return toKotlin(getMariaDbServerPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy