Hello, I am attempt to use the api/v2/runs api with variable overrides but when the run executes the variables are not being over ridden from values in the post body?
I have a terraform variable called “deployment_version” which I am attempting to pass thru the runs call to deploy a new version of the component. Is there something obvious that I’m doing incorrectly?
{
"data": {
"attributes": {
"variables": [
{
"key": "deployment_version",
"value": "0.0.33"
}
],
"message": "CLI 0.0.33 attempt."
},
"type": "runs",
"relationships": {
"workspace": {
"data": {
"type": "workspaces",
"id": "ws-iYjbVFEk6m5LbvrL"
}
}
}
}
}
maxb
April 28, 2023, 1:16pm
2
I am not familiar with this feature myself, but the documentation you linked to does say:
All values must be expressed as an HCL literal in the same syntax you would use when writing Terraform code.
and 0.0.33
would not be a valid HCL literal.
The example in the linked documentation shows additional quoting being used when passing a string:
{ "key": "access_key", "value": "\"ABCDE12345\"" }
maxb:
am not familiar with this feature myself, but the documentation you linked to does say:
All values must be expressed as an HCL literal in the same syntax you would use when writing Terraform code.
and 0.0.33
would not be a valid HCL literal.
The example in the linked documentation shows additional quoting being used when passing a string:
Great find, I didn’t notice that on my read thru. I’ll give it a try. Thank you.
No luck, I wish there was a way I could see the variables for a run. I have since tried to update the variable type to be HCL in the variable config.