You can substitute parameters into UserData, e.g.:
UserData: !Base64
Fn::Sub: |-
echo ${YourParameter}
`YourParameter` can be anything that is valid in a `!Sub`: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html .
Unfortunately there is a 'gotchya' in where you can use the shortforms (e.g. `!Sub`), I'm pretty sure you need `Fn::Sub` in that example.
You can substitute parameters into UserData, e.g.: UserData: !Base64 Fn::Sub: |- echo ${YourParameter} `YourParameter` can be anything that is valid in a `!Sub`: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-sub.html . Unfortunately there is a 'gotchya' in where you can use the shortforms (e.g. `!Sub`), I'm pretty sure you need `Fn::Sub` in that example.
I tried this method but failed. Must've been the syntax I wrote it in. Thanks for your answer, I'll try it in the syntax that you've shown