-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
userdata - interpolate stack variables into file #677
Comments
@brettswift In stacker we have the https://github.com/remind101/stacker/blob/master/stacker/lookups/handlers/file.py |
I haven't looked at the code but could there be a variant that does dictionary based string formatting against the file being imported? |
@phobologic cool - I'm pretty new to trop but stacker is on the radar as well. I'm more familiar with ruby but I'm sure there's a robust templating language on the python side that would be a good candidate. At risk of bloating the code for a fringe case. The simple one would be along the lines of @markpeek - pass a dict into the function and find / replace. Likely not a massively hard PR to throw in. Even for a ruby guy :) |
Another use case: For instance putting environment variables into a buildspec file for codebuild. It's nicer to have a buildspec as a .yml file a opposed to inline with \n carriage returns all over :) I haven't done the work around yet. I'm guessing someone has? |
@hybmg57 that will still result in a Base64 string though? #683 is another ticket I created that might solve this one, if we can bring files in that aren't base64 encoded, then you can wrap the result in a |
It'd be great if we could interpolate variables within an external userdata file.
Problem statement:
given this:
UserData=userdata.from_file('./templates/userdata/userdata.sh'),
and a requirement to drop in a cfn-signal that contains parameters at the end of the script:
I'd like to have a way to drop params and have them replaced within the external file. :)
Maybe there's a magical way I haven't come across?
The text was updated successfully, but these errors were encountered: