You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gitlab file data return the content in base64 encoded format. To pass content of the file to the templatestring function it is required to base64 decode. But base64decode function is not allowed inside templatestring
╷
│ Error: Invalid function argument
│
│ on modules/main.tf line 179, in resource "gitlab_repository_file" "kustomization_yaml":
│ 179: content = templatestring(base64decode(data.gitlab_repository_file.boilerplate_yamls["kustomization.yaml.tftpl"].content), {
│ 180: helm_version = local.chart_version,
│ 181: releaseName = each.key,
│ 182: namespace = "${each.key}-${local.namespace_prefix}",
│ 183: })
│ ├────────────────
│ │ while calling templatestring(template, vars)
│
│ Invalid value for "template" parameter: invalid template expression: must be a direct reference to a single string from elsewhere, containing valid Terraform template
│ syntax.
Attempted Solutions
For every template file read with gitlab file data, adding a local variable to assign the decoded string.
This makes it require to add a new local variable defined for every template file
Thanks for this feature request! If you are viewing this issue and would like to indicate your interest, please use the 👍 reaction on the issue description to upvote this issue. We also welcome additional use case descriptions.
Terraform Version
Use Cases
Gitlab file data return the content in base64 encoded format. To pass content of the file to the
templatestring
function it is required to base64 decode. Butbase64decode
function is not allowed insidetemplatestring
Error message.
Attempted Solutions
For every template file read with gitlab file data, adding a local variable to assign the decoded string.
Proposal
Support the inbuilt terraform function usage in the template string function
Eg:-
References
No response
The text was updated successfully, but these errors were encountered: