1. Packages
  2. Control Plane (cpln)
  3. API Docs
  4. getImage
Control Plane v0.0.27 published on Saturday, May 25, 2024 by pulumiverse

cpln.getImage

Explore with Pulumi AI

cpln logo
Control Plane v0.0.27 published on Saturday, May 25, 2024 by pulumiverse

    Use this data source to access information about an Image within Control Plane.

    Required

    • name (String) Name of the image. If the tag of the image is not specified, the latest image will be fetched for this data source.

    Outputs

    The following attributes are exported:

    • cpln_id (String) The ID, in GUID format, of the Image.
    • name (String) Name of the Image.
    • tags (Map of String) Key-value map of resource tags.
    • self_link (String) Full link to this resource. Can be referenced by other resources.
    • tag (String) Tag of the image.
    • repository (String) Respository name of the image.
    • digest (String) A unique SHA256 hash used to identify a specific image version within the image registry.
    • manifest (Block List, Max: 1) (see below)

    manifest

    The manifest provides configuration and layers information about the image. It plays a crucial role in the Docker image distribution system, enabling image creation, verification, and replication in a consistent and secure manner.

    • config (Block List, Max: 1) (see below).
    • layers (Block List) (see below).
    • media_type (String) Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
    • schema_version (Number) The version of the Docker Image Manifest format.

    config and layers

    The config is a JSON blob that contains the image configuration data which includes environment variables, default command to run, and other settings necessary to run the container based on this image.

    Layers lists the digests of the image’s layers. These layers are filesystem changes or additions made in each step of the Docker image’s creation process. The layers are stored separately and pulled as needed, which allows for efficient storage and transfer of images. Each layer is represented by a SHA256 digest, ensuring the integrity and authenticity of the image.

    • size (Number) The size of the image or layer in bytes. This helps in estimating the space required and the download time.
    • digest (String) A unique SHA256 hash used to identify a specific image version within the image registry.
    • media_type (String) Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Cpln = Pulumi.Cpln;
    
    return await Deployment.RunAsync(() => 
    {
        var image_name_only = Cpln.GetImage.Invoke(new()
        {
            Name = "IMAGE_NAME",
        });
    
        var image_name_with_tag = Cpln.GetImage.Invoke(new()
        {
            Name = "IMAGE_NAME:TAG",
        });
    
        return new Dictionary<string, object?>
        {
            ["latestImage"] = image_name_only,
            ["specificImage"] = image_name_with_tag,
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-cpln/sdk/go/cpln"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		image_name_only, err := cpln.GetImage(ctx, &cpln.GetImageArgs{
    			Name: "IMAGE_NAME",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		image_name_with_tag, err := cpln.GetImage(ctx, &cpln.GetImageArgs{
    			Name: "IMAGE_NAME:TAG",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("latestImage", image_name_only)
    		ctx.Export("specificImage", image_name_with_tag)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.cpln.CplnFunctions;
    import com.pulumi.cpln.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 image-name-only = CplnFunctions.getImage(GetImageArgs.builder()
                .name("IMAGE_NAME")
                .build());
    
            final var image-name-with-tag = CplnFunctions.getImage(GetImageArgs.builder()
                .name("IMAGE_NAME:TAG")
                .build());
    
            ctx.export("latestImage", image_name_only);
            ctx.export("specificImage", image_name_with_tag);
        }
    }
    
    import pulumi
    import pulumi_cpln as cpln
    
    image_name_only = cpln.get_image(name="IMAGE_NAME")
    image_name_with_tag = cpln.get_image(name="IMAGE_NAME:TAG")
    pulumi.export("latestImage", image_name_only)
    pulumi.export("specificImage", image_name_with_tag)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as cpln from "@pulumi/cpln";
    
    const image-name-only = cpln.getImage({
        name: "IMAGE_NAME",
    });
    const image-name-with-tag = cpln.getImage({
        name: "IMAGE_NAME:TAG",
    });
    export const latestImage = image_name_only;
    export const specificImage = image_name_with_tag;
    
    variables:
      image-name-only:
        fn::invoke:
          Function: cpln:getImage
          Arguments:
            name: IMAGE_NAME
      image-name-with-tag:
        fn::invoke:
          Function: cpln:getImage
          Arguments:
            name: IMAGE_NAME:TAG
    outputs:
      latestImage: ${["image-name-only"]}
      specificImage: ${["image-name-with-tag"]}
    

    Using getImage

    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 getImage(args: GetImageArgs, opts?: InvokeOptions): Promise<GetImageResult>
    function getImageOutput(args: GetImageOutputArgs, opts?: InvokeOptions): Output<GetImageResult>
    def get_image(name: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetImageResult
    def get_image_output(name: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetImageResult]
    func GetImage(ctx *Context, args *GetImageArgs, opts ...InvokeOption) (*GetImageResult, error)
    func GetImageOutput(ctx *Context, args *GetImageOutputArgs, opts ...InvokeOption) GetImageResultOutput

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

    public static class GetImage 
    {
        public static Task<GetImageResult> InvokeAsync(GetImageArgs args, InvokeOptions? opts = null)
        public static Output<GetImageResult> Invoke(GetImageInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: cpln:index/getImage:getImage
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Name string
    name String
    name string
    name str
    name String

    getImage Result

    The following output properties are available:

    CplnId string
    Digest string
    Id string
    The provider-assigned unique ID for this managed resource.
    Manifests List<Pulumiverse.Cpln.Outputs.GetImageManifest>
    Name string
    Repository string
    SelfLink string
    Tag string
    Tags Dictionary<string, string>
    CplnId string
    Digest string
    Id string
    The provider-assigned unique ID for this managed resource.
    Manifests []GetImageManifest
    Name string
    Repository string
    SelfLink string
    Tag string
    Tags map[string]string
    cplnId String
    digest String
    id String
    The provider-assigned unique ID for this managed resource.
    manifests List<GetImageManifest>
    name String
    repository String
    selfLink String
    tag String
    tags Map<String,String>
    cplnId string
    digest string
    id string
    The provider-assigned unique ID for this managed resource.
    manifests GetImageManifest[]
    name string
    repository string
    selfLink string
    tag string
    tags {[key: string]: string}
    cpln_id str
    digest str
    id str
    The provider-assigned unique ID for this managed resource.
    manifests Sequence[GetImageManifest]
    name str
    repository str
    self_link str
    tag str
    tags Mapping[str, str]
    cplnId String
    digest String
    id String
    The provider-assigned unique ID for this managed resource.
    manifests List<Property Map>
    name String
    repository String
    selfLink String
    tag String
    tags Map<String>

    Supporting Types

    GetImageManifest

    GetImageManifestConfig

    Digest string
    MediaType string
    Size int
    Digest string
    MediaType string
    Size int
    digest String
    mediaType String
    size Integer
    digest string
    mediaType string
    size number
    digest String
    mediaType String
    size Number

    GetImageManifestLayer

    Digest string
    MediaType string
    Size int
    Digest string
    MediaType string
    Size int
    digest String
    mediaType String
    size Integer
    digest string
    mediaType string
    size number
    digest String
    mediaType String
    size Number

    Package Details

    Repository
    cpln pulumiverse/pulumi-cpln
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the cpln Terraform Provider.
    cpln logo
    Control Plane v0.0.27 published on Saturday, May 25, 2024 by pulumiverse