AWS Amazon ECR Repository

This page shows how to write Terraform and CloudFormation for Amazon ECR Repository and write them securely.

code-icon

Fix issues in your cloud & app configurations

Test for misconfigurations of this resource in your cloud.

get-started-button

Terraform Example (aws_ecrpublic_repository)

Provides a Public Elastic Container Registry Repository.

NOTE: This resource can only be used with us-east-1 region.

Parameters

Example Usage (from GitHub)

github-iconfalcosecurity/test-infra
resource "aws_ecrpublic_repository" "falcosidekick" {
  provider = aws.us

  repository_name = "falcosidekick"

  catalog_data {
github-iconsomleng/somleng-switch
resource "aws_ecrpublic_repository" "app" {
  repository_name = "somleng-switch"
  provider = aws.us-east-1

  catalog_data {
    about_text        = "Somleng Switch"
github-iconnautible/nautible-infra
resource "aws_ecrpublic_repository" "ecr_payment_cash" {
  provider        = aws.us_east_1
  repository_name = "nautible-app-payment-cash"
}

resource "aws_ecrpublic_repository" "ecr_payment_convenience" {
github-iconsomleng/somleng-scfm
resource "aws_ecrpublic_repository" "app" {
  repository_name = "scfm"
  provider = aws.us-east-1

  catalog_data {
    about_text        = "Somleng Simple Call Flow Manager (Somleng SCFM)"
github-iconsomleng/somleng
resource "aws_ecrpublic_repository" "app" {
  repository_name = "somleng"
  provider = aws.us-east-1

  catalog_data {
    about_text        = "Somleng"

CloudFormation Example (AWS::ECR::PublicRepository)

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

Parameters

RepositoryCatalogData The details about the repository that are publicly visible in the Amazon ECR Public Gallery. For more information, see Amazon ECR Public repository catalog data in the Amazon ECR Public User Guide.
Required: No
Type: Json
Update requires: No interruption

RepositoryName The name to use for the public 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, AWS CloudFormation generates a unique physical ID and uses that ID for the repository name. For more information, see Name Type.
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. Required: No
Type: String
Update requires: Replacement

RepositoryPolicyText The JSON repository policy text to apply to the public repository. For more information, see Amazon ECR Public repository policies in the Amazon ECR Public User Guide.
Required: No
Type: Json
Update requires: No interruption

Tags An array of key-value pairs to apply to this resource.
Required: No
Type: List of Tag
Update requires: No interruption

Frequently asked questions

What is AWS Amazon ECR Repository?

AWS Amazon ECR Repository is a resource for Amazon ECR of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon ECR Repository?

For Terraform, the falcosecurity/test-infra, somleng/somleng-switch and nautible/nautible-infra source code examples are useful. See the Terraform Example section for further details.