terraform-provider-helm icon indicating copy to clipboard operation
terraform-provider-helm copied to clipboard

Unable to set "list" value in set block

Open benjah1 opened this issue 3 years ago • 3 comments

Terraform, Provider, Kubernetes and Helm Versions

Terraform version: 1.0.11
Provider version: 2.4.1
Kubernetes version: v1.19.10

Affected Resource(s)

  • helm_release

Terraform Configuration Files

resource "helm_release" "akeyless" {
...
  set {
    name = "akeylessUserAuth.allowedAccessIDs"
    value = "[\"p-789 subClimekey1=subClimeVaasdasdf sdfdsfcxvl1\" ,\"p-666 subClimekey2=subClimeVal2\"]"
  }
}

Steps to Reproduce

  1. terraform apply

Expected Behavior

The full value to be set in the secret.

Actual Behavior

The value is truncated. Only the following is passed into the secret,

[\"p-789 subClimekey1=subClimeVaasdasdf sdfdsfcxvl1\" 

Important Factoids

Unable to pass the full value

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

benjah1 avatar Nov 25 '21 23:11 benjah1

in additional, this also affect the json in string format,

  set {
    name = "customerFragments"
    value = "{\"customer_fragments\": [{\"id\": \"cf-et8u.....b3iw7\",\"value\": \"qrm0YoYSHb0j...JKb/zZmU8..yj4Ja/h/pa..Fvu4Esw==\",\"description\": \"MyFirstCF\"}]}"
  }

# show error,
Error: failed parsing key "customerFragments" with value {"customer_fragments": [{"id": "cf-et8u.....b3iw7","value": "qrm0YoYSHb0j...JKb/zZmU8..yj4Ja/h/pa..Fvu4Esw==","description": "MyFirstCF"}]}, key "]}" has no value

benjah1 avatar Dec 02 '21 17:12 benjah1

Try escaping your commas (passing the literal \, to the underlying helm provider via \\,:

resource "helm_release" "akeyless" {
...
  set {
    name = "akeylessUserAuth.allowedAccessIDs"
    value = "[\"p-789 subClimekey1=subClimeVaasdasdf sdfdsfcxvl1\"\\,\"p-666 subClimekey2=subClimeVal2\"]"
  }
  set {
    name = "customerFragments"
    value = "{\"customer_fragments\": [{\"id\": \"cf-et8u.....b3iw7\"\\,\"value\": \"qrm0YoYSHb0j...JKb/zZmU8..yj4Ja/h/pa..Fvu4Esw==\"\\,\"description\": \"MyFirstCF\"}]}"
  }
}

kclarkey avatar Dec 06 '21 04:12 kclarkey

Hi, this is to let you know that I'm facing the same problem with the provider version 2.5.1.

I did manage to get the provider to work by substituting the single command (,) with \\,.

esantoro avatar May 25 '22 12:05 esantoro

Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!

github-actions[bot] avatar May 26 '23 00:05 github-actions[bot]