AWS Classic
getImage
The ECR Image data source allows the details of an image with a particular tag or digest to be retrieved.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var serviceImage = Output.Create(Aws.Ecr.GetImage.InvokeAsync(new Aws.Ecr.GetImageArgs
{
ImageTag = "latest",
RepositoryName = "my/service",
}));
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v5/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{
ImageTag: pulumi.StringRef("latest"),
RepositoryName: "my/service",
}, nil)
if err != nil {
return err
}
return nil
})
}
package generated_program;
import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var serviceImage = Output.of(EcrFunctions.getImage(GetImageArgs.builder()
.imageTag("latest")
.repositoryName("my/service")
.build()));
}
}
import pulumi
import pulumi_aws as aws
service_image = aws.ecr.get_image(image_tag="latest",
repository_name="my/service")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const serviceImage = pulumi.output(aws.ecr.getImage({
imageTag: "latest",
repositoryName: "my/service",
}));
variables:
serviceImage:
Fn::Invoke:
Function: aws:ecr:getImage
Arguments:
imageTag: latest
repositoryName: my/service
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,
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,
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)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: aws:ecr/getImage:getImage
Arguments:
# Arguments dictionary
The following arguments are supported:
- Repository
Name string The name of the ECR Repository.
- Image
Digest string The sha256 digest of the image manifest. At least one of
image_digest
orimage_tag
must be specified.- Image
Tag string The tag associated with this image. At least one of
image_digest
orimage_tag
must be specified.- Registry
Id string The ID of the Registry where the repository resides.
- Repository
Name string The name of the ECR Repository.
- Image
Digest string The sha256 digest of the image manifest. At least one of
image_digest
orimage_tag
must be specified.- Image
Tag string The tag associated with this image. At least one of
image_digest
orimage_tag
must be specified.- Registry
Id string The ID of the Registry where the repository resides.
- repository
Name String The name of the ECR Repository.
- image
Digest String The sha256 digest of the image manifest. At least one of
image_digest
orimage_tag
must be specified.- image
Tag String The tag associated with this image. At least one of
image_digest
orimage_tag
must be specified.- registry
Id String The ID of the Registry where the repository resides.
- repository
Name string The name of the ECR Repository.
- image
Digest string The sha256 digest of the image manifest. At least one of
image_digest
orimage_tag
must be specified.- image
Tag string The tag associated with this image. At least one of
image_digest
orimage_tag
must be specified.- registry
Id string The ID of the Registry where the repository resides.
- repository_
name str The name of the ECR Repository.
- image_
digest str The sha256 digest of the image manifest. At least one of
image_digest
orimage_tag
must be specified.- image_
tag str The tag associated with this image. At least one of
image_digest
orimage_tag
must be specified.- registry_
id str The ID of the Registry where the repository resides.
- repository
Name String The name of the ECR Repository.
- image
Digest String The sha256 digest of the image manifest. At least one of
image_digest
orimage_tag
must be specified.- image
Tag String The tag associated with this image. At least one of
image_digest
orimage_tag
must be specified.- registry
Id String The 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 The date and time, expressed as a unix timestamp, at which the current image was pushed to the repository.
- Image
Size intIn Bytes The size, in bytes, of the image in the repository.
- List<string>
The list of tags associated with this image.
- Registry
Id string - Repository
Name string - Image
Tag string
- Id string
The provider-assigned unique ID for this managed resource.
- Image
Digest string - Image
Pushed intAt The date and time, expressed as a unix timestamp, at which the current image was pushed to the repository.
- Image
Size intIn Bytes The size, in bytes, of the image in the repository.
- []string
The list of tags associated with this image.
- Registry
Id string - Repository
Name string - Image
Tag string
- id String
The provider-assigned unique ID for this managed resource.
- image
Digest String - image
Pushed IntegerAt The date and time, expressed as a unix timestamp, at which the current image was pushed to the repository.
- image
Size IntegerIn Bytes The size, in bytes, of the image in the repository.
- List
The list of tags associated with this image.
- registry
Id String - repository
Name String - image
Tag String
- id string
The provider-assigned unique ID for this managed resource.
- image
Digest string - image
Pushed numberAt The date and time, expressed as a unix timestamp, at which the current image was pushed to the repository.
- image
Size numberIn Bytes The size, in bytes, of the image in the repository.
- string[]
The list of tags associated with this image.
- registry
Id string - repository
Name string - image
Tag string
- id str
The provider-assigned unique ID for this managed resource.
- image_
digest str - image_
pushed_ intat The date and time, expressed as a unix timestamp, at which the current image was pushed to the repository.
- image_
size_ intin_ bytes The size, in bytes, of the image in the repository.
- Sequence[str]
The list of tags associated with this image.
- registry_
id str - repository_
name str - image_
tag str
- id String
The provider-assigned unique ID for this managed resource.
- image
Digest String - image
Pushed NumberAt The date and time, expressed as a unix timestamp, at which the current image was pushed to the repository.
- image
Size NumberIn Bytes The size, in bytes, of the image in the repository.
- List
The list of tags associated with this image.
- registry
Id String - repository
Name String - image
Tag String
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.