aws-api-gateway

Access dynamodb with Angular

天涯浪子 提交于 2019-12-11 15:57:09
问题 I am new to AWS and plan to use Angular to make http request to endpoints to access DynamoDB. I am not sure which option to use since I see there is 1. Dynamodb's web services 2. use API Gateway to call lambda that call dynamodb. Could someone help me to understand what is the preferred method to access dynamodb from a front-end framework and why? Thank you! 回答1: It's not good idea to call DynamoDB from Angular(JavaScript). It doesn't comes under the AWS best practices. The reason is you have

AWS API Gateway 404 page not found error when invoking endpoint url

随声附和 提交于 2019-12-11 15:37:47
问题 I have an API running on ECS Fargate that accepts GET method requests. I put an API Gateway endpoint in front of it with a VPC_LINK integration with an NLB in a private subnet. When I send a GET request using the invoke url, I get a 404 page not found error. I am confused why I am getting this. I set up every component - the NLB listener, the target group, and my host and container ports in my task definition - on 8000/tcp . So, I am not sure why this error is happening. My Fargate task is

Cant get API Gateway `RequestId` in Lambda function

馋奶兔 提交于 2019-12-11 15:16:04
问题 I sent a post and get the response from amazon API Gateway as: {"MD5OfMessageBody": "bc709a65868c21309969a07cfeeac12f", "MD5OfMessageAttributes": "8a66ae91e9109cb75717520c287736eb", "MessageId": "b70a5453-5f30-4914-8006-b6cf7fa4ff93", "ResponseMetadata": {"RequestId": "1a38fbb5-859a-53f9-9551-a805d864768c", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Fri, 29 Jun 2018 16:18:06 GMT", "content-type": "text/xml", "content-length": "459", "connection": "keep-alive", "x-amzn

Integrating AMQ with Rest API gateway

廉价感情. 提交于 2019-12-11 14:58:47
问题 I am trying to integrate AMQ with api gateway so that i can push messages directly to AMQ from api gateway using AWS resource option in API gateway and gets this error on deployment AWS ARN for integration contains invalid action. What action should i use here so that api gatwway know which AMQ it should use to push messages. what all the things i need to take care so that i can setup apigateway with AMQ 回答1: For integrating Amazon MQ with API Gateway, you will not be able to use the "AWS

AWS Gateway always returns the default status code

空扰寡人 提交于 2019-12-11 14:31:57
问题 When I test my Lambda through AWS Gateway, I can see this lines being logged: Wed Jul 19 20:06:11 UTC 2017 : Method response body after transformations: {"errorCode":0,"headers":{},"statusCode":567,"base64Encoded":false} As you can see I'm returning 567 as status Code. But I always see 200: Then, this is my configuration in Integration Response: I'm using as reg exp .*"statusCode":567.* , but it is not matching with {"errorCode":0,"headers":{},"statusCode":567,"base64Encoded":false} . These

API Gateway - validating request parameters

喜夏-厌秋 提交于 2019-12-11 11:49:06
问题 So, I've heard about request validator in API gateway. Is it possible to validate request if it has atleast 1 parameter/querystring? Example: Either name or id should be in the query string https://something.domain.com/dev/employee?name=myname https://something.domain.com/dev/employee?id=myid Basically, what I want is that before a Lambda function is executed, this should consider these conditions first SHOULD have a parameter Either a name or an id should be in that parameter 回答1: API

AWS API Gateway with Lambda proxy integration fails

我是研究僧i 提交于 2019-12-11 10:45:17
问题 My problem is pretty simple, really. I wrote a Scala handler class that returns a String containing the following JSON: { "isBase64Encoded":false, "statusCode":404, "headers":{ "Content-Type":"text/html" }, "body":"<p>The requested resource could not be found.</p>" } My class has the following signature: object Handler extends RequestHandler[APIGatewayProxyRequestEvent, String] { override def handleRequest(input: APIGatewayProxyRequestEvent, context: Context): String = ??? } I am using the

API Gateway: ok on TEST button, 500 on Curl

≯℡__Kan透↙ 提交于 2019-12-11 08:45:28
问题 I checked all configurations and still cannot understand why it happens... My endpoint: My successful Logs in TEST: Execution log for request 24899adf-15c1-11e9-8131-9fdcec088245 Fri Jan 11 16:51:29 UTC 2019 : Starting execution for request: 24899adf-15c1-11e9-8131-9fdcec088245 Fri Jan 11 16:51:29 UTC 2019 : HTTP Method: POST, Resource Path: / Fri Jan 11 16:51:29 UTC 2019 : Method request path: {} Fri Jan 11 16:51:29 UTC 2019 : Method request query string: {} Fri Jan 11 16:51:29 UTC 2019 :

I have an error calling AWS API Gateway Websocket Route using wscat or via node.js

六月ゝ 毕业季﹏ 提交于 2019-12-11 08:17:40
问题 I create a websocket and then a custom route. Before publishing I need to select an integration for $disconnect and $default , for both I choose Mock (I have also tried default Lambda functions), this allows me to publish. I then use wscat to call wscat -c wss://t0p5b2xpm3.execute-api.us-east-1.amazonaws.com/prod the socket connects successfully,then i try to call the route {"action":"echo", "data":"test response body"} and get the following error. {"message": "Internal server error",

NodeJs delay each promise within Promise.all()

非 Y 不嫁゛ 提交于 2019-12-11 07:29:26
问题 I'm trying to update a tool that was created a while ago which uses nodejs (I am not a JS developer, so I'm trying to piece the code together) and am getting stuck at the last hurdle. The new functionality will take in a swagger .json definition, compare the endpoints against the matching API Gateway on the AWS Service, using the 'aws-sdk' SDK for JS and then updates the Gateway accordingly. The code runs fine on a small definition file (about 15 endpoints) but as soon as I give it a bigger