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
I've been trying to pass values present in a workflow context to the terraform.apply action as input to the variable_dict. I can confirm it is a properly formed dictionary of variable=value pairs, but terraform doesn't seem to know their values on execution.
As a manual workaround I've needed to write out a variables file using the core.local action and pass the variable filename to terraform.apply, but this is cludgy.
The text was updated successfully, but these errors were encountered:
Not sure if you've solved this for yourself already, but what I do for this is to create the dictionary in a python-runner action, then on action completion I return the dictionary along with my success status:
fromst2common.runners.base_actionimportActionclassMyAction(Action):
defrun(self, message):
some_dict= {
'apple': 'red',
'banana': 'yellow',
}
# maybe do more stuffreturn (True, some_dict)
After that you just need to publish the result to a variable in the workflow context, and then reference it in your terraform plan/apply/whatever. If I had to guess - you might not be referencing the contents of the variable properly using Jinja/YAQL:
EDIT: For sensitive/auth-y type stuff ie provider credentials or something, I actually do use the "write-to-file" pattern (although I'm using a python-runner with Jinja templates rather than core.local) because when you use the variable_dict parameter, the contents of the parameter will be shown in the web UI when you click on that particular action in the workflow step.
I've been trying to pass values present in a workflow context to the terraform.apply action as input to the variable_dict. I can confirm it is a properly formed dictionary of variable=value pairs, but terraform doesn't seem to know their values on execution.
As a manual workaround I've needed to write out a variables file using the core.local action and pass the variable filename to terraform.apply, but this is cludgy.
The text was updated successfully, but these errors were encountered: