Giter VIP home page Giter VIP logo

terraform-aws-ecr's Introduction

terraform-aws-ecr

Terraform module to create AWS ECR resources.

Default configurations

  • Tag image mutability to IMMUTABLE.
  • Scanning image on push with BASIC mode.
  • Encryption type with AES256.
  • Always having a tag called ManagedBy with value Terraform

Usage

Basic Repository

module "ecr" {
  source = "git::[email protected]:cauealvesbraz/terraform-aws-ecr.git?ref=v1.0.0"

  name = "basic-repository-example"

  force_delete = true
  image_tag_mutability = "MUTABLE"

  tags = {
    environment = "dev"
  }
}

Registry Scanning Configuration

The image_scanning_configuration block supports the following:

registry_scanning_configuration = object({
  scan_type = string
  rules = optional(list(object({
    scan_frequency = string
    repository_filter = object({
      filter = string
    })
  })))
})

The following example shows how to create a repository with registry scanning configuration.

module "ecr" {
  source = "git::[email protected]:cauealvesbraz/terraform-aws-ecr.git?ref=v1.0.0"

  name = "basic-repository-example"

  force_delete = true
  image_tag_mutability = "MUTABLE"

  registry_scanning_configuration = {
    scan_type = "ENHANCED"
    rules = [
      {
        scan_frequency = "CONTINUOUS_SCAN"
        repository_filter = {
          filter = "*"
        }
      }
    ]
  }
}

Requirements

Name Version
terraform >= 1.32.2
hashicorp/aws >= 4.34

Modules

No modules.

Resources

Name Type
aws_ecr_repository.this resource
aws_ecr_registry_scanning_configuration.this resource

Inputs

Name Description Type Default Required
name Name of the repository. string "" yes
encryption.type Encryption configuration of the repository. string AES256 no
encryption.kms_key The ARN of KMS key. string "" no
image_tag_mutability The tag mutability setting for the repository. Must be one of: MUTABLE or IMMUTABLE. string "IMMUTABLE" no
force_delete If true, will delete the repository even if it contains images. boolean false no
scan_on_push Indicates whether images are scanned after being pushed to the repository. boolean true no
registry_scanning_configuration The registry scanning configuration object object.scan_type = "BASIC" no
tags A map of tags to add to resources map(string) {} no

Outputs

Name Description
repository_arn Full ARN of the repository
registry_id The registry ID of the repository
repository_url The URL of the repository

License

MIT

terraform-aws-ecr's People

Stargazers

 avatar

Watchers

 avatar  avatar

terraform-aws-ecr's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.