aws-api-gateway

AWS API Gateway - Manage multiple model versions for different stages

旧巷老猫 提交于 2019-12-11 07:23:11
问题 I use multiple AWS API Gateway for many of our backend services. This is the standard structure of the Gateway (in relation to my question); API Gateway 2 stages (test and prod) AWS CLI Tool for automated changes and deployments The problem I'm having (this has been since I started using AWS API Gateway); The Gateway manages versionsing of the API perfectly fine, however, not model versioning... During a quarter (we work in 3 month sprints), we would make changes multiple models. This stage

access AWS API gateway using access token from identityserver

别来无恙 提交于 2019-12-11 07:05:07
问题 We have our identity server implemented using identity server https://github.com/IdentityServer/IdentityServer3 or https://github.com/IdentityServer/IdentityServer4 And user will authenticate and get the access token from the identity server. We have some APIs developed in AWS api gateway. Just wondering what is the common practice to implement the authentication / authorization in the aws api gateway. We would prefer to use the existing access token from the identity server in the API

Step Functions with Lambdas using Lambda Proxy Integration

ⅰ亾dé卋堺 提交于 2019-12-11 06:37:25
问题 I have written a bunch of Lambda functions that are exposed as Rest endpoints through API Gateway. I have chosen the "Lambda Proxy Integration" since it seemed like a straightforward way to get started. Now I want to chain together 2 of these functions via AWS Step Functions. The general integration and configuration works fine except how to create the proper inputs for each task. Using the console I can start an Execution and give the following JSON: { "headers": { "Authorization": "Bearer

Adding IP whitelisting security to API gateway

我与影子孤独终老i 提交于 2019-12-11 06:23:29
问题 I have a API on AWS API gateway which calls LAMBDA function and I want to add IP whitelisting for that API so the allowed IPs only can have access to that API. How can I achieve this? 回答1: There is a really extended blog post about this which you can find here. Bottom line, it comes to this: per method, select IAM Authorization method. Create a new IAM policy that looks like the one below and attach it to the API Method { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action":

API Gateway does not have permission to assume the provided role DynamoDB

荒凉一梦 提交于 2019-12-11 06:09:10
问题 I'm trying to follow this tutorial, but when I try to test the API I've created, I get the following message: API Gateway does not have permission to assume the provided role The API request should be posting to a DynamoDB table I've created. I've created an IAM Role and attached the policy AmazonDynamoDBFullAccess. I've also tried attaching this policy to my administrator user. Here is the integration request in my API: Any help is much appreciated. 回答1: The ARN you have provided for the IAM

Amazon API gateway — proxied requests are returning unreadable data

筅森魡賤 提交于 2019-12-11 05:49:20
问题 We have recently begun exploring Amazon's api gateway service, and I have configured a few apis with explicit mapping. These function as expected. However, the proxy mapping seems to be returning unexpected/unreadable content. This is what we get: ��������[o�0��J�Ů��-pǡ�j�Bڪ^�ɷīcg�CU��K Also, this only occurs when we hit it from the application/Postman. Doing test api calls from the gateway dashboard functions as expected. Does it sound like some configuration is missing? Anyone else

How to get validate Cognito Access Token in AWS Lambda to allow Gateway API call?

柔情痞子 提交于 2019-12-11 05:44:57
问题 What I am trying to do is to set up API Gateway to my Lambda function that saves some in DynamoDB (or other stuff that I want to be only for logged in users). But I do not understand how to validate AccessToken and how to get user from that. I found this post on AWS forum and I decided to try approach 1. Cognito User Pools + API Gateway + API Gateway Custom Authorizer + Cognito User Pools Access Token. So now I have logged in user : var authenticationData = { Username : 'username', // your

Missing Authentication Token on Unauthenticated Method

寵の児 提交于 2019-12-11 05:17:48
问题 I have the following Terraform for setting up a CORS method for my API on API Gateway: resource "aws_api_gateway_method" "default" { rest_api_id = "${var.rest_api_id}" resource_id = "${var.resource_id}" http_method = "OPTIONS" authorization = "NONE" } resource "aws_api_gateway_method_response" "default" { rest_api_id = "${var.rest_api_id}" resource_id = "${var.resource_id}" http_method = "${aws_api_gateway_method.default.http_method}" status_code = "200" response_parameters = { "method

AWS API Gateway - Elastic Beanstalk - Restricted Access

ぃ、小莉子 提交于 2019-12-11 04:53:19
问题 I have a NodeJS API on Amazon EB and an API on API Gateway. API Gateway is configure as a proxy to EB. I can call my API without problem, it's working but I don't know how to manage security. Actually if I use the API Gateway URL I must sign the request (it's ok!) but I can use the EB URL and nothing is necessary. Before using API Gateway I was using JWT but now what shall I do on my Node app? API Gateway is using the Authorization header for sign the request, so my Node app must check this

How to pass through Content-Type in AWS API Gateway?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 04:09:11
问题 I've set up AWS API Gateway to pass through requests to a service that returns images. When I use the "Test" functionality in the UI, the logs show the PNG data being returned in the method response, as well as the `Content-Type=image/png: However, when you actually go and visit the endpoint in a browser, the Content-Type is application/json . I would have expected that the "Method response headers" displayed in the logs of the "Test" UI to match what would actually be returned. How do I