AWS Cloudwatch Canary Oauth API Monitoring.

0

I am trying to setup a canary on our API. Our API requires a Oauth2 token. Keys and secrets to generate this token are kept in secrets manager. I used a Python script to run system tests, that uses the 'Oauth2lib' to generate this token, and this system works fine. I tried to use the same technique in a custom canary script, but it refuses to find the library, just get module not found, "ModuleNotFoundError: No module named 'oauthlib'" I've built this locally, all the packages are at root, the python file in in the 'python' direction (not consistent with other lambdas I might add). I built and uploaded to s3, created a canary and added the file via s3. After resolving the handler entry point, it finds the Python script fine, but refuses to find the library. I found some instructions here, https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries_WritingCanary_Python.html but don't feel they are complete, at least not for me. So can you tell me how I get this working please? Thanks Leona.

Leona
질문됨 2년 전827회 조회
1개 답변
0

TL;DR put everything in /python In case anyone comes across this post, the documentation is a little poor in that it says only the .py code needs to be in /python. This is not true, as you need to put all the required libraries in that directory too, then they'll get picked up, else they will not be found.

Leona
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