-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
element function on list of rendered templates fails with incorrect data #5828
Comments
Found the error:
I accidently assigned a list to a template var instead of a string.
Seems like handing a list to the template var completely throws off the template rendering. |
@gottwald Can you pls create a gist or something like that and present what 'mesos-master-init.sh.tpl' file contains? Thanks |
Don't have the original any more but something like this would do:
Was just referencing the vars, nothing fancy. |
Thanks @gottwald |
This is a proper error message and handled with 0.7 now. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I am experimenting with terraform and found something that looks like a bug when using templates in combination with count and the element function.
I've got a var definition like this:
And I render cloud instance start scripts as templates like this:
And with that, I create GCE instances like so:
Somehow the metadata_startup_script attribute is set to the value
mesos-master1
here instead of the rendered template.If I supply a rendered template by directly accessing the index of the list like
metadata_startup_script = "${template_file.mesos_master_init.0.rendered}"
, then I get a rendered script like I intended to.Is this a bug or am I doing something wrong?
Tested with Terraform v0.6.14
There is another Issue #5736 regarding count and templates that might be related.
The text was updated successfully, but these errors were encountered: