{"id":721,"date":"2017-11-02T10:28:15","date_gmt":"2017-11-02T10:28:15","guid":{"rendered":"http:\/\/wiki.thomasandsofia.com\/?p=721"},"modified":"2017-11-02T11:10:41","modified_gmt":"2017-11-02T11:10:41","slug":"api-gateway","status":"publish","type":"post","link":"https:\/\/wiki.thomasandsofia.com\/?p=721","title":{"rendered":"API Gateway"},"content":{"rendered":"<p><a href=\"https:\/\/www.udemy.com\/aws-certified-solutions-architect-associate\/learn\/v4\/t\/lecture\/6645406?start=0\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/aws-certified-solutions-architect-associate\/learn\/v4\/t\/lecture\/6645406?start=0<\/a><\/p>\n<h2>What is API Gateway<\/h2>\n<p>API Gateway is a fully managed service that makes it easy for developers to publish, maintain, monitor and secure APIs at any scale.\u00a0 With a few clicks in the AWS Management Console, you can create an API that acts as an &#8220;front door&#8221; for applications to access data, business logic, or functionality from your back-end services, such as applications running on Amazon Elastic Compute Cloud, code running on AWS Lambda, or any web application.<\/p>\n<p><a href=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2017\/11\/apigateway.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-723\" src=\"http:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2017\/11\/apigateway.png\" alt=\"\" width=\"774\" height=\"389\" srcset=\"https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2017\/11\/apigateway.png 774w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2017\/11\/apigateway-300x151.png 300w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2017\/11\/apigateway-768x386.png 768w, https:\/\/wiki.thomasandsofia.com\/wp-content\/uploads\/2017\/11\/apigateway-150x75.png 150w\" sizes=\"auto, (max-width: 774px) 100vw, 774px\" \/><\/a><\/p>\n<h2>What is API Caching?<\/h2>\n<p>You can enable API caching in API Gateway to cache your endpointt&#8217;s response.\u00a0 With caching, you can reduce the number of calls made to your endpoint and also improve the latency of the request to your API.\u00a0 When you enable caching for a stage, API Gateway caches responses from your endpoint for a specified time-to-live (TTL) period, in second.\u00a0 API Gateway then responds to the request by looking up the endpoint response from the cache instead of making a request to your endpoint.<\/p>\n<h2>What can API Gateway Do?<\/h2>\n<ul>\n<li>Low cost and efficient<\/li>\n<li>Scales effortlessly<\/li>\n<li>You can throttle requests to prevent attacks.<\/li>\n<li>Connect to Cloudwatch to log all requests<\/li>\n<\/ul>\n<h2>Same Origin Policy<\/h2>\n<p>In computing, the same-origin policy is an important concept in the web application security model.\u00a0 Under the policy, a web browser permits scrips contained in a first web page to access data in a second web page, but only if both web pages have the same origin.\u00a0 (Same domain name.)<\/p>\n<h2>CORS &#8211; Cross Origin Resource Sharing<\/h2>\n<p>CORS is one way the server at the other end (not the client code in the browser) can relax the same-origin policy.<\/p>\n<p>Cross-origin resource sharing is a mechanism that allows restricted resources (e.g.fonts) on a web page to be requested from another domain outside the domain from which the first resource was served.<\/p>\n<p><span style=\"color: #ff0000;\">Error: &#8220;Origin policy cannot be read at the remote resource&#8221; &#8211; You need to enable CORS on API Gateway.<\/span><\/p>\n<h2>Exam Tips<\/h2>\n<ul>\n<li>Know what API Gateway is at a high level<\/li>\n<li>API Gateway has caching ability<\/li>\n<li>API Gateway is low cost and scales automatically<\/li>\n<li>You can throttle API Gateway to prevent attacks<\/li>\n<li>You can log results to CloudWatch<\/li>\n<li>If using Javascript\/AJAX that uses multiple domains with API Gateway, ensure that you enable CORS.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/www.udemy.com\/aws-certified-solutions-architect-associate\/learn\/v4\/t\/lecture\/6645406?start=0 What is API Gateway API Gateway is a fully managed service that makes it easy for developers to publish, maintain, monitor and secure APIs at any scale.\u00a0 With a few clicks in the AWS Management Console, you can create an API that acts as an &#8220;front door&#8221; for applications to access data, business logic, ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/?p=721\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,23],"tags":[],"class_list":["post-721","post","type-post","status-publish","format-standard","hentry","category-amazon-web-services-aws","category-application-services"],"_links":{"self":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=721"}],"version-history":[{"count":4,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/721\/revisions"}],"predecessor-version":[{"id":726,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/721\/revisions\/726"}],"wp:attachment":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}