Closed kinseii closed 2 months ago
Interesting problem, should works. I'll check
I understood what the problem. Unfortunately, remoteState reference functions do not work with other templating functions.
username: {{ $USERNAME | b64enc }}
Problem is here | b64enc
.
Data processing in templating occurs at the initial stage before the generation of the terraform code and even before the processing of the output
function, which will also not work in this case. And in the case of remoteState
, data processing is generally on the terraform side. Therefore, no go-template functions are allowed in pipes after insertYaml
, remoteState
and output
. I also encountered this problem more than once, but it is not possible to solve it even for output
. Cdev is limited by the yaml syntax and templating process. The implementation of remoteState
/output
functions is quite complex. I recommend use local terraform wrapper modules for such data transformations.
I understood what the problem. Unfortunately, remoteState reference functions do not work with other templating functions.
username: {{ $USERNAME | b64enc }}
Problem is here
| b64enc
. Data processing in templating occurs at the initial stage before the generation of the terraform code and even before the processing of theoutput
function, which will also not work in this case. And in the case ofremoteState
, data processing is generally on the terraform side. Therefore, no go-template functions are allowed in pipes afterinsertYaml
,remoteState
andoutput
. I also encountered this problem more than once, but it is not possible to solve it even foroutput
. Cdev is limited by the yaml syntax and templating process. The implementation ofremoteState
/output
functions is quite complex. I recommend use local terraform wrapper modules for such data transformations.
OK, I'll check it, thank you!
It works, thank you!
Problem with passing values from remoteState to source template file of kubernetes unit.
The qwerty-credentials unit gets the strings from the Key Vault and passes it to the qwerty-credentials-k8s-secret unit to create a secret with those strings. After deploy we get the following error:
I looked at the
./cluster.dev/cache
directory and there are two.tf
files created there. One is a backend definition for saving the state file and the other is this one:So it seems that the kubernetes module, when creating a secret and passing a value to it from the state file via the remoteState function, is not creating the necessary terraform data-source and possibly other resources needed to do so.
Cluster.dev Version: cdev version v0.9.5