aws-api-gateway

AWS Signature Error using Postman to access the AWS API Gateway when posting a binary

佐手、 提交于 2019-12-11 03:52:14
问题 Works fine when doing a GET request or even a POST request with raw JSON. But sending a file returns this error: "The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details. The Canonical String for this request should have been 'POST......." Credentials are definitely correct. 回答1: This is a known issue posted on 3rd July: https://github.com/postmanlabs/postman-app-support

How to get AWS API Gateway invoke URL in an AWS Lambda function?

淺唱寂寞╮ 提交于 2019-12-11 02:59:28
问题 I'm using the proxy integration with my Java lambda function. The input for the lambda handler is a JSON object that represents an incoming request. It has a body, headers, query params and so on. But it doesn't include the source URL that is parsed by the API Gateway for the body, query params and etc. Is there a way to get it? The thing is API Gateway doesn't support arrays in query parameters. Example: /endpoint?numbers=1&numbers=2 . Seems, the only way to pass an array is to pass it as a

AWS Cloudfront distribution does not show API Gateway distribution

混江龙づ霸主 提交于 2019-12-11 01:52:35
问题 I have a API hosted using AWS Gateway API in combination with a custom domain. Its been in production for at least a year. However, when I go to Cloudfront resource page from AWS web console , I don't see any distribution entries under my same account which is used for Gateway API. AWS Documentation states below: The CloudFront distribution created by API Gateway is owned by a region-specific account affiliated with API Gateway. When tracing operations to create and update such a CloudFront

AWS API Gateway and Lambda function deployed through terraform — Execution failed due to configuration error: Invalid permissions on Lambda function

若如初见. 提交于 2019-12-11 00:34:48
问题 I'm deploying an API gateway and a Lambda function together through Terraform, and the Lambda function is meant to be triggered by the API Gateway. After the resources successfully deploy, I test the API Gateway and I get response: { "message": "Internal server error" } . The actual logs of the API gateway say: Execution failed due to configuration error: Invalid permissions on Lambda function I can get the actual api-lambda functionality to work by going to the integration request section of

AWS API Gateway Custom Authorizer with Proxy setup - Add Custom Headers to Request

折月煮酒 提交于 2019-12-10 20:21:33
问题 What I have: AWS API gateway setup as a proxy (/{proxy+}) A custom Auth function which authorizes the incoming request for this proxy setup. The custom auth function is passing the additional information I want to pass along to the request via the "context" object, like so: { "principalId": "yyyyyyyy", "policyDocument": { "Version": "2012-10-17", "Statement": [ { "Action": "execute-api:Invoke", "Effect": "Allow|Deny", "Resource": "some arn" } ] }, "context": { "customInfo1": "hello",

AWS Lambda behaviour when execution is waiting an async operation?

依然范特西╮ 提交于 2019-12-10 16:47:45
问题 Let say APIGateway triggers a function(handler) which awaits 10 secs public async Task<APIGatewayProxyResponse> Get(APIGatewayProxyRequest request, ILambdaContext context){ var x = await Wait10Async(); return SomeAPIGatewayProxyResponse; } Q1: What happens to this container(execution environment) when await returns the control flow to the function handler itself? Obviously Lambda waits for Task to complete before returning to the APIGateway, but during this 10 sec does the container(or

AWS API Gateway : Convert response to XML

空扰寡人 提交于 2019-12-10 16:33:39
问题 I am getting a string value (xml to string) from lambda backend which should be returned to end user in application/xml format. How can I achieve this? 回答1: You can specify an Integration Response that returns XML, along with a mapping template to format XML using the object returned from Lambda. I do not believe there is a default format conversion to XML. A simple mapping template might be like this: #set($root = $input.path('$')) <stuff> <message>$root.message</message> <sourceIp>$context

How do I reference one model from another model using aws API Gateway

人盡茶涼 提交于 2019-12-10 15:55:50
问题 Say I have a Model: "Pet":{ "type": "object" "properties": { "name":{"type":"integer"}, "age":{"type":"integer"} } } And another model: "Human":{ "type": "object" "properties": { "name":{"type":"integer"}, "age":{"type":"integer"}, "pets":{ "type":"array" "items": { <This is where my question is> } } } } How can I reference the Pet model in my human model? With swagger I was able to say: "$ref": "#/definitions/Pet" but API Gateway seems to not allow it. 回答1: If you mean reference model

How to test API Gateway methods with custom authorizer and empty $context.authorizer.* variables?

有些话、适合烂在心里 提交于 2019-12-10 13:35:20
问题 I have an API Gateway with a POST method that puts directly to a DynamoDB table. My method is also configured to use a custom authorizer via Lambda. In my template mapping I'm consuming some of the authorizer variables, such as $context.authorizer.principalId or $context.authorizer.accountId . Simplified template mapping looks as follows: { "TableName": "$stageVariables.tableName", "Item": { "AccountId": { "S": "$context.authorizer.accountId" }, "Id": { "S": "$context.requestId" }, "Content":

Is there a .NET library that can sign a request with AWS V4 Signature?

女生的网名这么多〃 提交于 2019-12-10 13:33:39
问题 I have an API Gateway where I'm setting the authentication to use AWS_IAM. This requires that I sign each request with the AWS V4 signature and attach the HMAC in the header. I've found libraries to sign a request with the V4 signature in nodejs. But I cannot find a library to sign for me. Even the aws-sdk for .NET has this abstracted for their own specific use case. Is there a library out there (i've done a quick google search and found no results)? Or do I need to write out the hmac myself?