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

com.pulumi.gcp.container.kotlin.ContainerFunctions.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.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.container.kotlin

import com.pulumi.gcp.container.ContainerFunctions.getAttachedInstallManifestPlain
import com.pulumi.gcp.container.ContainerFunctions.getAttachedVersionsPlain
import com.pulumi.gcp.container.ContainerFunctions.getAwsVersionsPlain
import com.pulumi.gcp.container.ContainerFunctions.getAzureVersionsPlain
import com.pulumi.gcp.container.ContainerFunctions.getClusterPlain
import com.pulumi.gcp.container.ContainerFunctions.getEngineVersionsPlain
import com.pulumi.gcp.container.ContainerFunctions.getRegistryImagePlain
import com.pulumi.gcp.container.ContainerFunctions.getRegistryRepositoryPlain
import com.pulumi.gcp.container.kotlin.inputs.GetAttachedInstallManifestPlainArgs
import com.pulumi.gcp.container.kotlin.inputs.GetAttachedInstallManifestPlainArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.GetAttachedVersionsPlainArgs
import com.pulumi.gcp.container.kotlin.inputs.GetAttachedVersionsPlainArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.GetAwsVersionsPlainArgs
import com.pulumi.gcp.container.kotlin.inputs.GetAwsVersionsPlainArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.GetAzureVersionsPlainArgs
import com.pulumi.gcp.container.kotlin.inputs.GetAzureVersionsPlainArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.GetClusterPlainArgs
import com.pulumi.gcp.container.kotlin.inputs.GetClusterPlainArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.GetEngineVersionsPlainArgs
import com.pulumi.gcp.container.kotlin.inputs.GetEngineVersionsPlainArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.GetRegistryImagePlainArgs
import com.pulumi.gcp.container.kotlin.inputs.GetRegistryImagePlainArgsBuilder
import com.pulumi.gcp.container.kotlin.inputs.GetRegistryRepositoryPlainArgs
import com.pulumi.gcp.container.kotlin.inputs.GetRegistryRepositoryPlainArgsBuilder
import com.pulumi.gcp.container.kotlin.outputs.GetAttachedInstallManifestResult
import com.pulumi.gcp.container.kotlin.outputs.GetAttachedVersionsResult
import com.pulumi.gcp.container.kotlin.outputs.GetAwsVersionsResult
import com.pulumi.gcp.container.kotlin.outputs.GetAzureVersionsResult
import com.pulumi.gcp.container.kotlin.outputs.GetClusterResult
import com.pulumi.gcp.container.kotlin.outputs.GetEngineVersionsResult
import com.pulumi.gcp.container.kotlin.outputs.GetRegistryImageResult
import com.pulumi.gcp.container.kotlin.outputs.GetRegistryRepositoryResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.container.kotlin.outputs.GetAttachedInstallManifestResult.Companion.toKotlin as getAttachedInstallManifestResultToKotlin
import com.pulumi.gcp.container.kotlin.outputs.GetAttachedVersionsResult.Companion.toKotlin as getAttachedVersionsResultToKotlin
import com.pulumi.gcp.container.kotlin.outputs.GetAwsVersionsResult.Companion.toKotlin as getAwsVersionsResultToKotlin
import com.pulumi.gcp.container.kotlin.outputs.GetAzureVersionsResult.Companion.toKotlin as getAzureVersionsResultToKotlin
import com.pulumi.gcp.container.kotlin.outputs.GetClusterResult.Companion.toKotlin as getClusterResultToKotlin
import com.pulumi.gcp.container.kotlin.outputs.GetEngineVersionsResult.Companion.toKotlin as getEngineVersionsResultToKotlin
import com.pulumi.gcp.container.kotlin.outputs.GetRegistryImageResult.Companion.toKotlin as getRegistryImageResultToKotlin
import com.pulumi.gcp.container.kotlin.outputs.GetRegistryRepositoryResult.Companion.toKotlin as getRegistryRepositoryResultToKotlin

