aws-lambda

How to invoke Lambda function with Event Invocation Type via API Gateway?

▼魔方 西西 提交于 2019-12-12 08:13:48
问题 Docs says: By default, the Invoke API assumes RequestResponse invocation type. You can optionally request asynchronous execution by specifying Event as the InvocationType. So all I can send to my function (python) is InvocationType:Event everywhere: curl -X POST "https://X.execute-api.us-east-1.amazonaws.com/prod/Y?InvocationType=Event" -d "InvocationType:Event" -H "X-Amz-Invocation-Type:Event" (function sleeps 3 seconds then responses) null But is not Async... docs also says: When you invoke

How to set “Use Lambda Proxy integration” in swagger for API-Gateway?

為{幸葍}努か 提交于 2019-12-12 08:12:33
问题 How to set Use Lambda Proxy integration in swagger for API-Gateway? My current swagger is bellow but I would really like to setup the proxy integration. I would let me simplify a lot of things, not to mention I could remove the requestTemplates and responses blocks from the swagger definition. I am attempting to setup the new Lambda Proxy mode from this blog post. Current swagger: '/document': options: summary: CORS support description: | Enable CORS by returning correct headers consumes: -

HTTP request with Alexa and Lambda on SDK v2, how to make it works?

℡╲_俬逩灬. 提交于 2019-12-12 08:09:45
问题 I am playing with ASK SDK v2 provided by Amazon in order to make Skill for Alexa but I face an architectural problem : First of all, the HTTP request works like a charm but I would like to return speach response if and only if my HTTP request is complete but I don't even know if it's possible because of the "handle" function that should return something (look at comments) : const MyIntentHandler = { canHandle(handlerInput) { const request = handlerInput.requestEnvelope.request; return request

Lambda in VPC won't create new ENI after an ENI has been manually detached from subnet

谁都会走 提交于 2019-12-12 08:00:51
问题 I have run into a problem where my Lambda functions can no longer create new ENI's in a VPC subnet once an ENI has been detached and deleted from that subnet. I have reproduced this on two different VPC's and multiple subnets. Here are the steps I used to reproduce this: Create a Lambda function and associate it with a VPC and a subnet. Execute the Lambda function which will cause it to create a new ENI in the subnet. The function is able to access an RDS database in the VPC. Manually detach

AWS API Gateway Custom Authorizer AuthorizerConfigurationException

爱⌒轻易说出口 提交于 2019-12-12 07:27:05
问题 For a Kinesis stream, I created a proxy API using AWS API Gateway. I added a custom authorizer using python Lambda for the proxy. After publish of lambda function and deploy of API, I was able to successfully test the API using Gateway Test functionality. I could see the logs in cloudwatch which had detailed prints from custom auth lambda function. After successful authentication, API Gateway pushed the record to my Kinesis stream However when I call the same API from Chrome Postman client, I

managing AWS SQS and DLQ

為{幸葍}努か 提交于 2019-12-12 07:00:53
问题 Scenario : create a lambda and it will be triggered whenever a message comes to SQS(let's assume SQS-A). The lambda (written in python)is responsible for sending the incoming payload to the another endpoint. The problem is, whenever the target endpoint or server is down, I was trying to place it into the another SQS (let's assume SQS-B), if other exceptions comes than placing it into Deal Letter Queue. Here I want to two things. If ConnectionError (it is the python exception says which says

AWS CloudFormation for Lambda and SNS Topic

北城以北 提交于 2019-12-12 06:48:28
问题 I have a cloud formation script which I am using to create a Lambda and SNS Topic. Here is the yml script for SNS Topic and Lambda creation, SampleSNSTopic: Type: AWS::SNS::Topic Properties: DisplayName: sampleTopic TopicName: sampleTopic SampleLambdaFunction: Type: AWS::Lambda::Function DependsOn: SampleSNSTopic Properties: Handler: index.handler Description: Sample Lambda function FunctionName: TestFunction Role: !Ref SomeRole Code: ZipFile: !Sub | var AWS = require("aws-sdk"); exports

How to get recently uploaded zip file from s3 bucket when we trigger the lambda using node js

拈花ヽ惹草 提交于 2019-12-12 06:39:05
问题 I am uploading a zip file to s3 bucket,Once I uploaded the zip file,my lambda Function will get triggered. Inside the Lambda Function block,I need to get the recently uploaded zip file name either based on Last Modified date of zip file from S3 bucket or Object Creation date from Lambda record event However it may be ,But I need to get recently uploaded zip file name from s3 bucket.** This is my code s3.listObjects(params, function (err, data) { if (err) console.log(err, err.stack); // an

AWS Cognito integration swift3 Refresh provides ResourceNotFoundException

人盡茶涼 提交于 2019-12-12 05:14:19
问题 Following the answer here: https://github.com/aws/aws-sdk-ios/issues/357 At the very bottom there is a mini guide on getting swift and cognito working. I've made a AWSCustomIdentityProvider as such: import Foundation import AWSCognitoIdentityProvider import AWSCognito class AWSCustomIdentityProvider: NSObject, AWSIdentityProviderManager { private var dict = NSDictionary() func addToken(value:NSString) { dict = ["graph.facebook.com":value] } public func logins() -> AWSTask<NSDictionary> {

Unable to create new native thread error when invoking lambda function on dynamodb table - how to avoid?

自古美人都是妖i 提交于 2019-12-12 05:05:47
问题 I have a lambda function that queries some DynamoDB tables and returns some entries in them. Invoking it a few times and all is fine, but I am now stress testing my back end and when I invoke this function over and over in a short period of time, I get the following error: "errorMessage":"unable to create new native thread","errorType":"java.lang.OutOfMemoryError" I am using DynamoDB's spatial indexing capabilities, and the error message seems to be suggesting that a line to do with the