jetbridge / psycopg2-lambda-layer Goto Github PK
View Code? Open in Web Editor NEWpsycopg2 Lambda Layer
psycopg2 Lambda Layer
I would like to have the following ARN available:
arn:aws:lambda:ap-southeast-1:898466741470:layer:psycopg2-py38:1
Hi.
Would it be possible to get the Python 3.7 layer in ap-southeast-2 (Sydney)?
Thanks a lot!
During deployment, this error occurs.
Serverless Error ---------------------------------------
An error occurred: MakeUnderscorequizLambdaFunction - User: arn:aws:iam::<me> is not authorized to perform: lambda:GetLayerVersion on resource: arn:aws:lambda:us-east-1:898466741470:layer:psycopg2:2 (Service: AWSLambdaInternal; Status Code: 403; Error Code: AccessDeniedException; Request ID: 6c379e94-315b-11e9-b1c8-51d17319cae3).
I've gone through and confirmed that the user account has full rights to perform the action and that the account used is in us-east-1
. When I perform simply try to access the version information, I receive:
An error occurred (AccessDeniedException) when calling the GetLayerVersion operation: User: arn:aws:iam::XXXXXXXXXXXX:user/XXXXXX-service is not authorized to perform: lambda:GetLayerVersion on resource: arn:aws:lambda:us-east-1:898466741470:layer:psycopg2-py37:2
My DevOps guys tells me I am doing it correctly, so what's up?
AWS Lambda supports Python 3.9 in all regions where Lambda is available from Mid August 2021.
AWS Lambda adds support for Python 3.9
Can you consider to provide 3.9 Layers?
Would it be possible to get a layer for us-west-2?
Using the python 3.6 layer, I am trying to use the sqlalchemy-redshift package.
This package has the following code in its __init__
module:
try:
import psycopg2 # noqa: F401
if get_distribution('psycopg2').parsed_version < parse_version('2.5'):
raise ImportError('Minimum required version for psycopg2 is 2.5')
This code is successfully importing psycopg2
, but is then failing with the following error:
Traceback (most recent call last):
File "/var/task/app.py", line 14, in <module>
import sqlalchemy_redshift # just testing
File "/var/task/sqlalchemy_redshift/__init__.py", line 5, in <module>
if get_distribution('psycopg2').parsed_version < parse_version('2.5'):
File "/var/lang/lib/python3.6/site-packages/pkg_resources/__init__.py", line 479, in get_distribution
dist = get_provider(dist)
File "/var/lang/lib/python3.6/site-packages/pkg_resources/__init__.py", line 355, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/var/lang/lib/python3.6/site-packages/pkg_resources/__init__.py", line 898, in require
needed = self.resolve(parse_requirements(requirements))
File "/var/lang/lib/python3.6/site-packages/pkg_resources/__init__.py", line 784, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'psycopg2' distribution was not found and is required by the application
This implies to me that something about the way the psycopg2 is installed isn't meeting all the requirements of some of the "standard" packaging tools in the Python world, but I am not 100% sure about all the details of this.
And thank you
":^)
Currently README lack of description for how to build layer ourselves and there are no references to serverless framework. It could be helpful for those who come searching for PostgreSQL layers whithout any knowledge about serverless
Would be a useful addition to me :-)
Thanks a lot !
Thanks
could you add support for us-east-2 for python 3.7?
many thanks
When I run aws lambda get-layer-version --layer-name arn:aws:lambda:eu-central-1:898466741470:layer:psycopg2-py37 --version-number 2 --region eu-central-1
I get
An error occurred (AccessDeniedException) when calling the GetLayerVersion operation: User: XXX is not authorized to perform: lambda:GetLayerVersion on resource: arn:aws:lambda:eu-central-1:898466741470:layer:psycopg2-py37:2
I tried the same with different regions as well, same result. Also same result when I attempt to use the layer in a cloudformation template.
Any hints?
Hello,
I tried to use the ARN given (arn:aws:lambda:sa-east-1:898466741470:layer:psycopg2-py37:1), but it didn't work. I got permission error. Could someone help please? Thanks.
I am getting a permissions error on arn:aws:lambda:us-west-2:898466741470:layer:psycopg2-py37:6, I just noticed it yesterday. Have used with not issues in the past.
User: arn:aws:iam::*MYUserId is not authorized to perform: lambda:GetLayerVersion on resource: arn:aws:lambda:us-west-2:898466741470:layer:psycopg2-py37:6 (Service: AWSLambdaInternal; Status Code: 403; Error Code: AccessDeniedException; Request ID: 252ed721-a226-4e96-add3-94e587e8413a; Proxy: null)
Also console error "you are not authorized to perform: lambda:GetLayerVersion" when logged into Oregan US-West-2, Also added additional permissions for GetLayerVersion, but user has full Lambda access and always worked before. Could it be from the recent updates you made?
Hi,
I would like to use your layer in eu-west-3.
Thanks
Regarding the PR that was merged yesterday, #42
Seems like the 3.9 version isn't yet available
Will the layers for Python 3.9 be redeployed anytime soon? Running into issues with compiling my own psycopg2 lambda layers, and this would be extremely useful to have! The region I'm particularly interested in is us-west-1
. Appreciate it!
Can you please add a layer for Python 3.8 in us-east-2? :)
Hi.. support for eu-west-1 (DUB) would be very cool. Thanks!
Hi,
Can you make available in ap-southeast-2 for python 3.8?
Thank you
arn:aws:lambda:us-east-1:898466741470:layer:psycopg2-py38:1 doesn't work, arn:aws:lambda:us-east-1:898466741470:layer:psycopg2-py38:2 does
Add psycopg2 region sa-east-1
The following command fails:
aws lambda get-layer-version --layer-name arn:aws:lambda:eu-central-1:898466741470:layer:psycopg2-py38 --version-number 1
though the following works fine:
aws lambda get-layer-version --layer-name arn:aws:lambda:eu-central-1:898466741470:layer:psycopg2-py37 --version-number 6
Please I need your help
Can you do this for python3.6?
Thanks
Can you please add a layer for Python 3.8 in ap-northeast-2 ? :)
Thanks a lot !
Could you add the ap-northeast-1 arn of Python 3.8.
thanks for very useful solutions !!
I'd like to create one for Py3.8
Hi, can you please add it on the new Europe region (eu-south-1 Milan) please?
Thank you sooo much
can I get layer for python 3.9 for us-east-1
Please add layer for ap-south-1.
I have successfully got the Lambda as part of the function configuration but when i use
import psycopg2-py38
in the code, i get a syntax error. I'm definitely using python v3.8. The error comes from the hyphen in the lambda layer name.
Is there a solution to this?
Can we please add a layer for psycopg2?
Region - us-west-2
Python version - 3.6
Just requesting an updated version of arn:aws:lambda:us-east-1:898466741470:layer:psycopg2-py37:3
Thank you!
Could you please add it?
We apologize for the inconvenience and thank you in advance for your time. ๐
psycopg2-lambda-layer is available for py3.8 in many regions but not in eu-west-2. It would be great to have it here.
Thank you very much,
Matias.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.