aws-api-gateway

AWS Cloudformation Link API Key to API Gateway

久未见 提交于 2019-12-08 07:06:46
问题 I have the following Cloudformation template I am trying to deploy via SAM. This template correctly creates the DynamoDB table, an API Key, a Lambda function and the API Gateway, but I cannot figure out what I need to specify in the template to associate the API KEY with the API Gateway. I have found plenty of snippets showing partial examples, but I am struggling to piece it all together. Thank you in advance, Denny AWSTemplateFormatVersion: 2010-09-09 Transform: AWS::Serverless-2016-10-31

Passing HTTP Post from AWS API GW to Lambda

折月煮酒 提交于 2019-12-08 06:05:27
问题 I process the HTTP POST from a service that does not support JSON (Mailgun). It appears if I create an AWS API GW for POST and pass this to an AWS Lambda function that the data must be in JSON. Other than trying to serialize the POST to JSON (which I would prefer not to), does anyone know if this is the case? 回答1: I found a solution here, works for me. https://forums.aws.amazon.com/thread.jspa?messageID=673012&tstart=0#673012 The following is from the original post for a complete answer. Step

How to configure backend server to use client side SSL certificates generated by aws gateway api?

隐身守侯 提交于 2019-12-08 05:16:20
问题 I have deployed node js app to ec2 instance of single instance type through elasticbeanstalk. After this I deployed my app through amazon api gateway. My EC2 instance is public. I want to restrict it in such a way that it only accepts request from amazon api gateway. To do this I am following this https://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started-client-side-ssl-authentication.html I generated a client side certificate through api gateway but I don't know how to use

How to integrate, by CloudFormation, Api Gateway with Step Functions

僤鯓⒐⒋嵵緔 提交于 2019-12-08 04:32:14
问题 I'm creating a CloudFormation template for the platform I'm working on. I need to integrate Api Gateway and Step Functions, to make one of my step functions be executed by a call to a Api Gateway Method. I'm not finding any documentation on this. I struggled to find the Integration/Uri, that should be arn:aws:apigateway:${region}:states:action/StartExecution but now I'm not sure on what to write in my RequestTemplates. I suppose that I could actually leave it empty, to make it act like a

AWS API Gateway with custom authorizer returns AuthorizerConfigurationException

别来无恙 提交于 2019-12-08 02:09:50
问题 I have an AWS API Gateway that uses a custom authorizer, and if the request is authorized, it triggers another lambda function. Since yesterday, whenever I call the API, I get an error saying { "message": null } and a 500 Internal Server Error. In the response headers it says x-amzn-ErrorType →AuthorizerConfigurationException . I can see in the logs that the authorizer is called and returns a valid policy, and that the other lambda function is not triggered. I have not (knowingly) changed the

Setting up proxy_pass on nginx to make API calls to API Gateway

房东的猫 提交于 2019-12-08 01:24:34
问题 Problem: I've set up a Lambda function behind API gateway which works beautifully. I have a hosted site that I want only a certain location to hit the API. Example https://www.example.com/ (Serves up html from hosted server) https://www.example.com/foobar (Returns a JSON payload that is generated by Lambda and returned by AWS) Here is my server block: location = /foobar { proxy_pass https://someawsuri; proxy_redirect default; } location / { # First attempt to serve request as file, then # as

Amazon API Gateway User keys

自古美人都是妖i 提交于 2019-12-08 01:04:22
问题 I have an API deployed on AWS API Gateway. I will have multiple subscribers using my API and each customer would be unique. Is it possible that each customer will have a separate API key unique to him? Or will I have to create those many IAM users in order for them to be unique? If yes for the IAM users, then what is the upper limit of the number of users? I will be doing all this programmatically. 回答1: By unique, if you mean that you should be able to identify which request came from who,

AWS API Gateway: Is it possible to add source IP address in each API method?

痴心易碎 提交于 2019-12-07 22:42:58
问题 I have created an API using AWS API Gateway. Now I want to log each of the request on each method of each resource. Also, I need the source IP address of the client accessing the route. How can I accomplish this without writing custom code in the API functions ? 回答1: The default CloudWatch logs for your API should include all headers, including the X-Forwarded-For header which will contain the source IP address. (See http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-stage

Default Response Headers: AWS API Gateway w/ Proxy Integration

北战南征 提交于 2019-12-07 20:44:57
问题 We have an Angular SPA front end, which communicates through an AWS API Gateway to a .Net Web API hosted in a Lambda function. This configuration mandates that our API Gateway uses proxy intgeration with the Lambda. Generally, this works well. We have enabled CORS in our API, and normal requests and responses flow as expected. However, when something happens that breaks the API Gateway or .Net Lambda Wrapper, such as exceeding the Gateway's (non-configurable) 30-second timeout, or exceeding

API Gateway with Cognito User Pool Authorizer and Lambda

三世轮回 提交于 2019-12-07 20:19:07
问题 I am having an Architecture where I am using API Gateway with Cognito User Pool Authorizer and I am passing the IdToken in Authorization Header from client side ReST call. It is working fine. I need the cognitoIdentityId in Lambda. Tried Body Template Mapping in Integration Request in API Gateway Content type - application/json { "cognito-identity" : "$context.identity.cognitoIdentityId" } It doesn't send the identityid (in event or in context) and also it transforms my payload only to this