public object ContainerFunctions {
    /**
     * Provides access to available platform versions in a location for a given project.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const manifest = gcp.container.getAttachedInstallManifest({
     *     location: "us-west1",
     *     project: "my-project",
     *     clusterId: "test-cluster-1",
     *     platformVersion: "1.25.0-gke.1",
     * });
     * export const installManifest = manifest;
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * manifest = gcp.container.get_attached_install_manifest(location="us-west1",
     *     project="my-project",
     *     cluster_id="test-cluster-1",
     *     platform_version="1.25.0-gke.1")
     * pulumi.export("installManifest", manifest)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var manifest = Gcp.Container.GetAttachedInstallManifest.Invoke(new()
     *     {
     *         Location = "us-west1",
     *         Project = "my-project",
     *         ClusterId = "test-cluster-1",
     *         PlatformVersion = "1.25.0-gke.1",
     *     });
     *     return new Dictionary
     *     {
     *         ["installManifest"] = manifest,
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		manifest, err := container.GetAttachedInstallManifest(ctx, &container.GetAttachedInstallManifestArgs{
     * 			Location:        "us-west1",
     * 			Project:         "my-project",
     * 			ClusterId:       "test-cluster-1",
     * 			PlatformVersion: "1.25.0-gke.1",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("installManifest", manifest)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.gcp.container.ContainerFunctions;
     * import com.pulumi.gcp.container.inputs.GetAttachedInstallManifestArgs;
     * 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 manifest = ContainerFunctions.getAttachedInstallManifest(GetAttachedInstallManifestArgs.builder()
     *             .location("us-west1")
     *             .project("my-project")
     *             .clusterId("test-cluster-1")
     *             .platformVersion("1.25.0-gke.1")
     *             .build());
     *         ctx.export("installManifest", manifest.applyValue(getAttachedInstallManifestResult -> getAttachedInstallManifestResult));
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   manifest:
     *     fn::invoke:
     *       Function: gcp:container:getAttachedInstallManifest
     *       Arguments:
     *         location: us-west1
     *         project: my-project
     *         clusterId: test-cluster-1
     *         platformVersion: 1.25.0-gke.1
     * outputs:
     *   installManifest: ${manifest}
     * ```
     * 
     * @param argument A collection of arguments for invoking getAttachedInstallManifest.
     * @return A collection of values returned by getAttachedInstallManifest.
     */
    public suspend fun getAttachedInstallManifest(argument: GetAttachedInstallManifestPlainArgs): GetAttachedInstallManifestResult =
        getAttachedInstallManifestResultToKotlin(getAttachedInstallManifestPlain(argument.toJava()).await())

    /**
     * @see [getAttachedInstallManifest].
     * @param clusterId The name that will be used when creating the attached cluster resource.
     * @param location The location to list versions for.
     * @param platformVersion The platform version for the cluster. A list of valid values can be retrieved using the `gcp.container.getAttachedVersions` data source.
     * @param project ID of the project to list available platform versions for. Should match the project the cluster will be deployed to.
     * Defaults to the project that the provider is authenticated with.
     * @return A collection of values returned by getAttachedInstallManifest.
     */
    public suspend fun getAttachedInstallManifest(
        clusterId: String,
        location: String,
        platformVersion: String,
        project: String,
    ): GetAttachedInstallManifestResult {
        val argument = GetAttachedInstallManifestPlainArgs(
            clusterId = clusterId,
            location = location,
            platformVersion = platformVersion,
            project = project,
        )
        return getAttachedInstallManifestResultToKotlin(getAttachedInstallManifestPlain(argument.toJava()).await())
    }

    /**
     * @see [getAttachedInstallManifest].
     * @param argument Builder for [com.pulumi.gcp.container.kotlin.inputs.GetAttachedInstallManifestPlainArgs].
     * @return A collection of values returned by getAttachedInstallManifest.
     */
    public suspend fun getAttachedInstallManifest(argument: suspend GetAttachedInstallManifestPlainArgsBuilder.() -> Unit): GetAttachedInstallManifestResult {
        val builder = GetAttachedInstallManifestPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getAttachedInstallManifestResultToKotlin(getAttachedInstallManifestPlain(builtArgument.toJava()).await())
    }

