1. Packages
  2. Control Plane (cpln)
  3. API Docs
  4. getImage
Control Plane v0.0.56 published on Wednesday, Apr 9, 2025 by pulumiverse

cpln.getImage

Explore with Pulumi AI

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

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;
Copy
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)
Copy
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
	})
}
Copy
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,
    };
});
Copy
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);
    }
}
Copy
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"]}
Copy

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>
Copy
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]
Copy
func GetImage(ctx *Context, args *GetImageArgs, opts ...InvokeOption) (*GetImageResult, error)
func GetImageOutput(ctx *Context, args *GetImageOutputArgs, opts ...InvokeOption) GetImageResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
public static Output<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: cpln:index/getImage:getImage
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
Name This property is required. string
name This property is required. String
name This property is required. string
name This property is required. str
name This property is required. 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

Configs This property is required. List<Pulumiverse.Cpln.Inputs.GetImageManifestConfig>
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 This property is required. List<Pulumiverse.Cpln.Inputs.GetImageManifestLayer>
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.
MediaType This property is required. string
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
SchemaVersion This property is required. int
The version of the Docker Image Manifest format.
Configs This property is required. []GetImageManifestConfig
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 This property is required. []GetImageManifestLayer
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.
MediaType This property is required. string
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
SchemaVersion This property is required. int
The version of the Docker Image Manifest format.
configs This property is required. List<GetImageManifestConfig>
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 This property is required. List<GetImageManifestLayer>
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.
mediaType This property is required. String
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
schemaVersion This property is required. Integer
The version of the Docker Image Manifest format.
configs This property is required. GetImageManifestConfig[]
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 This property is required. GetImageManifestLayer[]
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.
mediaType This property is required. string
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
schemaVersion This property is required. number
The version of the Docker Image Manifest format.
configs This property is required. Sequence[GetImageManifestConfig]
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 This property is required. Sequence[GetImageManifestLayer]
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.
media_type This property is required. str
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 This property is required. int
The version of the Docker Image Manifest format.
configs This property is required. List<Property Map>
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 This property is required. List<Property Map>
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.
mediaType This property is required. String
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
schemaVersion This property is required. Number
The version of the Docker Image Manifest format.

GetImageManifestConfig

Digest This property is required. string
A unique SHA256 hash used to identify a specific image version within the image registry.
MediaType This property is required. string
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
Size This property is required. int
The size of the image or layer in bytes. This helps in estimating the space required and the download time.
Digest This property is required. string
A unique SHA256 hash used to identify a specific image version within the image registry.
MediaType This property is required. string
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
Size This property is required. int
The size of the image or layer in bytes. This helps in estimating the space required and the download time.
digest This property is required. String
A unique SHA256 hash used to identify a specific image version within the image registry.
mediaType This property is required. String
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
size This property is required. Integer
The size of the image or layer in bytes. This helps in estimating the space required and the download time.
digest This property is required. string
A unique SHA256 hash used to identify a specific image version within the image registry.
mediaType This property is required. string
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
size This property is required. number
The size of the image or layer in bytes. This helps in estimating the space required and the download time.
digest This property is required. str
A unique SHA256 hash used to identify a specific image version within the image registry.
media_type This property is required. str
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
size This property is required. int
The size of the image or layer in bytes. This helps in estimating the space required and the download time.
digest This property is required. String
A unique SHA256 hash used to identify a specific image version within the image registry.
mediaType This property is required. String
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
size This property is required. Number
The size of the image or layer in bytes. This helps in estimating the space required and the download time.

GetImageManifestLayer

Digest This property is required. string
A unique SHA256 hash used to identify a specific image version within the image registry.
MediaType This property is required. string
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
Size This property is required. int
The size of the image or layer in bytes. This helps in estimating the space required and the download time.
Digest This property is required. string
A unique SHA256 hash used to identify a specific image version within the image registry.
MediaType This property is required. string
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
Size This property is required. int
The size of the image or layer in bytes. This helps in estimating the space required and the download time.
digest This property is required. String
A unique SHA256 hash used to identify a specific image version within the image registry.
mediaType This property is required. String
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
size This property is required. Integer
The size of the image or layer in bytes. This helps in estimating the space required and the download time.
digest This property is required. string
A unique SHA256 hash used to identify a specific image version within the image registry.
mediaType This property is required. string
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
size This property is required. number
The size of the image or layer in bytes. This helps in estimating the space required and the download time.
digest This property is required. str
A unique SHA256 hash used to identify a specific image version within the image registry.
media_type This property is required. str
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
size This property is required. int
The size of the image or layer in bytes. This helps in estimating the space required and the download time.
digest This property is required. String
A unique SHA256 hash used to identify a specific image version within the image registry.
mediaType This property is required. String
Specifies the type of the content represented in the manifest, allowing Docker clients and registries to understand how to handle the document correctly.
size This property is required. Number
The size of the image or layer in bytes. This helps in estimating the space required and the download time.

Package Details

Repository
cpln pulumiverse/pulumi-cpln
License
Apache-2.0
Notes
This Pulumi package is based on the cpln Terraform Provider.