aws-api-gateway

AWS API Gateway - CORS “access-control-allow-origin” - multiple entries

跟風遠走 提交于 2020-01-02 02:05:07
问题 I have a AWS Lambda instance that connects to a defined AWS API Gateway. If I enable CORS and give the access-control-allow-origin a definition of http://example.com , then I am able to access the Lambda instance from http://example.com . However, if I use https://example.com , it doesn't work. So in AWS, how can I define using multiple access-control-allow-origin values without using a wildcard? I tried using something like *.example.com , but that doesn't work. EDIT: If I use '*' as my

AWS API Gateway Proxy Response failure/dropped

此生再无相见时 提交于 2020-01-01 15:06:08
问题 Problem : AWS API Gateway Proxy is not passing back the response from my backend service when using Postman, but works on curl Description : I have a backend service that I want to exposed via AWS API gateway. The use of gateway in this case is purely as a HTTP proxy. So, Created a new API Set the Resource as "Proxy" using ANY Gave my backend service address Deployed it (No Auth required, but API Key is needed though) Could call my backend service from the deployment stage url successfully

AWS Lambda Performance issues

拜拜、爱过 提交于 2020-01-01 10:51:38
问题 I use aws api gateway integrated with aws lambda(java), but I'm seeing some serious problems in this approach. The concept of removing the server and having your app scaled out of the box is really nice but here are the problem I'm facing. My lambda is doing 2 simple things- validate the payload received from the client and then send it to a kinesis stream for further processing from another lambda(you will ask why I don't send directly to the stream and only use 1 lambda for all of the

AWS Lambda Performance issues

橙三吉。 提交于 2020-01-01 10:51:37
问题 I use aws api gateway integrated with aws lambda(java), but I'm seeing some serious problems in this approach. The concept of removing the server and having your app scaled out of the box is really nice but here are the problem I'm facing. My lambda is doing 2 simple things- validate the payload received from the client and then send it to a kinesis stream for further processing from another lambda(you will ask why I don't send directly to the stream and only use 1 lambda for all of the

AWS Route 53 wildcard subdomain with Api gateway

此生再无相见时 提交于 2020-01-01 10:16:13
问题 I have a Hosted zone name example.com on AWS Route53 DNS service. I have multiple subdomain record sets like: api.example.com - type A - ALIAS xxx.cloudfront.net www.example.com - type A - ALIAS xxx.cloudfront.net app.example.com - type A - ALIAS xxx.cloudfront.net All the records point to a Cloudfront generated by Api Gateway Custom Domain. I want to offer a custom subdomain to all of my users: USERNAME.example.com alice.example.com bob.example.com ... I do not know in advance the username

How do I pass arguments to AWS Lambda functions using GET requests?

别说谁变了你拦得住时间么 提交于 2020-01-01 03:57:04
问题 Say I want to pass val1 and val2 in the URL string when making a GET request from my Api gateway endpoint to my Lambda function: https://xyz.execute-api.amazonaws.com/prod/test?val1=5&val2=10 And I have a simple function that sums the two inputs, val1 and val2: def lambda_handler(event, context): # How do I get at val1 and val2?? return {'result': val1 + val2} I've added val1 and val2 to URL Query String Parameters on the Method Request on the AWS API Gateway. But how do I access them inside

aws lambda execution after callback guaranteed?

亡梦爱人 提交于 2020-01-01 01:56:21
问题 My node4 lambda function called via API GW makes a sequence of slow API calls. In order to not let users wait until everything completes, I'm planning to have my code look like this: function(event, context, callback) { ... // Return users API GW call now callback(null, data); // Do the heavy lifting afterwards. longApiCall().then(otherLongApiCalls) } But now I read in the AWS docs: "the callback will wait until the Node.js runtime event loop is empty before freezing the process and returning

How do I cloudform an API gateway resource with a lambda proxy integration

喜你入骨 提交于 2020-01-01 01:35:50
问题 I've been trying to work out how to express (in cloudformation) an API Gateway Resource that has a Lambda function integration type using the Lambda Proxy integration. This is easy to do in the AWS console as there is a check box that you can select: However there is no corresponding field in the AWS::ApiGateway::Method CloudFormation resource (it should be in the Integration property). How can I configure this in cloudformation? 回答1: The Integration type should be set to AWS_PROXY . An

AWS Cloudfront (with WAF) + API Gateway: how to force access through Cloudfront?

若如初见. 提交于 2019-12-31 10:41:54
问题 I want to put WAF in front of API Gateway, and with the (little) info I find that is only possible by manually putting an extra Cloudfront distribution with WAF enabled, in front of APIG. It's a bit of a shame, especially since APIG now supports custom domains natively, but it should work. Now to make the solution secure rather than just obscure, I want to enforce that the APIs can only be accessed through the Cloudfront distro. What is the best option to do this? I was hoping to be able to

AWS Cloudfront (with WAF) + API Gateway: how to force access through Cloudfront?

旧街凉风 提交于 2019-12-31 10:41:24
问题 I want to put WAF in front of API Gateway, and with the (little) info I find that is only possible by manually putting an extra Cloudfront distribution with WAF enabled, in front of APIG. It's a bit of a shame, especially since APIG now supports custom domains natively, but it should work. Now to make the solution secure rather than just obscure, I want to enforce that the APIs can only be accessed through the Cloudfront distro. What is the best option to do this? I was hoping to be able to