AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.4.0 published on Wednesday, May 4, 2022 by Pulumi

getRepository

The ECR Repository data source allows the ARN, Repository URI and Registry ID to be retrieved for an ECR repository.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var service = Output.Create(Aws.Ecr.GetRepository.InvokeAsync(new Aws.Ecr.GetRepositoryArgs
        {
            Name = "ecr-repository",
        }));
    }

}
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.LookupRepository(ctx, &ecr.LookupRepositoryArgs{
			Name: "ecr-repository",
		}, 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 service = Output.of(EcrFunctions.getRepository(GetRepositoryArgs.builder()
            .name("ecr-repository")
            .build()));

        }
}
import pulumi
import pulumi_aws as aws

service = aws.ecr.get_repository(name="ecr-repository")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const service = pulumi.output(aws.ecr.getRepository({
    name: "ecr-repository",
}));
variables:
  service:
    Fn::Invoke:
      Function: aws:ecr:getRepository
      Arguments:
        name: ecr-repository

Using getRepository

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 getRepository(args: GetRepositoryArgs, opts?: InvokeOptions): Promise<GetRepositoryResult>
function getRepositoryOutput(args: GetRepositoryOutputArgs, opts?: InvokeOptions): Output<GetRepositoryResult>
def get_repository(name: Optional[str] = None,
                   registry_id: Optional[str] = None,
                   tags: Optional[Mapping[str, str]] = None,
                   opts: Optional[InvokeOptions] = None) -> GetRepositoryResult
def get_repository_output(name: Optional[pulumi.Input[str]] = None,
                   registry_id: Optional[pulumi.Input[str]] = None,
                   tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryResult]
func LookupRepository(ctx *Context, args *LookupRepositoryArgs, opts ...InvokeOption) (*LookupRepositoryResult, error)
func LookupRepositoryOutput(ctx *Context, args *LookupRepositoryOutputArgs, opts ...InvokeOption) LookupRepositoryResultOutput

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

