aws-lambda

“errorMessage”: “event is not defined” in lambda function

廉价感情. 提交于 2019-12-12 02:27:42
问题 I am creating my first Alexa skill which fetches data from dynamodb table. I am naive in node.js and alexa both. I was successfully able to create a sample Space geek skill set , and then when I created my own skill set I used the same package( to make sure the libraries, response files remain the same) but only changed the index.js ( which is my lambda funnction). When I am testing this function on lambda console , I am getting the below error: { "errorMessage": "event is not defined",

Utterances to test lambda function not working (but lambda function itself executes)

自闭症网瘾萝莉.ら 提交于 2019-12-12 01:51:02
问题 I have a lambda function that executes successfully with an intent called GetEvent that returns a specific string. I've created one utterance for this intent for testing purposes (one that is simple and doesn't require any of the optional slots for invoking the skill), but when using the service simulator to test the lambda function with this utterance for GetEvent I'm met with a lambda response that says "The response is invalid" . Here is what the interaction model looks like: #Intent

Conversion from Swit2.3 to Swift3 cause “Terminating with uncaught exception of type NSException”

痞子三分冷 提交于 2019-12-12 01:24:22
问题 Here is the code I want to convert from Swift2.3 to Swift3: AWSCloudLogic.defaultCloudLogic().invokeFunction(functionName, withParameters: parameters, completionBlock: {(result: AnyObject?, error: NSError?) -> Void in if let result = result { dispatch_async(dispatch_get_main_queue(), { print("CloudLogicViewController: Result: \(result)") //self.activityIndicator.stopAnimating() //self.resultTextView.text = prettyPrintJson(result) }) } var errorMessage: String if let error = error { if let

Issue using M2Crypto on lambda (works on EC2)

浪尽此生 提交于 2019-12-12 01:22:30
问题 I am trying to install a python function using M2Crypto in AWS Lambda. I spun up an EC2 instance with the Lambda AMI image, installed M2Crypto into a virtualenv, and was able to get my function working on EC2. Then I zipped up the site-package and uploaded to Lambda. I got this error Unable to import module 'epd_M2Crypto': /var/task/M2Crypto/_m2crypto.cpython-36m-x86_64-linux-gnu.so: symbol sk_deep_copy, version libcrypto.so.10 not defined in file libcrypto.so.10 with link time reference

Logstash Filter: aggregate - auto save on timeout

纵饮孤独 提交于 2019-12-12 01:17:34
问题 I have a Lambda function in AWS which reports logs to an ELK instance. Each invocation of the lambda function generates a unique invocation_id that is sent with every log event, so the events from a single invocation can be identified in ELK. At the end of the operation, I send a "Done" event. A Lambda function can fail, or timeout, and then the "Done" event is not sent. I want to use the logstash aggregate filter to identify the failed invocations. Meaning - each invocation_id will be a task

Only first lambda update statement is running in my batch file

流过昼夜 提交于 2019-12-11 22:34:42
问题 Environment: Windows 10 Command prompt Why is only the first lambda update running in my batch file? Is this an asynchronous issue? script.bat ... aws lambda update-function-code --function-name "fx1" --zip-file fileb://zip1.zip aws lambda update-function-code --function-name "fx2" --zip-file fileb://zip2.zip 回答1: Assuming, aws is a batchfile: When you execute another batchfile (B) from a batchfile (A), you transfer control from (A) to (B) and if (B) ends, there is no "return" to (A). When

AWS Lambda aws.ec2() doesn't return values (NodeJS)

时光总嘲笑我的痴心妄想 提交于 2019-12-11 20:18:01
问题 I have a Lambda function to create snapshots in EC2. The function works but there is no return value (ie, I want to get this value data.SnapshotId ). The EC2 call to create snapshot is nested inside a call to s3.getObject and before a call to s3.putObject. s3.getObject(params, function(err, data) { if (err) { console.log(err); console.log(message); context.fail(message); } else { new aws.EC2().createSnapshot(params_snapshot, function(err, data) { if (err) console.log(err, err.stack); // an

AWS Lambda Ruby on VPC - Seahorse::Client::NetworkingError

狂风中的少年 提交于 2019-12-11 18:55:43
问题 After adding my Ruby Lambda function to a VPC and attaching the relevant SecurityGroups, I have problems retrieving the SSM credentials for pulling config from aws SSM Parameter Store and I bump into this weird network error after timeout. This happens when trying to retrieve SSM credentials via ssm.get_parameters_by_path but the trace feels like this would have happened on any other AWS call. { "errorMessage": "execution expired", "errorType": "Function<Seahorse::Client::NetworkingError>",

Triggering AWS Lambda on arrival of new files in AWS S3

风格不统一 提交于 2019-12-11 18:54:40
问题 I have a Lambda function written in Python, which has the code to run Redshift copy commands for 3 tables from 3 files located in AWS S3. Example: I have table A, B and C. The python code contains: 'copy to redshift A from "s3://bucket/abc/A.csv"' 'copy to redshift B from "s3://bucket/abc/B.csv"' 'copy to redshift C from "s3://bucket/abc/C.csv"' This code is triggered whenever a new file among the three arrives at "s3://bucket/abc/" location in S3. So, it loads all the three tables even if

Lambda - How to create customer managed policy?

本小妞迷上赌 提交于 2019-12-11 18:47:13
问题 Background: IAM policies can be created in two ways: Managed policies(newer way) AWS managed policies Customer managed policies Inline policies(older way) Below SAM template is creating inline policy: Resources: HelloWorldFunction: Type: AWS::Serverless::Function Properties: CodeUri: hello-world/ Handler: app.LambdaHandler Runtime: nodejs8.10 Policies: - Statement: - Sid: AccessToS3Policy Effect: Allow Action: - s3:GetObject - s3:GetObjectACL Resource: 'arn:aws:s3:::some-bucket/*' in the