AWS v6.77.1 published on Friday, Apr 18, 2025 by Pulumi
aws.ecr.getImage
Explore with Pulumi AI
The ECR Image data source allows the details of an image with a particular tag or digest to be retrieved.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const serviceImage = aws.ecr.getImage({
    repositoryName: "my/service",
    imageTag: "latest",
});
import pulumi
import pulumi_aws as aws
service_image = aws.ecr.get_image(repository_name="my/service",
    image_tag="latest")
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ecr"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecr.GetImage(ctx, &ecr.GetImageArgs{
			RepositoryName: "my/service",
			ImageTag:       pulumi.StringRef("latest"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var serviceImage = Aws.Ecr.GetImage.Invoke(new()
    {
        RepositoryName = "my/service",
        ImageTag = "latest",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ecr.EcrFunctions;
import com.pulumi.aws.ecr.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 serviceImage = EcrFunctions.getImage(GetImageArgs.builder()
            .repositoryName("my/service")
            .imageTag("latest")
            .build());
    }
}
variables:
  serviceImage:
    fn::invoke:
      function: aws:ecr:getImage
      arguments:
        repositoryName: my/service
        imageTag: latest
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(image_digest: Optional[str] = None,
              image_tag: Optional[str] = None,
              most_recent: Optional[bool] = None,
              registry_id: Optional[str] = None,
              repository_name: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetImageResult
def get_image_output(image_digest: Optional[pulumi.Input[str]] = None,
              image_tag: Optional[pulumi.Input[str]] = None,
              most_recent: Optional[pulumi.Input[bool]] = None,
              registry_id: Optional[pulumi.Input[str]] = None,
              repository_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)
public static Output<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
fn::invoke:
  function: aws:ecr/getImage:getImage
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Repository
Name string - Name of the ECR Repository.
 - Image
Digest string - Sha256 digest of the image manifest. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - Image
Tag string - Tag associated with this image. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - Most
Recent bool - Return the most recently pushed image. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - Registry
Id string - ID of the Registry where the repository resides.
 
- Repository
Name string - Name of the ECR Repository.
 - Image
Digest string - Sha256 digest of the image manifest. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - Image
Tag string - Tag associated with this image. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - Most
Recent bool - Return the most recently pushed image. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - Registry
Id string - ID of the Registry where the repository resides.
 
- repository
Name String - Name of the ECR Repository.
 - image
Digest String - Sha256 digest of the image manifest. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - image
Tag String - Tag associated with this image. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - most
Recent Boolean - Return the most recently pushed image. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - registry
Id String - ID of the Registry where the repository resides.
 
- repository
Name string - Name of the ECR Repository.
 - image
Digest string - Sha256 digest of the image manifest. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - image
Tag string - Tag associated with this image. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - most
Recent boolean - Return the most recently pushed image. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - registry
Id string - ID of the Registry where the repository resides.
 
- repository_
name str - Name of the ECR Repository.
 - image_
digest str - Sha256 digest of the image manifest. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - image_
tag str - Tag associated with this image. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - most_
recent bool - Return the most recently pushed image. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - registry_
id str - ID of the Registry where the repository resides.
 
- repository
Name String - Name of the ECR Repository.
 - image
Digest String - Sha256 digest of the image manifest. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - image
Tag String - Tag associated with this image. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - most
Recent Boolean - Return the most recently pushed image. At least one of 
image_digest,image_tag, ormost_recentmust be specified. - registry
Id String - ID of the Registry where the repository resides.
 
getImage Result
The following output properties are available:
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Image
Digest string - Image
Pushed intAt  - Date and time, expressed as a unix timestamp, at which the current image was pushed to the repository.
 - Image
Size intIn Bytes  - Size, in bytes, of the image in the repository.
 - List<string>
 - List of tags associated with this image.
 - Image
Uri string - The URI for the specific image version specified by 
image_tagorimage_digest. - Registry
Id string - Repository
Name string - Image
Tag string - Most
Recent bool 
- Id string
 - The provider-assigned unique ID for this managed resource.
 - Image
Digest string - Image
Pushed intAt  - Date and time, expressed as a unix timestamp, at which the current image was pushed to the repository.
 - Image
Size intIn Bytes  - Size, in bytes, of the image in the repository.
 - []string
 - List of tags associated with this image.
 - Image
Uri string - The URI for the specific image version specified by 
image_tagorimage_digest. - Registry
Id string - Repository
Name string - Image
Tag string - Most
Recent bool 
- id String
 - The provider-assigned unique ID for this managed resource.
 - image
Digest String - image
Pushed IntegerAt  - Date and time, expressed as a unix timestamp, at which the current image was pushed to the repository.
 - image
Size IntegerIn Bytes  - Size, in bytes, of the image in the repository.
 - List<String>
 - List of tags associated with this image.
 - image
Uri String - The URI for the specific image version specified by 
image_tagorimage_digest. - registry
Id String - repository
Name String - image
Tag String - most
Recent Boolean 
- id string
 - The provider-assigned unique ID for this managed resource.
 - image
Digest string - image
Pushed numberAt  - Date and time, expressed as a unix timestamp, at which the current image was pushed to the repository.
 - image
Size numberIn Bytes  - Size, in bytes, of the image in the repository.
 - string[]
 - List of tags associated with this image.
 - image
Uri string - The URI for the specific image version specified by 
image_tagorimage_digest. - registry
Id string - repository
Name string - image
Tag string - most
Recent boolean 
- id str
 - The provider-assigned unique ID for this managed resource.
 - image_
digest str - image_
pushed_ intat  - Date and time, expressed as a unix timestamp, at which the current image was pushed to the repository.
 - image_
size_ intin_ bytes  - Size, in bytes, of the image in the repository.
 - Sequence[str]
 - List of tags associated with this image.
 - image_
uri str - The URI for the specific image version specified by 
image_tagorimage_digest. - registry_
id str - repository_
name str - image_
tag str - most_
recent bool 
- id String
 - The provider-assigned unique ID for this managed resource.
 - image
Digest String - image
Pushed NumberAt  - Date and time, expressed as a unix timestamp, at which the current image was pushed to the repository.
 - image
Size NumberIn Bytes  - Size, in bytes, of the image in the repository.
 - List<String>
 - List of tags associated with this image.
 - image
Uri String - The URI for the specific image version specified by 
image_tagorimage_digest. - registry
Id String - repository
Name String - image
Tag String - most
Recent Boolean 
Package Details
- Repository
 - AWS Classic pulumi/pulumi-aws
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
awsTerraform Provider.