Skip to content

Commit

Permalink
pull from ent-ecr
Browse files Browse the repository at this point in the history
  • Loading branch information
morga471 committed Apr 14, 2025
1 parent 95f606a commit 04f62cb
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 39 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Common issues and solutions:

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.88.0 |
| <a name="provider_helm"></a> [helm](#provider\_helm) | 2.17.0 |

## Modules
Expand All @@ -85,11 +86,14 @@ Common issues and solutions:
| Name | Type |
|------|------|
| [helm_release.keycloak](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [aws_ecr_authorization_token.ecr_token](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ecr_authorization_token) | data source |
| [aws_ecr_authorization_token.token](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ecr_authorization_token) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_account_id"></a> [account\_id](#input\_account\_id) | aws account number | `string` | `""` | no |
| <a name="input_cluster_domain"></a> [cluster\_domain](#input\_cluster\_domain) | The domain name used to reference ingresses for the cluster. | `string` | n/a | yes |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | EKS cluster name name component used through out the EKS cluster describing its purpose (ex: dice-dev) | `string` | n/a | yes |
| <a name="input_default_storage_class"></a> [default\_storage\_class](#input\_default\_storage\_class) | The default storage class to use for persistent volumes | `string` | `"gp3-encrypted"` | no |
Expand Down
31 changes: 18 additions & 13 deletions copy_images.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ locals {
keycloak_name = "bitnami/keycloak"
keycloak_key = format("%v#%v", local.keycloak_name, var.keycloak_tag)
postgresql_key = format("%v#%v", "bitnami/postgresql", var.postgresql_tag)

ent_ecr_source = format("%v.%v.%v.%v", var.account_id, "dkr.ecr", var.region, "amazonaws.com/ent-images")

image_config = [
{
enabled = true
dest_path = null
name = "bitnami/keycloak"
source_image = "bitnami/keycloak"
source_registry = "public.ecr.aws"
source_registry = format("%v/%v", local.ent_ecr_source, "public-ecr")
source_tag = var.keycloak_tag
tag = var.keycloak_tag
},
Expand All @@ -19,19 +19,10 @@ locals {
dest_path = null
name = "bitnami/postgresql"
source_image = "bitnami/postgresql"
source_registry = "public.ecr.aws"
source_registry = format("%v/%v", local.ent_ecr_source, "public-ecr")
source_tag = var.postgresql_tag
tag = var.postgresql_tag
},
# {
# enabled = true
# dest_path = null
# name = "gogatekeeper"
# source_image = "bitnami/keycloak-gatekeeper"
# source_registry = "public.ecr.aws"
# source_tag = var.gogatekeeper_tag
# tag = var.gogatekeeper_tag
# },
]
}

Expand All @@ -46,5 +37,19 @@ module "images" {
enable_lifecycle_policy = true
lifecycle_policy_all = true
force_delete = true
lifecycle_policy_keep_count = 3
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
}
58 changes: 32 additions & 26 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
variable "cluster_name" {
description = "EKS cluster name name component used through out the EKS cluster describing its purpose (ex: dice-dev)"
type = string
}

variable "profile" {
description = "AWS config profile used to upload images into ECR"
variable "account_id" {
description = "aws account number"
type = string
default = ""
}

variable "namespace" {
description = "The namespace which will be created and into which keycloak will be deployed."
variable "cluster_domain" {
description = "The domain name used to reference ingresses for the cluster."
type = string
default = "keycloak"
}

variable "keycloak_tag" {
description = "The image tag associated with the keycloak_chart_version"
variable "cluster_name" {
description = "EKS cluster name name component used through out the EKS cluster describing its purpose (ex: dice-dev)"
type = string
default = "22.0.1-debian-11-r30"
}

variable "cluster_domain" {
description = "The domain name used to reference ingresses for the cluster."
variable "default_storage_class" {
description = "The default storage class to use for persistent volumes"
type = string
default = "gp3-encrypted"
}

variable "keycloak_database" {
Expand All @@ -32,22 +26,40 @@ variable "keycloak_database" {
default = "keycloak"
}

variable "keycloak_password" {
description = "The initial password for the database."
type = string
default = "keycloak"
}

variable "keycloak_tag" {
description = "The image tag associated with the keycloak_chart_version"
type = string
default = "22.0.1-debian-11-r30"
}

variable "keycloak_user" {
description = "The username for the database."
type = string
default = "keycloak"
}

variable "keycloak_password" {
description = "The initial password for the database."
variable "namespace" {
description = "The namespace which will be created and into which keycloak will be deployed."
type = string
default = "keycloak"
}

variable "default_storage_class" {
description = "The default storage class to use for persistent volumes"
variable "postgresql_tag" {
description = "The tag of the postgresql image to use."
type = string
default = "gp3-encrypted"
default = "17.4.0"
}

variable "profile" {
description = "AWS config profile used to upload images into ECR"
type = string
default = ""
}

variable "service_name" {
Expand All @@ -61,9 +73,3 @@ variable "telemetry_namespace" {
type = string
default = "namespace"
}

variable "postgresql_tag" {
description = "The tag of the postgresql image to use."
type = string
default = "17.4.0"
}

0 comments on commit 04f62cb

Please sign in to comment.