get Image
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()));
}
}
Content copied to clipboard
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.
name Regex
Regex pattern of the image to match.
resource Group Name
The Name of the Resource Group where this Image exists.
sort Descending
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.
Return
A collection of values returned by getImage.
See also
Parameters
argument
Builder for com.pulumi.azure.compute.kotlin.inputs.GetImagePlainArgs.