aws-lambda

How to make a whole object in CloudFormation templates optional?

喜你入骨 提交于 2019-12-25 01:29:52
问题 I'm making a Lambda function via CloudFormation template, and I'd like to make it optional to enter the information for the VpcConfig property. I've found articles like this one on how to make parameters optional: https://cloudonaut.io/optional-parameter-in-cloudformation/ That was very helpful for finding syntax to make properties with single values optional (like a single string value). But what I need to figure out is how to make the whole VpcConfig OBJECT optional. It's a little tricky,

AWS Lambda not able to make REST call to external API

橙三吉。 提交于 2019-12-25 00:55:31
问题 I am using the nodeJS code to make a rest call using request module. I have also used callback function but the request function is not getting executed. My flow goes to function searchTSTData but the request method is not getting executed. From the callback function I am only getting responseString = 'Yet to make query rest' which I have initialized in searchTSTData function. It's not getting updated based on the response returned by API which should be either error or success response

DynamoDB getItem call not giving a response

女生的网名这么多〃 提交于 2019-12-25 00:28:38
问题 I'm trying to read a basic DynamoDB table in AWS Lambda, following the AWS tutorials. I've got some basic code, that seems to be running OK (I'm not seeing any errors logged), but I can't get any output: const AWS = require('aws-sdk'); AWS.config.update({region: 'eu-west-1'}); const ddb = new AWS.DynamoDB({apiVersion: '2012-08-10'}); function readData(){ console.log("In the readData() function"); var params = { TableName: "desks", Key: { "desk_id": {N:'1'} } }; console.log("Set params"); //

AWS - Invoke Lambda within Lambda across regions

此生再无相见时 提交于 2019-12-24 21:00:58
问题 I would like to invoke Lambda B (US_EAST_1) within Lambda A (US_WEST_1) across regions. So Lambda A and B are situated in different regions. I have deployed both Lambdas to their regions and adjusted the IAM role: { "Version": "2012-10-17", "Statement": [ { "Sid": "VisualEditor0", "Effect": "Allow", "Action": [ "lambda:InvokeFunction", "lambda:InvokeAsync" ], "Resource": "*" } ] } This is the Java code of Lambda A: ObjectMapper mapper = new ObjectMapper(); String jsonString = ""; System.out

Cannot send POST data to Lambda

久未见 提交于 2019-12-24 20:48:47
问题 I am trying to send data to my lambda function however the function is not getting my data, the event variable is empty. I am not getting any errors and when I test the function in my API Gateway it works fine. So I am not sure what is happening. My code for sending data to Lambda is below. var options = { method: 'POST', url: 'correct api url', contentType: "application/json", dataType: "json", data: s } for data: s within my console looks like this data: '{"article_url":"a url here"}' Any

Lambda function ends after call to dynamoDB using promises, but returns no errors?

人盡茶涼 提交于 2019-12-24 20:44:18
问题 I have a Lambda function reaching out to DynamoDB, utilizing promises. I get no errors, but the function doesn't move past the call to Dynamo. Similar questions I have found seemed to be resolved by using promises, so I feel this is a new question. I have tried using promises with then statements to wait on DynamoDB to return data. I receive no errors, but my last log statement is right before the call to dynamo. Here is my dynamo helper function: let AWS = require("aws-sdk"); let dynamo =

Trouble with Amazon Lex chatbot slots

前提是你 提交于 2019-12-24 20:17:26
问题 I am trying to create a chatbot. Chatbot will prompt the question "What is your nationality? (A, B, C)" and if the user says C, I want to straight away end the chat by saying something like "I am sorry, C is not applicable to apply. Only A and B can apply." I know I have to uncheck the "required" checkbox after the said question but I'm not sure what to input in aws lambda for it to happen. 回答1: After unchecking the required checkbox, in the lambda code do below: # inside dialogcodehook slots

Starting a StepFunction and exiting doesn't trigger execution

谁都会走 提交于 2019-12-24 19:46:39
问题 I have Lambda function tranportKickoff which receives an input and then sends/proxies that input forward into a Step Function . The code below does run and I am getting no errors but at the same time the step function is NOT executing. Also critical to the design, I do not want the transportKickoff function to wait around for the step function to complete as it can be quite long running. I was, however, expecting that any errors in the calling of the Step Function would be reported back

Send cognito authentication as a promise is giving “Cannot read property 'promise' of undefined”

邮差的信 提交于 2019-12-24 19:44:25
问题 I'm developing a lambda function to login into Cognito, but I'm having problems to do it wait for my cognito authentication. I tried to use the code just like it is in examples, passing a onSuccess and a onFailure function as parameter, but the function is complete without wait. Then, I tried to make a promise, just like I did sending SES email, but it give the message "Cannot read property 'promise' of undefined" My code until now: 'use strict'; global.fetch = require('node-fetch'); let

aws lambda .net core s3 file download started giving this error “SSL peer certificate or SSH remote key was not OK”

故事扮演 提交于 2019-12-24 19:36:05
问题 Aws lambda written in dot net core 1.0 which was working from last 2 year started giving above error from yesterday in s3 GetObjectAsync method. Below is the Environment where lambda runs Languages-C# runtime .NET Core 1.0 Operating System- Amazon Linux Please find the error and stack trace here Error: An error occurred while sending the request. Inner exception System.Net.Http.CurlException: SSL peer certificate or SSH remote key was not OK at System.Net.Http.CurlHandler.ThrowIfCURLEError