get Cluster
Get info about a GKE cluster from its name and location.
Example Usage
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.GetClusterArgs;
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 myCluster = ContainerFunctions.getCluster(GetClusterArgs.builder()
.name("my-cluster")
.location("us-east1-a")
.build());
ctx.export("endpoint", myCluster.applyValue(getClusterResult -> getClusterResult.endpoint()));
ctx.export("instanceGroupUrls", myCluster.applyValue(getClusterResult -> getClusterResult.nodePools()[0].instanceGroupUrls()));
ctx.export("nodeConfig", myCluster.applyValue(getClusterResult -> getClusterResult.nodeConfigs()));
ctx.export("nodePools", myCluster.applyValue(getClusterResult -> getClusterResult.nodePools()));
}
}
Content copied to clipboard
Return
A collection of values returned by getCluster.
Parameters
argument
A collection of arguments for invoking getCluster.
suspend fun getCluster(location: String? = null, name: String, project: String? = null): GetClusterResult
Return
A collection of values returned by getCluster.
See also
Parameters
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.
name
The name of the cluster.
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.
See also
Parameters
argument
Builder for com.pulumi.gcp.container.kotlin.inputs.GetClusterPlainArgs.