aws-api-gateway

api gateway CORS setup

喜欢而已 提交于 2019-12-12 12:31:32
问题 I'm attempting to setup aws CORS from the command line using aws-cli in a deployment script. I have created the POST Resource with the following perl to shell command. I'm attempting to set the integration-response to '*' much like enabling cores would do. aws apigateway put-method-response \\ --region "$region" \\ --rest-api-id "$api_id" \\ --resource-id "$resource_id" \\ --http-method "POST" \\ --status-code 200 \\ --response-models '{"application/json":"Empty"}' \\ --response-parameters '{

Describe AWS API Gateway Body Mapping Templates in CloudFormation

旧巷老猫 提交于 2019-12-12 11:33:16
问题 I looked though the documentation but didn't find a way to do this. I have a API Gateway method that has a Body Mapping Template, as in the picture attached. How do I map this template in CloudFormation? (I'm using JSON). I added "PassthroughBehavior": "WHEN_NO_TEMPLATES", but haven't found a way to add the Content-Type mapping. Thank you. 回答1: You can do this as part of the RequestTemplates property described here. It should look something like this: "APIMethodGet": { "Type": "AWS:

Exporting api definition from AWS API Gateway

空扰寡人 提交于 2019-12-12 08:53:13
问题 I'm creating an entire API in AWS API Gateway. Since I'm using the graphical console, just because I'm in a learning phase, I will need some way to create the same API programmatically or via the CLI. Is there some facilities to do export the current API set in some way I can reproduce the same structure? 回答1: I've just published a tool for exporting existing APIs from Amazon API Gateway: Amazon API Gateway Swagger Exporter https://github.com/isabinin/aws-apigateway-swagger-exporter Hopefully

How to set “Use Lambda Proxy integration” in swagger for API-Gateway?

為{幸葍}努か 提交于 2019-12-12 08:12:33
问题 How to set Use Lambda Proxy integration in swagger for API-Gateway? My current swagger is bellow but I would really like to setup the proxy integration. I would let me simplify a lot of things, not to mention I could remove the requestTemplates and responses blocks from the swagger definition. I am attempting to setup the new Lambda Proxy mode from this blog post. Current swagger: '/document': options: summary: CORS support description: | Enable CORS by returning correct headers consumes: -

AWS API Gateway Binary output without Accept header

主宰稳场 提交于 2019-12-12 08:09:26
问题 According to http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-payload-encodings.html If contentHandling is not defined, and if the Content-Type header of the response and the Accept header of the original request match an entry of the binaryMediaTypes list, API Gateway passes through the body. This occurs when the Content-Type header and the Accept header are the same; otherwise, API Gateway converts the response body to the type specified in the Accept header. I can't

AWS API Gateway - using Access Token with Cognito User Pool authorizer?

时光怂恿深爱的人放手 提交于 2019-12-12 08:06:55
问题 I am configuring an app with various frontends (mobile and web apps) and a single API backend, powered by Lambda and accessed via AWS API Gateway. As I'm planning to use Cognito to authenticate and authorize users, I have set up a Cognito User Pool authorizer on my API Gateway and several API methods. With an architecture like this, it seems logical that my apps (e.g. an iOS or Vue.js app) are the Client applications from an OAuth perspective, and my API Gateway backend is a Resource Server.

AWS API Gateway Custom Authorizer AuthorizerConfigurationException

爱⌒轻易说出口 提交于 2019-12-12 07:27:05
问题 For a Kinesis stream, I created a proxy API using AWS API Gateway. I added a custom authorizer using python Lambda for the proxy. After publish of lambda function and deploy of API, I was able to successfully test the API using Gateway Test functionality. I could see the logs in cloudwatch which had detailed prints from custom auth lambda function. After successful authentication, API Gateway pushed the record to my Kinesis stream However when I call the same API from Chrome Postman client, I

API GateWay to server in ec2

我与影子孤独终老i 提交于 2019-12-12 04:47:54
问题 I wanted to know if it possible that API GateWay sends data to a specific EC2 instance (my server)? And how my server (that run codes in java) should get the data from the gateway? Thank you, Nofar. 回答1: As the name indicates API gateway is just a gateway to your actual business logic. API gateway cannot run business logic code on it's on. You have to integrate API gateway with an integration point. This integration point can be another HTTP endpoint (REST service), another AWS service or a

AWS API Gateway - Use Client-Side SSL Certificates

走远了吗. 提交于 2019-12-12 04:38:14
问题 I am trying to test API Gateway certificates locally to provide a proof of concept with no luck. I have created a localhost IIS server and configured it up using the following help pages (provided by AWS support team): https://medium.com/@hafizmohammedg/configuring-client-certificates-on-iis-95aef4174ddb https://blogs.msdn.microsoft.com/asiatech/2014/02/12/how-to-configure-iis-client-certificate-mapping-authentication-for-iis7/ In a nutshell, my IIS is setup to use a test website, that has

Where does one configure mapping templates in AWS API Gateway or Lambda?

笑着哭i 提交于 2019-12-12 04:37:56
问题 I see many people talk about using mapping templates in the form of json object to make user agents and ip addresses available to Lambda functions? Where are these json objects configured in the many control panels? 回答1: Api gateway -> your api -> your endpoint/resource method -> integration request -> body mapping templates Create one with a valid Content-type header such as application/json You can then pick a template or roll your own map. For example the template which maps everything