From 9569db56301f20afc4c3b3a186703bea5fed138e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Can=C3=A9vet?= Date: Sun, 22 Nov 2020 09:47:06 +0100 Subject: [PATCH] Create ArgoCD's pipeline token with Terraform --- modules/argocd-helm/main.tf | 22 ++++++++++++++++++++++ modules/argocd-helm/outputs.tf | 4 ++++ modules/eks-aws/main.tf | 7 ++++--- modules/eks-aws/values.tmpl.yaml | 4 ++++ modules/k3os-libvirt/main.tf | 23 ++++++++++++----------- modules/k3os-libvirt/values.tmpl.yaml | 4 ++++ modules/k3s-docker/main.tf | 23 ++++++++++++----------- modules/k3s-docker/values.tmpl.yaml | 4 ++++ 8 files changed, 66 insertions(+), 25 deletions(-) create mode 100644 modules/argocd-helm/outputs.tf diff --git a/modules/argocd-helm/main.tf b/modules/argocd-helm/main.tf index 3bf798e739..6e202b8eeb 100644 --- a/modules/argocd-helm/main.tf +++ b/modules/argocd-helm/main.tf @@ -1,3 +1,18 @@ +locals { + iat = 1605854613 # An arbitrary Unix timestamp before than now + + argocd_accounts_pipeline_tokens = jsonencode( + [ + { + id = random_uuid.accounts_pipeline_token_id.result + iat = local.iat + } + ] + ) +} + +resource "random_uuid" "accounts_pipeline_token_id" {} + resource "helm_release" "argocd" { name = "argocd" chart = "${path.module}/../../argocd/argocd" @@ -7,5 +22,12 @@ resource "helm_release" "argocd" { values = [ file("${path.module}/../../argocd/argocd/values.yaml"), + <