1. Packages
  2. AWS
  3. API Docs
  4. ecr
  5. getImages
AWS v7.5.0 published on Wednesday, Aug 20, 2025 by Pulumi

aws.ecr.getImages

Explore with Pulumi AI

aws logo
AWS v7.5.0 published on Wednesday, Aug 20, 2025 by Pulumi

    The ECR Images data source allows the list of images in a specified repository to be retrieved.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.ecr.getImages({
        repositoryName: "my-repository",
    });
    export const imageDigests = example.then(example => .filter(img => img.imageDigest != null).map(img => (img.imageDigest)));
    export const imageTags = example.then(example => .filter(img => img.imageTag != null).map(img => (img.imageTag)));
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ecr.get_images(repository_name="my-repository")
    pulumi.export("imageDigests", [img.image_digest for img in example.image_ids if img.image_digest != None])
    pulumi.export("imageTags", [img.image_tag for img in example.image_ids if img.image_tag != None])
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.Ecr.GetImages.Invoke(new()
        {
            RepositoryName = "my-repository",
        });
    
        return new Dictionary<string, object?>
        {
            ["imageDigests"] = .Where(img => img.ImageDigest != null).Select(img => 
            {
                return img.ImageDigest;
            }).ToList(),
            ["imageTags"] = .Where(img => img.ImageTag != null).Select(img => 
            {
                return img.ImageTag;
            }).ToList(),
        };
    });
    
    Example coming soon!
    
    Example coming soon!
    

    Using getImages

    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 getImages(args: GetImagesArgs, opts?: InvokeOptions): Promise<GetImagesResult>
    function getImagesOutput(args: GetImagesOutputArgs, opts?: InvokeOptions): Output<GetImagesResult>
    def get_images(region: Optional[str] = None,
                   registry_id: Optional[str] = None,
                   repository_name: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetImagesResult
    def get_images_output(region: Optional[pulumi.Input[str]] = None,
                   registry_id: Optional[pulumi.Input[str]] = None,
                   repository_name: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetImagesResult]
    func GetImages(ctx *Context, args *GetImagesArgs, opts ...InvokeOption) (*GetImagesResult, error)
    func GetImagesOutput(ctx *Context, args *GetImagesOutputArgs, opts ...InvokeOption) GetImagesResultOutput

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

    public static class GetImages 
    {
        public static Task<GetImagesResult> InvokeAsync(GetImagesArgs args, InvokeOptions? opts = null)
        public static Output<GetImagesResult> Invoke(GetImagesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetImagesResult> getImages(GetImagesArgs args, InvokeOptions options)
    public static Output<GetImagesResult> getImages(GetImagesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: aws:ecr/getImages:getImages
      arguments:
        # arguments dictionary

    The following arguments are supported:

    RepositoryName string
    Name of the ECR Repository.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    RegistryId string
    ID of the Registry where the repository resides.
    RepositoryName string
    Name of the ECR Repository.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    RegistryId string
    ID of the Registry where the repository resides.
    repositoryName String
    Name of the ECR Repository.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    registryId String
    ID of the Registry where the repository resides.
    repositoryName string
    Name of the ECR Repository.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    registryId string
    ID of the Registry where the repository resides.
    repository_name str
    Name of the ECR Repository.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    registry_id str
    ID of the Registry where the repository resides.
    repositoryName String
    Name of the ECR Repository.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    registryId String
    ID of the Registry where the repository resides.

    getImages Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    ImageIds List<GetImagesImageId>
    List of image objects containing image digest and tags. Each object has the following attributes:
    Region string
    RepositoryName string
    RegistryId string
    Id string
    The provider-assigned unique ID for this managed resource.
    ImageIds []GetImagesImageId
    List of image objects containing image digest and tags. Each object has the following attributes:
    Region string
    RepositoryName string
    RegistryId string
    id String
    The provider-assigned unique ID for this managed resource.
    imageIds List<GetImagesImageId>
    List of image objects containing image digest and tags. Each object has the following attributes:
    region String
    repositoryName String
    registryId String
    id string
    The provider-assigned unique ID for this managed resource.
    imageIds GetImagesImageId[]
    List of image objects containing image digest and tags. Each object has the following attributes:
    region string
    repositoryName string
    registryId string
    id str
    The provider-assigned unique ID for this managed resource.
    image_ids Sequence[GetImagesImageId]
    List of image objects containing image digest and tags. Each object has the following attributes:
    region str
    repository_name str
    registry_id str
    id String
    The provider-assigned unique ID for this managed resource.
    imageIds List<Property Map>
    List of image objects containing image digest and tags. Each object has the following attributes:
    region String
    repositoryName String
    registryId String

    Supporting Types

    GetImagesImageId

    ImageDigest string
    The sha256 digest of the image manifest.
    ImageTag string
    The tag associated with the image.
    ImageDigest string
    The sha256 digest of the image manifest.
    ImageTag string
    The tag associated with the image.
    imageDigest String
    The sha256 digest of the image manifest.
    imageTag String
    The tag associated with the image.
    imageDigest string
    The sha256 digest of the image manifest.
    imageTag string
    The tag associated with the image.
    image_digest str
    The sha256 digest of the image manifest.
    image_tag str
    The tag associated with the image.
    imageDigest String
    The sha256 digest of the image manifest.
    imageTag String
    The tag associated with the image.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v7.5.0 published on Wednesday, Aug 20, 2025 by Pulumi