title: Amazon EC2 user data script on instance startup - python script won't run?
body: <p>I am following the tutorial on <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html" rel="nofollow noreferrer">Running Commands on Your Linux Instance at Launch - Amazon Elastic Compute Cloud</a>.</p>
  
  <p>I have an EC2 instance and I've confirmed that running</p>
  
  <pre><code>python run.py
  </code></pre>
  
  <p>does exactly what I want (write a file to s3) when I run it through the command line. So in the web UI I added</p>
  
  <pre><code>#!/bin/bash
  
  python run.py
  </code></pre>
  
  <p>into the user data field. But when I start it back up nothing happens. I must be overlooking something, but not sure what it is. </p>
  
  <p>One thing that did surprise me was that all the python packages and scripts are still there when I start the instance back up, I thought everything would be wiped, and I would have to copy the script over from s3 after each launch. But I guess that's just the storage? Like I said I'm new to this, so any help will be appreciated!</p>