https://github.com/byu-oit/terraform-aws-ecr
Terraform module to create an ECR repository
https://github.com/byu-oit/terraform-aws-ecr
standard terraform-module
Last synced: about 1 month ago
JSON representation
Terraform module to create an ECR repository
- Host: GitHub
- URL: https://github.com/byu-oit/terraform-aws-ecr
- Owner: byu-oit
- License: apache-2.0
- Created: 2019-12-18T18:02:25.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2023-07-14T18:20:16.000Z (about 3 years ago)
- Last Synced: 2025-03-05T22:32:12.688Z (over 1 year ago)
- Topics: standard, terraform-module
- Language: HCL
- Size: 34.2 KB
- Stars: 1
- Watchers: 18
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Terraform AWS ECR
Terraform module to create an ECR repository with lifecycle and repository policies
## Usage
```hcl
module "ecr" {
source = "github.com/byu-oit/terraform-aws-ecr?ref=v2.0.1"
name = "example-app"
}
```
## Requirements
* Terraform version 0.12.16 or greater
## Inputs
| Name | Type | Description | Default |
| --- | --- | --- | --- |
| name | string | Repository name | |
| image_tag_mutability | string | The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE | IMMUTABLE |
| scan_image_on_push | boolean | Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false) | true |
| lifecycle_policy | string | ECR Lifecycle Policy (json string) to manage the image lifecycles in the ECR repository | JSON policy that only keeps latest 100 images |
| repository_policy | string | ECR Repository Policy (json string) to manage access to the ECR repository | JSON policy that allows CodeBuild service to pull any image from this ECR repo |
| tags | map(string) | A map of AWS Tags to attach to each resource created | {} |
## Outputs
| Name | Type | Description |
| --- | --- | --- |
| repository | [object](https://www.terraform.io/docs/providers/aws/r/ecr_repository.html#attributes-reference) | ECR repository object |
| lifecycle_policy | [object](https://www.terraform.io/docs/providers/aws/r/ecr_lifecycle_policy.html#attributes-reference) | The repository's lifecycle policy object |
| repository_policy | [object](https://www.terraform.io/docs/providers/aws/r/ecr_repository_policy.html#attributes-reference) | The repository's repository policy object |