How can I troubleshoot running user data scripts to configure my EC2 Windows instance?
"I have problems modifying the user data or running user data scripts on my Amazon Elastic Compute Cloud (Amazon EC2) Windows instance. Or, I want to view the user data logs but don't know where they are."
"I have problems modifying the user data or running user data scripts on my Amazon Elastic Compute Cloud (Amazon EC2) Windows instance. Or, I want to view the user data logs but don't know where they are.ResolutionYou modified or configured the user data, but it doesn't run on instance launch or you can't configure the user dataWhen you work with user data, keep the following criteria in mind:User data must be Base64-encoded.User data is limited to 16 KB, in raw form, before it is Base64-encoded.User data must be Base64-decoded when retrieved. If you retrieve the data with instance metadata or the Amazon EC2 console, then it's automatically decoded for you.If you stop an instance and then modify its user data, then the updated user data doesn't run when you start the instance.User data scripts require a specific syntax. For more information and examples of script syntax, see User data scripts.User data doesn't run on subsequent reboots or startsFor more information, see How do I run a command on an existing EC2 Windows instance when I reboot or start the instance?You can't find the user data logsThe log files for EC2Launch v2, EC2Launch, and EC2Config contain the output from the standard output and standard error streams. You can access the log files at the following locations:EC2Launch v2: C:\ProgramData\Amazon\EC2Launch\log\agent.logEC2Launch: C:\ProgramData\Amazon\EC2-Windows\Launch\Log\UserdataExecution.logEC2Config: C:\Program Files\Amazon\Ec2ConfigService\Logs\Ec2ConfigLog.txtNote: By default, C:\ProgramData is a hidden folder.Related informationHow do I run a command on a new EC2 Windows instance at launch?Follow"