From 240368150558494391e8931988bfaa4c31f474ad Mon Sep 17 00:00:00 2001 From: Srini Nangunuri Date: Wed, 9 Apr 2025 14:53:54 -0400 Subject: [PATCH] pointing ecr images to eecr account --- copy_images.tf | 15 +++++++++++---- variables.tf | 14 ++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/copy_images.tf b/copy_images.tf index ed05587..5277c55 100644 --- a/copy_images.tf +++ b/copy_images.tf @@ -7,8 +7,8 @@ locals { enabled = true dest_path = null name = "istio/pilot" - source_image = "istio/pilot" - source_registry = "docker.io" + source_image = "ironbank/opensource/istio/pilot" + source_registry = var.source_registry source_tag = var.istio_version tag = var.istio_version }, @@ -16,8 +16,8 @@ locals { enabled = true dest_path = null name = "istio/proxyv2" - source_image = "istio/proxyv2" - source_registry = "docker.io" + source_image = "ironbank/opensource/istio/proxyv2" + source_registry = var.source_registry source_tag = var.istio_version tag = var.istio_version }, @@ -32,7 +32,14 @@ module "images" { image_config = local.image_config tags = {} + source_username = data.aws_ecr_authorization_token.token.user_name + source_password = data.aws_ecr_authorization_token.token.password + enable_lifecycle_policy = true lifecycle_policy_all = true force_delete = true } + +data "aws_ecr_authorization_token" "token" { + registry_id = var.registry_id +} diff --git a/variables.tf b/variables.tf index bd11eb6..6375d25 100644 --- a/variables.tf +++ b/variables.tf @@ -36,6 +36,20 @@ variable "tags" { default = {} } +#source registry (enterpriser ecr account) where source image is being copied into target account +variable "source_registry" { + description = "source of the image or enterprise ECR account" + type = string + default = "269222635945.dkr.ecr.us-gov-east-1.amazonaws.com/ent-images" +} + +#source registry (enterpriser ecr account) +variable "registry_id" { + description = "source of the image or enterprise ECR account" + type = string + default = "269222635945" +} + # helm repo add istio https://istio-release.storage.googleapis.com/charts # helm search repo istio/istiod variable "istio_chart_version" {