<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Mgmt_api_lib python modules in AWS Lambda in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Mgmt-api-lib-python-modules-in-AWS-Lambda/m-p/2888#M233</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I'm trying to use the example mgmt_api_lib and addAccessRule.py Python code within AWS Lambda&amp;nbsp; (python_bundle_1_2.zip).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I'm no developer and minimal scripting experience means I'm falling at the first hurdle. I need to upload the code I want to run (addAccessRule.py) &lt;EM&gt;and all of its dependencies &lt;/EM&gt;to the AWS web interface. The AWS help page describes the way to create the deployment package is to use :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;pip install &amp;lt;module name&amp;gt; -t &amp;lt;my project directory&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I unzipped the python_bundle_1_2.zip and the module I want to use, addAccessRule, has a structure as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;/add_access_rule/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addAccessRule.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /mgmt_api_lib&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __init__.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; api_exceptions.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; api_responses.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cp_mgmt_api.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Whenever I try installing this into a deployment package (instructions from AWS Lambda website suggest this is how to create the necessary package with all dependencies) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I see the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;richardsk$ pip install addAccessRule.py -t ~/project/&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;Collecting addAccessRule.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp; Could not find a version that satisfies the requirement addAccessRule.py (from versions: )&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;No matching distribution found for addAccessRule.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;I don't understand packaging/building so I'm not sure what I should do to use this sample code. The addAccessRule.py contains a line :&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;from mgmt_api_lib import *&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Fundamentally, AWS Lambda expects all python files needed to run my function in a single directory - any thoughts on how to do this gratefully received!&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Keith&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Dec 2016 14:53:36 GMT</pubDate>
    <dc:creator>Keith_Richards</dc:creator>
    <dc:date>2016-12-30T14:53:36Z</dc:date>
    <item>
      <title>Mgmt_api_lib python modules in AWS Lambda</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Mgmt-api-lib-python-modules-in-AWS-Lambda/m-p/2888#M233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I'm trying to use the example mgmt_api_lib and addAccessRule.py Python code within AWS Lambda&amp;nbsp; (python_bundle_1_2.zip).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I'm no developer and minimal scripting experience means I'm falling at the first hurdle. I need to upload the code I want to run (addAccessRule.py) &lt;EM&gt;and all of its dependencies &lt;/EM&gt;to the AWS web interface. The AWS help page describes the way to create the deployment package is to use :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;pip install &amp;lt;module name&amp;gt; -t &amp;lt;my project directory&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I unzipped the python_bundle_1_2.zip and the module I want to use, addAccessRule, has a structure as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;/add_access_rule/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addAccessRule.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /mgmt_api_lib&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __init__.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; api_exceptions.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; api_responses.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cp_mgmt_api.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Whenever I try installing this into a deployment package (instructions from AWS Lambda website suggest this is how to create the necessary package with all dependencies) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I see the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;richardsk$ pip install addAccessRule.py -t ~/project/&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;Collecting addAccessRule.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp; Could not find a version that satisfies the requirement addAccessRule.py (from versions: )&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;No matching distribution found for addAccessRule.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;I don't understand packaging/building so I'm not sure what I should do to use this sample code. The addAccessRule.py contains a line :&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;from mgmt_api_lib import *&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Fundamentally, AWS Lambda expects all python files needed to run my function in a single directory - any thoughts on how to do this gratefully received!&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s1" style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Keith&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2016 14:53:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Mgmt-api-lib-python-modules-in-AWS-Lambda/m-p/2888#M233</guid>
      <dc:creator>Keith_Richards</dc:creator>
      <dc:date>2016-12-30T14:53:36Z</dc:date>
    </item>
  </channel>
</rss>

