I have a PowerShell script, that when runs, installs a large application and start a server. This process takes about 20 minutes to run.
I would like to start this install process when the server is first created to avoid having to RDP into the server, and start the script manually.
The problem I'm having is that there is no sign of the user data script running in the server. There are no logs in C:\Program Files\Amazon
.
The cloudformation script looks like this:
"UserData": { "Fn::Base64": { "Fn::Join": ["", [
"<powershell>\n",
"Set-Location C:\\Users\\Administrator\\Documents\\installer-and-scripts\\ \n",
".\\AddNewAppServer.ps1 ", { "Ref" : "RDSEndpoint" }, " ", { "Ref" : "DBAdminUser" }, " ", { "Ref" : "DBAdminPassword" }, " ", { "Ref" : "S3BackupFileARN" }, " ", { "Ref" : "NewdbName" }, " \n",
"</powershell>"]]
}}
The five variables in UserData are parameters of the Cloudformation script and are just Strings.
Why do I not see any sign of this script running? Also, will having a 20-minute script cause issues in logging into the server or even run at all?
Thanks!