-
Notifications
You must be signed in to change notification settings - Fork 679
Description
Overview of the Issue
Currently the module allows the userdata set on the aws_launch_template to be overriden if the variable userdata_template is passed. However, that variable currently only accepts path to a userdata script as the value of it is passed to templatefile
here.
It would be good to have a way to pass the userdata script as a string itself rather than a path to a file.
Motivation for or Use Case
I ran into this issue while attempting to setup multiple runners on the same instance. I have my own scripts that are loaded and rendered through templatefile
that I want to pass as userdata to the module.
However, I am not finding any straightforward way of doing this, the only way I can currently do it is:
- Pre-built AMI
- Somehow generate a local temp file and pass the location of that. Terraform currently does not support the creation of temp file (being tracked at Mechanism for creating and using a local temporary directory hashicorp/terraform#21308). And I do not want to use the local provider to create files as there would be a diff in the plan depending on where the module is being called from.
Module version being used
0.40.0
Suggest a Fix
A fix would be to introduce another variable with would allow the user to pass the userdata script as a string instead of a path to a file.