diff --git a/terraform/modules/happy-service-eks/main.tf b/terraform/modules/happy-service-eks/main.tf index feedcf3edb..19df5f805e 100644 --- a/terraform/modules/happy-service-eks/main.tf +++ b/terraform/modules/happy-service-eks/main.tf @@ -176,7 +176,7 @@ resource "kubernetes_deployment_v1" "deployment" { container { name = var.container_name - image = "${module.ecr.repository_url}:${var.image_tag}" + image = "${length(var.image_uri) == 0 ? module.ecr.repository_url : var.image_uri}:${var.image_tag}" command = var.cmd args = var.args image_pull_policy = var.image_pull_policy diff --git a/terraform/modules/happy-service-eks/variables.tf b/terraform/modules/happy-service-eks/variables.tf index a8c4e03794..0f82cddf37 100644 --- a/terraform/modules/happy-service-eks/variables.tf +++ b/terraform/modules/happy-service-eks/variables.tf @@ -51,6 +51,12 @@ variable "args" { default = [] } +variable "image_uri" { + type = string + description = "The image URI to deploy" + default = "" +} + variable "image_tag" { type = string description = "The image tag to deploy" diff --git a/terraform/modules/happy-stack-eks/main.tf b/terraform/modules/happy-stack-eks/main.tf index 8de5ba35fa..336a9dc0d9 100644 --- a/terraform/modules/happy-stack-eks/main.tf +++ b/terraform/modules/happy-stack-eks/main.tf @@ -166,6 +166,7 @@ module "services" { source = "../happy-service-eks" image_tag = lookup(var.image_tags, each.key, var.image_tag) + image_uri = var.image_uri tag_mutability = each.value.tag_mutability scan_on_push = each.value.scan_on_push container_name = each.value.name diff --git a/terraform/modules/happy-stack-eks/variables.tf b/terraform/modules/happy-stack-eks/variables.tf index 1bc8e6b346..ccbab06b1a 100644 --- a/terraform/modules/happy-stack-eks/variables.tf +++ b/terraform/modules/happy-stack-eks/variables.tf @@ -4,6 +4,12 @@ variable "app_name" { default = "" } +variable "image_uri" { + type = string + description = "The URI of the docker image to deploy, defaults to the image URI created by happy" + default = "" +} + variable "image_tags" { type = map(string) description = "Override image tag for each docker image"