첫번째 교육 아카이브

terraform {
  required_version = ">=1.9.1"
  required_providers {
      aws = {
        source  = "hashicorp/aws"
        version = ">= 5.57.0"
    }
  } 
}

provider "aws" {}

variable "ecr_repository" {
  type = list(string)
  default = ["foo", "bar", "baz"]
}

resource "aws_ecr_repository" "ecr_repository" {
  for_each = toset(var.ecr_repository)

  name                 = each.key

  image_tag_mutability = "MUTABLE"

  encryption_configuration {
    encryption_type = "KMS"
  }

  image_scanning_configuration {
    scan_on_push = true
  }
}

Last updated

Was this helpful?