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

com.pulumi.gcp.filestore.kotlin.FilestoreFunctions.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.13.1.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.filestore.kotlin

import com.pulumi.gcp.filestore.FilestoreFunctions.getInstancePlain
import com.pulumi.gcp.filestore.kotlin.inputs.GetInstancePlainArgs
import com.pulumi.gcp.filestore.kotlin.inputs.GetInstancePlainArgsBuilder
import com.pulumi.gcp.filestore.kotlin.outputs.GetInstanceResult
import com.pulumi.gcp.filestore.kotlin.outputs.GetInstanceResult.Companion.toKotlin
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit

public object FilestoreFunctions {
    /**
     * Get info about a Google Cloud Filestore instance.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const myInstance = gcp.filestore.getInstance({
     *     name: "my-filestore-instance",
     * });
     * export const instanceIpAddresses = myInstance.then(myInstance => myInstance.networks?.ipAddresses);
     * export const instanceConnectMode = myInstance.then(myInstance => myInstance.networks?.connectMode);
     * export const instanceFileShareName = myInstance.then(myInstance => myInstance.fileShares?.name);
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * my_instance = gcp.filestore.get_instance(name="my-filestore-instance")
     * pulumi.export("instanceIpAddresses", my_instance.networks.ip_addresses)
     * pulumi.export("instanceConnectMode", my_instance.networks.connect_mode)
     * pulumi.export("instanceFileShareName", my_instance.file_shares.name)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var myInstance = Gcp.Filestore.GetInstance.Invoke(new()
     *     {
     *         Name = "my-filestore-instance",
     *     });
     *     return new Dictionary
     *     {
     *         ["instanceIpAddresses"] = myInstance.Apply(getInstanceResult => getInstanceResult.Networks?.IpAddresses),
     *         ["instanceConnectMode"] = myInstance.Apply(getInstanceResult => getInstanceResult.Networks?.ConnectMode),
     *         ["instanceFileShareName"] = myInstance.Apply(getInstanceResult => getInstanceResult.FileShares?.Name),
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/filestore"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		myInstance, err := filestore.LookupInstance(ctx, &filestore.LookupInstanceArgs{
     * 			Name: "my-filestore-instance",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("instanceIpAddresses", myInstance.Networks.IpAddresses)
     * 		ctx.Export("instanceConnectMode", myInstance.Networks.ConnectMode)
     * 		ctx.Export("instanceFileShareName", myInstance.FileShares.Name)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.gcp.filestore.FilestoreFunctions;
     * import com.pulumi.gcp.filestore.inputs.GetInstanceArgs;
     * 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 myInstance = FilestoreFunctions.getInstance(GetInstanceArgs.builder()
     *             .name("my-filestore-instance")
     *             .build());
     *         ctx.export("instanceIpAddresses", myInstance.applyValue(getInstanceResult -> getInstanceResult.networks().ipAddresses()));
     *         ctx.export("instanceConnectMode", myInstance.applyValue(getInstanceResult -> getInstanceResult.networks().connectMode()));
     *         ctx.export("instanceFileShareName", myInstance.applyValue(getInstanceResult -> getInstanceResult.fileShares().name()));
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   myInstance:
     *     fn::invoke:
     *       function: gcp:filestore:getInstance
     *       arguments:
     *         name: my-filestore-instance
     * outputs:
     *   instanceIpAddresses: ${myInstance.networks.ipAddresses}
     *   instanceConnectMode: ${myInstance.networks.connectMode}
     *   instanceFileShareName: ${myInstance.fileShares.name}
     * ```
     * 
     * @param argument A collection of arguments for invoking getInstance.
     * @return A collection of values returned by getInstance.
     */
    public suspend fun getInstance(argument: GetInstancePlainArgs): GetInstanceResult =
        toKotlin(getInstancePlain(argument.toJava()).await())

    /**
     * @see [getInstance].
     * @param location The name of the location of the instance. This
     * can be a region for ENTERPRISE tier instances. If it is not provided,
     * the provider region or zone is used.
     * @param name The name of a Filestore instance.
     * - - -
     * @param project The project in which the resource belongs. If it
     * is not provided, the provider project is used.
     * @return A collection of values returned by getInstance.
     */
    public suspend fun getInstance(
        location: String? = null,
        name: String,
        project: String? = null,
    ): GetInstanceResult {
        val argument = GetInstancePlainArgs(
            location = location,
            name = name,
            project = project,
        )
        return toKotlin(getInstancePlain(argument.toJava()).await())
    }

    /**
     * @see [getInstance].
     * @param argument Builder for [com.pulumi.gcp.filestore.kotlin.inputs.GetInstancePlainArgs].
     * @return A collection of values returned by getInstance.
     */
    public suspend fun getInstance(argument: suspend GetInstancePlainArgsBuilder.() -> Unit): GetInstanceResult {
        val builder = GetInstancePlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return toKotlin(getInstancePlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy