1. Packages
  2. Azure Classic
  3. API Docs
  4. compute
  5. getPlatformImage

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi

azure.compute.getPlatformImage

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi

    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)
    
    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:     "0001-com-ubuntu-server-focal",
    			Sku:       "20_04-lts",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("id", example.Id)
    		return nil
    	})
    }
    
    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 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.applyValue(getPlatformImageResult -> getPlatformImageResult.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}
    

    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
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi