Watching this many dependencies could DDoS your servers!

Hi,

I’m running into the above message when generating config files from the vault. It’s a rather huge commercial product we’re working on, which has literally hundreds of passwords being generated, but I feel like the way I’m generating the template is sane, but I’m new to this particular templating system so I’m wondering if there’s some way to do it differently such that it doesn’t give this message.

A pseudo code version of the code that’s generating the file is:

{{ $vars := sprig_list "a" "b" }}
{{ range $a := $vars }}
{{ range $secret := secrets (printf "app/name/env/static/%s" $a) }}
{{ range $k, $v := secret (printf "app/name/env/static/%s/%s" $a $secret).Data.data }}
{{ $k }}: {{ $v }}
{{ end }}
{{ end }}
{{ end }}

Ignore any potential typos in that – I just put it together to give an example of what I’m doing.

The first call to secret that assigns the range comes back with over 700 results. The k,v assignment underneath typically only comes back with 1 or 2 per entry, but that line is the one that gives the DDoS error and it goes away if I remove it.

Is there a better way I can be writing this to make that error go away?