Is it possible to run python script through AWSCLI (user-data). I tried but it didn't run and i have following in my logs
boot.log:2015-08-07 10:08:30,660 - __init__.py[WARNING]: Unhandled non-multipart (text/x-not-multipart) userdata: './step-1
cloud-init.log:2015-08-07 10:08:30,660 - __init__.py[WARNING]: Unhandled non-multipart (text/x-not-multipart) userdata: './step-1'
cloud-init-output.log:2015-08-07 10:08:30,660 - __init__.py[WARNING]: Unhandled non-multipart (text/x-not-multipart) userdata: './step-1'
Note step-1 is my script which i am trying to pass as user-data . Also my script is present in same directory from where i am running command so it should pick
The default interpreter seems to be Python. So if you simply want to execute a shell script you'll need to start with a hash-bang, for example:
#!/bin/bash
/yourpath/step-1
Please note, in order to debug this, try: cat /var/log/cloud-init-output.log And see: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-shell-scripts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With