public static class GetRepository 
{
    public static Task<GetRepositoryResult> InvokeAsync(GetRepositoryArgs args, InvokeOptions? opts = null)
    public static Output<GetRepositoryResult> Invoke(GetRepositoryInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRepositoryResult> getRepository(GetRepositoryArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:ecr/getRepository:getRepository
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Name string

The name of the ECR Repository.

RegistryId string

The registry ID where the repository was created.

Tags Dictionary<string, string>

A map of tags assigned to the resource.

Name string

The name of the ECR Repository.

RegistryId string

The registry ID where the repository was created.

Tags map[string]string

A map of tags assigned to the resource.

name String

The name of the ECR Repository.

registryId String

The registry ID where the repository was created.

tags Map

A map of tags assigned to the resource.

name string

The name of the ECR Repository.

registryId string

The registry ID where the repository was created.

tags {[key: string]: string}

A map of tags assigned to the resource.

name str

The name of the ECR Repository.

registry_id str

The registry ID where the repository was created.

tags Mapping[str, str]

A map of tags assigned to the resource.

name String

The name of the ECR Repository.

registryId String

The registry ID where the repository was created.

tags Map

A map of tags assigned to the resource.

getRepository Result

The following output properties are available:

Arn string

Full ARN of the repository.

EncryptionConfigurations List<Pulumi.Aws.Ecr.Outputs.GetRepositoryEncryptionConfiguration>

Encryption configuration for the repository. See Encryption Configuration below.

Id string

The provider-assigned unique ID for this managed resource.

ImageScanningConfigurations List<Pulumi.Aws.Ecr.Outputs.GetRepositoryImageScanningConfiguration>

Configuration block that defines image scanning configuration for the repository. See Image Scanning Configuration below.

ImageTagMutability string

The tag mutability setting for the repository.

Name string
RegistryId string
RepositoryUrl string

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

Tags Dictionary<string, string>

A map of tags assigned to the resource.

Arn string

Full ARN of the repository.

EncryptionConfigurations []GetRepositoryEncryptionConfiguration

Encryption configuration for the repository. See Encryption Configuration below.

Id string

The provider-assigned unique ID for this managed resource.

ImageScanningConfigurations []GetRepositoryImageScanningConfiguration

Configuration block that defines image scanning configuration for the repository. See Image Scanning Configuration below.

ImageTagMutability string

The tag mutability setting for the repository.

Name string
RegistryId string
RepositoryUrl string

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

Tags map[string]string

A map of tags assigned to the resource.

arn String

Full ARN of the repository.

encryptionConfigurations ListRepositoryEncryptionConfiguration>

Encryption configuration for the repository. See Encryption Configuration below.

id String

The provider-assigned unique ID for this managed resource.

imageScanningConfigurations ListRepositoryImageScanningConfiguration>

Configuration block that defines image scanning configuration for the repository. See Image Scanning Configuration below.

imageTagMutability String

The tag mutability setting for the repository.

name String
registryId String
repositoryUrl String

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

tags Map

A map of tags assigned to the resource.

arn string

Full ARN of the repository.

encryptionConfigurations GetRepositoryEncryptionConfiguration[]

Encryption configuration for the repository. See Encryption Configuration below.

id string

The provider-assigned unique ID for this managed resource.

imageScanningConfigurations GetRepositoryImageScanningConfiguration[]

Configuration block that defines image scanning configuration for the repository. See Image Scanning Configuration below.

imageTagMutability string

The tag mutability setting for the repository.

name string
registryId string
repositoryUrl string

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

tags {[key: string]: string}

A map of tags assigned to the resource.

arn str

Full ARN of the repository.

encryption_configurations Sequence[GetRepositoryEncryptionConfiguration]

Encryption configuration for the repository. See Encryption Configuration below.

id str

The provider-assigned unique ID for this managed resource.

image_scanning_configurations Sequence[GetRepositoryImageScanningConfiguration]

Configuration block that defines image scanning configuration for the repository. See Image Scanning Configuration below.

image_tag_mutability str

The tag mutability setting for the repository.

name str
registry_id str
repository_url str

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

tags Mapping[str, str]

A map of tags assigned to the resource.

arn String

Full ARN of the repository.

encryptionConfigurations List

Encryption configuration for the repository. See Encryption Configuration below.

id String

The provider-assigned unique ID for this managed resource.

imageScanningConfigurations List

Configuration block that defines image scanning configuration for the repository. See Image Scanning Configuration below.

imageTagMutability String

The tag mutability setting for the repository.

name String
registryId String
repositoryUrl String

The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName).

tags Map

A map of tags assigned to the resource.

Supporting Types

GetRepositoryEncryptionConfiguration

EncryptionType string

The encryption type to use for the repository, either AES256 or KMS.

KmsKey string

If encryption_type is KMS, the ARN of the KMS key used.

EncryptionType string

The encryption type to use for the repository, either AES256 or KMS.

KmsKey string

If encryption_type is KMS, the ARN of the KMS key used.

encryptionType String

The encryption type to use for the repository, either AES256 or KMS.

kmsKey String

If encryption_type is KMS, the ARN of the KMS key used.

encryptionType string

The encryption type to use for the repository, either AES256 or KMS.

kmsKey string

If encryption_type is KMS, the ARN of the KMS key used.

encryption_type str

The encryption type to use for the repository, either AES256 or KMS.

kms_key str

If encryption_type is KMS, the ARN of the KMS key used.

encryptionType String

The encryption type to use for the repository, either AES256 or KMS.

kmsKey String

If encryption_type is KMS, the ARN of the KMS key used.

GetRepositoryImageScanningConfiguration

ScanOnPush bool

Indicates whether images are scanned after being pushed to the repository.

ScanOnPush bool

Indicates whether images are scanned after being pushed to the repository.

scanOnPush Boolean

Indicates whether images are scanned after being pushed to the repository.

scanOnPush boolean

Indicates whether images are scanned after being pushed to the repository.

scan_on_push bool

Indicates whether images are scanned after being pushed to the repository.

scanOnPush Boolean

Indicates whether images are scanned after being pushed to the repository.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.