1. 程式人生 > >Resolve 500 Errors With Lambda and API Gateway

Resolve 500 Errors With Lambda and API Gateway

If you build an API with Lambda integration using the API Gateway console, the console automatically requests to add the required permissions for standard Lambda integration. In contrast, when you set up a stage variable to call a Lambda function through your API, you must manually grant your API the permission to invoke the Lambda function. For a stage variable, the API Gateway console notifies you of a sample command that you must run outside the console to set up this permission.

If your Lambda function's resource policy doesn't include the permission for your API to invoke the function, your API returns a 500 status code with the message "Internal server error." To verify that the 500 status code is returned because the permission to invoke the function is missing, check your API Gateway execution logs for a message similar to "Invalid permissions on Lambda function."

相關推薦

Resolve 500 Errors With Lambda and API Gateway

If you build an API with Lambda integration using the API Gateway console, the console automatically requests to add the required permissions f

Code Evaluation With AWS Lambda and API Gateway

This tutorial details how AWS Lambda and API Gateway can be used to develop a simple code evaluation API, where an end user submits code, via an AJAX fo

Tutorial for building a Web Application with Amazon S3, Lambda, DynamoDB and API Gateway

Tutorial for building a Web Application with Amazon S3, Lambda, DynamoDB and API GatewayI recently attended Serverless Day at the AWS Loft in downtown San

Image resize on-the-fly with Lambda and S3

A crash course on Serverless with AWS — Image resize on-the-fly with Lambda and S3Handling large images has always been a pain in my side since I started w

Resolve "InvalidCipherText" Errors with AWS KMS

export KEY_PARAMETERS=`aws kms --region $REGION get-parameters-for-import --key-id $KEY_ID --wrapping-algorithm RSAES_OAEP_SHA_256 --wrapping-ke

Resolve Boot Errors with C5 or M5 Linux Instances

Your Linux instance might not boot after you change its type to C5 or M5 for the following reasons: 1.    The enhanced networking ad

Resolve "Malformed Lambda Proxy Response" or 502 Errors With API Gateway

exports.handler = (event, context, callback) => { var responseBody = { "key3": "value3", "key2": "value2", "key1

Distributed Tracing with Java “MicroDonuts”, Kubernetes and the Ambassador API Gateway

Distributed Tracing with Java “MicroDonuts”, Kubernetes and the Ambassador API GatewayDistributing tracing is increasingly seen as an essential component f

結合API GatewayLambda實現登入時的重定向和表單提交請求(Python3實現)

1. 建立Lambda函式,程式碼如下: 1 from urllib import parse 2 3 def lambda_handler(event, context): 4 body = event['body'] 5 print("-----------body:"

Managing a Spotify Library with Go and AWS Lambda

Managing a Spotify Library with Go and AWS LambdaSpotify exposes a robust API that can be used to manage your (or someone elses) music library and do all s

A Proposal for RESTful API’s with Mongoose and Express

A Proposal for RESTful API’s with Mongoose and ExpressThroughout my journey to becoming a developer, there has always been a sage group of developers in my

Crowdsourcing ML training data with the AutoML API and Firebase

Crowdsourcing ML training data with the AutoML API and FirebaseWant to build an ML model but don’t have enough training data? In this post I’ll show you ho

Create a personal video watch list in the cloud with PHP and the Movie Database API Part 1

Up until a few years ago, I’d turn on the TV and find myself humming Springsteen’s “57 Channels and Nothin’ On” as I flipped through

Create a personal video watchlist in the cloud with PHP and the Movie Database API Part 2

If you have been following along with Part 1, you are half-way through building a web-based PHP application to store your personal wa

Create a REST API in Minutes With Pyramid and Ramses

This is a guest blog post from Chris Hart of Brandicted—a technologist from the great city of Montreal. This tutorial is meant for beginners. If you get

Getting Started With the Slack API Using Python and Flask

The slick hosted chat application Slack is all the rage this year. The tool’s adoption isn’t empty hype - it’s incredibly useful for communicating with

Mass Email with SES and Lambda

Amazon Web Services is Hiring. Amazon Web Services (AWS) is a dynamic, growing business unit within Amazon.com. We are currently hiring So

Resolve Errors with Captcha on AWS

Amazon Web Services is Hiring. Amazon Web Services (AWS) is a dynamic, growing business unit within Amazon.com. We are currently hiring So

Pass Custom Headers Through Amazon API Gateway to an AWS Lambda Function

By default, a Lambda function only ingests the request body received by an API created in the API Gateway. To pass custom headers f