    /**
     * Provides access to available platform versions in a location for a given project.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const uswest = gcp.container.getAttachedVersions({
     *     location: "us-west1",
     *     project: "my-project",
     * });
     * export const firstAvailableVersion = versions.validVersions[0];
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * uswest = gcp.container.get_attached_versions(location="us-west1",
     *     project="my-project")
     * pulumi.export("firstAvailableVersion", versions["validVersions"])
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var uswest = Gcp.Container.GetAttachedVersions.Invoke(new()
     *     {
     *         Location = "us-west1",
     *         Project = "my-project",
     *     });
     *     return new Dictionary
     *     {
     *         ["firstAvailableVersion"] = versions.ValidVersions[0],
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := container.GetAttachedVersions(ctx, &container.GetAttachedVersionsArgs{
     * 			Location: "us-west1",
     * 			Project:  "my-project",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("firstAvailableVersion", versions.ValidVersions[0])
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.gcp.container.ContainerFunctions;
     * import com.pulumi.gcp.container.inputs.GetAttachedVersionsArgs;
     * 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 uswest = ContainerFunctions.getAttachedVersions(GetAttachedVersionsArgs.builder()
     *             .location("us-west1")
     *             .project("my-project")
     *             .build());
     *         ctx.export("firstAvailableVersion", versions.validVersions()[0]);
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   uswest:
     *     fn::invoke:
     *       Function: gcp:container:getAttachedVersions
     *       Arguments:
     *         location: us-west1
     *         project: my-project
     * outputs:
     *   firstAvailableVersion: ${versions.validVersions[0]}
     * ```
     * 
     * @param argument A collection of arguments for invoking getAttachedVersions.
     * @return A collection of values returned by getAttachedVersions.
     */
    public suspend fun getAttachedVersions(argument: GetAttachedVersionsPlainArgs): GetAttachedVersionsResult =
        getAttachedVersionsResultToKotlin(getAttachedVersionsPlain(argument.toJava()).await())

    /**
     * @see [getAttachedVersions].
     * @param location The location to list versions for.
     * @param project ID of the project to list available platform versions for. Should match the project the cluster will be deployed to.
     * Defaults to the project that the provider is authenticated with.
     * @return A collection of values returned by getAttachedVersions.
     */
    public suspend fun getAttachedVersions(location: String, project: String): GetAttachedVersionsResult {
        val argument = GetAttachedVersionsPlainArgs(
            location = location,
            project = project,
        )
        return getAttachedVersionsResultToKotlin(getAttachedVersionsPlain(argument.toJava()).await())
    }

    /**
     * @see [getAttachedVersions].
     * @param argument Builder for [com.pulumi.gcp.container.kotlin.inputs.GetAttachedVersionsPlainArgs].
     * @return A collection of values returned by getAttachedVersions.
     */
    public suspend fun getAttachedVersions(argument: suspend GetAttachedVersionsPlainArgsBuilder.() -> Unit): GetAttachedVersionsResult {
        val builder = GetAttachedVersionsPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getAttachedVersionsResultToKotlin(getAttachedVersionsPlain(builtArgument.toJava()).await())
    }

    /**
     * Provides access to available Kubernetes versions in a location for a given project.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const central1b = gcp.container.getAwsVersions({
     *     location: "us-west1",
     *     project: "my-project",
     * });
     * export const firstAvailableVersion = versions.validVersions[0];
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * central1b = gcp.container.get_aws_versions(location="us-west1",
     *     project="my-project")
     * pulumi.export("firstAvailableVersion", versions["validVersions"])
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var central1b = Gcp.Container.GetAwsVersions.Invoke(new()
     *     {
     *         Location = "us-west1",
     *         Project = "my-project",
     *     });
     *     return new Dictionary
     *     {
     *         ["firstAvailableVersion"] = versions.ValidVersions[0],
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := container.GetAwsVersions(ctx, &container.GetAwsVersionsArgs{
     * 			Location: pulumi.StringRef("us-west1"),
     * 			Project:  pulumi.StringRef("my-project"),
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("firstAvailableVersion", versions.ValidVersions[0])
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.gcp.container.ContainerFunctions;
     * import com.pulumi.gcp.container.inputs.GetAwsVersionsArgs;
     * 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 central1b = ContainerFunctions.getAwsVersions(GetAwsVersionsArgs.builder()
     *             .location("us-west1")
     *             .project("my-project")
     *             .build());
     *         ctx.export("firstAvailableVersion", versions.validVersions()[0]);
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   central1b:
     *     fn::invoke:
     *       Function: gcp:container:getAwsVersions
     *       Arguments:
     *         location: us-west1
     *         project: my-project
     * outputs:
     *   firstAvailableVersion: ${versions.validVersions[0]}
     * ```
     * 
     * @param argument A collection of arguments for invoking getAwsVersions.
     * @return A collection of values returned by getAwsVersions.
     */
    public suspend fun getAwsVersions(argument: GetAwsVersionsPlainArgs): GetAwsVersionsResult =
        getAwsVersionsResultToKotlin(getAwsVersionsPlain(argument.toJava()).await())

