aws-api-gateway

Authentication between microservices: Amazon API Gateway

倾然丶 夕夏残阳落幕 提交于 2020-05-28 06:41:53
问题 I have several microservices(Springboot) which I have hosted on AWS. For example Lets assume Service1 and Service2 are two micro services. Service1 is the microservice which is accessed by frontend and mobile app. Service1 calls Service2. Service2 is completely internal. I have setup Amazon API Gateway which sits infront of Service1. And I have Authentication(Oauth) configured using cognito. All this is working. When calling from frontend/app, the request needs to be authenticated with the

How can I find the arn of an api gateway stage?

断了今生、忘了曾经 提交于 2020-05-26 10:32:11
问题 I am trying to use awscli to add tags to my api gateway stage https://docs.aws.amazon.com/cli/latest/reference/apigateway/tag-resource.html I am required to supply the --resource-arn for the stage, however I am unable to ascertain this value. I have tried using both awscli and the console to determine this value, but have been unable to find what the arn for the api gateway stage is. I have also tried guessing based off arn pattern/formats. How can I determine this value, or alternatively

WebSockets - send json data via php

馋奶兔 提交于 2020-05-25 20:26:22
问题 I'm trying to send a fire-and-forget request from PHP to my websocket aws api gateway. I've set up an action called "sendmessage". This is the code I'm using: $protocol = "ssl"; $host = "<myendpoint>.amazonaws.com"; $port = 443; $path = "/<mystage>/"; $timeout = 2000; $socket = pfsockopen($protocol . "://" . $host, $port, $errno, $errstr, $timeout); $content = "{'action': 'sendmessage', 'data': 'test'}"; $body = "POST $path HTTP/1.1\r\n"; $body .= "Host: $host\r\n"; $body .= "Content-Type:

WebSockets - send json data via php

情到浓时终转凉″ 提交于 2020-05-25 20:25:17
问题 I'm trying to send a fire-and-forget request from PHP to my websocket aws api gateway. I've set up an action called "sendmessage". This is the code I'm using: $protocol = "ssl"; $host = "<myendpoint>.amazonaws.com"; $port = 443; $path = "/<mystage>/"; $timeout = 2000; $socket = pfsockopen($protocol . "://" . $host, $port, $errno, $errstr, $timeout); $content = "{'action': 'sendmessage', 'data': 'test'}"; $body = "POST $path HTTP/1.1\r\n"; $body .= "Host: $host\r\n"; $body .= "Content-Type:

WebSockets - send json data via php

六眼飞鱼酱① 提交于 2020-05-25 20:24:47
问题 I'm trying to send a fire-and-forget request from PHP to my websocket aws api gateway. I've set up an action called "sendmessage". This is the code I'm using: $protocol = "ssl"; $host = "<myendpoint>.amazonaws.com"; $port = 443; $path = "/<mystage>/"; $timeout = 2000; $socket = pfsockopen($protocol . "://" . $host, $port, $errno, $errstr, $timeout); $content = "{'action': 'sendmessage', 'data': 'test'}"; $body = "POST $path HTTP/1.1\r\n"; $body .= "Host: $host\r\n"; $body .= "Content-Type:

How to Restrict Custom api access using AWS Cognito

匆匆过客 提交于 2020-05-17 06:38:06
问题 I am using Spring Boot in my application. While searching for some IAM tools, I actually liked Auth0, but iam not affordable their pricing. So, I found another called AWS Cognito . Below is Auth0 to restrict our custom access api https://auth0.com/docs/api-auth/restrict-access-api Currently, I am trying to restrict access API using AWS cognito, but I am not finding correct documentation to achieve this. Can anyone please tell me whether restricting api access can be possible using aws cognito

Redirecting AWS API Gateway to S3 Binary

别说谁变了你拦得住时间么 提交于 2020-05-15 04:29:08
问题 I'm trying to download large binaries from S3 via an API Gateway URL. Because the maximum download size in API Gateway is limited I thought I just could provide the basic URL to Amazon S3 (in the swagger file) and add the folder/item to the binary I want to download. But all I find is redirection API Gateway via a Lambda function, but I don't want that. I want a swagger file where the redirect is already configured. So if I call <api_url>/folder/item I want to be redirected to s3-url/folder

AWS API Gateway: How do I make querystring parameters optional in mapping template?

血红的双手。 提交于 2020-05-14 17:56:06
问题 I can't seem to figure out how to create optional query string parameters using a mapping template within my resource's Integration Request. My template looks like this: { "limit": "$input.params('limit')", "post_date":"$input.params('post_date')" } I'd like 'limit' & 'post_date' to be optional. This template creates a querystring that looks like this when these parameters are not provided: /myresource?limit=undefined& When I'm expecting: /myresource The Docs don't seem to cover this. I have

AWS API Gateway caching ignores query parameters

 ̄綄美尐妖づ 提交于 2020-05-12 11:55:06
问题 I'm configuring the caching on AWS API Gateway side to improve performance of my REST API. The endpoint I'm trying to configure is using a query parameter. I already enabled caching on AWS API Gateway side but unfortunately had to find out that it's ignoring the query parameters when building the cache key. For instance, when I make first GET call with query parameter "test1" GET https://2kdslm234ds9.execute-api.us-east-1.amazonaws.com/api/test?search=test1 Response for this call is saved in

Preflight response 403 forbidden. How can I allow options method without x-api-key?

偶尔善良 提交于 2020-04-30 08:47:22
问题 I'm using SAM to create my API in cloudformation. I'm getting a 403 FORBIDDEN on my options method (thus also my preflight for my get method). How can I allow my options method to reply with 200 OK without my x-api-key? I've tried so many stackoverflow answers but none fit my SAM template format. I've tried all the different combinations of my AllowHeaders. I've ommited the x-api-key - still the same 403 FORBIDDEN. If I send my x-api-key in postman with my request I get a 200 OK, but in my