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:
"cfn-signal -e 0",
" --resource AutoscalingGroup",
" --stack ", Ref("AWS::StackName"),
" --region ", Ref("AWS::Region"), "\n"
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?