    /**
     * @see [getAwsVersions].
     * @param location The location to list versions for.
     * @param project ID of the project to list available cluster versions for. Should match the project the cluster will be deployed to.
     * Defaults to the project that the provider is authenticated with.
     * @return A collection of values returned by getAwsVersions.
     */
    public suspend fun getAwsVersions(location: String? = null, project: String? = null): GetAwsVersionsResult {
        val argument = GetAwsVersionsPlainArgs(
            location = location,
            project = project,
        )
        return getAwsVersionsResultToKotlin(getAwsVersionsPlain(argument.toJava()).await())
    }

    /**
     * @see [getAwsVersions].
     * @param argument Builder for [com.pulumi.gcp.container.kotlin.inputs.GetAwsVersionsPlainArgs].
     * @return A collection of values returned by getAwsVersions.
     */
    public suspend fun getAwsVersions(argument: suspend GetAwsVersionsPlainArgsBuilder.() -> Unit): GetAwsVersionsResult {
        val builder = GetAwsVersionsPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getAwsVersionsResultToKotlin(getAwsVersionsPlain(builtArgument.toJava()).await())
    }

    /**
     * Provides access to available Kubernetes versions in a location for a given project.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const central1b = gcp.container.getAzureVersions({
     *     location: "us-west1",
     *     project: "my-project",
     * });
     * export const firstAvailableVersion = versions.validVersions[0];
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * central1b = gcp.container.get_azure_versions(location="us-west1",
     *     project="my-project")
     * pulumi.export("firstAvailableVersion", versions["validVersions"])
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var central1b = Gcp.Container.GetAzureVersions.Invoke(new()
     *     {
     *         Location = "us-west1",
     *         Project = "my-project",
     *     });
     *     return new Dictionary
     *     {
     *         ["firstAvailableVersion"] = versions.ValidVersions[0],
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		_, err := container.GetAzureVersions(ctx, &container.GetAzureVersionsArgs{
     * 			Location: pulumi.StringRef("us-west1"),
     * 			Project:  pulumi.StringRef("my-project"),
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("firstAvailableVersion", versions.ValidVersions[0])
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.gcp.container.ContainerFunctions;
     * import com.pulumi.gcp.container.inputs.GetAzureVersionsArgs;
     * 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 central1b = ContainerFunctions.getAzureVersions(GetAzureVersionsArgs.builder()
     *             .location("us-west1")
     *             .project("my-project")
     *             .build());
     *         ctx.export("firstAvailableVersion", versions.validVersions()[0]);
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   central1b:
     *     fn::invoke:
     *       Function: gcp:container:getAzureVersions
     *       Arguments:
     *         location: us-west1
     *         project: my-project
     * outputs:
     *   firstAvailableVersion: ${versions.validVersions[0]}
     * ```
     * 
     * @param argument A collection of arguments for invoking getAzureVersions.
     * @return A collection of values returned by getAzureVersions.
     */
    public suspend fun getAzureVersions(argument: GetAzureVersionsPlainArgs): GetAzureVersionsResult =
        getAzureVersionsResultToKotlin(getAzureVersionsPlain(argument.toJava()).await())

    /**
     * @see [getAzureVersions].
     * @param location The location to list versions for.
     * @param project ID of the project to list available cluster versions for. Should match the project the cluster will be deployed to.
     * Defaults to the project that the provider is authenticated with.
     * @return A collection of values returned by getAzureVersions.
     */
    public suspend fun getAzureVersions(location: String? = null, project: String? = null): GetAzureVersionsResult {
        val argument = GetAzureVersionsPlainArgs(
            location = location,
            project = project,
        )
        return getAzureVersionsResultToKotlin(getAzureVersionsPlain(argument.toJava()).await())
    }

    /**
     * @see [getAzureVersions].
     * @param argument Builder for [com.pulumi.gcp.container.kotlin.inputs.GetAzureVersionsPlainArgs].
     * @return A collection of values returned by getAzureVersions.
     */
    public suspend fun getAzureVersions(argument: suspend GetAzureVersionsPlainArgsBuilder.() -> Unit): GetAzureVersionsResult {
        val builder = GetAzureVersionsPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getAzureVersionsResultToKotlin(getAzureVersionsPlain(builtArgument.toJava()).await())
    }

    /**
     * Get info about a GKE cluster from its name and location.
     * ## Example Usage
     * ```tf
     * data "google_container_cluster" "my_cluster" {
     *   name     = "my-cluster"
     *   location = "us-east1-a"
     * }
     * output "endpoint" {
     *   value = data.google_container_cluster.my_cluster.endpoint
     * }
     * output "instance_group_urls" {
     *   value = data.google_container_cluster.my_cluster.node_pool[0].instance_group_urls
     * }
     * output "node_config" {
     *   value = data.google_container_cluster.my_cluster.node_config
     * }
     * output "node_pools" {
     *   value = data.google_container_cluster.my_cluster.node_pool
     * }
     * ```
     * @param argument A collection of arguments for invoking getCluster.
     * @return A collection of values returned by getCluster.
     */
    public suspend fun getCluster(argument: GetClusterPlainArgs): GetClusterResult =
        getClusterResultToKotlin(getClusterPlain(argument.toJava()).await())

    /**
     * @see [getCluster].
     * @param location The location (zone or region) this cluster has been
     * created in. One of `location`, `region`, `zone`, or a provider-level `zone` must
     * be specified.
     * @param name The name of the cluster.
     * @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 getCluster.
     */
    public suspend fun getCluster(
        location: String? = null,
        name: String,
        project: String? = null,
    ): GetClusterResult {
        val argument = GetClusterPlainArgs(
            location = location,
            name = name,
            project = project,
        )
        return getClusterResultToKotlin(getClusterPlain(argument.toJava()).await())
    }

    /**
     * @see [getCluster].
     * @param argument Builder for [com.pulumi.gcp.container.kotlin.inputs.GetClusterPlainArgs].
     * @return A collection of values returned by getCluster.
     */
    public suspend fun getCluster(argument: suspend GetClusterPlainArgsBuilder.() -> Unit): GetClusterResult {
        val builder = GetClusterPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getClusterResultToKotlin(getClusterPlain(builtArgument.toJava()).await())
    }

