I have an EC2 Instance with Windows, and I need to run a python3/selenium code automatically right after it starts.
I have tried USER-DATA but no success.
The objective is set a process to run automated tests to our portal automatically after the instance boot, without any manual interaction.
I have tried creating an USER-DATA script like:
<script>
python c:\script.py
</script>
or
<powershell>
python c:\script.py
</powershell>"
I expected that at the end of boot it will start the python script, but no success
C:\ProgramData\Amazon\EC2-Windows\Launch\Log\UserdataExecution.log. For older Windows versions, look inC:\Program Files\Amazon\Ec2ConfigService\Logs\Ec2Config.log. Are you launching a new instance, or merely changing the User Data on an existing instance? See also: Running Commands on Your Windows Instance at Launch