diff --git a/examples/complete/main.tf b/examples/complete/main.tf index 55a32b0..bbf6397 100644 --- a/examples/complete/main.tf +++ b/examples/complete/main.tf @@ -15,6 +15,10 @@ module "ecr" { push_and_pull_accounts = [data.aws_cloudtrail_service_account.main.id] max_untagged_image_count = 5 max_tagged_image_count = 50 + tags = { + Terraform = "true" + Environment = "dev" + } } data "aws_cloudtrail_service_account" "main" {} diff --git a/main.tf b/main.tf index 25007fb..20397df 100644 --- a/main.tf +++ b/main.tf @@ -17,6 +17,7 @@ resource "aws_ecr_repository" "this" { image_scanning_configuration { scan_on_push = var.scan_on_push } + tags = var.tags } # https://www.terraform.io/docs/providers/aws/r/ecr_repository_policy.html diff --git a/variables.tf b/variables.tf index 730f92f..0b67417 100644 --- a/variables.tf +++ b/variables.tf @@ -43,3 +43,9 @@ variable "image_tag_mutability" { type = string description = "Whether images are allowed to overwrite existing tags." } + +variable "tags" { + description = "A map of tags to add to ecr repository" + type = map(string) + default = {} +}