getInstanceTemplate

Get information about a VM instance template 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.GetInstanceTemplateArgs;
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 generic = ComputeFunctions.getInstanceTemplate(GetInstanceTemplateArgs.builder()
.name("generic-tpl-20200107")
.build());
final var generic-regex = ComputeFunctions.getInstanceTemplate(GetInstanceTemplateArgs.builder()
.filter("name != generic-tpl-20200107")
.mostRecent(true)
.build());
}
}

Return

A collection of values returned by getInstanceTemplate.

Parameters

argument

A collection of arguments for invoking getInstanceTemplate.


suspend fun getInstanceTemplate(filter: String? = null, mostRecent: Boolean? = null, name: String? = null, project: String? = null): GetInstanceTemplateResult

Return

A collection of values returned by getInstanceTemplate.

See also

Parameters

filter

A filter to retrieve the instance templates. See gcloud topic filters for reference. If multiple instance templates match, either adjust the filter or specify most_recent. One of name or filter must be provided.

mostRecent

If filter is provided, ensures the most recent template is returned when multiple instance templates match. One of name or filter must be provided.

name

The name of the instance template. One of name or filter must be provided.

project

The ID of the project in which the resource belongs. If project is not provided, the provider project is used.


Return

A collection of values returned by getInstanceTemplate.

See also

Parameters

argument

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