aws-lambda

AWS Lambda ending early (without any explicit return or callback)

纵饮孤独 提交于 2021-01-26 09:49:21
问题 I'm having a bit of an issue with some node.js code I'm putting into AWS Lambda. I've got a couple of async calls that I need to make, and while the first is behaving like I expect, the lambda function is terminating before the second call is complete. The return is null, which makes me think that lambda is hitting its implicit callback, but I don't think it should be doing that while there is a promise that hasn't been resolved yet. Code: exports.handle = async function(event, context) { var

AWS Lambda ending early (without any explicit return or callback)

谁说胖子不能爱 提交于 2021-01-26 09:47:59
问题 I'm having a bit of an issue with some node.js code I'm putting into AWS Lambda. I've got a couple of async calls that I need to make, and while the first is behaving like I expect, the lambda function is terminating before the second call is complete. The return is null, which makes me think that lambda is hitting its implicit callback, but I don't think it should be doing that while there is a promise that hasn't been resolved yet. Code: exports.handle = async function(event, context) { var

How to structure terraform code to get Lambda ARN after creation?

你。 提交于 2021-01-24 07:19:17
问题 This was a previous question I asked: How to get AWS Lambda ARN using Terraform? This question was answered but turns out didn't actually solve my problem so this is a follow up. The terraform code I have written provisions a Lambda function: Root module: terraform { required_providers { aws = { source = "hashicorp/aws" } } } provider "aws" { region = var.region profile = var.aws_profile } module "aws_lambda_function" { source = "./modules/lambda_function" } Child module: resource "aws_lambda

How to structure terraform code to get Lambda ARN after creation?

浪子不回头ぞ 提交于 2021-01-24 07:19:10
问题 This was a previous question I asked: How to get AWS Lambda ARN using Terraform? This question was answered but turns out didn't actually solve my problem so this is a follow up. The terraform code I have written provisions a Lambda function: Root module: terraform { required_providers { aws = { source = "hashicorp/aws" } } } provider "aws" { region = var.region profile = var.aws_profile } module "aws_lambda_function" { source = "./modules/lambda_function" } Child module: resource "aws_lambda

How to structure terraform code to get Lambda ARN after creation?

余生长醉 提交于 2021-01-24 07:17:25
问题 This was a previous question I asked: How to get AWS Lambda ARN using Terraform? This question was answered but turns out didn't actually solve my problem so this is a follow up. The terraform code I have written provisions a Lambda function: Root module: terraform { required_providers { aws = { source = "hashicorp/aws" } } } provider "aws" { region = var.region profile = var.aws_profile } module "aws_lambda_function" { source = "./modules/lambda_function" } Child module: resource "aws_lambda

AWS Lambda not removing messages from the queue

故事扮演 提交于 2021-01-23 15:21:02
问题 I am triggering a Lambda function from an SQS event with the following code: @Override public Void handleRequest(SQSEvent sqsEvent, Context context) { for (SQSMessage sqsMessage : sqsEvent.getRecords()) { final String body = sqsMessage.getBody(); try { //do stuff here } catch (Exception ex) { //send to DLQ } } return null; } The "do stuff" is calling another Lambda function with the following code: private final AWSLambda client; private final String functionName; public LambdaService

AWS Lambda not removing messages from the queue

守給你的承諾、 提交于 2021-01-23 15:18:53
问题 I am triggering a Lambda function from an SQS event with the following code: @Override public Void handleRequest(SQSEvent sqsEvent, Context context) { for (SQSMessage sqsMessage : sqsEvent.getRecords()) { final String body = sqsMessage.getBody(); try { //do stuff here } catch (Exception ex) { //send to DLQ } } return null; } The "do stuff" is calling another Lambda function with the following code: private final AWSLambda client; private final String functionName; public LambdaService

AWS Lambda not removing messages from the queue

久未见 提交于 2021-01-23 15:08:11
问题 I am triggering a Lambda function from an SQS event with the following code: @Override public Void handleRequest(SQSEvent sqsEvent, Context context) { for (SQSMessage sqsMessage : sqsEvent.getRecords()) { final String body = sqsMessage.getBody(); try { //do stuff here } catch (Exception ex) { //send to DLQ } } return null; } The "do stuff" is calling another Lambda function with the following code: private final AWSLambda client; private final String functionName; public LambdaService

AccessDeniedException: Unable to determine service/operation name to be authorized

前提是你 提交于 2021-01-21 12:15:56
问题 Using AWS CLI aws --version aws-cli/1.11.21 Python/2.7.12 Darwin/15.3.0 botocore/1.4.78 Creating a POST method for API Gateway as explained at https://github.com/arun-gupta/serverless/tree/master/aws/microservice#post-method. This method can be invoked successfully using test-invoke-method and AWS Console. Creating a GET method using AWS CLI https://github.com/arun-gupta/serverless/tree/master/aws/microservice#get-method. Invoking this method using test-invoke-method and AWS Console gives the

Disable and enable AWS lambda trigger programmatically

只谈情不闲聊 提交于 2021-01-21 11:43:05
问题 Is there a way for us to disable & enable the Lambda trigger programmatically (e.g. for scheduled maintains purposes)? 回答1: You can disable and enable Lambda triggers by using following approaches with Update Event Source Mapping , based on how you are going to do it. Using AWS CLI: You can use AWS CLI update-event-source-mapping command with --enabled | --no-enabled parameters. Using AWS SDK (E.g NodeJS): You can use AWS SDK updateEventSourceMapping method with Enabled: true || false