aws-lambda

sqlite3 error on AWS lambda with Python 3

╄→гoц情女王★ 提交于 2019-12-20 09:31:09
问题 I am building a python 3.6 AWS Lambda deploy package and was facing an issue with SQLite . In my code I am using nltk which has a import sqlite3 in one of the files. Steps taken till now: Deployment package has only python modules that I am using in the root. I get the error: Unable to import module 'my_program': No module named '_sqlite3' Added the _sqlite3.so from /home/my_username/anaconda2/envs/py3k/lib/python3.6/lib-dynload/_sqlite3.so into package root. Then my error changed to: Unable

How to point ApiGateway to a specific Lambda alias

不羁的心 提交于 2019-12-20 09:16:14
问题 I created a resource in Amazon's ApiGateway. It is pointing to a Lambda function. This is being hit by a native mobile application (android and ios) which is already in the wild. I now want to modify the Lambda function, but I see no way to change my ApiGateway resource to point to an alias of the lambda. This is my first time playing with any of these technologies and I see no easy mechanism to manage this in the aws console. How can I modify my ApiGateway resource to point to my lambda

AWS Lambda scheduled event source via cloudformation

懵懂的女人 提交于 2019-12-20 09:14:28
问题 I already have my lambda / roles defined in cloudformation and would love to also use it to add a scheduled eventsources ... are there any docs or examples around ? 回答1: Use Aws::Event::Rule with a ScheduleExpression and a AWS::Lambda::Permission // rule to periodically call the lambda "TagWatcherRule": { "Type": "AWS::Events::Rule", "Properties": { "ScheduleExpression": "rate(10 minutes)", "Targets": [ { "Id": "TagWatcherScheduler", "Arn": { "Fn::GetAtt": [ "TagWatcherFunction", "Arn" ] } }

AWS Lambda Function is returning “Cannot find module 'index'” yet the handler in the config is set to index

淺唱寂寞╮ 提交于 2019-12-20 08:56:49
问题 As my title explains I am getting the following error: { "errorMessage": "Cannot find module 'index'", "errorType": "Error", "stackTrace": [ "Function.Module._resolveFilename (module.js:338:15)", "Function.Module._load (module.js:280:25)", "Module.require (module.js:364:17)", "require (module.js:380:17)" ] } I have tried both solutions provided in creating-a-lambda-function-in-aws-from-zip-file and simple-node-js-example-in-aws-lambda My config currently looks like: and my file structure is:

Cloudfront Lambda@edge set cookie on Viewer Request

你说的曾经没有我的故事 提交于 2019-12-20 06:28:04
问题 Update: Collected my thoughts better I'm generating a unique identifier (UUID) for each user in the Viewer Request Lambda, and then selecting a cached page to return based upon that UUID. This works. Ideally, this user would always have the same UUID. I must generate that UUID in the Viewer Request if it is not present in a cookie on that Viewer Request. I also need that UUID to be set as a cookie, which of course happens in the response not the request. Without caching, my server simply

Is it possible to use AMAZON LEX to build a chatbot which connects with database and Web service stored on client side?

一个人想着一个人 提交于 2019-12-20 05:46:44
问题 Our organization wants to develop a "LOST & FOUND System Application" using chatbot integrated in a website. Whenever the user starts the conversation with the chatbot, the chatbot should ask the details of lost item or item found and it should store the details in database. How can we do it ? And can we use our own web-service because organization doesn't want to keep the database in Amazon's Server. 回答1: As someone who just implemented this very same situation (with a lot of help from

How to get current time in Pacific Timezone when import pytz fails?

老子叫甜甜 提交于 2019-12-20 04:55:19
问题 I'm working in an environment (AWS Lambda) where import pytz doesn't work. The environment is set to UTC. How can I get the current time in the U.S. Pacific Timezone in this environment? I need something simple, and low-maintenance. Somehow forcing import pytz to work would be ideal, and I hope to avoid having to copy the entire pytz library into my own script. Details What have I tried so far? I tried using import pytz , and it failed with module not found. Example code? I tried this,

`body` parameter is absent in AWS Lambda Authorizer `event` object

与世无争的帅哥 提交于 2019-12-20 03:21:41
问题 The event object is missing body and isBase64Encoded properties. But they should be there according to the docs The full structure is the following: { "type": "REQUEST", "methodArn": "arn:aws:execute-api:us-west-2:*******:*******/development/POST/auth/login", "resource": "/{proxy+}", "path": "/auth/login", "httpMethod": "ANY", "headers": { ..... }, "queryStringParameters": { "test": "123" }, "pathParameters": { "proxy": "auth/login" }, "stageVariables": { "lambdaVersion": "development" },

AWS Lambda function timing out

筅森魡賤 提交于 2019-12-20 02:43:06
问题 In my local mocha tests the following handler function works just fine. However, when I upload to AWS (using Serverless framework) it times out (unless you don't provide a uid parameter where it then correctly responds immediately). What's particularly odd is that in less than 3 seconds (timeout is set at 5 seconds), the job completes and even the "post-facto" log message is output but it somehow calling the callback and that is not completing the Lambda function Here's the cloudwatch log: ]1

“AllAccessDisabled: All access to this object has been disabled” error being thrown when copying between S3 Buckets

安稳与你 提交于 2019-12-20 01:01:45
问题 I am getting this error: AllAccessDisabled: All access to this object has been disabled When performing the s3.copyObject function in my node Lambda function. Is this error being thrown because of insufficient permissions on the source bucket, or because of insufficient permissions on the target bucket? 回答1: This error means you are trying to access a bucket that has been locked down by AWS so that nobody can access it, regardless of permissions -- all access has been disabled. It can occur