I am following this blog available in AWS market place to automate the integration.
Initially I got an error message that Python 3.7 runtime is not supported. I updated the runtime to Python 3.8 in aws-snowflake-integrationobject.yml.
Now I am getting
Runtime.ImportModuleError: Unable to import module 'index': No module named 'requests' Traceback (most recent call last):
when I try to execute the stack. Its failing in the "SnowflakeResources" step.
When I go through the snowflakelayers.zip I am able to find the request folder inside that. Whether I have to create new zip file for the version change. I am newbie. I am just following the steps with the help of Google search.
As you have indicated, the blog, and hence the layer, was written with Python 3.7 runtime.
The directory structure of a Lambda layer for Python runtime contains the runtime version:
python/lib/python3.x/site-packages
You can verify this in the snowflakelayer.zip
as well that the directory is python3.7
. This is why it failed to find the module.
So, you are right in that you have to recreate the layer for newer Python runtimes, if you want to follow this blog.
Alternatively, follow Snowflake documentation for configuring integrations and automate it using your own IaC solution. It's quite straightforward. I do think the blog's method of using a Lambda function, which as you have experienced first-hand involves maintaining its code, runtime, and dependencies, is a bit of an overkill for setting this up.