aws-api-gateway

How to - AWS Rest API Authentication

风格不统一 提交于 2019-12-07 20:01:43
问题 I'm trying to make a Rest API using AWS API Gateway, Lambda, and DynamoDB. I'm using java-script as my lambda language, and I have successfully created some resources already. However, i don't understand how to make authenticated requests to my IP. I want simple HTTP Authentication. Can someone explain how to make authenticated requests to the API Gateway and Lambda? 回答1: Here is very Good GitHub Lambda Http Authentication Example Repository. You can walk through this example. A sample

How can I use AWS CloudFront and API Gateway side by side for the same domain?

南楼画角 提交于 2019-12-07 17:38:44
问题 I'm putting that static assets of my website on S3, and setting up CloudFront to distribute them. These essentially holds the content users would need for any GET request on my site, to existing paths that is, with a catchall for errors. I also have some POST requests I need to handle. Form submissions, sending emails, notifications, interacting with the database. How can I set up Lambda (or API Gateway) side by side with CloudFront for the same domain so that CloudFront handles GET requests,

Amazon (AWS) API Gateway - Authentication

北城以北 提交于 2019-12-07 14:42:10
问题 I have a python microservice which I would love to connect to AWS API Gateway. - The problem is that I have researched ways to make both secure, but not really came to a conclusion. I came across a site saying I should use SSL Certifications to only enable requests from API Gateway. Can someone enlighten me on what's the best practice for authentication between the client and API Gateway and the API itself? 回答1: There are a very large number of ways to authenticate between the client and API

Api Gateway: AWS Subdomain for Lambda Integration

帅比萌擦擦* 提交于 2019-12-07 13:26:12
问题 I'm attempting to integrate my lambda function, which must run async because it takes too long, with API gateway. I believe I must, instead of choosing the "Lambda" integration type, choose "AWS Service" and specify Lambda. (e.g. this and this seem to imply that.) However, I get the message "AWS ARN for integration must contain path or action" when I attempt to set the AWS Subdomain to the ARN of my Lambda function. If I set the subdomain to just the name of my Lambda function, when

Parse AWS API Gateway header in Lambda

我是研究僧i 提交于 2019-12-07 13:13:14
问题 I've created a lambda function and API gateway endpoint so that it echoes the query and header parameters it receives, and I want to parse the whole payload to JSON for manageability. The received payloads is in this form: "{Accept=*/*, Accept-Encoding=gzip, deflate, Accept-Language=nb-NO,nb;q=0.8,no;q=0.6,nn;q=0.4,en-US;q=0.2,en;q=0.2,sv;q=0.2,da;q=0.2, Authorization=COzTjCKD6VHTC, Cache-Control=no-cache, User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML,

AWS API Gateway Lambda Error Regex

天涯浪子 提交于 2019-12-07 12:20:53
问题 I have Lambda function written in Python 2.7 which is triggered from API Gateway, I want API Gateway to return 400 code when Lambda fails and I don't want to use Lambda Proxy so I'm trying to set API Gateway Integration Response. When Lambda function fails it returns: { "stackTrace": [ [ "/var/task/lambda_function.py", 12, "lambda_handler", "raise Exception('failure')" ] ], "errorType": "Exception", "errorMessage": "failure" } Lambda Error Regex and Body Mapping template: ..the same from CLI:

How to authenticate serverless web request using AWS Web API and Lambda?

家住魔仙堡 提交于 2019-12-07 12:08:23
问题 Little background info, I have built an interactive website where users can upload images to S3. I built it so the image upload goes right from the browser to AWS S3 using a signed request ( python django backend ). Now the issue is, the users wish to be able to rotate the image. I Similarly I would like this set up so the user's request goes straight from the browser. I built an AWS Lambda function and attached it to a web api, which will accept POST requests. I have been testing and I

AWS GET request with body rejected by CloudFront

久未见 提交于 2019-12-07 10:26:52
问题 I'm build an API using AWS SAM (Lambda & API Gateway) whose contract is defined by a 3rd party. The 3rd party calls my API with a GET request that contains JSON in the body. However, when a request is sent to the API with a body it gets rejected by CloudFront. This is the request: curl -X GET -H "Content-Type: application/json" --data '{"hello":"world"}' https://my-api.execute-api.us-east-2.amazonaws.com/Prod/my-api This is the response: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01

AWS Lambda: Clarification on retrieving data from event object

流过昼夜 提交于 2019-12-07 08:55:34
问题 At the moment I think I have a foundational misunderstanding of how to extract/pass data from lambda functions & I'm seeking clarification Example: Let's say I want to pass some data to a lambda function ie {"hello":"world"} and do so by passing data to that Lambda function by creating a REST endpoint in AWS API Gateway At the moment I understand there are three ways to extract data: 1) event.queryStringParameters (makes sense) ex. We can attach query parameters to the request URL: https:/

AWS Lambda Go function not getting request body when called via API GW

冷暖自知 提交于 2019-12-07 08:44:36
问题 First off, one might say this question is very similar to HTTP request body not getting to AWS lambda function via AWS API Gateway or Getting json body in aws Lambda via API gateway However, none of these questions address using Golang, and the problem I have been having is finding an equivalent of the event parameter used everywhere in the Node.js documentation. Here's my Lambda Function: package main import ( "context" "encoding/json" "github.com/aws/aws-lambda-go/lambda" "github.com/aws