title: Aws lambda call the sftp server and decrypt the new files and move them
body: <p>I have an sftp server in which some files come from 3rd parties in <code>~/raw/in/</code> folder as  <code>filename.enc</code> format. I want to decrypt it using <code>decrypt filename.enc</code> command and then that file gets placed in same folder and <code>.enc</code> get removed from that file and it becomes <code>.txt</code>, after that I want to move it to <code>~/res/in/</code> folder.</p>
  <p>I want to do this task using AWS lambda server every 5 minutes, to decrypt all the new files which have come to sftp server in <code>~/raw/in/</code> folder, and it should also authenticate the lambda server request.</p>
  <p>Now I think my lambda server code is ready but I am not getting the other part, should i make a shell script (then how will i call it and how to execute it), or do something else.</p>
  <p>LAMBDA CODE</p>
  <pre><code>def lambda_handler(event:, context:)
      uri = URI(&quot;&quot;)
      http =  Net::HTTP.new(uri.host,uri.port)
      http.use_ssl = true
      req = Net::HTTP::Get.new(uri)
      req.basic_auth &quot;username&quot;,&quot;password&quot;
      res = http.request(req)
      res.body
  end
  </code></pre>