    /**
     * Provides access to available Google Kubernetes Engine versions in a zone or region for a given project.
     * > If you are using the `gcp.container.getEngineVersions` datasource with a
     * regional cluster, ensure that you have provided a region as the `location` to
     * the datasource. A region can have a different set of supported versions than
     * its component zones, and not all zones in a region are guaranteed to
     * support the same version.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const central1b = gcp.container.getEngineVersions({
     *     location: "us-central1-b",
     *     versionPrefix: "1.12.",
     * });
     * const foo = new gcp.container.Cluster("foo", {
     *     name: "test-cluster",
     *     location: "us-central1-b",
     *     nodeVersion: central1b.then(central1b => central1b.latestNodeVersion),
     *     initialNodeCount: 1,
     * });
     * export const stableChannelDefaultVersion = central1b.then(central1b => central1b.releaseChannelDefaultVersion?.STABLE);
     * export const stableChannelLatestVersion = central1b.then(central1b => central1b.releaseChannelLatestVersion?.STABLE);
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * central1b = gcp.container.get_engine_versions(location="us-central1-b",
     *     version_prefix="1.12.")
     * foo = gcp.container.Cluster("foo",
     *     name="test-cluster",
     *     location="us-central1-b",
     *     node_version=central1b.latest_node_version,
     *     initial_node_count=1)
     * pulumi.export("stableChannelDefaultVersion", central1b.release_channel_default_version["STABLE"])
     * pulumi.export("stableChannelLatestVersion", central1b.release_channel_latest_version["STABLE"])
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var central1b = Gcp.Container.GetEngineVersions.Invoke(new()
     *     {
     *         Location = "us-central1-b",
     *         VersionPrefix = "1.12.",
     *     });
     *     var foo = new Gcp.Container.Cluster("foo", new()
     *     {
     *         Name = "test-cluster",
     *         Location = "us-central1-b",
     *         NodeVersion = central1b.Apply(getEngineVersionsResult => getEngineVersionsResult.LatestNodeVersion),
     *         InitialNodeCount = 1,
     *     });
     *     return new Dictionary
     *     {
     *         ["stableChannelDefaultVersion"] = central1b.Apply(getEngineVersionsResult => getEngineVersionsResult.ReleaseChannelDefaultVersion?.STABLE),
     *         ["stableChannelLatestVersion"] = central1b.Apply(getEngineVersionsResult => getEngineVersionsResult.ReleaseChannelLatestVersion?.STABLE),
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		central1b, err := container.GetEngineVersions(ctx, &container.GetEngineVersionsArgs{
     * 			Location:      pulumi.StringRef("us-central1-b"),
     * 			VersionPrefix: pulumi.StringRef("1.12."),
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		_, err = container.NewCluster(ctx, "foo", &container.ClusterArgs{
     * 			Name:             pulumi.String("test-cluster"),
     * 			Location:         pulumi.String("us-central1-b"),
     * 			NodeVersion:      pulumi.String(central1b.LatestNodeVersion),
     * 			InitialNodeCount: pulumi.Int(1),
     * 		})
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("stableChannelDefaultVersion", central1b.ReleaseChannelDefaultVersion.STABLE)
     * 		ctx.Export("stableChannelLatestVersion", central1b.ReleaseChannelLatestVersion.STABLE)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.gcp.container.ContainerFunctions;
     * import com.pulumi.gcp.container.inputs.GetEngineVersionsArgs;
     * import com.pulumi.gcp.container.Cluster;
     * import com.pulumi.gcp.container.ClusterArgs;
     * 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 central1b = ContainerFunctions.getEngineVersions(GetEngineVersionsArgs.builder()
     *             .location("us-central1-b")
     *             .versionPrefix("1.12.")
     *             .build());
     *         var foo = new Cluster("foo", ClusterArgs.builder()
     *             .name("test-cluster")
     *             .location("us-central1-b")
     *             .nodeVersion(central1b.applyValue(getEngineVersionsResult -> getEngineVersionsResult.latestNodeVersion()))
     *             .initialNodeCount(1)
     *             .build());
     *         ctx.export("stableChannelDefaultVersion", central1b.applyValue(getEngineVersionsResult -> getEngineVersionsResult.releaseChannelDefaultVersion().STABLE()));
     *         ctx.export("stableChannelLatestVersion", central1b.applyValue(getEngineVersionsResult -> getEngineVersionsResult.releaseChannelLatestVersion().STABLE()));
     *     }
     * }
     * ```
     * ```yaml
     * resources:
     *   foo:
     *     type: gcp:container:Cluster
     *     properties:
     *       name: test-cluster
     *       location: us-central1-b
     *       nodeVersion: ${central1b.latestNodeVersion}
     *       initialNodeCount: 1
     * variables:
     *   central1b:
     *     fn::invoke:
     *       Function: gcp:container:getEngineVersions
     *       Arguments:
     *         location: us-central1-b
     *         versionPrefix: 1.12.
     * outputs:
     *   stableChannelDefaultVersion: ${central1b.releaseChannelDefaultVersion.STABLE}
     *   stableChannelLatestVersion: ${central1b.releaseChannelLatestVersion.STABLE}
     * ```
     * 
     * @param argument A collection of arguments for invoking getEngineVersions.
     * @return A collection of values returned by getEngineVersions.
     */
    public suspend fun getEngineVersions(argument: GetEngineVersionsPlainArgs): GetEngineVersionsResult =
        getEngineVersionsResultToKotlin(getEngineVersionsPlain(argument.toJava()).await())

