aws-api-gateway

Can I specify HTTP endpoint in a VPC as resource in AWS API Gateway?

夙愿已清 提交于 2019-11-30 04:15:35
I have a situation when my product(some Web API) is living inside of VPC, i.e. with no any any external access. I'd like to expose the part of this APIs(just a couple of HTTP methods) to be accessible from the internet. I'm trying to achieve this using AWS API Gateway but it looks like I cannot make internal ELB endpoint the API Gateway resource. Any ideas how can I do this? Thanks, --Vovan This was originally not possible, and then was solved with support for client certificates that API Gateway could use to authenticate itself to your services. This was a good solution, and is still

Request payload limit with AWS API Gateway

孤者浪人 提交于 2019-11-30 03:56:52
问题 What is the request-payload limit with AWS API-Gateway? I need to send a JSON payload with base64 encoded files and some other parameters to API Gateway, that will then pass on the payload to AWS Lambda. I could not find AWS documentation regarding this. 回答1: Maximum payload to API gateway is 10 MB and maximum payload for Lambda is 6 MB, which cannot be increased. Please see API gateway payload limits here Please see Lambda payload limits here But there is an alternative way (a work around)

How setup header in Postman for Api Gateway authenticated with Cognito?

拈花ヽ惹草 提交于 2019-11-30 03:48:13
问题 I use AWS Identity Pool with Facebook provider to authenticate client. I need to invoke AWS Lambda using Api Gateway. From Cognito, using Facebook token, i received credentials: AccessKeyId, SecretKey and SessionToken. Using this credentials, how should I setup header request to invoke my Lambda? Api Gateway setup (test calls my lambda) I try to call my api, it returns "The security token included in the request is invalid." Thank you! 回答1: You have to manually set ' x-amz-security-token ' in

How to get the HTTP method in AWS Lambda?

邮差的信 提交于 2019-11-30 03:18:54
问题 In an AWS Lambda code, how can I get the HTTP method (e.g. GET, POST...) of an HTTP request coming from the AWS Gateway API? I understand from the documentation that context.httpMethod is the solution for that. However, I cannot manage to make it work. For instance, when I try to add the following 3 lines: if (context.httpMethod) { console.log('HTTP method:', context.httpMethod) } into the AWS sample code of the "microservice-http-endpoint" blueprint as follows: exports.handler = function

In Terraform, how do you specify an API Gateway endpoint with a variable in the request path?

不打扰是莪最后的温柔 提交于 2019-11-30 03:00:02
In AWS API Gateway, I have a endpoint defined as /users/{userId}/someAction , and I'm trying to recreate this with terraform I would start having some sort of linked gateway_resource chain like so... resource "aws_api_gateway_resource" "Users" { rest_api_id = "${var.rest_api_id}" parent_id = "${var.parent_id}" path_part = "users" } //{userId} here? resource "aws_api_gateway_resource" "SomeAction" { rest_api_id = "${var.rest_api_id}" parent_id = "${aws_api_gateway_resource.UserIdReference.id}" path_part = "someAction" } In which I then define the aws_api_gateway_method and everything else. How

How to integrate API Gateway with SQS

守給你的承諾、 提交于 2019-11-30 02:28:32
问题 Just like in the title. I try to integrate API Gateway method with a SQS using cloud formation. What I am missing is the correct URI for the SQS. If any of you already did that, what should the URI look like? I came up with something like that, but have no idea where to put the SQS ARN "arn:aws:apigateway:${AWS::Region}:sqs:action/SendMessage" Here is the full configuration for the method: PostMethod: Type: "AWS::ApiGateway::Method" Properties: ApiKeyRequired: "true" HttpMethod: "POST"

How to CNAME to Amazon API Gateway Endpoint

时光怂恿深爱的人放手 提交于 2019-11-29 22:52:58
I'm trying to set a CNAME on Cloudflare to point to an Amazon API Gateway endpoint. The CNAME is for use when referring to one of my subdomains. The gateway in turn points to the IP of a server on DigitalOcean. I am very new to Amazon web services and would appreciate if someone could give me an overview of the correct configuration for the DNS, Amazon Gateway and Cloudfront (which I think is needed to expose the gateway to DNS servers external to Amazon). Any help would be much appreciated. UPDATE I've been going at this for a while now and not making much progress. Does anyone have an idea

Passing ARN reference from CloudFormation to Swagger

故事扮演 提交于 2019-11-29 22:09:39
问题 We are trying to automate the deployment of AWS lambda and API gateway using Amazon CloudFormation and Swagger. Towards this, we have created a CloudFormation template to create the Lambda and other resources required for APIGateway (including the endpoints). We would like to import the API definitions from an external swagger file so that the same CloudFormation template can be used for multiple lambdas and APIGateways. Is there a way we can refer the ARN of the lambda which has been created

Regional/Edge-optimized API Gateway VS Regional/Edge-optimized custom domain name

我是研究僧i 提交于 2019-11-29 20:26:14
This does not make sense to me at all. When you create a new API Gateway you can specify whether it should be regional or edge-optimized. But then again, when you are creating a custom domain name for API Gateway, you can choose between the two. Worst of all, you can mix and match them!!! You can have a regional custom domain name for an edge-optimized API gateway and it's absolutely meaningless to me! Why these two can be regional/edge-optimized separately? And when do I want each of them to be regional/edge-optimized? Why these two can be regional/edge-optimized separately? Regional and Edge

Client certificates with AWS API Gateway

情到浓时终转凉″ 提交于 2019-11-29 19:40:11
问题 I am trying to implement mutual authentication for the communication between aws api gateway and my server. I want to use the client side certificates that amazon offers for authentication. I know that my server is configured correctly because previously I was using a lambda function and mutual authentication was working. I have exported the (.PEM) certificate and added it into a truststore. I have configured my Jetty server to use that truststore for authentication. I have set client-auth to