getInstance

Get information about a VM instance resource within GCE. For more information see the official documentation and API.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.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 appserver = ComputeFunctions.getInstance(GetInstanceArgs.builder()
.name("primary-application-server")
.zone("us-central1-a")
.build());
}
}

Return

A collection of values returned by getInstance.

Parameters

argument

A collection of arguments for invoking getInstance.


suspend fun getInstance(name: String? = null, project: String? = null, selfLink: String? = null, zone: String? = null): GetInstanceResult

Return

A collection of values returned by getInstance.

Parameters

name

The name of the instance. One of name or self_link must be provided.

project

The ID of the project in which the resource belongs. If self_link is provided, this value is ignored. If neither self_link nor project are provided, the provider project is used.

selfLink

The self link of the instance. One of name or self_link must be provided.

zone

The zone of the instance. If self_link is provided, this value is ignored. If neither self_link nor zone are provided, the provider zone is used.

See also


suspend fun getInstance(argument: suspend GetInstancePlainArgsBuilder.() -> Unit): GetInstanceResult

Return

A collection of values returned by getInstance.

Parameters

argument

Builder for com.pulumi.gcp.compute.kotlin.inputs.GetInstancePlainArgs.

See also