Skip to content

terrablocks/aws-ecr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Create an ECR repository

License Tests Checkov Commit Release

This terraform module will deploy the following services:

  • ECR Repository
  • ECR Repository Policy
  • ECR Repository Lifecycle Policy

Usage Instructions

Example

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

  name = "backend"
}

Requirements

Name Version
terraform >= 1.0
aws >= 4.0.0

Inputs

Name Description Type Default Required
name Name of ECR repository string n/a yes
kms_key ID/Alias/ARN of KMS key to use for SSE encryption. You can skip this to use default AWS managed key string "alias/aws/ecr" no
image_tag_mutability Whether to allow image overwrite string "IMMUTABLE" no
scan_image_on_push Enable scanning of container image for vulnerabilities on push bool true no
ecr_resource_policy To attach a resource policy to ECR repository provide a JSON formatted policy document. Refer to AWS doc for creating the policy document string "" no
apply_default_lifecycle_policy Whether to create a lifecycle policy to delete container image after 30 days. Set this to false if you are passing custom policy bool true no
custom_lifecycle_policy Pass a custom JSON formatted string policy document. Refer to AWS doc for creating the policy document string "" no
tags Map of key value pair to associate with ECR repo map(string) {} no

Outputs

Name Description
arn ARN of ECR repository
id The registry ID where the repository was created
url URL of the repository