Are you looking for an efficient way to manage your Docker images in AWS? Look no further! Our team has extensive experience working with AWS ECS and has optimized this Terraform module for AWS Elastic Container Registry (ECR) that includes a lifecycle policy.
This module makes it easy to set up and manage your ECR repositories, as well as automatically delete images that are older than 30 days, saving you storage space and reducing your costs. The lifecycle policy ensures that your repositories are clean and up-to-date, freeing up resources and improving the performance of your application.
Our team has optimized this Terraform module to provide a seamless experience for users. Whether you are just getting started with containers or looking to enhance your current setup, this module provides a preconfigured solution for efficiently managing your ECS Cluster with enabled Container Insights, logging, and advanced monitoring.
With this Terraform module, you can quickly set up and manage your ECR repositories, and take advantage of the benefits of a lifecycle policy, all with just a few simple commands. Try it out today!
Name | Description | Type | Default | Required |
---|---|---|---|---|
encryption_type | The encryption type to use for the repository. | string |
"AES256" |
no |
force_delete | Delete the repository even if it contains images. | bool |
false |
no |
image_tag_mutability | The tag mutability setting for the repository. | string |
"MUTABLE" |
no |
kms_key | The ARN of the KMS key to use for encryption. | string |
null |
no |
lifecycle_rules | Lifecycle policy rules for expiring images. | list(object({ |
[ |
no |
name | Name of the ECR repository. | string |
n/a | yes |
policy | Repository policy document in JSON format. | string |
null |
no |
scan_on_push | Indicates whether images are scanned after being pushed to the repository. | bool |
true |
no |
tags | Tags to add to the ECR repository. | map(any) |
{} |
no |
Name | Description |
---|---|
arn | The ARN of the repository. |
name | The name of the repository. |
url | The URL of the repository (in the form aws_account_id.dkr.ecr.region.amazonaws.com/repositoryName). |
Name | Version |
---|---|
aws | >= 4.36 |
jq | 0.2.1 |
- resource.aws_ecr_lifecycle_policy.main (main.tf#43)
- resource.aws_ecr_repository.main (main.tf#19)
- resource.aws_ecr_repository_policy.main (main.tf#36)
- data source.jq_query.main (main.tf#52)
module "basic_example" {
source = "../.."
name = var.name
}