1. Packages
  2. AWS Cloud Control
  3. API Docs
  4. ecr
  5. getRepository

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.27.0 published on Monday, Apr 14, 2025 by Pulumi

aws-native.ecr.getRepository

Explore with Pulumi AI

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.27.0 published on Monday, Apr 14, 2025 by Pulumi

The AWS::ECR::Repository resource specifies an Amazon Elastic Container Registry (Amazon ECR) repository, where users can push and pull Docker images, Open Container Initiative (OCI) images, and OCI compatible artifacts. For more information, see Amazon ECR private repositories in the Amazon ECR User Guide.

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>
Copy
def get_repository(repository_name: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetRepositoryResult
def get_repository_output(repository_name: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryResult]
Copy
func LookupRepository(ctx *Context, args *LookupRepositoryArgs, opts ...InvokeOption) (*LookupRepositoryResult, error)
func LookupRepositoryOutput(ctx *Context, args *LookupRepositoryOutputArgs, opts ...InvokeOption) LookupRepositoryResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetRepositoryResult> getRepository(GetRepositoryArgs args, InvokeOptions options)
public static Output<GetRepositoryResult> getRepository(GetRepositoryArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws-native:ecr:getRepository
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

RepositoryName This property is required. string
The name to use for the repository. The repository name may be specified on its own (such as nginx-web-app) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app). If you don't specify a name, CFNlong generates a unique physical ID and uses that ID for the repository name. For more information, see Name type. The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes. If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
RepositoryName This property is required. string
The name to use for the repository. The repository name may be specified on its own (such as nginx-web-app) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app). If you don't specify a name, CFNlong generates a unique physical ID and uses that ID for the repository name. For more information, see Name type. The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes. If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
repositoryName This property is required. String
The name to use for the repository. The repository name may be specified on its own (such as nginx-web-app) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app). If you don't specify a name, CFNlong generates a unique physical ID and uses that ID for the repository name. For more information, see Name type. The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes. If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
repositoryName This property is required. string
The name to use for the repository. The repository name may be specified on its own (such as nginx-web-app) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app). If you don't specify a name, CFNlong generates a unique physical ID and uses that ID for the repository name. For more information, see Name type. The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes. If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
repository_name This property is required. str
The name to use for the repository. The repository name may be specified on its own (such as nginx-web-app) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app). If you don't specify a name, CFNlong generates a unique physical ID and uses that ID for the repository name. For more information, see Name type. The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes. If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
repositoryName This property is required. String
The name to use for the repository. The repository name may be specified on its own (such as nginx-web-app) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app). If you don't specify a name, CFNlong generates a unique physical ID and uses that ID for the repository name. For more information, see Name type. The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes. If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

getRepository Result

The following output properties are available:

Arn string
Returns the Amazon Resource Name (ARN) for the specified AWS::ECR::Repository resource. For example, arn:aws:ecr: *eu-west-1* : *123456789012* :repository/ *test-repository* .
ImageScanningConfiguration Pulumi.AwsNative.Ecr.Outputs.RepositoryImageScanningConfiguration
The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
ImageTagMutability Pulumi.AwsNative.Ecr.RepositoryImageTagMutability
The tag mutability setting for the repository. If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.
LifecyclePolicy Pulumi.AwsNative.Ecr.Outputs.RepositoryLifecyclePolicy
Creates or updates a lifecycle policy. For information about lifecycle policy syntax, see Lifecycle policy template.
RepositoryPolicyText object

The JSON repository policy text to apply to the repository. For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide.

Search the CloudFormation User Guide for AWS::ECR::Repository for more information about the expected schema for this property.

RepositoryUri string
Returns the URI for the specified AWS::ECR::Repository resource. For example, *123456789012* .dkr.ecr. *us-west-2* .amazonaws.com/repository .
Tags List<Pulumi.AwsNative.Outputs.Tag>
An array of key-value pairs to apply to this resource.
Arn string
Returns the Amazon Resource Name (ARN) for the specified AWS::ECR::Repository resource. For example, arn:aws:ecr: *eu-west-1* : *123456789012* :repository/ *test-repository* .
ImageScanningConfiguration RepositoryImageScanningConfiguration
The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
ImageTagMutability RepositoryImageTagMutability
The tag mutability setting for the repository. If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.
LifecyclePolicy RepositoryLifecyclePolicy
Creates or updates a lifecycle policy. For information about lifecycle policy syntax, see Lifecycle policy template.
RepositoryPolicyText interface{}

The JSON repository policy text to apply to the repository. For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide.

Search the CloudFormation User Guide for AWS::ECR::Repository for more information about the expected schema for this property.

RepositoryUri string
Returns the URI for the specified AWS::ECR::Repository resource. For example, *123456789012* .dkr.ecr. *us-west-2* .amazonaws.com/repository .
Tags Tag
An array of key-value pairs to apply to this resource.
arn String
Returns the Amazon Resource Name (ARN) for the specified AWS::ECR::Repository resource. For example, arn:aws:ecr: *eu-west-1* : *123456789012* :repository/ *test-repository* .
imageScanningConfiguration RepositoryImageScanningConfiguration
The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
imageTagMutability RepositoryImageTagMutability
The tag mutability setting for the repository. If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.
lifecyclePolicy RepositoryLifecyclePolicy
Creates or updates a lifecycle policy. For information about lifecycle policy syntax, see Lifecycle policy template.
repositoryPolicyText Object

The JSON repository policy text to apply to the repository. For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide.

