getImage

suspend fun getImage(argument: GetImagePlainArgs): GetImageResult

Use this data source to access information about an existing Image.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.compute.ComputeFunctions;
import com.pulumi.azure.compute.inputs.GetImageArgs;
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 search = ComputeFunctions.getImage(GetImageArgs.builder()
.name("search-api")
.resourceGroupName("packerimages")
.build());
ctx.export("imageId", search.applyValue(getImageResult -> getImageResult.id()));
}
}

Return

A collection of values returned by getImage.

Parameters

argument

A collection of arguments for invoking getImage.


suspend fun getImage(name: String? = null, nameRegex: String? = null, resourceGroupName: String, sortDescending: Boolean? = null): GetImageResult

Return

A collection of values returned by getImage.

See also

Parameters

name

The name of the Image.

nameRegex

Regex pattern of the image to match.

resourceGroupName

The Name of the Resource Group where this Image exists.

sortDescending

By default when matching by regex, images are sorted by name in ascending order and the first match is chosen, to sort descending, set this flag.


suspend fun getImage(argument: suspend GetImagePlainArgsBuilder.() -> Unit): GetImageResult

Return

A collection of values returned by getImage.

See also

Parameters

argument

Builder for com.pulumi.azure.compute.kotlin.inputs.GetImagePlainArgs.