aws-api-gateway

How to integrate API Gateway with Cognito Federated Identity and Cognito User Pools

♀尐吖头ヾ 提交于 2020-03-23 12:39:19
问题 In AWS, I have built an API gateway which invokes a Lambda function. Users gain access by logging in to a Cognito User Pool associated with a Cognito Federated Identity Pool and the associated IAM roles contain API invoke permissions. The API Gateway method is a POST request. If I use the User Pool as the authorizer of the API Gateway I am able to successfully trigger the Lambda function via an ajax request in my javascript web app - note though, this grants the same access to every user in

Trace full-request / response bodies in AWS ApiGateway (not truncated)

|▌冷眼眸甩不掉的悲伤 提交于 2020-03-23 07:34:15
问题 I am using AWS Api Gateway and I'd like to trace full request and response . Some of my integrations are lambdas and some other http endpoints. I enabled stage > Logs > "Log full requests/responses data" and I can see logs on CloudWatch. This seemed to be perfect until I discovered bodies were being TRUNCATED ... There is a limitation of 1024 bytes in ApiGateway sending logs to cloudwatch. Is there any solution to this? I am considering using a lambda as a proxy (with http-proxy) as my last

Trace full-request / response bodies in AWS ApiGateway (not truncated)

房东的猫 提交于 2020-03-23 07:34:09
问题 I am using AWS Api Gateway and I'd like to trace full request and response . Some of my integrations are lambdas and some other http endpoints. I enabled stage > Logs > "Log full requests/responses data" and I can see logs on CloudWatch. This seemed to be perfect until I discovered bodies were being TRUNCATED ... There is a limitation of 1024 bytes in ApiGateway sending logs to cloudwatch. Is there any solution to this? I am considering using a lambda as a proxy (with http-proxy) as my last

Using aws-sdk inside lambda? (AWS.ApiGatewayManagementApi is not a constructor at Response)

生来就可爱ヽ(ⅴ<●) 提交于 2020-03-22 02:33:29
问题 I am trying to use aws-sdk inside lambda but I can't seem to figure it out. var AWS = require('aws-sdk'); AWS.config.update(); var DDB = new AWS.DynamoDB({ apiVersion: "2012-10-08" }); exports.handler = function (event, context, callback) { var url_handler = event.requestContext.domainName + "/" + event.requestContext.stage; var scanParams = { TableName: "tbl-web-socket-connection", ProjectionExpression: "id" }; DDB.scan(scanParams, function (err, data) { console.log(err, "Error"); if (err) {

AWS API gateway and elastic search get query

喜欢而已 提交于 2020-02-29 08:03:49
问题 I need to call elastic search engine directly from api gateway using http connection eg. https:////_doc/_search?pretty&filter_path=hits.hits._source i have n number of orders in elastic search engine which i want to get using get query ,but i want only array of json i posted and dont want any other information in the response.how can i do that ? eg. this is what i am getting : { "hits" : { "hits" : [ { "_index" : "gpss_orders", "_type" : "_doc", "_id" : "4867254", "_score" : 1.0, "_source" :

AWS API gateway and elastic search get query

主宰稳场 提交于 2020-02-29 08:03:21
问题 I need to call elastic search engine directly from api gateway using http connection eg. https:////_doc/_search?pretty&filter_path=hits.hits._source i have n number of orders in elastic search engine which i want to get using get query ,but i want only array of json i posted and dont want any other information in the response.how can i do that ? eg. this is what i am getting : { "hits" : { "hits" : [ { "_index" : "gpss_orders", "_type" : "_doc", "_id" : "4867254", "_score" : 1.0, "_source" :

What is the use of Use Proxy Integration in API Gateway Integration?

╄→гoц情女王★ 提交于 2020-02-23 04:15:09
问题 I am trying to make a integration between API Gateway API and a resource behind VPC. While creating the integration, there is a option to select, "Use Proxy Integration". Even if I am not selecting this check box and deploy the API, I am able to make the API Gateway connectivity working via NLB to the target resource behing VPC. So, I am having difficulty in understanding still why we need to select the check box. 来源: https://stackoverflow.com/questions/59917934/what-is-the-use-of-use-proxy

Amazon API security with API Keys?

前提是你 提交于 2020-02-16 06:51:31
问题 I have deployed my rest API on amazon API gateway and I have a scenario in front of me with security concern. I am using an api key for all the api requests, I wanna know if the that api key is exposed somehow and as we know the same api key is being used by already published apps...Then what are my options? Also as mentioned here I can have only 10000 API keys per AWS account if I want the api keys to be unique per user for it to be more secure but what if the number of user shoots out to be

Amazon Cognito Oauth2 Native App : Best practice

馋奶兔 提交于 2020-02-04 12:16:20
问题 I am developing backend API's for a native app. This backend service(developed using java/springboot) is deployed on AWS. For Securing the backend API's I am planning to use Oauth2 (Authorization Code grant Flow with PKCE). I am trying to achieve this through Amazon API Gateway and Cognito User Pool. This is what I have done so far. I have created Cognito user pool Add an app client(app client id/secret) Configured Domain and Resource Server Configured App Client Settings with Authorization

Amazon Cognito Oauth2 Native App : Best practice

冷暖自知 提交于 2020-02-04 12:12:04
问题 I am developing backend API's for a native app. This backend service(developed using java/springboot) is deployed on AWS. For Securing the backend API's I am planning to use Oauth2 (Authorization Code grant Flow with PKCE). I am trying to achieve this through Amazon API Gateway and Cognito User Pool. This is what I have done so far. I have created Cognito user pool Add an app client(app client id/secret) Configured Domain and Resource Server Configured App Client Settings with Authorization