Search the CloudFormation User Guide for AWS::ECR::Repository for more information about the expected schema for this property.

repositoryUri String
Returns the URI for the specified AWS::ECR::Repository resource. For example, *123456789012* .dkr.ecr. *us-west-2* .amazonaws.com/repository .
tags List<Tag>
An array of key-value pairs to apply to this resource.
arn string
Returns the Amazon Resource Name (ARN) for the specified AWS::ECR::Repository resource. For example, arn:aws:ecr: *eu-west-1* : *123456789012* :repository/ *test-repository* .
imageScanningConfiguration RepositoryImageScanningConfiguration
The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
imageTagMutability RepositoryImageTagMutability
The tag mutability setting for the repository. If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.
lifecyclePolicy RepositoryLifecyclePolicy
Creates or updates a lifecycle policy. For information about lifecycle policy syntax, see Lifecycle policy template.
repositoryPolicyText any

The JSON repository policy text to apply to the repository. For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide.

Search the CloudFormation User Guide for AWS::ECR::Repository for more information about the expected schema for this property.

repositoryUri string
Returns the URI for the specified AWS::ECR::Repository resource. For example, *123456789012* .dkr.ecr. *us-west-2* .amazonaws.com/repository .
tags Tag[]
An array of key-value pairs to apply to this resource.
arn str
Returns the Amazon Resource Name (ARN) for the specified AWS::ECR::Repository resource. For example, arn:aws:ecr: *eu-west-1* : *123456789012* :repository/ *test-repository* .
image_scanning_configuration RepositoryImageScanningConfiguration
The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
image_tag_mutability RepositoryImageTagMutability
The tag mutability setting for the repository. If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.
lifecycle_policy RepositoryLifecyclePolicy
Creates or updates a lifecycle policy. For information about lifecycle policy syntax, see Lifecycle policy template.
repository_policy_text Any

The JSON repository policy text to apply to the repository. For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide.

Search the CloudFormation User Guide for AWS::ECR::Repository for more information about the expected schema for this property.

repository_uri str
Returns the URI for the specified AWS::ECR::Repository resource. For example, *123456789012* .dkr.ecr. *us-west-2* .amazonaws.com/repository .
tags Sequence[root_Tag]
An array of key-value pairs to apply to this resource.
arn String
Returns the Amazon Resource Name (ARN) for the specified AWS::ECR::Repository resource. For example, arn:aws:ecr: *eu-west-1* : *123456789012* :repository/ *test-repository* .
imageScanningConfiguration Property Map
The image scanning configuration for the repository. This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
imageTagMutability "MUTABLE" | "IMMUTABLE"
The tag mutability setting for the repository. If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten. If IMMUTABLE is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.
lifecyclePolicy Property Map
Creates or updates a lifecycle policy. For information about lifecycle policy syntax, see Lifecycle policy template.
repositoryPolicyText Any

The JSON repository policy text to apply to the repository. For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide.

Search the CloudFormation User Guide for AWS::ECR::Repository for more information about the expected schema for this property.

repositoryUri String
Returns the URI for the specified AWS::ECR::Repository resource. For example, *123456789012* .dkr.ecr. *us-west-2* .amazonaws.com/repository .
tags List<Property Map>
An array of key-value pairs to apply to this resource.

Supporting Types

RepositoryImageScanningConfiguration

ScanOnPush bool
The setting that determines whether images are scanned after being pushed to a repository. If set to true, images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started.
ScanOnPush bool
The setting that determines whether images are scanned after being pushed to a repository. If set to true, images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started.
scanOnPush Boolean
The setting that determines whether images are scanned after being pushed to a repository. If set to true, images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started.
scanOnPush boolean
The setting that determines whether images are scanned after being pushed to a repository. If set to true, images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started.
scan_on_push bool
The setting that determines whether images are scanned after being pushed to a repository. If set to true, images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started.
scanOnPush Boolean
The setting that determines whether images are scanned after being pushed to a repository. If set to true, images will be scanned after being pushed. If this parameter is not specified, it will default to false and images will not be scanned unless a scan is manually started.

RepositoryImageTagMutability

RepositoryLifecyclePolicy

LifecyclePolicyText string
The JSON repository policy text to apply to the repository.
RegistryId string
The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
LifecyclePolicyText string
The JSON repository policy text to apply to the repository.
RegistryId string
The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
lifecyclePolicyText String
The JSON repository policy text to apply to the repository.
registryId String
The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
lifecyclePolicyText string
The JSON repository policy text to apply to the repository.
registryId string
The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
lifecycle_policy_text str
The JSON repository policy text to apply to the repository.
registry_id str
The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.
lifecyclePolicyText String
The JSON repository policy text to apply to the repository.
registryId String
The AWS account ID associated with the registry that contains the repository. If you do not specify a registry, the default registry is assumed.

Tag

Key This property is required. string
The key name of the tag
Value This property is required. string
The value of the tag
Key This property is required. string
The key name of the tag
Value This property is required. string
The value of the tag
key This property is required. String
The key name of the tag
value This property is required. String
The value of the tag
key This property is required. string
The key name of the tag
value This property is required. string
The value of the tag
key This property is required. str
The key name of the tag
value This property is required. str
The value of the tag
key This property is required. String
The key name of the tag
value This property is required. String
The value of the tag

Package Details

Repository
AWS Native pulumi/pulumi-aws-native
License
Apache-2.0

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.27.0 published on Monday, Apr 14, 2025 by Pulumi