Skip to content

Commit

Permalink
feat: add variable to set boot secrets (#325)
Browse files Browse the repository at this point in the history
Signed-off-by: ankitm123 <[email protected]>
  • Loading branch information
ankitm123 authored Nov 11, 2021
1 parent 4913af8 commit 6c42f2e
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/jx3/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,16 @@ module "eks-jx" {
volume_type = "gp3"
volume_size = "100"
encrypt_volume_self = true
boot_secrets = [
{
name = "jxBootJobEnvVarSecrets.EXTERNAL_VAULT"
value = "true"
type = "string"
},
{
name = "jxBootJobEnvVarSecrets.VAULT_ADDR"
value = "http://ankitm123-ms-7c02:8200"
type = "string"
}
]
}
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ module "cluster" {
enable_logs_storage = var.enable_logs_storage
enable_reports_storage = var.enable_reports_storage
enable_repository_storage = var.enable_repository_storage
boot_secrets = var.boot_secrets
}

// ----------------------------------------------------------------------------
Expand Down
9 changes: 9 additions & 0 deletions modules/cluster/charts.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ resource "helm_release" "jx-git-operator" {
value = var.jx_bot_token
}

dynamic "set" {
for_each = toset(var.boot_secrets)
content {
name = set.value["name"]
value = set.value["value"]
type = set.value["type"]
}
}

depends_on = [
null_resource.kubeconfig
]
Expand Down
11 changes: 11 additions & 0 deletions modules/cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,14 @@ variable "tls_cert" {
type = string
default = ""
}


variable "boot_secrets" {
description = ""
type = list(object({
name = string
value = string
type = string
}))
default = []
}
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -626,3 +626,13 @@ variable "nginx_values_file" {
type = string
description = "Name of the values file which holds the helm chart values"
}

variable "boot_secrets" {
description = ""
type = list(object({
name = string
value = string
type = string
}))
default = []
}

0 comments on commit 6c42f2e

Please sign in to comment.