diff --git a/infrastructure/cloud/modules/container/ecr.tf b/infrastructure/cloud/modules/container/ecr.tf new file mode 100644 index 00000000..5372dece --- /dev/null +++ b/infrastructure/cloud/modules/container/ecr.tf @@ -0,0 +1,13 @@ +resource "aws_ecr_repository" "aws_ecr_repository" { + name = "${var.ecr_repository_name}-${var.environment}" + image_tag_mutability = "MUTABLE" + + image_scanning_configuration { + scan_on_push = true + } + + tags = { + env = var.environment + name = "${var.ecr_repository_name}-${var.environment}" + } +} diff --git a/infrastructure/cloud/modules/container/outputs.tf b/infrastructure/cloud/modules/container/outputs.tf new file mode 100644 index 00000000..ca0e0cd8 --- /dev/null +++ b/infrastructure/cloud/modules/container/outputs.tf @@ -0,0 +1,4 @@ +output "ecr_url" { + description = "The ECR URL." + value = try(aws_ecr_repository.aws_ecr_repository.repository_url, "") +} diff --git a/infrastructure/cloud/modules/container/variables.tf b/infrastructure/cloud/modules/container/variables.tf new file mode 100644 index 00000000..0299e29a --- /dev/null +++ b/infrastructure/cloud/modules/container/variables.tf @@ -0,0 +1,13 @@ + + +variable "environment" { + type = string + description = "The environment to deploy the application to" + default = "dev" +} + +variable "ecr_repository_name" { + type = string + description = "Name of AWS ECR Repository" + default = "aws-ecr-repository" +}