get Instance
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
A collection of arguments for invoking getInstance.
Return
A collection of values returned by getInstance.
Parameters
The name of the instance. One of name
or self_link
must be provided.
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.
The self link of the instance. One of name
or self_link
must be provided.
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
Return
A collection of values returned by getInstance.
Parameters
Builder for com.pulumi.gcp.compute.kotlin.inputs.GetInstancePlainArgs.