aws-lambda

Getting response from AWS Lambda function to AWS Lex bot is giving error?

旧城冷巷雨未停 提交于 2020-01-15 12:37:12
问题 I have created one AWS Lex bot and I am invoking one lambda function from that bot. When testing the lambda function I am getting proper response but at bot I am getting below error: An error has occurred: Received invalid response from Lambda: Can not construct instance of IntentResponse: no String-argument constructor/factory method to deserialize from String value ('2017-06-22 10:23:55.0') at [Source: "2017-06-22 10:23:55.0"; line: 1, column: 1] Not sure, what is wrong and where I am

How to create a Mono from a completableFuture

被刻印的时光 ゝ 提交于 2020-01-15 12:18:07
问题 I am trying to wrap CompletableFuture inside a Reactor Mono type in order to simplify my transform operations. Project Reactor is more convenient in general! I am working inside an AWS Lambda function and I am invoking AWS services such as S3, SQS, etc... using the new AWS Java SDK 2.x version. This new SDK allows to make asynchronous calls to AWS services and returns CompleteableFuture objects. For example: S3AsyncClient s3AsyncClient = S3AsyncClient.builder().build(); Mono.fromFuture

How to create a Mono from a completableFuture

穿精又带淫゛_ 提交于 2020-01-15 12:18:05
问题 I am trying to wrap CompletableFuture inside a Reactor Mono type in order to simplify my transform operations. Project Reactor is more convenient in general! I am working inside an AWS Lambda function and I am invoking AWS services such as S3, SQS, etc... using the new AWS Java SDK 2.x version. This new SDK allows to make asynchronous calls to AWS services and returns CompleteableFuture objects. For example: S3AsyncClient s3AsyncClient = S3AsyncClient.builder().build(); Mono.fromFuture

Reached second execution of fulfillment lambda on the same utterance

╄→гoц情女王★ 提交于 2020-01-15 11:46:10
问题 Using AWS Lex and Lambda, I am trying to build a lambda function which, first validates the invoked intent and, then moves forward with the questions (to assign values to slots). Towards the end of fulfimentCodeHook, an error occurs, "Reached second execution of fulfillment lambda on the same utterance" 来源: https://stackoverflow.com/questions/44424680/reached-second-execution-of-fulfillment-lambda-on-the-same-utterance

How to use ctypes.util.find_library to import .so libraries in AWS lambda (python)?

社会主义新天地 提交于 2020-01-15 10:27:08
问题 What I'm trying A python package I'm using (OCRMYPDF) on Lambda needs the leptonica library liblept.so.5 . On isolating the import code I found the issue is with find_library('lept') . Printing the result returns None. from ctypes.util import find_library def lambda_handler(event, context): liblept=find_library('lept') print("liblept:%s"%liblept) The python package I'm using needs many native compiled dependencies. I'm trying to import these using lambda layers. layer structure /opt/ /opt/bin

AWS Api Gateway: Missing Authentication Token

人走茶凉 提交于 2020-01-15 10:25:32
问题 So i have a Custom Domain Name setup for api gateway linked to a lambda function. I have it working fine if i do https://api_domain.com/something the behavior is as expected. Resource: /{proxy+} Base Path Mappings: / But when i go to the root domain and try to display something for that url i can't get it to work https://api_domain.com/ {"message":"Missing Authentication Token"} Searching around i found; The "Missing Authentication Token" error might be happening if you aren't adding the

Python: How to know which URL is failing using urllib2 and pool.map?

百般思念 提交于 2020-01-15 10:16:38
问题 I'm trying to simultaneously call 3 URLs and log any errors. Here is my sample code: urls = ["https://example.com/gives200.php", "https://example.com/alsogives200.php", "https://example.com/gives500.php"]; try: results = pool.map(urllib2.urlopen, urls); except URLError: urllib2.urlopen("https://example.com/log_error/?url="+URLError.url); I just want to know which URLs (if any) erred by having them call that /log_error/ URL. But when I have the code like this, I'm getting an error saying

Python: How to know which URL is failing using urllib2 and pool.map?

[亡魂溺海] 提交于 2020-01-15 10:16:31
问题 I'm trying to simultaneously call 3 URLs and log any errors. Here is my sample code: urls = ["https://example.com/gives200.php", "https://example.com/alsogives200.php", "https://example.com/gives500.php"]; try: results = pool.map(urllib2.urlopen, urls); except URLError: urllib2.urlopen("https://example.com/log_error/?url="+URLError.url); I just want to know which URLs (if any) erred by having them call that /log_error/ URL. But when I have the code like this, I'm getting an error saying

Saving some info as a session in API Gateway or lambda

試著忘記壹切 提交于 2020-01-15 08:46:50
问题 I am going to design a single sign on website and in one component of my project I am using API Gateway. API Gateway is responsible to direct the to the appropriate services based on the user status so if the user is valid(the token sent from user is not expired) the related service for getting what he is requesting will be serve and if the token sent from the UI is expired then he will be sent to authorization service first. So as you noticed I need to save the tokens and their expiration

AWS Lambda seems exiting before completion

ぃ、小莉子 提交于 2020-01-15 07:41:14
问题 I have a very simple lambda function (nodeJS) which put the event received in kinesis stream. Here is the source code: 'use strict'; const AWS = require('aws-sdk'); const kinesis = new AWS.Kinesis({apiVersion: '2013-12-02'}); exports.handler = async (event, context, callback) => { let body = JSON.parse(event.body); let receptionDate = new Date().toISOString(); let partitionKey = "pKey-" + Math.floor(Math.random() * 10); // Response format needed for API Gateway const formatResponse = (status,