aws-ecr

June 27, 2024 ยท View on GitHub

The aws-ecr is a generic Terraform module within the pippi.io family, maintained by Tech Chapter. The pippi.io modules are build to support common use cases often seen at Tech Chapters clients. They are created with best practices in mind and battle tested at scale. All modules are free and open-source under the Mozilla Public License Version 2.0.

The aws-ecr module is made to deploying AWS ECR resources on amazon.

Usage

module "ecr" {
  source = "github.com/pippiio/aws-ecr.git"

  global_pull_accounts = ["123456789"]
  global_push_accounts = ["987654321"]

  private_repositories = {
    "app" = {
      pull_accounts = ["657453672"]
    },
    "app2" = {
      pull_accounts = ["657453672"]
    }
  }

  public_repositories = {
    "app3" = {
      push_accounts = ["657453672"]

      about             = "App3 about"
      architectures     = ["ARM"]
      description       = "App3 description"
      logo_image_blob   = filebase64("img.png")
      operating_systems = ["Linux"]
      usage_text        = "pull"
    }
  }
}

Requirements

NameVersion
terraform>= 1.5.0
aws~> 5.0

Resources

NameType
aws_ecr_repository.thisresource
aws_ecr_repository_policy.thisresource
aws_ecrpublic_repository.thisresource
aws_ecrpublic_repository_policy.thisresource
aws_iam_access_key.artifact_userresource
aws_iam_user.artifact_userresource
aws_iam_user_policy.artifact_userresource
aws_kms_key.ecrresource
aws_caller_identity.currentdata source
aws_iam_policy_document.artifact_user_privatedata source
aws_iam_policy_document.artifact_user_publicdata source
aws_iam_policy_document.kmsdata source
aws_iam_policy_document.privatedata source
aws_iam_policy_document.publicdata source

Inputs

NameDescriptionTypeDefaultRequired
default_tagsA map of default tags, that will be applied to all resources applicable.map(string){}no
global_pull_accountsList of accounts that can pull from all the private repositorieslist(string)[]no
global_push_accountsList of accounts that can push to all the repositorieslist(string)[]no
name_prefixA prefix that will be used on all named resources.string"pippi-"no
private_repositoriesList of private repositories that should be created
map(object({
image_tag_mutability = optional(string)
pull_accounts = optional(list(string), [])
pull_role_arns = optional(list(string), [])
push_accounts = optional(list(string), [])
push_role_arns = optional(list(string), [])
create_iam_user = optional(bool, false)
}))
{}no
public_repositoriesList of public repositories that should be created
map(object({
about = optional(string)
architectures = optional(list(string))
description = optional(string)
logo_image_blob = optional(string)
operating_systems = optional(list(string))
usage_text = optional(string)
push_accounts = optional(list(string), [])
push_role_arns = optional(list(string), [])
create_iam_user = optional(bool, false)
}))
{}no

Outputs

NameDescription
iam_usersList of IAM users
private_repositoriesList of private ECR repositories
public_repositoriesList of public ECR repositories