Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lgallard/terraform-aws-ecr
Terraform module to create AWS ECR (Elastic Container Registry)
https://github.com/lgallard/terraform-aws-ecr
aws aws-ecr aws-ecr-terraform ecr-registry terraform terraform-module terraform-modules
Last synced: about 2 months ago
JSON representation
Terraform module to create AWS ECR (Elastic Container Registry)
- Host: GitHub
- URL: https://github.com/lgallard/terraform-aws-ecr
- Owner: lgallard
- License: apache-2.0
- Created: 2020-04-30T19:59:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-06-02T23:45:29.000Z (7 months ago)
- Last Synced: 2024-11-02T08:51:28.382Z (2 months ago)
- Topics: aws, aws-ecr, aws-ecr-terraform, ecr-registry, terraform, terraform-module, terraform-modules
- Language: HCL
- Homepage:
- Size: 37.1 KB
- Stars: 11
- Watchers: 3
- Forks: 20
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![Terraform](https://lgallardo.com/images/terraform.jpg)
# terraform-aws-ecr
Terraform module to create [AWS ECR](https://aws.amazon.com/ecr/) (Elastic Container Registry) which is a fully-managed Docker container registry.## Usage
You can use this module to create an ECR registry using few parameters (simple example) or define in detail every aspect of the registry (complete example).Check the [examples](examples/) for the **simple** and the **complete** snippets.
### Simple example
This example creates an ECR registry using few parameters```
module "ecr" {source = "lgallard/ecr/aws"
name = "ecr-repo-dev"
# Tags
tags = {
Owner = "DevOps team"
Environment = "dev"
Terraform = true
}}
```### Complete example
In this example the register is defined in detailed.```
module "ecr" {source = "lgallard/ecr/aws"
name = "ecr-repo-dev"
scan_on_push = true
timeouts_delete = "60m"
image_tag_mutability = "MUTABLE"# Note that currently only one policy may be applied to a repository.
policy = <
## RequirementsNo requirements.
## Providers
| Name | Version |
|------|---------|
| [aws](#provider\_aws) | 5.12.0 |## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [aws_ecr_lifecycle_policy.lifecycle_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecr_lifecycle_policy) | resource |
| [aws_ecr_repository.repo](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecr_repository) | resource |
| [aws_ecr_repository_policy.policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecr_repository_policy) | resource |
| [aws_kms_alias.kms_key_alias](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_alias) | resource |
| [aws_kms_key.kms_key](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_key) | resource |## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [encryption\_type](#input\_encryption\_type) | The encryption type to use for the repository. Valid values are `AES256` or `KMS` | `string` | `"AES256"` | no |
| [force\_delete](#input\_force\_delete) | If `true`, will delete the repository even if it contains images. Defaults to `false` | `bool` | `false` | no |
| [image\_scanning\_configuration](#input\_image\_scanning\_configuration) | Configuration block that defines image scanning configuration for the repository. By default, image scanning must be manually triggered. See the ECR User Guide for more information about image scanning. | `map(any)` | `null` | no |
| [image\_tag\_mutability](#input\_image\_tag\_mutability) | The tag mutability setting for the repository. Must be one of: `MUTABLE` or `IMMUTABLE`. | `string` | `"MUTABLE"` | no |
| [kms\_key](#input\_kms\_key) | The ARN of the KMS key to use when encryption\_type is `KMS`. If not specified when encryption\_type is `KMS`, uses a new KMS key. Otherwise, uses the default AWS managed key for ECR. | `string` | `null` | no |
| [lifecycle\_policy](#input\_lifecycle\_policy) | Manages the ECR repository lifecycle policy | `string` | `null` | no |
| [name](#input\_name) | Name of the repository. | `string` | n/a | yes |
| [policy](#input\_policy) | Manages the ECR repository policy | `string` | `null` | no |
| [scan\_on\_push](#input\_scan\_on\_push) | Indicates whether images are scanned after being pushed to the repository (true) or not scanned (false). | `bool` | `true` | no |
| [tags](#input\_tags) | A mapping of tags to assign to the resource. | `map(string)` | `{}` | no |
| [timeouts](#input\_timeouts) | Timeouts map. | `map(any)` | `{}` | no |
| [timeouts\_delete](#input\_timeouts\_delete) | How long to wait for a repository to be deleted. | `string` | `null` | no |## Outputs
| Name | Description |
|------|-------------|
| [arn](#output\_arn) | Full ARN of the repository |
| [name](#output\_name) | The name of the repository. |
| [registry\_id](#output\_registry\_id) | The registry ID where the repository was created. |
| [repository\_url](#output\_repository\_url) | The URL of the repository (in the form `aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName`) |