    /**
     * @see [getEngineVersions].
     * @param location The location (region or zone) to list versions for.
     * Must exactly match the location the cluster will be deployed in, or listed
     * versions may not be available. If `location`, `region`, and `zone` are not
     * specified, the provider-level zone must be set and is used instead.
     * @param project ID of the project to list available cluster versions for. Should match the project the cluster will be deployed to.
     * Defaults to the project that the provider is authenticated with.
     * @param versionPrefix If provided, the provider will only return versions
     * that match the string prefix. For example, `1.11.` will match all `1.11` series
     * releases. Since this is just a string match, it's recommended that you append a
     * `.` after minor versions to ensure that prefixes such as `1.1` don't match
     * versions like `1.12.5-gke.10` accidentally. See [the docs on versioning schema](https://cloud.google.com/kubernetes-engine/versioning-and-upgrades#versioning_scheme)
     * for full details on how version strings are formatted.
     * @return A collection of values returned by getEngineVersions.
     */
    public suspend fun getEngineVersions(
        location: String? = null,
        project: String? = null,
        versionPrefix: String? = null,
    ): GetEngineVersionsResult {
        val argument = GetEngineVersionsPlainArgs(
            location = location,
            project = project,
            versionPrefix = versionPrefix,
        )
        return getEngineVersionsResultToKotlin(getEngineVersionsPlain(argument.toJava()).await())
    }

    /**
     * @see [getEngineVersions].
     * @param argument Builder for [com.pulumi.gcp.container.kotlin.inputs.GetEngineVersionsPlainArgs].
     * @return A collection of values returned by getEngineVersions.
     */
    public suspend fun getEngineVersions(argument: suspend GetEngineVersionsPlainArgsBuilder.() -> Unit): GetEngineVersionsResult {
        val builder = GetEngineVersionsPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getEngineVersionsResultToKotlin(getEngineVersionsPlain(builtArgument.toJava()).await())
    }

    /**
     * This data source fetches the project name, and provides the appropriate URLs to use for container registry for this project.
     * The URLs are computed entirely offline - as long as the project exists, they will be valid, but this data source does not contact Google Container Registry (GCR) at any point.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const debian = gcp.container.getRegistryImage({
     *     name: "debian",
     * });
     * export const gcrLocation = debian.then(debian => debian.imageUrl);
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * debian = gcp.container.get_registry_image(name="debian")
     * pulumi.export("gcrLocation", debian.image_url)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var debian = Gcp.Container.GetRegistryImage.Invoke(new()
     *     {
     *         Name = "debian",
     *     });
     *     return new Dictionary
     *     {
     *         ["gcrLocation"] = debian.Apply(getRegistryImageResult => getRegistryImageResult.ImageUrl),
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		debian, err := container.GetRegistryImage(ctx, &container.GetRegistryImageArgs{
     * 			Name: "debian",
     * 		}, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("gcrLocation", debian.ImageUrl)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.gcp.container.ContainerFunctions;
     * import com.pulumi.gcp.container.inputs.GetRegistryImageArgs;
     * 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 debian = ContainerFunctions.getRegistryImage(GetRegistryImageArgs.builder()
     *             .name("debian")
     *             .build());
     *         ctx.export("gcrLocation", debian.applyValue(getRegistryImageResult -> getRegistryImageResult.imageUrl()));
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   debian:
     *     fn::invoke:
     *       Function: gcp:container:getRegistryImage
     *       Arguments:
     *         name: debian
     * outputs:
     *   gcrLocation: ${debian.imageUrl}
     * ```
     * 
     * @param argument A collection of arguments for invoking getRegistryImage.
     * @return A collection of values returned by getRegistryImage.
     */
    public suspend fun getRegistryImage(argument: GetRegistryImagePlainArgs): GetRegistryImageResult =
        getRegistryImageResultToKotlin(getRegistryImagePlain(argument.toJava()).await())

    /**
     * @see [getRegistryImage].
     * @param digest The image digest to fetch, if any.
     * @param name The image name.
     * @param project The project ID that this image is attached to.  If not provider, provider project will be used instead.
     * @param region The GCR region to use.  As of this writing, one of `asia`, `eu`, and `us`.  See [the documentation](https://cloud.google.com/container-registry/docs/pushing-and-pulling) for additional information.
     * @param tag The tag to fetch, if any.
     * @return A collection of values returned by getRegistryImage.
     */
    public suspend fun getRegistryImage(
        digest: String? = null,
        name: String,
        project: String? = null,
        region: String? = null,
        tag: String? = null,
    ): GetRegistryImageResult {
        val argument = GetRegistryImagePlainArgs(
            digest = digest,
            name = name,
            project = project,
            region = region,
            tag = tag,
        )
        return getRegistryImageResultToKotlin(getRegistryImagePlain(argument.toJava()).await())
    }

