Skip to content

Commit

Permalink
Merge pull request #9 from SCT-Engineering/copy-images
Browse files Browse the repository at this point in the history
Copy images
  • Loading branch information
morga471 committed Apr 14, 2025
2 parents d13d2e2 + 287f124 commit 783fba2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
30 changes: 23 additions & 7 deletions copy_images.tf
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
locals {
kiali_operator_key = format("%v#%v", "istio-tools/kiali-operator", var.kiali_application_version)
kiali_server_key = format("%v#%v", "istio-tools/kiali", var.kiali_application_version)
ent_ecr_source = format("%v.%v.%v.%v", var.account_id, "dkr.ecr", var.region, "amazonaws.com/ent-images")

image_config = [
## Images for Kiali
{
enabled = true
dest_path = null
name = "istio-tools/kiali-operator"
source_image = "kiali/kiali-operator"
source_registry = "quay.io"
source_image = "opensource/kiali/kiali-operator"
source_registry = format("%v/%v", local.ent_ecr_source, "ironbank")
source_tag = var.kiali_application_version
tag = var.kiali_application_version
},
{
enabled = true
dest_path = null
name = "istio-tools/kiali"
source_image = "kiali/kiali"
source_registry = "quay.io"
source_image = "opensource/kiali/kiali"
source_registry = format("%v/%v", local.ent_ecr_source, "ironbank")
source_tag = var.kiali_application_version
tag = var.kiali_application_version
},
Expand All @@ -33,7 +34,22 @@ module "images" {
image_config = local.image_config
tags = {}

enable_lifecycle_policy = true
lifecycle_policy_all = true
force_delete = true
enable_lifecycle_policy = true
lifecycle_policy_all = true
force_delete = true
lifecycle_policy_keep_count = 5

source_username = data.aws_ecr_authorization_token.ecr_token.user_name
source_password = data.aws_ecr_authorization_token.ecr_token.password

destination_username = data.aws_ecr_authorization_token.token.user_name
destination_password = data.aws_ecr_authorization_token.token.password
}

data "aws_ecr_authorization_token" "ecr_token" {
registry_id = var.account_id
}

data "aws_ecr_authorization_token" "token" {
registry_id = var.account_id
}
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,15 @@ variable "service_name" {
type = string
default = "kiali"
}

variable "account_id" {
description = "aws account number"
type = string
default = ""
}

variable "region" {
description = "region name"
type = string
default = "us-gov-east-1"
}

0 comments on commit 783fba2

Please sign in to comment.