"FileName" :{
"Type" : "String",
"Default" : "cf-file.sh",
"AllowedValues": [ "cf-file.sh"]
},
"InstanceType" : {
"Description" : "WebServer EC2 instance type",
"Type" : "String",
"Default" : "t2.micro",
"AllowedValues" : ["t2.micro"],
"ConstraintDescription" : "must be a valid EC2 instance type."
},
"AMIID" :{
"Type": "String",
"Default":"ami-1ecae776",
"AllowedValues":["ami-1ecae776"]
}
},
"Resources" : {
"EC2Instance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"UserData" : {
"Fn::Base64" : {
"Fn::Join" : [
"",
[
"#!/bin/bash\n",
"yes y | yum install dos2unix\n",
"touch ",{ "Ref" : "FileName" },"\n",
"chmod 777 ",{ "Ref" : "FileName" },"\n"
]
]
}
},
"KeyName" : { "Ref" : "KeyName" },
"ImageId" : { "Ref" : "AMIID" }
}
},