Configures an AWS ECR with enhanced scanning, applying multiple rules for different scan frequencies and repository filters.

Terraform Template

resource "aws_ecr_registry_scanning_configuration" "test" {

  rule {

    repository_filter {
      filter = *
      filter_type = "WILDCARD"
    }
    scan_frequency = "SCAN_ON_PUSH"
  }

  rule {

    repository_filter {
      filter = "example"
      filter_type = "WILDCARD"
    }
    scan_frequency = "CONTINUOUS_SCAN"
  }
  scan_type = "ENHANCED"
}