32 lines
585 B
HCL
32 lines
585 B
HCL
terraform {
|
|
required_providers {
|
|
aws = {
|
|
source = "hashicorp/aws"
|
|
version = "~> 6.27"
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
provider "aws" {
|
|
region = var.aws_region
|
|
}
|
|
|
|
resource "aws_ecr_repository" "app" {
|
|
name = var.repository_name
|
|
image_tag_mutability = "MUTABLE" # or "IMMUTABLE"
|
|
|
|
image_scanning_configuration {
|
|
scan_on_push = true
|
|
}
|
|
|
|
encryption_configuration {
|
|
encryption_type = "AES256" # or "KMS" for customer managed keys
|
|
}
|
|
|
|
tags = {
|
|
Name = var.repository_name
|
|
Environment = var.environment
|
|
ManagedBy = "Terraform"
|
|
}
|
|
} |