getPlatformImage

Use this data source to access information about a Platform Image.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.compute.getPlatformImage({
location: "West Europe",
publisher: "Canonical",
offer: "0001-com-ubuntu-server-focal",
sku: "20_04-lts",
});
export const id = example.then(example => example.id);
import pulumi
import pulumi_azure as azure
example = azure.compute.get_platform_image(location="West Europe",
publisher="Canonical",
offer="0001-com-ubuntu-server-focal",
sku="20_04-lts")
pulumi.export("id", example.id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Compute.GetPlatformImage.Invoke(new()
{
Location = "West Europe",
Publisher = "Canonical",
Offer = "0001-com-ubuntu-server-focal",
Sku = "20_04-lts",
});
return new Dictionary<string, object?>
{
["id"] = example.Apply(getPlatformImageResult => getPlatformImageResult.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := compute.GetPlatformImage(ctx, &compute.GetPlatformImageArgs{
Location: "West Europe",
Publisher: "Canonical",
Offer: "0001-com-ubuntu-server-focal",
Sku: "20_04-lts",
}, nil)
if err != nil {
return err
}
ctx.Export("id", example.Id)
return nil
})
}
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.GetPlatformImageArgs;
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 example = ComputeFunctions.getPlatformImage(GetPlatformImageArgs.builder()
.location("West Europe")
.publisher("Canonical")
.offer("0001-com-ubuntu-server-focal")
.sku("20_04-lts")
.build());
ctx.export("id", example.id());
}
}
variables:
example:
fn::invoke:
function: azure:compute:getPlatformImage
arguments:
location: West Europe
publisher: Canonical
offer: 0001-com-ubuntu-server-focal
sku: 20_04-lts
outputs:
id: ${example.id}

API Providers

This data source uses the following Azure API Providers:

  • Microsoft.Compute: 2024-03-01

Return

A collection of values returned by getPlatformImage.

Parameters

argument

A collection of arguments for invoking getPlatformImage.


suspend fun getPlatformImage(location: String, offer: String, publisher: String, sku: String, version: String? = null): GetPlatformImageResult

Return

A collection of values returned by getPlatformImage.

Parameters

location

Specifies the Location to pull information about this Platform Image from.

offer

Specifies the Offer associated with the Platform Image.

publisher

Specifies the Publisher associated with the Platform Image.

sku

Specifies the SKU of the Platform Image.

version

The version of the Platform Image.

See also


Return

A collection of values returned by getPlatformImage.

Parameters

argument

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

See also