How to run ShellCommandActivity on my own EC2 instance?
<p>I am trying to run a simple command to test a ShellCommandActivity with Data Pipeline from AWS.</p>

<pre><code>&gt;&gt;&gt; /usr/bin/python /home/ubuntu/script.py
</code></pre>

<p>That script should create a file on a S3, I know I could create a S3 file using the same Data Pipeline, but I want to test how to execute the script.</p>

<p>When I execute the pipeline I get this error:</p>

<blockquote>
  <p>/usr/bin/python: can't open file '/home/ubuntu/script.py': [Errno 2] No such file or directory</p>
</blockquote>

<p>This is because AWS DP create a complete new EC2 instance when it runs, and my <code>script.py</code> is not there.</p>

<p>I created a Resource EC2
<a href="https://i.stack.imgur.com/DNs9G.png" rel="nofollow"><img src="https://i.stack.imgur.com/DNs9G.png" alt="enter image description here"></a></p>

<p>But there is not a field to define my own EC2 instance. How can I do this? Or maybe there some other way to approach this.</p>

<p>Thanks.</p>

<p>One workaround is directly execute script.py
like </p>

<p>"command": "script.py"</p>

<p>Be sure your script.py with header </p>

<pre><code>#!/usr/bin/env python
</code></pre>

python amazon-ec2 amazon-data-pipeline