Skip to content

Commit

Permalink
chore: use loop to build issuers values and output them
Browse files Browse the repository at this point in the history
  • Loading branch information
lconsuegra committed Nov 9, 2023
1 parent cffb474 commit 018083b
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 8 deletions.
5 changes: 5 additions & 0 deletions aks/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ output "id" {
description = "ID to pass other modules in order to refer to this module as a dependency."
value = module.cert-manager.id
}

output "issuers" {
description = "List of issuers created by cert-manager"
value = module.cert-manager.issuers
}
5 changes: 5 additions & 0 deletions eks/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ output "id" {
description = "ID to pass other modules in order to refer to this module as a dependency."
value = module.cert-manager.id
}

output "issuers" {
description = "List of issuers created by cert-manager"
value = module.cert-manager.issuers
}
27 changes: 19 additions & 8 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
locals {
issuers = {
letsencrypt = {
prod = {
name = "letsencrypt-prod"
email = "[email protected]"
server = "https://acme-v02.api.letsencrypt.org/directory"
}
staging = {
name = "letsencrypt-staging"
email = "[email protected]"
server = "https://acme-staging-v02.api.letsencrypt.org/directory"
}
}
}

helm_values = [{
cert-manager = {
installCRDs = true
Expand All @@ -12,14 +27,10 @@ locals {
}
}
letsencrypt = {
issuers = {
letsencrypt-prod = {
email = "[email protected]"
server = "https://acme-v02.api.letsencrypt.org/directory"
}
letsencrypt-staging = {
email = "[email protected]"
server = "https://acme-staging-v02.api.letsencrypt.org/directory"
issuers = { for issuer_id, issuer in local.issuers.letsencrypt :
issuer.name => {
email = issuer.email
server = issuer.server
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ output "id" {
description = "ID to pass other modules in order to refer to this module as a dependency."
value = resource.null_resource.this.id
}

output "issuers" {
description = "List of issuers created by cert-manager"
value = local.issuers
}
5 changes: 5 additions & 0 deletions scaleway/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ output "id" {
description = "ID to pass other modules in order to refer to this module as a dependency."
value = module.cert-manager.id
}

output "issuers" {
description = "List of issuers created by cert-manager"
value = module.cert-manager.issuers
}
5 changes: 5 additions & 0 deletions self-signed/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ output "id" {
description = "ID to pass other modules in order to refer to this module as a dependency."
value = module.cert-manager.id
}

output "issuers" {
description = "List of issuers created by cert-manager"
value = module.cert-manager.issuers
}
5 changes: 5 additions & 0 deletions sks/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ output "id" {
description = "ID to pass other modules in order to refer to this module as a dependency."
value = module.cert-manager.id
}

output "issuers" {
description = "List of issuers created by cert-manager"
value = module.cert-manager.issuers
}

0 comments on commit 018083b

Please sign in to comment.