aws-lambda

Having trouble to do if statement for Amazon Lex using AWS Lambda (python)

半腔热情 提交于 2019-12-13 02:49:58
问题 I am trying to do an if statement for amazon lex where if a user answers 'A' for question 1, user's next question will be question 2 but when user answers 'B', the user is brought to question 3 instead. For example, Example 1: Lex: "Do you like ice cream?" User: "Yes" Lex: "What flavour"? Example 2: Lex: "Do you like ice cream?" User: "No" Lex: "Do you like cake?" I know I have to do the validation in aws lambda (python) but I am not really sure what the code is for this to happen. 回答1: First

Does Amazon Web Services (AWS) Lambda support all Python libraries?

六眼飞鱼酱① 提交于 2019-12-13 02:39:46
问题 For example, I would like to use scikit-learn for machine learning, and pandas, numpy, and matplotlib/seaborn for data analysis. Does AWS Lambda support all these libraries? Is there a list of libraries supported? Or should I create a virtual server instead, to ensure I can use any Python library I want? 回答1: Those modules are not available by default. I found this (older) list of available modules, along with code to generate a current report of what is available, should you wish to do so:

Website deployment to AWS issues with domain

牧云@^-^@ 提交于 2019-12-12 23:31:31
问题 When I attempt to certify a Domain using I am getting this error: zappa certify BadRequestException: An error occurred (BadRequestException) when calling the CreateDomainName operation: The domain name you provided already exists. I have recently transferred this domain from GoDaddy to AWS. Does anyone know a solution to this issue? 来源: https://stackoverflow.com/questions/47216585/website-deployment-to-aws-issues-with-domain

Append string to a text file Nodejs in AWS Lambda

雨燕双飞 提交于 2019-12-12 20:24:26
问题 The scenario: A text file snapshot-ids.txt is located in a S3 bucket. I'm trying to create a Lambda function that run daily (Cron) that would use AWS CLI to take snapshot of a volume, then save that snapshotId to a text file in S3. On the next time another snapshot is created, the new snapshotId will be saved to the same text file on S3. The text file is a place holder for snapshotIds and when it reaches a threshold, it will delete the top snapshotIds and add the new one at the end (FIFO pipe

AWS Lambda package deployment

别来无恙 提交于 2019-12-12 19:35:46
问题 I'm trying to deploy a python .zip package as an AWS Lambda I choose the hello-python Footprint. I created the 1st lambda with the inline code, after that I tried to change to upload from a development .zip. The package I used is a .zip contains a single file called hello_python.py with the same code as the default inline code sample, which is shown below: from __future__ import print_function import json print('Loading function') def lambda_handler(event, context): #print("Received event: "

Can't close db connection with MyBatis

亡梦爱人 提交于 2019-12-12 19:20:45
问题 What I'm doing : I've got an AWS Lambda, written in Kotlin (JVM) which reads a message from a queue and writes something on a MySQL table. I'm using MyBatis for this purpose, and this is a short simplified snippet of what I'm doing inside the Handler: // initializing configuration val dataSource = PooledDataSource(driver, url, username, password) val environment = Environment(environmentName, JdbcTransactionFactory(), dataSource) val configuration = Configuration(environment) try { val

AWS Lambda with Nodejs native modules

流过昼夜 提交于 2019-12-12 18:42:39
问题 Recently I started with AWS Lambda functions, my Nodejs application was working well until I tried to use web3.js package. After I added the line const Web3 = require('web3'); I got the error "Internal Server Error" for the HTTP endpoint, and the following in CloudWatch logs module initialization error: Error at Object.Module._extensions..node (module.js:681:18) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require

Packaging code for AWS Lambda

扶醉桌前 提交于 2019-12-12 18:36:39
问题 I am trying to package code for AWS Lambda. Lambda has various restrictions, such as using Node 6.10, and not having a build step, like AWS EB does. I also am using NPM modules, so these will need to be bundled with the AWS Lambda handler. Here is what I would like to do: Define and use NPM modules (pure JS modules only) Transpile all code (including NPM modules) to a JS version that Node 6.10 supports Statically link all NPM modules into one big JS file Upload that single file to AWS Lambda

How to ADD Multiple Responses in AWS Lex

只愿长相守 提交于 2019-12-12 18:33:55
问题 I was trying to add Multiple Responses for AWS Lex using AWS Lambda Functions but I am facing this error. I was trying for But I am stuck at the message An error has occurred: Invalid Lambda Response: Received invalid response from Lambda: Can not construct instance of Message, problem: contentType must not be null at [Source: {"dialogAction": {"type": "ConfirmIntent", "message": {"messages": [{"contentType": "PlainText", "group": 1, "content": "Hello"}, {"contentType": "PlainText", "group":

Using a NodeJS 4 script from Python on AWS Lambda

落爺英雄遲暮 提交于 2019-12-12 18:21:10
问题 The problem I have a Python script running on AWS Lambda. This script is using subprocess to execute a NodeJS 4 script. What have I tried subprocess.check_output('my-script.js'); Got a non-zero result Got the interpreter error: Version of node.js doesn't meet minimum requirement. Please ensure system has node.js version 4.0.0 or higher. subprocess.check_output('node -v'); printed it's 0.10.x My question Is it possible to use a NodeJS 4 script from a Python AWS Lambda? 回答1: You cannot rely on