    /**
     * @see [getRegistryImage].
     * @param argument Builder for [com.pulumi.gcp.container.kotlin.inputs.GetRegistryImagePlainArgs].
     * @return A collection of values returned by getRegistryImage.
     */
    public suspend fun getRegistryImage(argument: suspend GetRegistryImagePlainArgsBuilder.() -> Unit): GetRegistryImageResult {
        val builder = GetRegistryImagePlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getRegistryImageResultToKotlin(getRegistryImagePlain(builtArgument.toJava()).await())
    }

    /**
     * This data source fetches the project name, and provides the appropriate URLs to use for container registry for this project.
     * The URLs are computed entirely offline - as long as the project exists, they will be valid, but this data source does not contact Google Container Registry (GCR) at any point.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const foo = gcp.container.getRegistryRepository({});
     * export const gcrLocation = foo.then(foo => foo.repositoryUrl);
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * foo = gcp.container.get_registry_repository()
     * pulumi.export("gcrLocation", foo.repository_url)
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var foo = Gcp.Container.GetRegistryRepository.Invoke();
     *     return new Dictionary
     *     {
     *         ["gcrLocation"] = foo.Apply(getRegistryRepositoryResult => getRegistryRepositoryResult.RepositoryUrl),
     *     };
     * });
     * ```
     * ```go
     * package main
     * import (
     * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/container"
     * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
     * )
     * func main() {
     * 	pulumi.Run(func(ctx *pulumi.Context) error {
     * 		foo, err := container.GetRegistryRepository(ctx, nil, nil)
     * 		if err != nil {
     * 			return err
     * 		}
     * 		ctx.Export("gcrLocation", foo.RepositoryUrl)
     * 		return nil
     * 	})
     * }
     * ```
     * ```java
     * package generated_program;
     * import com.pulumi.Context;
     * import com.pulumi.Pulumi;
     * import com.pulumi.core.Output;
     * import com.pulumi.gcp.container.ContainerFunctions;
     * import com.pulumi.gcp.container.inputs.GetRegistryRepositoryArgs;
     * 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 foo = ContainerFunctions.getRegistryRepository();
     *         ctx.export("gcrLocation", foo.applyValue(getRegistryRepositoryResult -> getRegistryRepositoryResult.repositoryUrl()));
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   foo:
     *     fn::invoke:
     *       Function: gcp:container:getRegistryRepository
     *       Arguments: {}
     * outputs:
     *   gcrLocation: ${foo.repositoryUrl}
     * ```
     * 
     * @param argument A collection of arguments for invoking getRegistryRepository.
     * @return A collection of values returned by getRegistryRepository.
     */
    public suspend fun getRegistryRepository(argument: GetRegistryRepositoryPlainArgs): GetRegistryRepositoryResult =
        getRegistryRepositoryResultToKotlin(getRegistryRepositoryPlain(argument.toJava()).await())

    /**
     * @see [getRegistryRepository].
     * @param project The project ID that this repository is attached to.  If not provided, provider project will be used instead.
     * @param region The GCR region to use.  As of this writing, one of `asia`, `eu`, and `us`.  See [the documentation](https://cloud.google.com/container-registry/docs/pushing-and-pulling) for additional information.
     * @return A collection of values returned by getRegistryRepository.
     */
    public suspend fun getRegistryRepository(project: String? = null, region: String? = null): GetRegistryRepositoryResult {
        val argument = GetRegistryRepositoryPlainArgs(
            project = project,
            region = region,
        )
        return getRegistryRepositoryResultToKotlin(getRegistryRepositoryPlain(argument.toJava()).await())
    }

    /**
     * @see [getRegistryRepository].
     * @param argument Builder for [com.pulumi.gcp.container.kotlin.inputs.GetRegistryRepositoryPlainArgs].
     * @return A collection of values returned by getRegistryRepository.
     */
    public suspend fun getRegistryRepository(argument: suspend GetRegistryRepositoryPlainArgsBuilder.() -> Unit): GetRegistryRepositoryResult {
        val builder = GetRegistryRepositoryPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getRegistryRepositoryResultToKotlin(getRegistryRepositoryPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy