{"id":1020,"date":"2019-11-27T09:00:00","date_gmt":"2019-11-27T08:00:00","guid":{"rendered":"http:\/\/cmagazine.test\/going-serverless-the-easy-way\/"},"modified":"2021-12-23T14:25:51","modified_gmt":"2021-12-23T13:25:51","slug":"going-serverless-the-easy-way","status":"publish","type":"post","link":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/","title":{"rendered":"Going serverless, the easy way"},"content":{"rendered":"<p><strong>Serverless<\/strong> is one of the (not so) new buzzword in town and it has been gaining a lot of attention lately. Cloud vendors are pushing this technology as much as they can, presenting it as the ultimate way to easily implement complex applications without the typical burdens of system administration. No OS friction, hardware management, scalability issues. No \u201cservers\u201d to manage, update, replace. The cloud provider takes care of all of it, letting the developers be free to focus on what really matters, aka developing their application, instead of wasting their energy in the infrastructure.<\/p>\n<p>Aside from the marketing hype, serverless architectures are a very interesting approach to the ageless dilemma of finding the perfect balance when <strong>splitting energies between application development and infrastructure management<\/strong>. That is probably the reason why serverless is so popular, not only on public clouds, but also on-premises.<\/p>\n<p>During <b><a href=\"https:\/\/events.codemotion.com\/conferences\/milan\/2019\/\">Codemotion Milan 2019<\/a><\/b>, <b>Alex Casalboni<\/b>, Sr. Technical Evangelist with <strong>Amazon Web Services<\/strong>, delivered a speech titled <em>Advanced Serverless Architectural Patterns on AWS<\/em>. In this article we will learn the basics of serverless technology provided by <abbr title=\"Amazon Web Services\">AWS<\/abbr>.<\/p>\n<p>If you want to learn more about serverless (even if with different technologies), do not miss the opportunity to attend <strong><a href=\"https:\/\/events.codemotion.com\/conferences\/berlin\/2019\/\">Codemotion Berlin 2019<\/a><\/strong>! Check the <a href=\"https:\/\/events.codemotion.com\/conferences\/berlin\/2019\/agenda\/\">agenda<\/a> and particularly the <a href=\"https:\/\/events.codemotion.com\/conferences\/berlin\/2019\/wp-content\/themes\/event\/detail-talk.php?detail=14879\">talk by Ivan Culjak<\/a>: <strong><a href=\"https:\/\/www.eventbrite.co.uk\/e\/codemotion-berlin-2019-tech-conference-november-12-13-tickets-59103422929\">tickets are still available, get yours here<\/a><\/strong>!<\/p>\n<h2>A service without a server<\/h2>\n<p>For the sake of clarity, let\u2019s re-state the obvious: serverless doesn\u2019t mean there aren\u2019t servers involved (and how that could possibly be?). It simply means that the infrastructure that runs the application (or a part of it) is transparent to the developer.<\/p>\n<p>Instead of deploying a whole microservice, a module or even an entire application as a container, deployment in a serverless environment is done by providing functions, pieces of code that the cloud provider will instantiate when needed. This execution model is often referred to as <b>Function as a Service<\/b> (<strong>FaaS<\/strong>).<\/p>\n<p>Depending on the provider, functions can be implemented in a variety of programming languages such as <strong>JavaScript<\/strong>, <strong>Python<\/strong>, <strong>Java<\/strong>, <strong>Go<\/strong>, <strong>Ruby<\/strong>, <strong>C#<\/strong> and more.<\/p>\n<p>Amazon was among the first cloud providers to offer a FaaS service with its well known <b>AWS Lambda<\/b> service. AWS Lambda is an event-driven serverless platform that allows the execution of code in response to predefined events. Lambda takes care of instantiating and managing the computing resources needed to execute the serverless code, scaling them automatically when needed.<\/p>\n<h2>The serverless Hello World<\/h2>\n<p>Let\u2019s dive in the serverless world creating our first AWS Lambda function. Anyone can experiment with AWS Lambda for free, since the Lambda free tier does not expire and is immediately available after signing up, provided that our application does not perform more than 1 million requests per month or uses more than 400,000 GB-seconds of compute time per month.<\/p>\n<p>After signing in the AWS Management Console, we are greeted with a list of wizards that can help getting started setting up the services we need.<\/p>\n<p>Let\u2019s click on the \u201c<b>Deploy a serverless microservice<\/b>\u201d wizard to create our simple serverless Hello World example.<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1071\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image2-4.png\" alt=\"\" width=\"1099\" height=\"501\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image2-4.png 1099w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image2-4-300x137.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image2-4-1024x467.png 1024w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image2-4-768x350.png 768w\" sizes=\"auto, (max-width: 1099px) 100vw, 1099px\" \/><\/center>The wizard is based on a blueprint, a template for our microservice: a simple REST endpoint to perform CRUD (Create, Read, Update, Delete) operations on a DynamoDB database. We will modify this template according to our needs, removing the connection to DynamoDB and simply returning an Hello World message instead.<\/p>\n<p>Let\u2019s fill in the details of our new lambda function, assigning the name \u201cmyHelloWorld\u201d and creating a new security role for it.<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1073\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image8.png\" alt=\"\" width=\"819\" height=\"621\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image8.png 819w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image8-300x227.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image8-768x582.png 768w\" sizes=\"auto, (max-width: 819px) 100vw, 819px\" \/><\/center><br \/>\nSince we will not actually connect to DynamoDB, we can remove this policy from the execution role by clicking on the little X on the policy block.<\/p>\n<p>Now let\u2019s proceed with the API gateway trigger. This trigger will execute the lambda function whenever the API endpoint is reached.<\/p>\n<p>Let\u2019s choose to create a new API, set its security to \u201cOpen\u201d so we can call the endpoint without authentication (just for the sake of the example) and assign a name to it.<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1074\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image6.png\" alt=\"\" width=\"797\" height=\"563\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image6.png 797w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image6-300x212.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image6-768x543.png 768w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image6-180x128.png 180w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/><\/p>\n<p>After that, just scroll to the end of the page and click on the \u201cCreate function\u201d button. We will modify the code our lambda function immediately after.<\/p>\n<p><\/center>When AWS has finished creating the Lambda function, its code will be presented in the inline editor. Just replace the code with the following:<\/p>\n<p><script src=\"https:\/\/pastebin.com\/embed_js\/UeXb8wPs\"><\/script><\/p>\n<p>This function will respond with a JSON object containing the message \u201cHello World!\u201d if called via the API gateway using the GET method.<\/p>\n<p>Let\u2019s click on the orange \u201cSave\u201d button on the top right corner of the page to apply the modifications.<\/p>\n<p>Now let\u2019s click on the API Gateway block in the Designer to close the function code editor and inspect the API Gateway URL:<\/p>\n<p><center><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1078 size-large hoverZoomLink\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image3-1-1024x270.png\" alt=\"\" width=\"1024\" height=\"270\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image3-1-1024x270.png 1024w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image3-1-300x79.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image3-1-768x203.png 768w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image3-1-1536x406.png 1536w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image3-1.png 1617w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/center>The API endpoint URL is shown in the block below. Since authentication is disabled, we can simply point our browser to it be welcomed by our Hello World message:<\/p>\n<p><center><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1079\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image1-4.png\" alt=\"\" width=\"259\" height=\"80\"><\/center><\/p>\n<h2>Adding an API key<\/h2>\n<p>Let\u2019s now suppose we want to provide our end users with an API key. We will therefore modify our gateway in order to deny requests performed without a valid API key. To do so, let\u2019s click again on the API Gateway block in the designer, then on the name our gateway \u201cmyHelloWorld-API\u201d. This will open the API Gateway editor. Click on \u201cAPI Keys\u201d to set up an API Key for our API:<\/p>\n<p><center><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1080\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image4.png\" alt=\"\" width=\"478\" height=\"410\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image4.png 478w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image4-300x257.png 300w\" sizes=\"auto, (max-width: 478px) 100vw, 478px\" \/><\/center>Click on the \u201cActions\u201d and then choose \u201cCreate API Key\u201d. Give the key a name, and click on Save. For this example, we went with \u201ctestkey\u201d.<\/p>\n<p>Now let\u2019s go back to the API to add authentication. Click on \u201cResources\u201d then choose the \u201cANY\u201d item in the API Method execution list:&nbsp;<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1082\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image7.png\" alt=\"\" width=\"1918\" height=\"723\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image7.png 1200w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image7-300x113.png 300w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image7-1024x386.png 1024w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image7-768x289.png 768w\" sizes=\"auto, (max-width: 1918px) 100vw, 1918px\" \/><\/p>\n<p>Click on the \u201cMethod Request\u201d link to change the authorization mode, switching the \u201cAPI Key Required\u201d parameter from \u201cfalse\u201d to \u201ctrue\u201d:<\/p>\n<p><center><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1081\" src=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image5.png\" alt=\"\" width=\"628\" height=\"469\" srcset=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image5.png 628w, https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/image5-300x224.png 300w\" sizes=\"auto, (max-width: 628px) 100vw, 628px\" \/><\/center>Then click on the little tick button to apply the change.<\/p>\n<p>An important note here: in order to apply any changes to the API Gateway, we must re-deploy it. To do so, click on the Actions button again and then choose \u201cDeploy API\u201d. You can use the \u201cdefault\u201d stage created with the wizard to deploy the new version of the gateway.<\/p>\n<p>Now that the API Gateway is up and running, any attempt to call it without providing a registered API key will fail.<\/p>\n<h2>Conclusions<\/h2>\n<p>There is a lot more to cover about serverless, considering best practices, performance and costs optimization and advanced architectures. Again, if you want to learn more about it, don\u2019t miss the talk <b>Ivan Culjak<\/b>, Cloud Solution Architect with Celeste Maze, will give at <strong><a href=\"https:\/\/events.codemotion.com\/conferences\/berlin\/2019\/\">Codemotion Berlin 2019<\/a><\/strong>: <strong><a href=\"https:\/\/www.eventbrite.co.uk\/e\/codemotion-berlin-2019-tech-conference-november-12-13-tickets-59103422929\">tickets are still available, get yours here<\/a><\/strong>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Serverless is one of the (not so) new buzzword in town and it has been gaining a lot of attention lately. Cloud vendors are pushing this technology as much as they can, presenting it as the ultimate way to easily implement complex applications without the typical burdens of system administration. No OS friction, hardware management,&#8230; <a class=\"more-link\" href=\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/\">Read more<\/a><\/p>\n","protected":false},"author":31,"featured_media":941,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_editorskit_title_hidden":false,"_editorskit_reading_time":0,"_editorskit_is_block_options_detached":false,"_editorskit_block_options_position":"{}","_uag_custom_page_level_css":"","_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[5244],"tags":[22,75],"collections":[],"class_list":{"0":"post-1020","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-cloud","8":"tag-codemotion-milan","9":"tag-serverless","10":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.9 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Going serverless, the easy way - Codemotion Magazine<\/title>\n<meta name=\"description\" content=\"Serverless is running application with an infrastructure transparent to developers. In this article well learn how to create our first AWS Lambda function.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Going serverless, the easy way\" \/>\n<meta property=\"og:description\" content=\"Serverless is running application with an infrastructure transparent to developers. In this article well learn how to create our first AWS Lambda function.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/\" \/>\n<meta property=\"og:site_name\" content=\"Codemotion Magazine\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Codemotion.Italy\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-27T08:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-23T13:25:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1013\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Sergio Monteleone\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:site\" content=\"@CodemotionIT\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sergio Monteleone\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/going-serverless-the-easy-way\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/going-serverless-the-easy-way\\\/\"},\"author\":{\"name\":\"Sergio Monteleone\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/person\\\/1175f6a51ed61a57ce2bbe8f28682052\"},\"headline\":\"Going serverless, the easy way\",\"datePublished\":\"2019-11-27T08:00:00+00:00\",\"dateModified\":\"2021-12-23T13:25:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/going-serverless-the-easy-way\\\/\"},\"wordCount\":1103,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/going-serverless-the-easy-way\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/Stefano-Snaidero-20171110_0021__B9A9864.jpg\",\"keywords\":[\"Codemotion Milan\",\"Serverless\"],\"articleSection\":[\"Cloud\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/going-serverless-the-easy-way\\\/\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/going-serverless-the-easy-way\\\/\",\"name\":\"Going serverless, the easy way - Codemotion Magazine\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/going-serverless-the-easy-way\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/going-serverless-the-easy-way\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/Stefano-Snaidero-20171110_0021__B9A9864.jpg\",\"datePublished\":\"2019-11-27T08:00:00+00:00\",\"dateModified\":\"2021-12-23T13:25:51+00:00\",\"description\":\"Serverless is running application with an infrastructure transparent to developers. In this article well learn how to create our first AWS Lambda function.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/going-serverless-the-easy-way\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/going-serverless-the-easy-way\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/going-serverless-the-easy-way\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/Stefano-Snaidero-20171110_0021__B9A9864.jpg\",\"contentUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/10\\\/Stefano-Snaidero-20171110_0021__B9A9864.jpg\",\"width\":1013,\"height\":675},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/going-serverless-the-easy-way\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DevOps\",\"item\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Cloud\",\"item\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/devops\\\/cloud\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Going serverless, the easy way\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#website\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\",\"name\":\"Codemotion Magazine\",\"description\":\"We code the future. Together\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#organization\",\"name\":\"Codemotion\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/codemotionlogo.png\",\"contentUrl\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/codemotionlogo.png\",\"width\":225,\"height\":225,\"caption\":\"Codemotion\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/Codemotion.Italy\\\/\",\"https:\\\/\\\/x.com\\\/CodemotionIT\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/#\\\/schema\\\/person\\\/1175f6a51ed61a57ce2bbe8f28682052\",\"name\":\"Sergio Monteleone\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/01ed53edef772160c6afbbad5e36940f0cd612cbcf1a6dc3178588bd2b44708c?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/01ed53edef772160c6afbbad5e36940f0cd612cbcf1a6dc3178588bd2b44708c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/01ed53edef772160c6afbbad5e36940f0cd612cbcf1a6dc3178588bd2b44708c?s=96&d=mm&r=g\",\"caption\":\"Sergio Monteleone\"},\"description\":\"Software developer and the co-founder of Moga Software s.r.l., a software house based in Italy. I tend to write code for anything that has a C\\\/C++ compiler, but don't mind using other technologies and languages. I love cats, dogs and, more in general, any lifeform when Lifeform.numLegs() &lt;= 4.\",\"url\":\"https:\\\/\\\/www.codemotion.com\\\/magazine\\\/author\\\/sergio-monteleone\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Going serverless, the easy way - Codemotion Magazine","description":"Serverless is running application with an infrastructure transparent to developers. In this article well learn how to create our first AWS Lambda function.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/","og_locale":"en_US","og_type":"article","og_title":"Going serverless, the easy way","og_description":"Serverless is running application with an infrastructure transparent to developers. In this article well learn how to create our first AWS Lambda function.","og_url":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/","og_site_name":"Codemotion Magazine","article_publisher":"https:\/\/www.facebook.com\/Codemotion.Italy\/","article_published_time":"2019-11-27T08:00:00+00:00","article_modified_time":"2021-12-23T13:25:51+00:00","og_image":[{"width":1013,"height":675,"url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864.jpg","type":"image\/jpeg"}],"author":"Sergio Monteleone","twitter_card":"summary_large_image","twitter_creator":"@CodemotionIT","twitter_site":"@CodemotionIT","twitter_misc":{"Written by":"Sergio Monteleone","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/#article","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/"},"author":{"name":"Sergio Monteleone","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/1175f6a51ed61a57ce2bbe8f28682052"},"headline":"Going serverless, the easy way","datePublished":"2019-11-27T08:00:00+00:00","dateModified":"2021-12-23T13:25:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/"},"wordCount":1103,"publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864.jpg","keywords":["Codemotion Milan","Serverless"],"articleSection":["Cloud"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/","url":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/","name":"Going serverless, the easy way - Codemotion Magazine","isPartOf":{"@id":"https:\/\/www.codemotion.com\/magazine\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/#primaryimage"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864.jpg","datePublished":"2019-11-27T08:00:00+00:00","dateModified":"2021-12-23T13:25:51+00:00","description":"Serverless is running application with an infrastructure transparent to developers. In this article well learn how to create our first AWS Lambda function.","breadcrumb":{"@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/#primaryimage","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864.jpg","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864.jpg","width":1013,"height":675},{"@type":"BreadcrumbList","@id":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/going-serverless-the-easy-way\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codemotion.com\/magazine\/"},{"@type":"ListItem","position":2,"name":"DevOps","item":"https:\/\/www.codemotion.com\/magazine\/devops\/"},{"@type":"ListItem","position":3,"name":"Cloud","item":"https:\/\/www.codemotion.com\/magazine\/devops\/cloud\/"},{"@type":"ListItem","position":4,"name":"Going serverless, the easy way"}]},{"@type":"WebSite","@id":"https:\/\/www.codemotion.com\/magazine\/#website","url":"https:\/\/www.codemotion.com\/magazine\/","name":"Codemotion Magazine","description":"We code the future. Together","publisher":{"@id":"https:\/\/www.codemotion.com\/magazine\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codemotion.com\/magazine\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codemotion.com\/magazine\/#organization","name":"Codemotion","url":"https:\/\/www.codemotion.com\/magazine\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/","url":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","contentUrl":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/11\/codemotionlogo.png","width":225,"height":225,"caption":"Codemotion"},"image":{"@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Codemotion.Italy\/","https:\/\/x.com\/CodemotionIT"]},{"@type":"Person","@id":"https:\/\/www.codemotion.com\/magazine\/#\/schema\/person\/1175f6a51ed61a57ce2bbe8f28682052","name":"Sergio Monteleone","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/01ed53edef772160c6afbbad5e36940f0cd612cbcf1a6dc3178588bd2b44708c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/01ed53edef772160c6afbbad5e36940f0cd612cbcf1a6dc3178588bd2b44708c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/01ed53edef772160c6afbbad5e36940f0cd612cbcf1a6dc3178588bd2b44708c?s=96&d=mm&r=g","caption":"Sergio Monteleone"},"description":"Software developer and the co-founder of Moga Software s.r.l., a software house based in Italy. I tend to write code for anything that has a C\/C++ compiler, but don't mind using other technologies and languages. I love cats, dogs and, more in general, any lifeform when Lifeform.numLegs() &lt;= 4.","url":"https:\/\/www.codemotion.com\/magazine\/author\/sergio-monteleone\/"}]}},"featured_image_src":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864-600x400.jpg","featured_image_src_square":"https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864-600x600.jpg","author_info":{"display_name":"Sergio Monteleone","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/sergio-monteleone\/"},"uagb_featured_image_src":{"full":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864.jpg",1013,675,false],"thumbnail":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864-150x150.jpg",150,150,true],"medium":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864-300x200.jpg",300,200,true],"medium_large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864-768x512.jpg",768,512,true],"large":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864.jpg",1013,675,false],"1536x1536":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864.jpg",1013,675,false],"2048x2048":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864.jpg",1013,675,false],"small-home-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864.jpg",100,67,false],"sidebar-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864-180x128.jpg",180,128,true],"genesis-singular-images":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864-896x504.jpg",896,504,true],"archive-featured":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864-400x225.jpg",400,225,true],"gb-block-post-grid-landscape":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864-600x400.jpg",600,400,true],"gb-block-post-grid-square":["https:\/\/www.codemotion.com\/magazine\/wp-content\/uploads\/2019\/10\/Stefano-Snaidero-20171110_0021__B9A9864-600x600.jpg",600,600,true]},"uagb_author_info":{"display_name":"Sergio Monteleone","author_link":"https:\/\/www.codemotion.com\/magazine\/author\/sergio-monteleone\/"},"uagb_comment_info":0,"uagb_excerpt":"Serverless is one of the (not so) new buzzword in town and it has been gaining a lot of attention lately. Cloud vendors are pushing this technology as much as they can, presenting it as the ultimate way to easily implement complex applications without the typical burdens of system administration. No OS friction, hardware management,&#8230;&hellip;","lang":"en","_links":{"self":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/1020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/comments?post=1020"}],"version-history":[{"count":3,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/1020\/revisions"}],"predecessor-version":[{"id":1858,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/posts\/1020\/revisions\/1858"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media\/941"}],"wp:attachment":[{"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/media?parent=1020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/categories?post=1020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/tags?post=1020"},{"taxonomy":"collections","embeddable":true,"href":"https:\/\/www.codemotion.com\/magazine\/wp-json\/wp\/v2\/collections?post=1020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}