aws-lambda

Async Lambda Function: Returning promise or sending responseURL does not terminate CloudFormation custom resource invocation

十年热恋 提交于 2021-01-27 07:12:52
问题 I have a lambda function invoked as a custom resource via a CloudFormation template. It Creates/Deletes AWS Connect instances. The API calls work fine but I cannot seem to terminate the custom resource invocation, so the last CF block remains CREATE_IN_PROGRESS. No matter what I return from the async function it just won't terminate the CF execution with a success. I'm able to use a non-async handler successfully as in https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/walkthrough

Getting the response results from an asynchronous call to AWS lambda in python

只愿长相守 提交于 2021-01-27 06:47:40
问题 I have an AWS lambda function which I can call synchronously and get results back alright with below code response = lambda_client.invoke( FunctionName=FUNCTION_NAME, InvocationType='RequestResponse', LogType='Tail', Payload=payload, Qualifier=$LATEST ) The response Payload is of type <botocore.response.StreamingBody object at 0x115fb3160> So I use below code to extract the payload which works fine. response_body = response['Payload'] response_str = response_body.read().decode('utf-8')

Getting the response results from an asynchronous call to AWS lambda in python

混江龙づ霸主 提交于 2021-01-27 06:45:33
问题 I have an AWS lambda function which I can call synchronously and get results back alright with below code response = lambda_client.invoke( FunctionName=FUNCTION_NAME, InvocationType='RequestResponse', LogType='Tail', Payload=payload, Qualifier=$LATEST ) The response Payload is of type <botocore.response.StreamingBody object at 0x115fb3160> So I use below code to extract the payload which works fine. response_body = response['Payload'] response_str = response_body.read().decode('utf-8')

Is it possible to configure different API Gateway stages with different lambda versions using AWS SAM

…衆ロ難τιáo~ 提交于 2021-01-27 05:32:12
问题 I have a SAM template for my application. Each time I deploy my SAM template with a new API Gateway stage name, it replaces the previously created stage. So, found this article which helps me in releasing different versions pointing to different lambda versions. https://aws.amazon.com/blogs/compute/using-api-gateway-stage-variables-to-manage-lambda-functions/ But, for this, I have to change API Gateway manually after deployment. So, Is there any way that I can do this using AWS SAM ? For

Best practice for reading data from Kafka to AWS Redshift

时光总嘲笑我的痴心妄想 提交于 2021-01-27 05:32:11
问题 What is the best practice for moving data from a Kafka cluster to a Redshift table? We have continuous data arriving on Kafka and I want to write it to tables in Redshift (it doesn't have to be in real time). Should I use Lambda function? Should I write a Redshift connector (consumer) that will run on a dedicated EC2 instance? (downside is that I need to handle redundancy) Is there some AWS pipeline service for that? 回答1: Kafka Connect is commonly used for streaming data from Kafka to (and

Intermittent timeouts between AWS Lambda and RDS

冷暖自知 提交于 2021-01-27 05:31:14
问题 We are currently experiencing what I can only describe as random intermittent timeouts between AWS Lambda and RDS. After deploying our functions and running them successfully, they can randomly switch to a state of timing out with no configuration changes . Important to note, we are also monitoring the DB connections and can confirm that we aren't running into a max connection issue. Here are the details on our setup: Code being executed (using Node.JS v. 6.10): const mysql = require('mysql')

How to publish to SNS from Lambda within VPC using VPC Endpoint?

牧云@^-^@ 提交于 2021-01-27 05:29:32
问题 I have set up a VPC with 3 subnets, this to have access to a private RDS instance from my Lambda functions. The RDS <-> Lambda connection works fine, however now I'm not able to publish to SNS. I found the announcement of VPC Endpoint support for SNS (incl. this blog post https://aws.amazon.com/blogs/security/securing-messages-published-to-amazon-sns-with-aws-privatelink/) and have added a VPC Endpoint Interface with these properties: Service name: com.amazonaws.eu-west-1.sns VPC: same as

Intermittent timeouts between AWS Lambda and RDS

血红的双手。 提交于 2021-01-27 05:29:21
问题 We are currently experiencing what I can only describe as random intermittent timeouts between AWS Lambda and RDS. After deploying our functions and running them successfully, they can randomly switch to a state of timing out with no configuration changes . Important to note, we are also monitoring the DB connections and can confirm that we aren't running into a max connection issue. Here are the details on our setup: Code being executed (using Node.JS v. 6.10): const mysql = require('mysql')

How to publish to SNS from Lambda within VPC using VPC Endpoint?

走远了吗. 提交于 2021-01-27 05:28:56
问题 I have set up a VPC with 3 subnets, this to have access to a private RDS instance from my Lambda functions. The RDS <-> Lambda connection works fine, however now I'm not able to publish to SNS. I found the announcement of VPC Endpoint support for SNS (incl. this blog post https://aws.amazon.com/blogs/security/securing-messages-published-to-amazon-sns-with-aws-privatelink/) and have added a VPC Endpoint Interface with these properties: Service name: com.amazonaws.eu-west-1.sns VPC: same as

How to get latest file-name or file from S3 bucket using event triggered lambda

人盡茶涼 提交于 2021-01-26 18:00:49
问题 I am very new to AWS services and has just a week worth of experience with serverless architecture, My requirement is to trigger an event when a new file is uploaded to a specific bucket, once the event trigger is set my Lambda should get the details of the latest file such as Name, Size, and Date of creation. The source is uploading this file in a new folder every time and names the folder with the current date. So far I am able to crack how to create my Lambda function and listen to the