aws-lambda

AWS lambda basic-authentication without custom authorizer

此生再无相见时 提交于 2019-12-11 04:49:55
问题 I have a problem with setting up the basic authentication for my AWS lambda function written in Node.js. The problem: AWS lambda function which is a proxy for an additional service. This function only forwards the whole request and give the user the whole response. That's why I need to force the usage of the Authentication header and I would like to have the prompt window for passing the credentials: https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication Apart from the proxy part of

Passing a path parameter to Google's Endpoint for Cloud Function

有些话、适合烂在心里 提交于 2019-12-11 04:47:46
问题 I am following Google's tutorial on setting up Google Cloud endpoint (not AWS API Gateway) in front of my Cloud Function. I am triggering my Cloud Function to trigger an AWS lambda function, AND I am trying to pass a path parameter from my Endpoint as defined by OpenAPI spec. Path parameters are variable parts of a URL path. They are typically used to point to a specific resource within a collection, such as a user identified by ID. A URL can have several path parameters, each denoted with

AWS Lambda + Tinkerpop/Gremlin + TitanDB on EC2 + AWS DynamoDB in cloud

≯℡__Kan透↙ 提交于 2019-12-11 04:45:34
问题 I am trying to execute following flow: user hits AWS Gateway (REST), it triggers AWS Lambda, that uses Tinkerpop/Gremlin connects to TitanDB on EC2, that uses AWS DynamoDB in cloud (not on EC2) as backend. Right now I have managed to crete fully working TitanDB instance on EC2, that stores data in DynamoDB in cloud. I am also able to connect from AWS Lambda to EC2 through Tinkerpop/Gremlin BUT only this way: Cluster.build() .addContactPoint("10.x.x.x") // ip of EC2 .create() .connect()

AWS API Gateway Malformed Lambda Response

六月ゝ 毕业季﹏ 提交于 2019-12-11 04:45:15
问题 The documentation states that the json should return containing a body,headers,and a status code all of which I have. However for whatever reason when I test it in API gateway it returns a malformed response. This is the output of the method below it. "{\"body\": 200, \"headers\": {\"Content-type\": \"application/json\"}, \"statusCode\": 200}" def addnumbers(message, context): result = message['num1'] + 1 print(result) resp = { "statusCode": 200, "body": result, "headers": { "Content-type":

aws-mock-sdk s3.getObject not working

只愿长相守 提交于 2019-12-11 04:44:23
问题 This is my lambda handler where i am using various AWS services. exports.handler = function(event,context){ var body = event; var isValidBody = validate.doValidation(body); var s3DetailsObj = { eTag: body.s3Details.eTag, location: body.s3Details.location, key: body.s3Details.key, bucket: body.s3Details.bucket } var s3DeletionErrorObject = { status : "SERVER_ERROR", sourceUid : body.sourceUid, s3Details : s3DetailsObj }; if(isValidBody.status){ console.log("Request validation successfull");

Lex chat bot error: Reached second execution of fulfillment lambda on the same utterance

随声附和 提交于 2019-12-11 04:37:25
问题 I've read the Lex Docs on Responses. I've searched and found: - An unanswered question on same error. - An unanswered similar question but in Python. - An unanswered similar question in Amazon Dev Forum. So my question remains. What is causing / How to fix this error in Lex chat bot: An error has occurred: Invalid Lambda Response: Reached second execution of fulfillment lambda on the same utterance The error is only occurring when attempting to respond with Delegate. Here is my AWS lambda

CloudWatch Events trigger on Amazon Transcribe event

时光总嘲笑我的痴心妄想 提交于 2019-12-11 04:35:04
问题 I'm working with the Amazon Transcribe service and trying to get CloudWatch Events to fire a Lambda function that executes a POST request to my API. Here's the Lambda function var querystring = require('querystring'); var http = require('http'); exports.handler = function(event, context) { var post_data = querystring.stringify( event ); // An object of options to indicate where to post to var post_options = { host: '193e561e.ngrok.io', port: '80', path: '/api/lambda', method: 'POST', headers:

Lambda - EnvironmentVariablesFeature is not supported in cn-north-1 region

喜你入骨 提交于 2019-12-11 04:10:49
问题 I am trying to deploy lambda using the serverless framework in China AWS region - I am getting into below error. Is there any workaround to pass variables in serverless.yaml? CloudFormation - UPDATE_ROLLBACK_COMPLETE - AWS::CloudFormation::Stack - aws-china-lambda-Test-Env Serverless: Operation failed! Serverless: View the full error output: https://cn-north-1.console.aws.amazon.com/cloudformation/home?region=cn-north-1#/stack/detail?stackId=arn%3Aaws-cn%3Acloudformation%3Acn-north-1%XXXXX

Adding Wait Message in my Amazon ALexa skill

一笑奈何 提交于 2019-12-11 03:19:33
问题 I am developing an Alexa service which connects to an external service. In order to get the response, it takes around 9-10 seconds. Is there a way to add a message in Alexa while Lambda function is processing the request. Something like - "hang on a second. I am retrieving the results" 回答1: You could get Alexa to say that, but then the user would have to say something to your skill for control to return to you. The only way I can think of to do what you want is to use the audio player to

How to run SQLAlchemy on AWS Lambda in Python

你离开我真会死。 提交于 2019-12-11 03:19:13
问题 I preapre very simple file for connecting to external MySQL database server, like below: from sqlalchemy import * def run(event, context): sql = create_engine('mysql://root:root@127.0.0.1/scraper?charset=utf8'); metadata = MetaData(sql) print(sql.execute('SHOW TABLES').fetchall()) Doesn't work on AWS, but localy on Windows works perfectly. Next, I install by pip install sqlalchemy --target my/dir and prepare ZIP file to upload packages to AWS Lambda. Run, but with failed message No module