How to pass parameter to UserData in AWS template

"EnableWebServer": {
"Default": "No",
"Description": "Enable Web Server in the Ubuntu or not",
"Type": "String"
}
"UserData": {
"Fn::Base64": {
"Fn::Join": [
"",
[
"#!/bin/bash -xe\n",
"if [[ \"Yes\" == ",
{
"Ref": "EnableWebServer"
},
" ]]; then ",
"echo yes > /tmp/1.txt; ",
"else ",
"echo no > /tmp/1.txt;",
"fi\n",
]
]
}
}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store