Azure Classic

Pulumi Official
Package maintained by Pulumi
v5.14.0 published on Thursday, Jul 28, 2022 by Pulumi

getPlatformImage

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

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Azure.Compute.GetPlatformImage.InvokeAsync(new Azure.Compute.GetPlatformImageArgs
        {
            Location = "West Europe",
            Publisher = "Canonical",
            Offer = "UbuntuServer",
            Sku = "16.04-LTS",
        }));
        this.Id = example.Apply(example => example.Id);
    }

    [Output("id")]
    public Output<string> Id { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/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:     "UbuntuServer",
			Sku:       "16.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("UbuntuServer")
            .sku("16.04-LTS")
            .build());

        ctx.export("id", example.applyValue(getPlatformImageResult -> getPlatformImageResult.id()));
    }
}
import pulumi
import pulumi_azure as azure

example = azure.compute.get_platform_image(location="West Europe",
    publisher="Canonical",
    offer="UbuntuServer",
    sku="16.04-LTS")
pulumi.export("id", example.id)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.compute.getPlatformImage({
    location: "West Europe",
    publisher: "Canonical",
    offer: "UbuntuServer",
    sku: "16.04-LTS",
});
export const id = example.then(example => example.id);
variables:
  example:
    Fn::Invoke:
      Function: azure:compute:getPlatformImage
      Arguments:
        location: West Europe
        publisher: Canonical
        offer: UbuntuServer
        sku: 16.04-LTS
outputs:
  id: ${example.id}

Using getPlatformImage

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getPlatformImage(args: GetPlatformImageArgs, opts?: InvokeOptions): Promise<GetPlatformImageResult>
function getPlatformImageOutput(args: GetPlatformImageOutputArgs, opts?: InvokeOptions): Output<GetPlatformImageResult>
def get_platform_image(location: Optional[str] = None,
                       offer: Optional[str] = None,
                       publisher: Optional[str] = None,
                       sku: Optional[str] = None,
                       version: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetPlatformImageResult
def get_platform_image_output(location: Optional[pulumi.Input[str]] = None,
                       offer: Optional[pulumi.Input[str]] = None,
                       publisher: Optional[pulumi.Input[str]] = None,
                       sku: Optional[pulumi.Input[str]] = None,
                       version: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetPlatformImageResult]
func GetPlatformImage(ctx *Context, args *GetPlatformImageArgs, opts ...InvokeOption) (*GetPlatformImageResult, error)
func GetPlatformImageOutput(ctx *Context, args *GetPlatformImageOutputArgs, opts ...InvokeOption) GetPlatformImageResultOutput

> Note: This function is named GetPlatformImage in the Go SDK.

public static class GetPlatformImage 
{
    public static Task<GetPlatformImageResult> InvokeAsync(GetPlatformImageArgs args, InvokeOptions? opts = null)
    public static Output<GetPlatformImageResult> Invoke(GetPlatformImageInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPlatformImageResult> getPlatformImage(GetPlatformImageArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: azure:compute/getPlatformImage:getPlatformImage
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Location string

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

Offer string

Specifies the Offer associated with the Platform Image.

Publisher string

Specifies the Publisher associated with the Platform Image.

Sku string

Specifies the SKU of the Platform Image.

Version string

The version of the Platform Image.

Location string

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

Offer string

Specifies the Offer associated with the Platform Image.

Publisher string

Specifies the Publisher associated with the Platform Image.

Sku string

Specifies the SKU of the Platform Image.

Version string

The version of the Platform Image.

location String

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

offer String

Specifies the Offer associated with the Platform Image.

publisher String

Specifies the Publisher associated with the Platform Image.

sku String

Specifies the SKU of the Platform Image.

version String

The version of the Platform Image.

location string

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

offer string

Specifies the Offer associated with the Platform Image.

publisher string

Specifies the Publisher associated with the Platform Image.

sku string

Specifies the SKU of the Platform Image.

version string

The version of the Platform Image.

location str

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

offer str

Specifies the Offer associated with the Platform Image.

publisher str

Specifies the Publisher associated with the Platform Image.

sku str

Specifies the SKU of the Platform Image.

version str

The version of the Platform Image.

location String

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

offer String

Specifies the Offer associated with the Platform Image.

publisher String

Specifies the Publisher associated with the Platform Image.

sku String

Specifies the SKU of the Platform Image.

version String

The version of the Platform Image.

getPlatformImage Result

The following output properties are available:

Id string

The provider-assigned unique ID for this managed resource.

Location string
Offer string
Publisher string
Sku string
Version string
Id string

The provider-assigned unique ID for this managed resource.

Location string
Offer string
Publisher string
Sku string
Version string
id String

The provider-assigned unique ID for this managed resource.

location String
offer String
publisher String
sku String
version String
id string

The provider-assigned unique ID for this managed resource.

location string
offer string
publisher string
sku string
version string
id str

The provider-assigned unique ID for this managed resource.

location str
offer str
publisher str
sku str
version str
id String

The provider-assigned unique ID for this managed resource.

location String
offer String
publisher String
sku String
version String

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.