<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Webiny</title>
    <description>The latest articles on DEV Community by Webiny (@webiny).</description>
    <link>https://dev.to/webiny</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F1429%2F7d25adce-249f-40af-86fa-a98a6266ab50.png</url>
      <title>DEV Community: Webiny</title>
      <link>https://dev.to/webiny</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/webiny"/>
    <language>en</language>
    <item>
      <title>Introducing Webiny Enterprise Headless CMS+</title>
      <dc:creator>Ben Read</dc:creator>
      <pubDate>Tue, 18 Oct 2022 12:41:25 +0000</pubDate>
      <link>https://dev.to/webiny/introducing-webiny-enterprise-headless-cms-2dlb</link>
      <guid>https://dev.to/webiny/introducing-webiny-enterprise-headless-cms-2dlb</guid>
      <description>&lt;p&gt;We have struggled for a long time on the question of how to position Webiny as a product. From the start, it was clear that we we were building was a feature-rich product that didn't quite sit firmly in the camp of "Headless CMS", yet that is what the majority of our users focused in on. &lt;/p&gt;

&lt;p&gt;As a result, we have doubled down on that particular marketing, building more features and explanation around the concept of Webiny as a Headless CMS. However, as I'm sure you realize, it's an extremely crowded space. And we still didn't quite fit in.&lt;/p&gt;

&lt;p&gt;You see, Webiny isn't just one product. It's four fundamental ones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Content management system&lt;/li&gt;
&lt;li&gt;File storage and Management&lt;/li&gt;
&lt;li&gt;No-code Web Page Builder&lt;/li&gt;
&lt;li&gt;Form builder&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In reality, it's actually &lt;em&gt;more&lt;/em&gt; than even those products: Not every CMS can scale to tens of thousands of users, serve content for millions of website pages and application interfaces, and be as easily customizable as Webiny is. &lt;/p&gt;

&lt;p&gt;We frequently hear about teams using Webiny in unique and different ways: from wealth management portals, to BitCoin exchanges, to online course providers, to customer service desks, to a no-code form builder. It's been amazing to watch different teams do all of this with Webiny and more.&lt;/p&gt;

&lt;p&gt;Not every CMS can become all — or any — of these things.&lt;/p&gt;

&lt;p&gt;But if we were to look at the terminology around the kind of tools on the market that have those features ... well, that's not what we want to be either.&lt;/p&gt;

&lt;h2&gt;
  
  
  What if you Need More Than a Headless CMS?
&lt;/h2&gt;

&lt;p&gt;Products that we could compete with that are more than a CMS are varied, but the basic premise is the same: allow large, complex, multinational organizations with content creators in different locations and languages to populate their websites with products, blog posts and other information on a regular basis. This might not just involve writing content, but also creating short-lived product launch pages, gaining feedback using a web-based form, or sharing product literature with vendors and potential contractors.&lt;/p&gt;

&lt;p&gt;Popular acronyms in this space are WCM ("Web Content Manager"), and DXP ("Digital Experience Platforms").&lt;/p&gt;

&lt;p&gt;These systems are often very clunky, with difficult-to-navigate interfaces. Customization options are very limited, and they often require hiring specialized individuals to manage them. Not to mention the fact that they're nearly always hugely expensive SAAS platforms that exist outside the organization's perimeter.&lt;/p&gt;

&lt;p&gt;With the features we have, it would be possible to become a competitor in this space. But Webiny is much more nimble, adaptable and on top of that, is also self-hosted.&lt;/p&gt;

&lt;h2&gt;
  
  
  By Any Other Name
&lt;/h2&gt;

&lt;p&gt;So we stopped and asked ourselves: do tools to manage content on the web really need more acronyms? CMS is a pretty good fit, and even the "headless" part seems to be on it's way to being generally accepted.&lt;/p&gt;

&lt;p&gt;And, we thought, if we adopt that terminology, not only would we be alienating the fact that medium and small businesses can also depend on Webiny for their content, other teams might start to get the impression that we are also a clunky system that's prohibitively expensive, not customizable, and overall difficult to use.&lt;/p&gt;

&lt;p&gt;No, we don't want to pigeonhole ourselves like that. Yet, Webiny &lt;em&gt;is more&lt;/em&gt; than a CMS.&lt;/p&gt;

&lt;h2&gt;
  
  
  An All-in-one Solution
&lt;/h2&gt;

&lt;p&gt;So we're sticking with "Headless CMS" as a description of Webiny. But opening a conversation on that front can sometimes present a problem: what if the organization approaching us doesn't have the requirement of a content store. Perhaps instead theyre looking for a way to dynamically populating content from the CMS into a &lt;a href="https://www.webiny.com/docs/overview/applications/page-builder"&gt;no-code page builder&lt;/a&gt;? Or Perhaps they need an &lt;a href="https://www.webiny.com/docs/overview/applications/apw"&gt;advanced publishing workflow&lt;/a&gt; for their teams to be able to create, edit, update, approve, and publish their content?&lt;/p&gt;

&lt;p&gt;Starting off the conversation "We're a Headless CMS" unfortunately leaves out all of the other cool features we've built, or are planning to build in the next few months.&lt;/p&gt;

&lt;p&gt;These new features will enable organizations to build dynamic content quickly, ahead of the competition, without the involvement of technical teams past the initial setup, and do so at a fraction of the cost of other providers. And to do it at the scale that enterprise organizations require.&lt;/p&gt;

&lt;p&gt;Yes, for those organizations who need that kind of power, Webiny is an all-in-one solution that might be able to replace several costly products that are strung together with digital duct tape, not designed to work together, and are also individually difficult to work with.&lt;/p&gt;

&lt;p&gt;For those people, Webiny isn't just a CMS. It's a CMS &lt;em&gt;Plus&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Webiny Enterprise Headless CMS+?
&lt;/h2&gt;

&lt;p&gt;Plus.&lt;/p&gt;

&lt;p&gt;It's succinct, minimalistic, but covers &lt;em&gt;a lot&lt;/em&gt; of stuff. Webiny is still a Headless CMS. But it's a Headless CMS &lt;em&gt;Plus&lt;/em&gt; all of the other features we've talked about.&lt;/p&gt;

&lt;p&gt;Adding the word "Plus" to the business and enterprise products opens the discussion around Webiny's other capabilities. It allows us to showcase other features whilst not detracting from the core use that many of our users see value in.&lt;/p&gt;

&lt;p&gt;It allows us to start more conversations around the functionality of the Page Builder and Form Builder tools, tools that are going to get some pretty interesting added features in coming months.&lt;/p&gt;

&lt;p&gt;We're really hoping that this new initiative will allows us to open more discussions with organizations looking for, not just a Headless CMS, but something that can solve a lot of the issues around producing content in their business.&lt;/p&gt;

&lt;p&gt;If this is you, please reach out to us! We'd love to hear about the difficulties you're facing. For our Enterprise customers we provide SLA support and consultancy services tailored to help your teams to build a solution that'll be designed around your workflow and specific needs. And we can build custom SSO implementations with your IDP of choice.&lt;/p&gt;

&lt;p&gt;If you're an agency or a smaller business, Webiny is a great fit for you! Use it as a Headless CMS with multi-tenancy built-in, and pay a reasonable cost for each user seat. And add-on optional benefits such as our advanced publishing workflow and headless pages.&lt;/p&gt;

&lt;p&gt;Remember, Webiny is an open-source, self-hosted solution: you can use it at no cost under our MIT license today. We hope this will help you to build smaller projects and thoroughly investigate its capabilities before you make a decision.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://webiny.typeform.com/to/VYffkZlR"&gt;Try a live demo today&lt;/a&gt; to get more background on the product.&lt;/p&gt;

</description>
      <category>react</category>
      <category>serverless</category>
    </item>
    <item>
      <title>🤔 Should I Use Gatsby or Next.js For My Next Project?</title>
      <dc:creator>Ben Read</dc:creator>
      <pubDate>Wed, 05 Oct 2022 10:18:58 +0000</pubDate>
      <link>https://dev.to/webiny/should-i-use-gatsby-or-nextjs-for-my-next-project-4el4</link>
      <guid>https://dev.to/webiny/should-i-use-gatsby-or-nextjs-for-my-next-project-4el4</guid>
      <description>&lt;p&gt;Developers tend to get very passionate about their tools. And rightly so: without the best tools for the job at hand, we couldn't achieve our objectives, make something awesome, or build a better world.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://reactjs.org/" rel="noopener noreferrer"&gt;React&lt;/a&gt; is still a major player in terms of frontend development. There's currently a competition of sorts going on between the two React heavyweight frameworks &lt;a href="https://nextjs.org/" rel="noopener noreferrer"&gt;Next.js&lt;/a&gt; and &lt;a href="https://www.gatsbyjs.com/" rel="noopener noreferrer"&gt;Gatsby&lt;/a&gt;. Which one is better? Which should you learn? Is Gatsby better, or Next.js, for building your next project?&lt;/p&gt;

&lt;p&gt;At Webiny, we're interested in providing developers a backend Headless CMS to compliment your frontend, so it's of deep interest to us which tools are popular. Knowing which ones you're using ... even which ones you are &lt;em&gt;preferring&lt;/em&gt;, influences our product decisions. We think about it when we talk about marketing. And we consider it when we're planning what we build into our open source CMS.&lt;/p&gt;

&lt;p&gt;So we decided to do a bit of critical thinking about whether Next.js or Gatsby is better. We came up with these criteria to match them against. Even so, we're going to leave it up to you as to which one you're going to use!&lt;/p&gt;

&lt;h2&gt;
  
  
  Server Generation and Configuration
&lt;/h2&gt;

&lt;p&gt;Generating React code, or any JavaScript, when an application is built, is a critical metric when it comes to frontend frameworks like Gatsby and Next.js. But we don't think it's &lt;em&gt;speed&lt;/em&gt; that's critical. It's certainly important, but it's one of those metrics that the developers of these frameworks are acutely aware of, so they're going to make sure they keep making advancements in this area.&lt;/p&gt;

&lt;p&gt;What's more interesting is what APIs you have access to on server generation. Does the tool make it easier or more difficult to do what you need to? That's what we're assessing here.&lt;/p&gt;

&lt;p&gt;Whilst Next.js allows access to customize headers, page initialization, add rewrites and redirects with it's &lt;a href="https://nextjs.org/docs/api-reference/next.config.js/introduction" rel="noopener noreferrer"&gt;config&lt;/a&gt; file and custom &lt;a href="https://nextjs.org/docs/advanced-features/custom-app" rel="noopener noreferrer"&gt;&lt;code&gt;_App.js&lt;/code&gt;&lt;/a&gt; component, Gatsby has a &lt;a href="https://www.gatsbyjs.com/docs/reference/config-files/gatsby-config/" rel="noopener noreferrer"&gt;config&lt;/a&gt; file, &lt;a href="https://www.gatsbyjs.com/docs/custom-html/" rel="noopener noreferrer"&gt;a custom &lt;code&gt;html.js&lt;/code&gt; document&lt;/a&gt; (which is similar to Next.js). It also has files to directly access the &lt;a href="https://www.gatsbyjs.com/docs/recipes/pages-layouts/#project-structure" rel="noopener noreferrer"&gt;server-rendered application&lt;/a&gt; and the &lt;a href="https://www.gatsbyjs.com/docs/reference/config-files/gatsby-browser/" rel="noopener noreferrer"&gt;hydrated application in the browser&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Gatsby certainly has a wider variety of configuration open to developers here. But that can also be daunting or unnecessarily complex for someone who just wants to build with React but also have static generation.&lt;/p&gt;

&lt;p&gt;Also, sometimes it's not clear what the files are for. For example, the &lt;a href="https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/" rel="noopener noreferrer"&gt;gatsby-node.js&lt;/a&gt; file isn't specifically for APIs that run in the server environment (which would be using Node.js), instead, this is where the internal node transformation happens, allowing you to create dynamic pages and custom GraphQL resolvers to your application.&lt;/p&gt;

&lt;p&gt;Admittedly, once you know that, it's great to have access to all of these APIs to customize your data. But we'll get to that a bit more later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Documentation
&lt;/h2&gt;

&lt;p&gt;Whether Gatsby or Next.js documentation is good or bad seems highly subjective. But sometimes documentation can inadvertently hide things developers need to know under generalizations or by accidentally missing things out. Sometimes an API badly explained is worse than not having it documented at all.&lt;/p&gt;

&lt;p&gt;We all know this, which is why we looked at documentation as a marker on whether you should choose Next.js or Gatsby to build your next project.&lt;/p&gt;

&lt;p&gt;Whilst Next.js documentation has a cleaner, focused look, Gatsby's is busier with a 3-column layout. Though sometimes that's a good thing. Developers probably won't get as lost contextually in the Gatsby docs as they might in Next.js.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webiny.com%2Fstatic%2Fd5f4029f2c3a1103288df84acfe3da11%2F5a190%2Fgatsby-docs-site.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webiny.com%2Fstatic%2Fd5f4029f2c3a1103288df84acfe3da11%2F5a190%2Fgatsby-docs-site.png" alt="Gatsby's documentation site"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We generally prefer the darker code blocks and higher contrast on the Next.js website. But it could be because we're just getting old and our eyes aren't as good as they used to be. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webiny.com%2Fstatic%2F94674cc768d9845b010c2ab127ca87a8%2F5a190%2Fnextjs-docs-site.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.webiny.com%2Fstatic%2F94674cc768d9845b010c2ab127ca87a8%2F5a190%2Fnextjs-docs-site.png" alt="The Next.js documentation site"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next.js' strengths come out clearly in it's focused approach towards lower-level APIs such as the &lt;code&gt;getStaticProps()&lt;/code&gt; and &lt;code&gt;getServerSideProps()&lt;/code&gt; functions, and these are explained very well. But there are also some things that are not mentioned except succinctly in an &lt;a href="https://nextjs.org/docs/advanced-features/static-html-export#unsupported-features" rel="noopener noreferrer"&gt;"unsupported features" section&lt;/a&gt;. This can be frustrating when you find out you've built your application to use a certain feature, only to realize it's not supported in the environment you intended to deploy to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Routing
&lt;/h2&gt;

&lt;p&gt;Both frameworks take advantage of file-based routing. &lt;a href="https://nextjs.org/docs/routing/dynamic-routes" rel="noopener noreferrer"&gt;Next.js&lt;/a&gt; and &lt;a href="https://www.gatsbyjs.com/docs/how-to/routing/creating-routes/#dynamic-and-authenticated-routing" rel="noopener noreferrer"&gt;Gatsby&lt;/a&gt; have the ability to define dynamic routes as  well, but Gatsby doesn't clearly explain how this works, perhaps assuming you're only looking for this feature if you've already used Next.js.&lt;/p&gt;

&lt;p&gt;What is great about Next.js is the ability to create &lt;a href="https://nextjs.org/docs/api-routes/introduction" rel="noopener noreferrer"&gt;API Routes&lt;/a&gt;. This could be really useful in a lot of situations, especially if you have a sprawling REST API endpoint and want a minimal set of data returned from it, you could massage that data down to only the content you need on your frontend. In fact, Next.js has it's &lt;a href="https://github.com/vercel/micro" rel="noopener noreferrer"&gt;own express-like server-side framework called Micro&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This turns Next.js into a truly isomorphic application, which is meant to have components server side and on the client, working in tandem to produce a single application.&lt;/p&gt;

&lt;p&gt;On the other hand, Gatsby seems to keep these concerns clearly separated, even with their own &lt;a href="https://www.gatsbyjs.com/products/cloud/functions" rel="noopener noreferrer"&gt;Gatsby Functions&lt;/a&gt;, the emphasis is on a separate backend that communicates with the hydrated frontend application.&lt;/p&gt;

&lt;p&gt;Do you like to mix these concerns? Or keep them separate? It depends slightly on what kind of developer you are, and what kind of project you're building, as to which you'll prefer from this point of view.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Gatsby and Next.js are two very different tools with unique value propositions: either low-level tools to provide fundamental APIs and free developers from unnecessary tooling, or an ecosystem full of plugins of varying quality, together with a data layer to stitch your content together.&lt;/p&gt;

&lt;p&gt;As we said at the start, this isn't a full roundup of all of their features. Maybe what you're building needs something more specific like &lt;a href="https://astro.build/" rel="noopener noreferrer"&gt;Astro&lt;/a&gt;, &lt;a href="https://nuxtjs.org/" rel="noopener noreferrer"&gt;Nuxt&lt;/a&gt; or &lt;a href="https://kit.svelte.dev/" rel="noopener noreferrer"&gt;SvelteKit&lt;/a&gt;. We only know what we've encountered when building our starters for Next.js and Gatsby.&lt;/p&gt;

&lt;p&gt;Oh we didn't tell you? We've built 1-click deploy starters for Webiny headless CMS.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/webiny/nextjs-starter-webiny" rel="noopener noreferrer"&gt;1-click starter for Next.js and Webiny Headless CMS on Vercel&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://www.gatsbyjs.com/dashboard/deploynow?url=https://github.com/webiny/gatsby-starter-webiny" rel="noopener noreferrer"&gt;1-click starter for Gatsby and Webiny Headless CMS on Gatsby Cloud&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Make sure you check those out. Maybe it'll help you make your mind up ... should you use Gatsby or Next.js? The choice is ultimately yours.&lt;/p&gt;

</description>
      <category>react</category>
      <category>gatsby</category>
      <category>nextjs</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Alternatives to Heroku’s Free Tier</title>
      <dc:creator>Ben Read</dc:creator>
      <pubDate>Sat, 27 Aug 2022 20:23:48 +0000</pubDate>
      <link>https://dev.to/webiny/alternatives-to-herokus-free-tier-hlp</link>
      <guid>https://dev.to/webiny/alternatives-to-herokus-free-tier-hlp</guid>
      <description>&lt;p&gt;Heroku &lt;a href="https://blog.heroku.com/next-chapter"&gt;announced yesterday&lt;/a&gt; that it's extremely popular free tier plans are being phased out starting on November 28 this year (2022). It's the end of an era for a lot of people, particularly independent bloggers who have hobby sites, developers evaluating software for use at their organizations, and non-profits who host their Headless CMS backend. But is there an alternative to Heroku?&lt;/p&gt;

&lt;h2&gt;
  
  
  The Heroku Story
&lt;/h2&gt;

&lt;p&gt;Heroku started as a platform offering hosting to exclusively Ruby-based websites. It's since expanded that option and now a host of "build packs" for other languages exist which can deploy infrastructure to Heroku in one click. This was likely the inspiration for similar "one click deploy" buttons that have been adopted by Netlify, Vercel and others.&lt;/p&gt;

&lt;p&gt;The unique thing about the way Heroku was built is that it leveraged &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html"&gt;AWS' ability to hibernate EC2 instances&lt;/a&gt;. So when you deploy your infrastructure to one of the free-tier "dynos" (a dyno is an environment in which your application can run, similar to containers), after a while of inactivity the dyno would hibernate: it would turn off, or go to sleep. The effect of this was that you couldn't contact the application straight away in that state. It would take around 30 seconds for it to activate, or wake up. This was enough time for Heroku to spin up your dyno again so that it can start accepting requests.&lt;/p&gt;

&lt;p&gt;This method did come with some complications like ephermeral file storage, meaning you couldn't store things like SQLLite databases or upload images alongside your application. But there were other Heroku services and 3rd party integrations to allow you to use databases and store images and other files.&lt;/p&gt;

&lt;p&gt;This was a great help to many people who's main concern was with small blogs built on an open source blogging platform such as Ghost or Strapi. With Heroku you could deploy your application and build a separate, static frontend (which would be hosted on a separate service, such as &lt;a href="https://www.netlify.com/"&gt;Netlify&lt;/a&gt; or &lt;a href="https://vercel.com/"&gt;Vercel&lt;/a&gt;). That way, you could write an article, rebuild your static site, and afterwards allow the application to hibernate. And it would be free to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  Alternatives to Heroku
&lt;/h2&gt;

&lt;p&gt;Looking for an alternative to Heroku depends on what you were using for. Many people had used it to host backend services for small hobby apps that didn't make any money, or for proof-of-concept ideas so they could evaluate tools for their organizations to later use in production.&lt;/p&gt;

&lt;p&gt;If this is what you're looking for, there are a plethora of services which deploy containerized applications to a managed environment and that offer free tiers with different pricing models depending on what databases persistent storage and other services you require.&lt;/p&gt;

&lt;p&gt;Depending on what you were using, it's feasible that you could move your application stack there without too many code changes. In fact, both Fly and Render offer guides for migrating from Heroku:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://fly.io/docs/app-guides/speed-up-a-heroku-app/"&gt;Speed up a Heroku App with Fly.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://render.com/docs/migrate-from-heroku"&gt;Migrate from Heroku to Render&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But some other popular alternatives include &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.linode.com/products/managed/"&gt;Linode Managed Hosting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.digitalocean.com/solutions/managed-cloud-hosting"&gt;Digital Ocean Managed Cloud Hosting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://firebase.google.com/products-build"&gt;Firebase Build&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And there are also the following newer alternatives:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://adaptable.io"&gt;Adaptable&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://qoddi.com/"&gt;Qoddi&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You could also get quite far by using the serverless functions that now come with (formerly) static hosting providers like &lt;a href="https://vercel.com/docs/concepts/functions/serverless-functions"&gt;Vercel&lt;/a&gt;, &lt;a href="https://www.netlify.com/products/functions/"&gt;Netlify&lt;/a&gt;, and &lt;a href="https://www.gatsbyjs.com/products/cloud/hosting"&gt;Gatsby Cloud&lt;/a&gt;. There are even complex frameworks like &lt;a href="https://redwoodjs.com/"&gt;RedwoodJs&lt;/a&gt; that have been built on top of these providers.&lt;/p&gt;

&lt;p&gt;If you were using Heroku for a Headless CMS for a static frontend, most of the open-source Headless CMS platforms offer their own cloud-based infrastructure which will avoid having to re-platform to a different CMS altogether.&lt;/p&gt;

&lt;p&gt;There is however potentially another problem looming...&lt;/p&gt;

&lt;h2&gt;
  
  
  Stay in Control of your Application Stack
&lt;/h2&gt;

&lt;p&gt;If Heroku can suddenly turn around and kill it's free-for-starters offering, who's to say it won't happen for these other services? Even Vercel and Netlify leverage the raw computing power of cloud providers such as AWS, Azure and Google Cloud, repackaging those services and selling them at a profitable margin.&lt;/p&gt;

&lt;p&gt;For that reason, we think the best alternative is to embrace these foundational computing platforms, instead of standing again on the unsteady ground of a reseller.&lt;/p&gt;

&lt;p&gt;AWS and other providers have a &lt;a href="https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&amp;amp;all-free-tier.sort-order=asc&amp;amp;awsf.Free%20Tier%20Types=*all&amp;amp;awsf.Free%20Tier%20Categories=*all"&gt;free tier&lt;/a&gt; which applies to most of its services. These are specific allowances for each of their services that you can use before you start incurring fees.&lt;/p&gt;

&lt;p&gt;With this and similar offerings from other cloud providers like Google Cloud Platform and Microsoft Azure, you could set up an EC2 instance (similar to a virtual machine), configure it to hibernate in a similar fashion to what Heroku was doing, and move your application to it manually.&lt;/p&gt;

&lt;p&gt;This would take a bit of work, either &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html"&gt;to SSH in and upload your application&lt;/a&gt;, or &lt;a href="https://aws.amazon.com/getting-started/hands-on/set-up-ci-cd-pipeline/"&gt;set up a deployment pipeline&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;But there's also another opportunity here that we would like to highlight.&lt;/p&gt;

&lt;h2&gt;
  
  
  Embrace Serverless
&lt;/h2&gt;

&lt;p&gt;If you notice, the limits on EC2 instances for containerized applications are time-based. You get a certain number of free hours in traditional "always-on" computing models. After that you need to pay for them. Even though this is quite a generous offering, you could still leave yourself with a substantial bill if you're not careful.&lt;/p&gt;

&lt;p&gt;However, other services are based on the number of invocations. Why not take advantage of these? &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Functions as a service&lt;/strong&gt; with AWS Lambda: 1 million free requests per month&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;File storage&lt;/strong&gt; You get 5GB of S3 static file storage (think images and static website hosting)&lt;/li&gt;
&lt;li&gt;AWS' no-sql &lt;strong&gt;Database&lt;/strong&gt;, DynamoDB, comes at 25GB of storage for free&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The next time you need to build a proof of concept, or hobby app, you could build your solution using a combination of these and host it indefinitely. It wouldn't need special configuration to hibernate since that is it's natural state.&lt;/p&gt;

&lt;p&gt;Why not try serverless in your next proof of concept or hobby project?&lt;/p&gt;

&lt;p&gt;To do so, you could leverage a framework which allows you to write infrastructure-as-code, such as &lt;a href="https://aws.amazon.com/amplify/"&gt;AWS Amplify&lt;/a&gt;, &lt;a href="https://sst.dev/"&gt;Serverless Stack&lt;/a&gt;, the &lt;a href="https://www.serverless.com/"&gt;Serverless framework&lt;/a&gt;, or &lt;a href="https://www.pulumi.com/"&gt;Pulumi&lt;/a&gt;. There is a bit of an overhead to learning these tools so you will need to research which one is best for your needs.&lt;/p&gt;

&lt;p&gt;But there's an alternative...&lt;/p&gt;

&lt;h2&gt;
  
  
  Webiny: Leverage the Power of Serverless
&lt;/h2&gt;

&lt;p&gt;For a little over two years, we have been building Webiny. It's a Headless CMS you can use for your personal blog ... but it's not only a Headless CMS: it's a fully-featured application framework that you can use to scaffold unique applications that will have access to the existing setup we have built via plugins. &lt;/p&gt;

&lt;p&gt;You don't need to reinvent the wheel of how to store files, or how to build a GraphQL API, or how to build an admin interface because we've already done that for you.&lt;/p&gt;

&lt;p&gt;And what is more, you get all of that for free when you choose the DynamoDB-only option in your setup. You will eventually pay for the amount of requests, storage and database usage ... but only if you exceed the free tier on AWS.&lt;/p&gt;

&lt;p&gt;Once your proof-of-concept has satisfied it's requirements, you can destroy your Webiny instance ... or leave it there for future tinkering!&lt;/p&gt;

&lt;p&gt;And if you want a place to write blog articles, &lt;a href="https://www.webiny.com/enterprise-serverless-cms/headless-cms"&gt;Webiny is built to do that out-of-the-box&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/webiny/webiny-js"&gt;Visit our GitHub repo and give us a star today&lt;/a&gt;. And please let us know if you've built something with Webiny, the world's only serverless Headless CMS.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>linux</category>
      <category>containers</category>
    </item>
    <item>
      <title>Learn How to Use Lambda Layers by Building an Image Resize Function Using Sharp</title>
      <dc:creator>Swapnil M Mane</dc:creator>
      <pubDate>Wed, 04 May 2022 08:18:45 +0000</pubDate>
      <link>https://dev.to/webiny/learn-how-to-use-lambda-layers-by-building-an-image-resize-function-using-sharp-bj4</link>
      <guid>https://dev.to/webiny/learn-how-to-use-lambda-layers-by-building-an-image-resize-function-using-sharp-bj4</guid>
      <description>&lt;p&gt;Lambda Layer is a true gem in the Lambda function realm. It provides a convenient way to package your libraries and other dependencies that can be used with the Lambda functions. Our open-source project, &lt;a href="https://github.com/webiny/webiny-js/"&gt;Webiny&lt;/a&gt; which has 50k+ downloads and 5.5k stars on GitHub uses Lambda layers. It helps us reduce our Lambda function size by 12 MB and enable us to share the image processing library &lt;a href="https://sharp.pixelplumbing.com/"&gt;sharp&lt;/a&gt; across all the Webiny deployments.&lt;/p&gt;

&lt;p&gt;By the time you finish reading this article, you will know how to create and use Lambda layers. As an example, we will create a sharp library Layer and use it in a Lambda function to create thumbnail images.&lt;br&gt;
In this tutorial, we will create a Lambda function that will create a thumbnail image using the &lt;code&gt;sharp&lt;/code&gt; library. This library will be packaged into the Lambda function using a &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-concepts.html#gettingstarted-concepts-layer"&gt;Lambda Layer&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The workflow will be like this, for each image file uploaded to an S3 bucket (source bucket), the lambda function will be invoked. It will read the image object from the source S3 bucket, create a thumbnail image, and save it to the target S3 bucket.&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;AWS account - To use various AWS services, you will need an AWS account. Please follow &lt;a href="https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account"&gt; this link&lt;/a&gt; to create an AWS account.&lt;/li&gt;
&lt;li&gt;AWS command line - We will use the AWS command line for creating Lambda Function and Lambda Layer. The AWS CLI installation guide is available &lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Step 1 - Create two S3 buckets
&lt;/h2&gt;

&lt;p&gt;Let’s start by creating two buckets, the source and the target. As mentioned earlier, for each image file uploaded to a source bucket, the Lambda function will create a corresponding thumbnail image and save it in the target S3 bucket.&lt;/p&gt;

&lt;p&gt;Please follow these steps to create S3 buckets.&lt;/p&gt;

&lt;p&gt;1.) Open the &lt;a href="https://console.aws.amazon.com/s3"&gt;Amazon S3 console&lt;/a&gt;.&lt;br&gt;
2.) &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html"&gt;Create two S3 buckets&lt;/a&gt; - source and target.&lt;/p&gt;

&lt;p&gt;The target bucket name should be &lt;code&gt;source-bucket-name&lt;/code&gt; plus suffixed by &lt;code&gt;-resized&lt;/code&gt; .  For example, if the source bucket is named &lt;code&gt;mybucket&lt;/code&gt; then the target bucket should be named as &lt;code&gt;mybucket-resized&lt;/code&gt;. Please follow this naming convention because we will be using this naming logic in the Lambda function.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 2 - Create the IAM policy
&lt;/h2&gt;

&lt;p&gt;Now let’s create an IAM policy that specifies the permissions for the Lambda function. The Lambda function must have permission for the following operations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get the object from the source S3 bucket.&lt;/li&gt;
&lt;li&gt;Put the resized object into the target S3 bucket.&lt;/li&gt;
&lt;li&gt;Write logs to Amazon CloudWatch Logs.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  To create an IAM policy
&lt;/h3&gt;

&lt;p&gt;1.) Open the &lt;a href="https://console.aws.amazon.com/iam/home#/policies"&gt;Policies page&lt;/a&gt; in the IAM console.&lt;br&gt;
2.) Choose &lt;strong&gt;Create policy&lt;/strong&gt;.&lt;br&gt;
3.) Choose the &lt;strong&gt;JSON&lt;/strong&gt; tab, and then paste the following policy. Be sure to replace &lt;code&gt;mybucket&lt;/code&gt; with the name of the source bucket that you created previously.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"logs:PutLogEvents"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"logs:CreateLogGroup"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"logs:CreateLogStream"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:logs:*:*:*"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"s3:GetObject"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:s3:::mybucket/*"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"s3:PutObject"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:s3:::mybucket-resized/*"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.) Choose &lt;strong&gt;Next: Tags&lt;/strong&gt;.&lt;br&gt;
5.) Choose &lt;strong&gt;Next: Review&lt;/strong&gt;.&lt;br&gt;
6.) Under &lt;strong&gt;Review policy&lt;/strong&gt;, for &lt;strong&gt;Name&lt;/strong&gt;, enter &lt;code&gt;AWSLambdaS3Policy&lt;/code&gt;.&lt;br&gt;
7.) Choose &lt;strong&gt;Create policy&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 3 - Create the execution role
&lt;/h2&gt;

&lt;p&gt;Create the &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html"&gt;execution role&lt;/a&gt; that gives your Lambda function permissions to access AWS resources.&lt;/p&gt;
&lt;h3&gt;
  
  
  To create an execution role
&lt;/h3&gt;

&lt;p&gt;1.) Open the &lt;a href="https://console.aws.amazon.com/iam/home#/roles"&gt;Roles page&lt;/a&gt; in the IAM console.&lt;br&gt;
2.) Choose &lt;strong&gt;Create role&lt;/strong&gt;.&lt;br&gt;
3.) Create a role with the following properties:&lt;br&gt;
    - &lt;strong&gt;Trusted entity type&lt;/strong&gt; – AWS Service (Allow AWS services like EC2, Lambda, or others to perform actions in this account.)&lt;br&gt;
    - &lt;strong&gt;Use case&lt;/strong&gt; - Lambda (Allows Lambda functions to call AWS services on your behalf.)&lt;br&gt;
    - &lt;strong&gt;Permissions policy&lt;/strong&gt; – &lt;strong&gt;AWSLambdaS3Policy&lt;/strong&gt;&lt;br&gt;
    - &lt;strong&gt;Role name&lt;/strong&gt; – &lt;code&gt;lambda-s3-role&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Step 4 - Create a sharp Lambda Layer
&lt;/h2&gt;

&lt;p&gt;Here comes the special part of this tutorial. We will create the &lt;a href="https://sharp.pixelplumbing.com/install#aws-lambda"&gt;sharp&lt;/a&gt; Lambda Layer in this section.&lt;/p&gt;

&lt;p&gt;You will perform this part of the tutorial on your machine. Please ensure you have &lt;code&gt;npm&lt;/code&gt; installed (we will need the &lt;code&gt;npm&lt;/code&gt; to install the &lt;code&gt;sharp&lt;/code&gt; package).&lt;/p&gt;

&lt;p&gt;1.) Create a directory with the name &lt;code&gt;nodejs&lt;/code&gt;.&lt;br&gt;
2.) Install the &lt;code&gt;sharp&lt;/code&gt; dependency in the &lt;code&gt;nodejs&lt;/code&gt; directory by running the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;SHARP_IGNORE_GLOBAL_LIBVIPS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--arch&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;x64 &lt;span class="nt"&gt;--platform&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;linux sharp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After this step, you will get the following directory structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nodejs
|- node_modules
|- package-lock.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.) Create a &lt;code&gt;.zip&lt;/code&gt; file archive of the &lt;code&gt;nodejs&lt;/code&gt; directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zip &lt;span class="nt"&gt;-r&lt;/span&gt; nodejs.zip nodejs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.) Now let’s publish the Layer. Run the following command to create and publish the Layer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws lambda publish-layer-version &lt;span class="nt"&gt;--layer-name&lt;/span&gt; sharp &lt;span class="nt"&gt;--description&lt;/span&gt; &lt;span class="s2"&gt;"Sharp dependency for image transformation"&lt;/span&gt; &lt;span class="nt"&gt;--zip-file&lt;/span&gt; fileb://nodejs.zip &lt;span class="nt"&gt;--compatible-runtimes&lt;/span&gt; &lt;span class="s2"&gt;"nodejs14.x"&lt;/span&gt; &lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"us-east-1"&lt;/span&gt; &lt;span class="nt"&gt;--output&lt;/span&gt; &lt;span class="s2"&gt;"json"&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After successful execution of the command above, you will see an output similar to this one.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Please note the &lt;code&gt;LayerVersionArn&lt;/code&gt;, we will use it while creating the Lambda function.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Content"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"Location"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://prod-04-2014-layers.s3.us-east-1.amazonaws.com/snapshots/400803493251/sharp-539dd937-e29c-4418-bb52-2089f3945afc?versionId=4AMhQSZjY3uw3WI85Jcbf7j7Wj1x1X9i&amp;amp;X-Amz-Security-Token=IQoJb3JpZ2luX2VjEJz%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJHMEUCIQDu5lMXWxGc7ydyD6HbmtJk2tnqLLxfRbCYqP7tAwi8wAIgAt3KpyhdECs9I7a2mSGNPjk1n4fq1BKjA7iOmBxOquUq%2BgMIRBAAGgw3NDk2Nzg5MDI4MzkiDOj9vGzyeEXkicvNUirXA9YvAlIvZPE3WdpgIYp51YCl28ISR4eL93paFfqBC0IguHOz%2BctOG2P5MwSc2Vj10UVBUBE4qTiGXYTbB3Gk4jCzTvgDEN90fXdMqQYWXCd8zDpq6OIcZ59qVTQPIFdjo2JZ8U3Tfu68BkIynFNLIiX4Y2WvBqxpJoFUlrmOcU4%2FtuXhSmiW6E7xyQus%2F%2BTq3A2n7JaJ2XgKOKPyINyOOBD3ZsonHjiZw0Djtjk7IgvwMjWVLb6Gn73c%2BG9bLKsHHW7aUnRaNEYSdhWejPpz1QEUlcOKpAkLI87kAgTMPCsljZMujUgWxozAth76hWebjXoE7OHUFx870jscKhpMH2DfJhaOCOsmyme69jpqc4%2FEN6jT2WGjIG42xlfUnxB90DpNBjkPguXFyghOHFlhR07bp9Rom0oW1XOriN9jnbxSZqyQsqDFwbrua4oKtOcJJrzDnUGmhKAlWPMkwE81wDyxXSB%2BGYlYQb%2F%2BXScqvqsieBtIpN5KOfAlB0VuoN17gi5BFXsP5ePaGeJPZ5MJ9COQtm6nXdvclUc8ENc0xPfw0l0485%2BVWe%2BzME%2FIIB0Sclg8TuyNSNcqrSxVxb7VVZMZfFrmMpXpU2FD1chXDGTv1tOP3x%2BthjDLvtWSBjqlATnNWnlBoAfJJE7C6ZqVOgRZU4EvDCpLchTmHT%2F99LoBvqYUU0qospR1VT4pGKtfBBEuNGgg9%2F8Dkj6l0q7p62mlxwt%2BENpVp2QOczzj6CDCjMg1E6jnsVGNzCoPeYiEEx8q6LBM51EOMcm2sSSVjNeVNRhTFrF84ch%2FCteFF5Ilr%2FTHW7pb9pJCaOOuJ%2FMZIpXy2w9CtOXxbO8%2BkG4kHHDarz8M9w%3D%3D&amp;amp;X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;amp;X-Amz-Date=20220412T121324Z&amp;amp;X-Amz-SignedHeaders=host&amp;amp;X-Amz-Expires=600&amp;amp;X-Amz-Credential=ASIA25DCYHY3S4VTGYGI%2F20220412%2Fus-east-1%2Fs3%2Faws4_request&amp;amp;X-Amz-Signature=d84c5f4e44cf6473e0a924f3a5fd57aea32c00b17480af1551a869e41693b030"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"CodeSha256"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"f9IchJrdt01ftKIlcSZ25z6ZRbf780hO8xVYCd6Uxhs="&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"CodeSize"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8748397&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"LayerArn"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:lambda:us-east-1:400803493251:layer:sharp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"LayerVersionArn"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:lambda:us-east-1:400803493251:layer:sharp:1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Sharp dependency for image transformation"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"CreatedDate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2022-04-12T12:13:27.990+0000"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"CompatibleRuntimes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"nodejs14.x"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 5 - Create Lambda function
&lt;/h2&gt;

&lt;p&gt;Now let’s create a Lambda function that will use the &lt;code&gt;sharp&lt;/code&gt; Lambda Layer. As discussed earlier, this Lambda function will be invoked when an object is created in the source bucket. Then it will create the respective thumbnail image and store it in the target bucket. The code example below assumes that you are following the S3 bucket name convention that is mentioned in Step-1.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5.1 Create the function code
&lt;/h3&gt;

&lt;p&gt;Copy the following code example into a file named &lt;code&gt;index.js&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// dependencies&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;AWS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;aws-sdk&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;util&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;util&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sharp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sharp&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// get reference to S3 client&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;s3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;AWS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;S3&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;handler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="c1"&gt;// Read options from the event parameter.&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Reading options from event:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;util&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;depth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;}));&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;srcBucket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Records&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// Object key may have spaces or unicode non-ASCII characters.&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;srcKey&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;decodeURIComponent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Records&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\+&lt;/span&gt;&lt;span class="sr"&gt;/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dstBucket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;srcBucket&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;-resized&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dstKey&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;resized-&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;srcKey&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// Infer the image type from the file suffix.&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;typeMatch&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;srcKey&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\.([^&lt;/span&gt;&lt;span class="sr"&gt;.&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;*&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="sr"&gt;$/&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;typeMatch&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Could not determine the image type.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;// Check that the image type is supported&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;imageType&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;typeMatch&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;imageType&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;jpg&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;imageType&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;png&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Unsupported image type: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;imageType&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;// Download the image from the S3 source bucket.&lt;/span&gt;

  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;Bucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;srcBucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;Key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;srcKey&lt;/span&gt;
      &lt;span class="p"&gt;};&lt;/span&gt;
      &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;origimage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;promise&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;// set thumbnail width. Resize will set the height automatically to maintain aspect ratio.&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;width&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// Use the sharp module to resize the image and save in a buffer.&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;sharp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;origimage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Body&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;resize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;toBuffer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="c1"&gt;// Upload the thumbnail image to the destination bucket&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;destparams&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;Bucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;dstBucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;Key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;dstKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;Body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;ContentType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;image&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="p"&gt;};&lt;/span&gt;

      &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;putResult&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;putObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;destparams&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;promise&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Successfully resized &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;srcBucket&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;srcKey&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
      &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; and uploaded to &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;dstBucket&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;dstKey&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5.2 Create the deployment package
&lt;/h3&gt;

&lt;p&gt;The deployment package is a &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-package.html#gettingstarted-package-zip"&gt;.zip file archive&lt;/a&gt; containing your Lambda function code and its dependencies.&lt;/p&gt;

&lt;p&gt;1.) Open a command-line terminal or shell in a Linux environment.&lt;br&gt;
2.) Save the function code as &lt;code&gt;index.js&lt;/code&gt; in a directory named &lt;code&gt;lambda-s3&lt;/code&gt;.&lt;br&gt;
After this step, you have the following directory structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lambda-s3
|- index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.) Create a deployment package with the function code and its dependencies. Set the -r (recursive) option for the zip command to compress the subfolders.&lt;br&gt;
Run this command from the &lt;code&gt;lambda-s3&lt;/code&gt; directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zip &lt;span class="nt"&gt;-r&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt;.zip &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 5.3 Create a Lambda function
&lt;/h3&gt;

&lt;p&gt;We will use the AWS CLI command (&lt;code&gt;aws lambda create-function&lt;/code&gt;) to create the Lambda function.&lt;/p&gt;

&lt;p&gt;Please replace the role parameter &lt;code&gt;123456789012&lt;/code&gt;with your &lt;a href="https://docs.aws.amazon.com/general/latest/gr/acct-identifiers.html"&gt;AWS account ID&lt;/a&gt; and layers ARN with the one we got in Step 4 (&lt;code&gt;LayerVersionArn&lt;/code&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws lambda create-function &lt;span class="nt"&gt;--function-name&lt;/span&gt; CreateThumbnail &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--zip-file&lt;/span&gt; fileb://function.zip &lt;span class="nt"&gt;--handler&lt;/span&gt; index.handler &lt;span class="nt"&gt;--runtime&lt;/span&gt; nodejs14.x &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--timeout&lt;/span&gt; 30 &lt;span class="nt"&gt;--memory-size&lt;/span&gt; 1024 &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--role&lt;/span&gt; arn:aws:iam::123456789012:role/lambda-s3-role &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--region&lt;/span&gt; &lt;span class="s2"&gt;"us-east-1"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--layers&lt;/span&gt; &lt;span class="s2"&gt;"arn:aws:lambda:us-east-1:400803493251:layer:sharp:1"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the successful execution of the above command, you will see an output similar to this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"FunctionName"&lt;/span&gt;: &lt;span class="s2"&gt;"CreateThumbnail"&lt;/span&gt;,
    &lt;span class="s2"&gt;"FunctionArn"&lt;/span&gt;: &lt;span class="s2"&gt;"arn:aws:lambda:us-east-1:400803493251:function:CreateThumbnail"&lt;/span&gt;,
    &lt;span class="s2"&gt;"Runtime"&lt;/span&gt;: &lt;span class="s2"&gt;"nodejs14.x"&lt;/span&gt;,
    &lt;span class="s2"&gt;"Role"&lt;/span&gt;: &lt;span class="s2"&gt;"arn:aws:iam::400803493251:role/lambda-s3-role"&lt;/span&gt;,
    &lt;span class="s2"&gt;"Handler"&lt;/span&gt;: &lt;span class="s2"&gt;"index.handler"&lt;/span&gt;,
    &lt;span class="s2"&gt;"CodeSize"&lt;/span&gt;: 1061,
    &lt;span class="s2"&gt;"Description"&lt;/span&gt;: &lt;span class="s2"&gt;""&lt;/span&gt;,
    &lt;span class="s2"&gt;"Timeout"&lt;/span&gt;: 30,
    &lt;span class="s2"&gt;"MemorySize"&lt;/span&gt;: 1024,
    &lt;span class="s2"&gt;"LastModified"&lt;/span&gt;: &lt;span class="s2"&gt;"2022-04-12T12:22:02.432+0000"&lt;/span&gt;,
    &lt;span class="s2"&gt;"CodeSha256"&lt;/span&gt;: &lt;span class="s2"&gt;"y0QVpF6+WN3wH1Zp+sbpbYlQEeAdkBuSf7p5aJV52Sc="&lt;/span&gt;,
    &lt;span class="s2"&gt;"Version"&lt;/span&gt;: &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$LATEST&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;,
    &lt;span class="s2"&gt;"TracingConfig"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"Mode"&lt;/span&gt;: &lt;span class="s2"&gt;"PassThrough"&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;,
    &lt;span class="s2"&gt;"RevisionId"&lt;/span&gt;: &lt;span class="s2"&gt;"64dc7cab-9adf-4472-b20b-e15237209939"&lt;/span&gt;,
    &lt;span class="s2"&gt;"Layers"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;
        &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"Arn"&lt;/span&gt;: &lt;span class="s2"&gt;"arn:aws:lambda:us-east-1:400803493251:layer:sharp:4"&lt;/span&gt;,
            &lt;span class="s2"&gt;"CodeSize"&lt;/span&gt;: 8748397
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;]&lt;/span&gt;,
    &lt;span class="s2"&gt;"State"&lt;/span&gt;: &lt;span class="s2"&gt;"Pending"&lt;/span&gt;,
    &lt;span class="s2"&gt;"StateReason"&lt;/span&gt;: &lt;span class="s2"&gt;"The function is being created."&lt;/span&gt;,
    &lt;span class="s2"&gt;"StateReasonCode"&lt;/span&gt;: &lt;span class="s2"&gt;"Creating"&lt;/span&gt;,
    &lt;span class="s2"&gt;"PackageType"&lt;/span&gt;: &lt;span class="s2"&gt;"Zip"&lt;/span&gt;,
    &lt;span class="s2"&gt;"Architectures"&lt;/span&gt;: &lt;span class="o"&gt;[&lt;/span&gt;
        &lt;span class="s2"&gt;"x86_64"&lt;/span&gt;
    &lt;span class="o"&gt;]&lt;/span&gt;,
    &lt;span class="s2"&gt;"EphemeralStorage"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"Size"&lt;/span&gt;: 512
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 6 - Configure Amazon S3 Trigger
&lt;/h2&gt;

&lt;p&gt;So far we have created all the building blocks. Now let's add the final piece where we will configure the Amazon S3 Trigger to invoke the Lambda function.&lt;br&gt;
When a file is uploaded to S3, it should trigger the Lambda function that will resize, create a thumbnail, and upload it to the target S3 bucket.&lt;/p&gt;

&lt;h3&gt;
  
  
  To create an Amazon S3 Trigger
&lt;/h3&gt;

&lt;p&gt;1.) Open the &lt;a href="https://console.aws.amazon.com/lambda/home"&gt;Lambda page&lt;/a&gt; in the AWS console.&lt;br&gt;
2.) Open the &lt;code&gt;CreateThumbnail&lt;/code&gt; function.&lt;br&gt;
3.) Choose &lt;strong&gt;Add trigger&lt;/strong&gt; under the Function overview section&lt;br&gt;
4.) Create a trigger with the following properties:&lt;br&gt;
    - &lt;strong&gt;Select a trigger&lt;/strong&gt; – S3&lt;br&gt;
    - &lt;strong&gt;Bucket&lt;/strong&gt; - mybucket (your source bucket name)&lt;br&gt;
    - &lt;strong&gt;Event type&lt;/strong&gt; – &lt;strong&gt;PUT&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JzCv5rt---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jafkp7utpz5jl4uj3ru4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JzCv5rt---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jafkp7utpz5jl4uj3ru4.png" alt="S3 Trigger Form" width="748" height="661"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 7 - All set, let’s test it!
&lt;/h2&gt;

&lt;p&gt;Nice, we are all set with our Lambda function, which uses the sharp Layer and creates thumbnail images. Please upload an image (&lt;code&gt;jpg&lt;/code&gt; or &lt;code&gt;png&lt;/code&gt;) to the source S3 bucket. Once the upload is complete, you should be able to see the thumbnail version of the image in the target S3 bucket.&lt;/p&gt;

&lt;p&gt;Lambda Layer is a very efficient and convenient way to package libraries and other dependencies that you can use with your Lambda functions. It offers great benefits in reducing the deployment archives size and faster deployment. layers enable code sharing and separation of responsibilities to create maintainable Lambda functions.&lt;/p&gt;

&lt;p&gt;In case you want to explore and learn more about best coding practices and code examples related to Lambda, you can check out the &lt;a href="https://github.com/webiny/webiny-js/"&gt;Webiny code repository&lt;/a&gt;. Webiny is an open-source enterprise-grade serverless CMS.&lt;/p&gt;

&lt;p&gt;If you have any questions related to this tutorial or have any feedback, please feel free to ping us on the &lt;a href="https://webiny.com/slack/"&gt;Community Slack&lt;/a&gt;!&lt;/p&gt;

&lt;h2&gt;
  
  
  Credits
&lt;/h2&gt;

&lt;p&gt;As this tutorial aims to explain and demonstrate the use of Lambda Layer, we didn't reinvent the wheel and write a new Lambda function to create thumbnail images. The Lambda function code used in this article to create thumbnail images is taken from this &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/with-s3-tutorial.html"&gt;official AWS Lambda tutorial&lt;/a&gt;. Huge thanks to the authors of this great tutorial on the Lambda function. 🙏🏻&lt;/p&gt;

</description>
      <category>serverless</category>
      <category>aws</category>
      <category>lambda</category>
      <category>layer</category>
    </item>
    <item>
      <title>Using Webiny Headless CMS With Our New Starter Kits for Gatsby and NextJS</title>
      <dc:creator>Ben Read</dc:creator>
      <pubDate>Fri, 22 Apr 2022 13:59:46 +0000</pubDate>
      <link>https://dev.to/webiny/using-webiny-headless-cms-with-our-new-starter-kits-for-gatsby-and-nextjs-3naj</link>
      <guid>https://dev.to/webiny/using-webiny-headless-cms-with-our-new-starter-kits-for-gatsby-and-nextjs-3naj</guid>
      <description>&lt;p&gt;There's a hidden cost that comes with the majority of self-hosted headless content management systems: the time you must spend initially setting up the project. &lt;/p&gt;

&lt;p&gt;Some require you to install Docker and run its cryptic terminal commands. Others ask you to write code to set up content models. With some you have to install and manage MongoDB or SQL servers on your local machine which may keep running in the background, eating valuable resources even when you're not using your CMS.&lt;/p&gt;

&lt;p&gt;By contrast, Webiny have always tried to make the experience of getting started with our Headless CMS as easy and quick as possible. &lt;/p&gt;

&lt;p&gt;Now it's easier than ever, especially if you're a fan of Gatsby or NextJS, two of the most popular React site builder frameworks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Official Gatsby Starter for Webiny Headless CMS
&lt;/h2&gt;

&lt;p&gt;Gatsby revolutionised the way frontend development was done. It wasn't the first static site generator, but it was the first to bring React and JavaScript as first-class browser tools along with a unified data layer for generating pages at build time from remote data by using GraphQL schema stitching.&lt;/p&gt;

&lt;p&gt;When you partner Gatsby with Webiny, it's an ideal combination! You can &lt;a href="https://www.webiny.com/docs/get-started/install-webiny"&gt;spin up a Webiny instance on your own cloud infrastructure in minutes&lt;/a&gt; (instead of spending hours wrangling with Docker, MongoDB or other code-specific setup), define your own models and write content in the browser, and pair it with your Gatsby site at the click of a single button.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GBLpGHOe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.webiny.com/static/8b361314ac8a7d1edaee2d9d0b9f087d/5a190/gatsby.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GBLpGHOe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.webiny.com/static/8b361314ac8a7d1edaee2d9d0b9f087d/5a190/gatsby.png" alt="Gatsby starter rendered from a Webiny backend" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.webiny.com/docs/headless-cms/integrations/gatsby"&gt;Read the Documentation&lt;/a&gt; or &lt;a href="https://github.com/webiny/gatsby-starter-webiny"&gt;go directly to the Gatsby code for a 1-click deploy button to Gatsby Cloud&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Official NextJS Starter for Webiny Headless CMS
&lt;/h2&gt;

&lt;p&gt;NextJS has revolutionised web development because of it's flexibility. It implements the React framework, along with a custom router, server-side data fetching and other tools, but is unopinionated and allows you to form your code however you wish. For that reason, it's been the tool of choice for organisations and individuals worldwide.&lt;/p&gt;

&lt;p&gt;Now it's even easier to get started with Webiny CMS and Next. &lt;a href="https://www.webiny.com/docs/get-started/install-webiny"&gt;Install Webiny on your own cloud infrastructure in minutes&lt;/a&gt;, which will avoid any issues with setting up MongoDB / Docker or some other tool on your machine, or writing code to generate content models.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KvI3xhBz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.webiny.com/static/32f0fbbfa1190b58fab04a22914d1463/5a190/next.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KvI3xhBz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.webiny.com/static/32f0fbbfa1190b58fab04a22914d1463/5a190/next.png" alt="NextJS starter rendered from a Webiny backend" width="800" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you're ready, fetch the content on your NextJS site in minutes. &lt;a href="https://www.webiny.com/docs/headless-cms/integrations/nextjs"&gt;Take a look at the documentation&lt;/a&gt; or &lt;a href="https://github.com/webiny/nextjs-starter-webiny"&gt;view the starter for a 1-click deploy button to Vercel&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Starter Should We Build Next?
&lt;/h2&gt;

&lt;p&gt;We don't want to stop there! &lt;/p&gt;

&lt;p&gt;Do you like the view from Vue? Do you like to keep your apps svelte with Svelte? Or perhaps it's time to put Remix into the mix.&lt;/p&gt;

&lt;p&gt;Please tell us by &lt;a href="https://twitter.com/WebinyCMS"&gt;tweeting to us&lt;/a&gt; or via our &lt;a href="https://webiny-community.slack.com/"&gt;Community Slack channel&lt;/a&gt; what starter you would like to see next!&lt;/p&gt;

&lt;p&gt;We hope you enjoy using these tools to get started quickly with Webiny Headless CMS. Please join our community if you get stuck, or to give us feedback you'd like to offer.&lt;/p&gt;

</description>
      <category>gatsby</category>
      <category>react</category>
      <category>javascript</category>
      <category>nextjs</category>
    </item>
    <item>
      <title>Learn About Infrastructure as Code in 5 Minutes and Why You Should Use It</title>
      <dc:creator>Swapnil M Mane</dc:creator>
      <pubDate>Fri, 21 Jan 2022 09:15:06 +0000</pubDate>
      <link>https://dev.to/webiny/learn-about-infrastructure-as-code-in-5-minutes-and-why-you-should-use-it-4maj</link>
      <guid>https://dev.to/webiny/learn-about-infrastructure-as-code-in-5-minutes-and-why-you-should-use-it-4maj</guid>
      <description>&lt;p&gt;In the past, IT infrastructure management was challenging. Hardware and software had to be managed and configured manually. Recently, a tool, that allows you to simplify and automate these actions, has appeared. This tool is called infrastructure as code (IaC).&lt;/p&gt;

&lt;p&gt;In this article, we will discuss what infrastructure as code is, the best providers that allow you to implement IaC, IaC best practices, examples, and possible challenges.&lt;/p&gt;

&lt;h2&gt;
  
  
  Infrastructure as code declaration
&lt;/h2&gt;

&lt;p&gt;Infrastructure as Code (IaC) is the process of managing and configuring an infrastructure using configuration files, rather than manually editing configurations on servers or using interactive configuration tools. The IaC model creates the same environment every time it is applied. IaC is used in infrastructure as a service (IaaS), but they should not be confused. The main idea of IaC is to describe the infrastructure using code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it is needed
&lt;/h2&gt;

&lt;p&gt;Without IaC, teams must maintain customization of individual deployment environments. Over time, this leads to each environment having a unique configuration that cannot be reproduced automatically, which in turn leads to problems during deployment. In such a case, infrastructure administration and maintenance involve manual processes that are difficult to track and which can lead to errors. IaC allows you to always set the same configuration for the target environment, regardless of the initial state of the environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  The best IaC providers
&lt;/h2&gt;

&lt;p&gt;Let’s take a look at the most popular IaC providers and the main features they provide.&lt;/p&gt;

&lt;h3&gt;
  
  
  Amazon AWS Cloudformation
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/cloudformation/"&gt;AWS CloudFormation&lt;/a&gt; is a built-in IaC tool in the AWS Cloud Platform that provides the ability to provision and manage a set of multiple related AWS and third-party resources. CloudFormation lets you manage your resource scaling, automate resource management by integrating CloudFormation with other required AWS resources, and create your own resource providers to provide and manage third-party application resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  Azure Resource Manager
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://azure.microsoft.com/features/resource-manager/"&gt;Azure Resource Manager&lt;/a&gt; is an IaC tool for deploying and managing Azure resources. It allows you to deploy, maintain, and track resources as a collective action rather than separately. It incorporates role-based access control into the resource control mechanism to enable users to enforce access control over all resources in a resource category.&lt;/p&gt;

&lt;h3&gt;
  
  
  Google Cloud Deployment Manager
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://cloud.google.com/deployment-manager/docs"&gt;Google Cloud Deployment Manager&lt;/a&gt; is an infrastructure deployment service designed to automate the creation, configuration, provision, and management of assets on the Google Cloud Platform. It allows you to easily create a collection of Google cloud assets and then manage them as a whole. Google Cloud Deployment Manager enables multiple resources to be deployed concurrently, controls the order in which resources are created, and creates resource definition dependencies.&lt;/p&gt;

&lt;h3&gt;
  
  
  Terraform
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.terraform.io/"&gt;HashiCorp Terraform&lt;/a&gt; is the most popular open-source infrastructure automation tool. terraform allows you to easily plan and build IaC for multiple infrastructure providers with a single workflow. You can easily provision different environments using the same configuration and manage the complete lifecycle of the infrastructure you want; thereby reducing human error and increasing the automation of infrastructure provision and management.&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS CDK
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://aws.amazon.com/cdk/"&gt;AWS CDK&lt;/a&gt; is a software development platform for defining cloud infrastructure in code and exposing it using AWS CloudFormation. It allows you to define the framework and application stack in programming languages such as Python, Java, Typescript, .NET, and JavaScript, and deploys a full-featured application stack directly from a supported IDE.&lt;/p&gt;

&lt;p&gt;AWS CDK allows you to automatically create a CloudFormation template based on your source code and deploy this template to your AWS account.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pulumi
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.pulumi.com/"&gt;Pulumi&lt;/a&gt; is an open-source multilingual development platform that lets you manage your cloud infrastructure with code. It provides any cloud deployment functionality, cloud management. Pulumi offers the freedom to use any supported programming language you like. With Pulumi, you can view all existing environments and the changes you make to them. In addition, you can easily customize their configurations to protect your data.&lt;/p&gt;

&lt;h2&gt;
  
  
  IaC examples
&lt;/h2&gt;

&lt;p&gt;Let’s look at a simple scenario for provisioning an AWS EC2 instance. In the following example, we can see how Terraform code is used for this requirement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;required_providers&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;aws&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;source&lt;/span&gt;  &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hashicorp/aws&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="nx"&gt;version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;~&amp;gt; 3.27&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aws&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;access_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aws_access_key&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="nx"&gt;secret_key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aws_secret_key&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="nx"&gt;region&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;us-west-1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aws_instance&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;web_server&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ami&lt;/span&gt;                    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ami-0123456&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="nx"&gt;instance_type&lt;/span&gt;          &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;t3.small&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="nx"&gt;subnet_id&lt;/span&gt;              &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;subnet-a000111x&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="nx"&gt;vpc_security_group_ids&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sg-dfdd00011&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="nx"&gt;key_name&lt;/span&gt;               &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;web_server_test_key&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

  &lt;span class="nx"&gt;tags&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;Name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Web_Server&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  IaC best practices
&lt;/h2&gt;

&lt;p&gt;Some of the best IaC practices to consider when developing it are listed below.&lt;/p&gt;

&lt;h3&gt;
  
  
  Version control
&lt;/h3&gt;

&lt;p&gt;Configuration files should be versioned so that you can easily track, manage, and recover any potential changes. Version control is also very helpful in diagnosing problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Document as little as possible
&lt;/h3&gt;

&lt;p&gt;When using IaC, the code is the infrastructure documentation and will always be up-to-date, so your employees don’t need to write a lot of additional instructions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Modularity and microservices
&lt;/h3&gt;

&lt;p&gt;IaC can be used to develop, manage and maintain applications as many deployable modules. It also allows you to split your infrastructure into multiple modular components and then use automation to combine them in the most appropriate way.&lt;/p&gt;

&lt;h3&gt;
  
  
  IaC Compliance Regulation
&lt;/h3&gt;

&lt;p&gt;Errors in IaC files can be a serious problem if they are not detected prior to deploying IaC definitions. Therefore, it is recommended to automatically and continuously scan IaC files, ensuring that verification occurs whenever an IaC definition is created or updated. You can do it using such tools as &lt;a href="https://www.checkov.io/"&gt;Checkov&lt;/a&gt;, &lt;a href="https://github.com/terraform-linters/tflint"&gt;TFLint&lt;/a&gt;, &lt;a href="https://www.accurics.com/products/accurics/"&gt;Accurics&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  IaC challenges
&lt;/h2&gt;

&lt;p&gt;While there is a list of IaC advantages, there are certain issues with this model that need to be understood and solved before the IaC implementation process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Shift of configuration
&lt;/h3&gt;

&lt;p&gt;In the long run, a configuration shift can occur, no matter how consistently or often you configure your servers. Therefore, every time you need to change your infrastructure, you must ensure that it is done in accordance with a predefined maintenance workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Potential duplication of errors
&lt;/h3&gt;

&lt;p&gt;In the process of implementing IaC, there are certain processes that must be done manually. One of these processes is writing the code that generates your IaC architecture, during which there is always the possibility of error.&lt;/p&gt;

&lt;h3&gt;
  
  
  Need for new skills
&lt;/h3&gt;

&lt;p&gt;The IaC model requires a high level of technical expertise, so teams must continually invest in people and skills. For some teams, this may be too costly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;IaC fully frees developers and other professionals from manual, error-prone tasks. In addition, it lowers costs and increases efficiency throughout the entire software development lifecycle.&lt;br&gt;
If you have questions or comments, please reach out via &lt;a href="https://twitter.com/paveldenisjuk"&gt;Twitter&lt;/a&gt; or &lt;a href="https://www.webiny.com/slack?utm_source=Webiny-blog&amp;amp;utm_medium=blog-post&amp;amp;utm_campaign=Regular-content&amp;amp;utm_content=what-is-infrastructure-as-code&amp;amp;utm_term=W00750"&gt;Webiny Community Slack&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Introducing the new Object field 🚀</title>
      <dc:creator>Swapnil M Mane</dc:creator>
      <pubDate>Thu, 29 Jul 2021 11:20:41 +0000</pubDate>
      <link>https://dev.to/webiny/introducing-the-new-object-field-4ba</link>
      <guid>https://dev.to/webiny/introducing-the-new-object-field-4ba</guid>
      <description>&lt;p&gt;⚡️Seamlessly create nested and repeatable data structures with the new Object field.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hrL-SjCV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webiny.com/static/673772f4832f06e7ba3fd770d3fde4e5/c1b63/modelObjectField.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hrL-SjCV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webiny.com/static/673772f4832f06e7ba3fd770d3fde4e5/c1b63/modelObjectField.png" alt="Headless CMS - Object Field"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With the latest &lt;a href="https://www.webiny.com/docs/changelog/5.11.0/?utm_source=Webiny-blog&amp;amp;utm_medium=blog-post&amp;amp;utm_campaign=Regular-content&amp;amp;utm_content=introducing-new-object-field&amp;amp;utm_term=W00691"&gt;Webiny 5.11.0&lt;/a&gt; release, we are glad to introduce the new Object field in Headless CMS.&lt;br&gt;&lt;br&gt;
The nested and repeatable data structures was one of the hot topic discussed in the Webiny community. With the new Object field now, you can create complex data structures with ease. Huge thanks to our community members for their suggestions and contributions.&lt;/p&gt;

&lt;p&gt;Let's quickly dive into the highlighting capabilities of the Object field.&lt;/p&gt;

&lt;h3&gt;
  
  
  Build nested data structures
&lt;/h3&gt;

&lt;p&gt;The new Object field allows you to build nested data structures. You can create an object and add various existing fields (&lt;code&gt;ref&lt;/code&gt;, &lt;code&gt;richText&lt;/code&gt; field, etc.) to it. Along with this, you can also nest objects within other objects.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9tQOl3S9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webiny.com/static/fa36d25b44d74d7f09f980246cc8234c/58213/addressModel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9tQOl3S9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webiny.com/static/fa36d25b44d74d7f09f980246cc8234c/58213/addressModel.png" alt="Address Model"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Repeatable structure
&lt;/h3&gt;

&lt;p&gt;The icing on the cake is, the data structure created with Object fields can be repeatable (like an array of nested objects).&lt;br&gt;&lt;br&gt;
The &lt;code&gt;Use as a repeatable object&lt;/code&gt; property allows creating the repeatable object. E.g. setting the 'Use as a repeatable object' property to true on the Equipment model will make it multi-valued.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pB7osym1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webiny.com/static/223aeb206c3e3fa75474ff925a75499a/c1b63/useAsRepeatableObject.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pB7osym1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webiny.com/static/223aeb206c3e3fa75474ff925a75499a/c1b63/useAsRepeatableObject.png" alt="Repeatable Object"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Below is the model view for the multi-valued Equipment field.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lsmravAK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webiny.com/static/717cb376429ef612a9fe750ec1e5a82a/1cfc2/multiValuedModel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lsmravAK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webiny.com/static/717cb376429ef612a9fe750ec1e5a82a/1cfc2/multiValuedModel.png" alt="Multi Value Model"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the preview of the model will look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EVEIlN7t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webiny.com/static/bfbd1e4afdc9744cd44b93e1b1dbd3d8/e35ec/multiValuedModelPreview.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EVEIlN7t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webiny.com/static/bfbd1e4afdc9744cd44b93e1b1dbd3d8/e35ec/multiValuedModelPreview.png" alt="Multi Value Model Preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  GraphQL Schema auto-complete support
&lt;/h3&gt;

&lt;p&gt;Object field respects all the rules and behaviors of all the other existing fields (&lt;code&gt;ref&lt;/code&gt;, &lt;code&gt;richText&lt;/code&gt; field, etc.). You also get a full GraphQL Schema auto-complete on your nested fields.&lt;/p&gt;

&lt;p&gt;Alright, here is the &lt;a href="https://www.webiny.com/6d76a5f7c93600ce9ec7043ee7016dca/objectFieldDemo.gif"&gt;demo in action&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Try the new &lt;a href="https://www.webiny.com/serverless-cms?utm_source=Webiny-blog&amp;amp;utm_medium=blog-post&amp;amp;utm_campaign=Regular-content&amp;amp;utm_content=introducing-new-object-field&amp;amp;utm_term=W00693z"&gt;Headless CMS - Object field&lt;/a&gt; and please &lt;a href="https://www.webiny.com/slack/?utm_source=Webiny-blog&amp;amp;utm_medium=blog-post&amp;amp;utm_campaign=Regular-content&amp;amp;utm_content=introducing-new-object-field&amp;amp;utm_term=W00692"&gt;let us know&lt;/a&gt; your valuable feedback!&lt;/p&gt;

</description>
      <category>serverless</category>
      <category>javascript</category>
      <category>cms</category>
      <category>aws</category>
    </item>
    <item>
      <title>5 Things to Avoid When Writing Cypress Tests</title>
      <dc:creator>Swapnil M Mane</dc:creator>
      <pubDate>Mon, 26 Jul 2021 09:15:05 +0000</pubDate>
      <link>https://dev.to/webiny/5-things-to-avoid-when-writing-cypress-tests-564e</link>
      <guid>https://dev.to/webiny/5-things-to-avoid-when-writing-cypress-tests-564e</guid>
      <description>&lt;p&gt;When it comes to testing an application, End-to-End (E2E) testing provides the most confidence and the most bang for the buck.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Bv3JQTFB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webiny.com/static/2a238110718f1be2fe5b43b5fc757b4e/8f77f/pyramid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bv3JQTFB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.webiny.com/static/2a238110718f1be2fe5b43b5fc757b4e/8f77f/pyramid.png" alt="Testing Pyramid"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the contrary, there is no doubt that End-to-End testing is hard, time-consuming, and comes with a bag of issues to solve. But, only if you're using the wrong tool for the job.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Enter &lt;a href="https://www.cypress.io"&gt;Cypress&lt;/a&gt;: Fast, easy, and reliable testing for anything that runs in a browser&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Cypress helps in solving most of the pain points of End-to-End testing and makes it fun to write tests.&lt;br&gt;
But, there are certain mistakes to be avoided so that you can get the full benefit of working with Cypress.&lt;/p&gt;

&lt;p&gt;In this blog post, we'll cover 5 such common mistakes, which should be avoided when writing Cypress tests.&lt;br&gt;
So, without further ado, let's begin!&lt;/p&gt;
&lt;h2&gt;
  
  
  Use &lt;code&gt;id&lt;/code&gt; and &lt;code&gt;class&lt;/code&gt; For Selecting Element
&lt;/h2&gt;

&lt;p&gt;Using &lt;code&gt;id&lt;/code&gt; and &lt;code&gt;class&lt;/code&gt; for selecting element is problematic because they are primarily for behavior and styling purposes, due to which they are subject to change frequently.&lt;br&gt;
Doing so result in brittle tests which, you probably don't want.&lt;/p&gt;

&lt;p&gt;Instead, you should always try to use &lt;code&gt;data-cy&lt;/code&gt; or &lt;code&gt;data-test-id&lt;/code&gt;.&lt;br&gt;
Why? Because they are specifically for testing purposes, which makes them decoupled to the behavior or styling, hence more reliable.&lt;/p&gt;

&lt;p&gt;For example, let's suppose we have an &lt;code&gt;input&lt;/code&gt; element:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;input&lt;/span&gt;
  &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"main"&lt;/span&gt;
  &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt;
  &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"input-box"&lt;/span&gt;
  &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt;
  &lt;span class="na"&gt;data-testid=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt;
&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of using &lt;code&gt;id&lt;/code&gt; or &lt;code&gt;class&lt;/code&gt; to target this element for test, use &lt;code&gt;data-testid&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Don't ❌&lt;/span&gt;
&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#main&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;something&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.input-box&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;something&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Do ☑️&lt;/span&gt;
&lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[data-testid=name]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;something&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What about using text for selecting element?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sometimes it is necessary to use text such as button label to make an assertion or action.&lt;br&gt;
Although, it's perfectly fine, keep in mind that, your test will fail if the text changes, which is what you might want if the text is critical for the application.&lt;/p&gt;
&lt;h2&gt;
  
  
  Treating Cypress Commands as Promise
&lt;/h2&gt;

&lt;p&gt;Cypress tests are composed of Cypress commands, for example, &lt;code&gt;cy.get&lt;/code&gt; and &lt;code&gt;cy.visit&lt;/code&gt;.&lt;br&gt;
Cypress commands are like &lt;em&gt;Promise&lt;/em&gt;, but they are not real &lt;em&gt;Promise&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;What that means is, we can't use syntax like &lt;code&gt;async-await&lt;/code&gt; while working with them. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="c1"&gt;// This won't work&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[data-testid=element]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// Do something with element&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you need to do something after a command has been completed, you can do so with the help of the &lt;code&gt;cy.then&lt;/code&gt; command.&lt;br&gt;
It will guarantee that only after the previous command finishes, the next will run.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="c1"&gt;// This works&lt;/span&gt;
    &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[data-testid=element]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;$el&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Do something with $el&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note when using a clause like &lt;code&gt;Promise.all&lt;/code&gt; with Cypress command, it might not work as you expect because Cypress commands are like &lt;em&gt;Promise&lt;/em&gt;, but not real &lt;em&gt;Promise&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Arbitrary Waits in Cypress Tests
&lt;/h2&gt;

&lt;p&gt;When writing the Cypress test we want to mimic the behavior of a real user in real-world scenarios.&lt;br&gt;
Real-world applications are asynchronous and slow due to things like network latency and device limitations.&lt;/p&gt;

&lt;p&gt;When writing tests for such applications we are tempted to use arbitrary values in the &lt;code&gt;cy.wait&lt;/code&gt; command.&lt;br&gt;
The problem with this approach is that, while it works fine in development, it is not guaranteed. Why? Because the underlying system depends upon things like network requests which are asynchronous and nearly impossible to predict.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="c1"&gt;// Might work (sometimes) 🤷&lt;/span&gt;
    &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[data-testid=element]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;performSomeAsyncAction&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="c1"&gt;// Wait for 1000 ms&lt;/span&gt;
    &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;wait&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Do something else after the action is completed&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead, we should wait for visual elements, for example, completion of loading. Not only does it mimic the real-world use case more closely, but it also gives more reliable results.&lt;br&gt;
Think about it, a user using your application mostly likely wait for a visual clue like loading to determine the completion of an action rather than arbitrary time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="c1"&gt;// The right way ☑️&lt;/span&gt;
    &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[data-testid=element]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;performSomeAsyncAction&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="c1"&gt;// Wait for loading to finish&lt;/span&gt;
    &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[data-testid=loader]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;not.be.visible&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="c1"&gt;// Now that we know previous action has been completed; move ahead&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Cypress commands, for example, &lt;code&gt;cy.get&lt;/code&gt; wait for the element before making the assertion, of course for a predefined &lt;strong&gt;timeout&lt;/strong&gt; value which you can &lt;a href="https://docs.cypress.io/guides/references/configuration#Timeouts"&gt;modify&lt;/a&gt;.&lt;br&gt;
The cool thing about &lt;strong&gt;timeout&lt;/strong&gt; is that they will only wait until the condition is met rather than waiting for the complete duration like the &lt;code&gt;cy.wait&lt;/code&gt; command.&lt;/p&gt;
&lt;h2&gt;
  
  
  Using Different Domains within a Cypress Test
&lt;/h2&gt;

&lt;p&gt;One limitation of Cypress is that it doesn't allow using more than one domain name in a single test.&lt;/p&gt;

&lt;p&gt;If you try using more than one domain in a single test block &lt;code&gt;it(...)&lt;/code&gt; or &lt;code&gt;test(...)&lt;/code&gt;, Cypress will throw a security warning.&lt;br&gt;
This is the way Cypress has been &lt;a href="https://docs.cypress.io/guides/guides/web-security#Same-superdomain-per-test"&gt;built&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With that being said, sometimes there is a requirement to visit more than one domain in a single test. We can do so by splitting our test logic into multiple test blocks within a single test file. You can think of it as a multi-step test, for example,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Test Page Builder&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Step 1: Visit Admin app and do something&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// ...&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Step 2: Visit Website app and assert something&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// ...&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We use a similar approach at Webiny for testing the &lt;a href="https://www.webiny.com/serverless-app/page-builder/?utm_source=Dev-to&amp;amp;utm_medium=blog-post&amp;amp;utm_campaign=Regular-content&amp;amp;utm_content=5-things-to-avoid-cypress-tests&amp;amp;utm_term=W00685"&gt;Page Builder application&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Few things to keep in mind when writing tests in such a manner are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You cannot rely on persistent storage be it variable in test block or even local storage.&lt;br&gt;
Why? Because, when we issue a Cypress command with a domain other than the &lt;code&gt;baseURL&lt;/code&gt; defined in the &lt;a href="https://docs.cypress.io/guides/references/best-practices#Setting-a-global-baseUrl"&gt;configuration&lt;/a&gt;, Cypress performs a tear-down and does a full reload.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Blocks like &lt;code&gt;"before"&lt;/code&gt;, &lt;code&gt;"after"&lt;/code&gt; will be run for each such test block because of the same issue mentioned above.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Be mindful of these issues before adapting this approach and adjust the tests accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mixing Async and Sync Code
&lt;/h2&gt;

&lt;p&gt;Cypress commands are asynchronous, and they don't &lt;strong&gt;return&lt;/strong&gt; a value but &lt;strong&gt;yield&lt;/strong&gt; it.&lt;/p&gt;

&lt;p&gt;When we run Cypress it won't execute the commands immediately but read them serially and queue them.&lt;br&gt;
Only after it executes them one by one. So, if you write your tests mixing async and sync code, you will get the wrong results.&lt;br&gt;
For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;does not work as we expect&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;visit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;your-application&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// Nothing happens yet&lt;/span&gt;

  &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[data-testid=submit]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// Still nothing happening&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;click&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// Nope, nothing&lt;/span&gt;

  &lt;span class="c1"&gt;// Something synchronous&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Cypress&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;title&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// evaluates immediately as []&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// It will never run because "el.length" will immediately evaluates as 0&lt;/span&gt;
    &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.another-selector&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="cm"&gt;/*
    * This code block will always run because "el.length" is 0 when the code executes
    */&lt;/span&gt;
    &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.optional-selector&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead, use our good friend &lt;code&gt;cy.then&lt;/code&gt; command to run code after the command has been completed. For example,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;does work as we expect&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;visit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;your-application&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// Nothing happens yet&lt;/span&gt;

  &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;[data-testid=submit]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// Still nothing happening&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;click&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c1"&gt;// Nope, nothing&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// placing this code inside the .then() ensures&lt;/span&gt;
      &lt;span class="c1"&gt;// it runs after the cypress commands 'execute'&lt;/span&gt;
      &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;el&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Cypress&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.new-el&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// evaluates after .then()&lt;/span&gt;

      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;el&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.another-selector&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;cy&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;.optional-selector&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Cypress is a powerful tool for End-to-End testing, but sometimes we make few mistakes which makes the experience not fun.&lt;br&gt;
By avoiding the common mistakes we can make the journey of End-to-End testing smooth and fun.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>testing</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Webiny 5.0 Release</title>
      <dc:creator>Sven A</dc:creator>
      <pubDate>Fri, 12 Mar 2021 13:22:17 +0000</pubDate>
      <link>https://dev.to/webiny/webiny-5-0-release-1h9o</link>
      <guid>https://dev.to/webiny/webiny-5-0-release-1h9o</guid>
      <description>&lt;p&gt;It took us ~6 months, 179 calls with users and 3676 commits to ship this release. It is a release where all the changes are 100% driven by community feedback.&lt;/p&gt;

&lt;p&gt;Here are the main highlights:&lt;/p&gt;

&lt;p&gt;🚀 Drastic performance improvements (benchmarks included)&lt;br&gt;
🔐 Default VPC and private VPC deployment are now supported&lt;br&gt;
🗄 DynamoDB and Elasticsearch support &lt;br&gt;
🏗 Page Builder overhaul - way faster and more stable than before&lt;br&gt;
💻 Improved developer experience&lt;br&gt;
🧱 IaC implementation via Pulumi&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.webiny.com/blog/webiny-v5-the-big-update?utm_source=Dev-to&amp;amp;utm_medium=webiny-blog&amp;amp;utm_campaign=webiny-cross-promote-mar-12&amp;amp;utm_content=webiny-v5-updates&amp;amp;utm_term=W00624"&gt;Check out the blog post for full details&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;To get started with Webiny 5.0 (&lt;a href="https://docs.webiny.com/docs/tutorials/create-an-application/introduction?utm_source=Dev-to&amp;amp;utm_medium=webiny-blog&amp;amp;utm_campaign=webiny-cross-promote-mar-12&amp;amp;utm_content=webiny-v5-updates&amp;amp;utm_term=W00625"&gt;full tutorial&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  In Other News
&lt;/h2&gt;

&lt;p&gt;Webiny is proud to announce that we have received funding from &lt;code&gt;Y Combinator&lt;/code&gt; and have joined their latest batch of companies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0hJx5rEX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wuutunytegneo4dzeqw4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0hJx5rEX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wuutunytegneo4dzeqw4.png" alt="Screen Shot 2021-03-12 at 14.19.10"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The Complete Beginners Guide to AWS S3</title>
      <dc:creator>Albiona</dc:creator>
      <pubDate>Mon, 25 Jan 2021 18:18:34 +0000</pubDate>
      <link>https://dev.to/webiny/get-started-with-aws-s3-3bod</link>
      <guid>https://dev.to/webiny/get-started-with-aws-s3-3bod</guid>
      <description>&lt;p&gt;When developing your web application, you must think of a place where to store your data, how to back up them, types of data you want to store, such as images, music, and videos, application hosting, data archiving, disaster recoveries. AWS Simple Storage Service (S3) provides you the solutions for these cases. S3 is one of the core services of AWS cloud infrastructure. It's object storage that acts like a regular file system on your personal computer. S3 scales infinitely, with no limit on the amount of data you store.&lt;/p&gt;

&lt;p&gt;In this tutorial, we'll get to learn how to use the AWS S3. First, learn what is S3, the core parts of S3 that are the Buckets, Access Point, and Objects. Then we'll get to the practice, by implementing the AWS SDK for Node.js 💻&lt;/p&gt;

&lt;p&gt;Finally, we'll provide a cheat sheet on AWS S3 CMD Commands.&lt;/p&gt;




&lt;p&gt;Amazon Web Services (AWS) provides multiple types of cloud computing services, one of them is the AWS Storage Service. There are different storage services, such as Simple Storage Service (S3), AWS Elastic File System (EFS), &amp;amp; Elastic Block Store (EBS). For this tutorial, we'll be focusing on the S3 service. S3 is one of the most favorite cloud computing services among all the other services, based on &lt;a href="https://twitter.com/acloudguru/status/1240722699493801987" rel="noopener noreferrer"&gt;this poll&lt;/a&gt; by &lt;a href="https://acloudguru.com/" rel="noopener noreferrer"&gt;acloud.guru&lt;/a&gt; on Twitter.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is S3?
&lt;/h2&gt;

&lt;p&gt;You can use S3 to host your static websites, delivering HTML, JavaScript, images, videos, and other files to your website visitors - that doesn't contain server-side code such as Node.js or PHP. Using S3, you can easily deploy your applications in just two to three clicks via the user interface. S3 provides a simple web services interface you can use to store and retrieve any amount of data from anywhere on the web.&lt;/p&gt;

&lt;p&gt;We'll now go through the core concepts of S3, such as &lt;strong&gt;buckets&lt;/strong&gt;, &lt;strong&gt;access points&lt;/strong&gt;, and &lt;strong&gt;objects&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Buckets
&lt;/h3&gt;

&lt;p&gt;To upload your data to S3, you must create an S3 bucket in one of the AWS Regions, within one bucket you can upload many objects to the bucket. For implementation, buckets and objects are resources, and S3 provides &lt;strong&gt;APIs&lt;/strong&gt; for you to manage them. There are different methods you can use to create buckets such as.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Amazon S3 Console&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Follow the guides &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/user-guide/create-bucket.html" rel="noopener noreferrer"&gt;here&lt;/a&gt; to create your first bucket with the S3 console.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;REST API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To create buckets using REST API, you must authenticate your requests — follow the &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html" rel="noopener noreferrer"&gt;PUT Bucket&lt;/a&gt; in the S3 API reference. But it's recommended to use the AWS Management Console or AWS SDKs instead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS SDK&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To create buckets with the SDK, you first have to create a client and then use the client to send a request to create a bucket. Note: When creating the client and the bucket, use the same region. Here is a dominant &lt;a href="https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/s3-example-creating-buckets.html" rel="noopener noreferrer"&gt;source&lt;/a&gt; on creating and using AWS S3 Buckets.&lt;/p&gt;

&lt;h3&gt;
  
  
  Access points
&lt;/h3&gt;

&lt;p&gt;To access the data that you store on S3, you need the S3 Access Point. These are endpoints that are attached to buckets that you used to perform S3 object operations.&lt;/p&gt;

&lt;p&gt;Each access point has distinct permissions and network controls S3 applies for any request that is made through the access point. Access points are used to perform operations on objects, but not on buckets. Go through this source to learn how to manage data access with S3 access points.&lt;/p&gt;

&lt;h3&gt;
  
  
  Objects
&lt;/h3&gt;

&lt;p&gt;We mentioned that AWS S3 is object storage. Each AWS S3 object has data, a key, and metadata. The object key (or key name) uniquely identifies the object in a bucket. Object metadata is a set of name-value pairs.&lt;/p&gt;

&lt;p&gt;You can store objects in one or more buckets, and each object can be up to 5 TB in size. For the real-world solutions, let's say you want to share an image or video stored in AWS S3 bucket on your website, that is possible only if you make the object public or use a pre-signed URL on your website. Follow this source on how to work with S3 objects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hands-on S3 with AWS SDK
&lt;/h2&gt;

&lt;p&gt;We'll go with the AWS SDK and Node.js to &lt;strong&gt;create&lt;/strong&gt; S3 buckets, &lt;strong&gt;uploading&lt;/strong&gt; an object to a specified bucket and &lt;strong&gt;deleting&lt;/strong&gt; that bucket afterward; we'll provide a &lt;code&gt;How-To on the S3&lt;/code&gt; section where you can learn more about different use-cases commands to run on S3.&lt;/p&gt;

&lt;p&gt;In order to continue, you must:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Install Node.js, in case you don't have it, follow the &lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;Node.js website&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set up your user credentials, follow &lt;a href="https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/loading-node-credentials-shared.html" rel="noopener noreferrer"&gt;here&lt;/a&gt; for more information.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Configuring the SDK
&lt;/h3&gt;

&lt;p&gt;To use the AWS SDK for JavaScript, we must first initiate a node module for our hands-on project.&lt;/p&gt;

&lt;p&gt;To do that, first, create a folder named &lt;code&gt;webiny-hands-on-s3&lt;/code&gt; and &lt;code&gt;cd&lt;/code&gt; into that folder.&lt;/p&gt;

&lt;p&gt;Run the command &lt;code&gt;npm init&lt;/code&gt; — this will ask you to provide the project's name and you can name it as you want, in this case, we'll leave it the same as the folder name with an entry point of the &lt;code&gt;index.js&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Inside our folder, we'll create a couple of files, such as.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;createBucket.js&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;upload.js&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;listObjects.js&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;deleteBucket.js&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before we continue to implement any code, we need to install the AWS SDK package by running this command: &lt;code&gt;npm install aws-sdk --save&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let's dive in.&lt;/p&gt;




&lt;h3&gt;
  
  
  Creating an AWS S3 Bucket
&lt;/h3&gt;

&lt;p&gt;In order to use the SDK, we have to configure the SDK package by loading it into our file. Open the createBucket.js file, and start writing the below code in your own file. In the snippet we have comments to explain to you what we're doing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Load the AWS SDK for Node.js&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;AWS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aws-sdk&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Set the region&lt;/span&gt;
&lt;span class="nx"&gt;AWS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;region&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;us-east-1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Create S3 service object&lt;/span&gt;
&lt;span class="nx"&gt;s3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;AWS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;S3&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2006-03-01&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Create the parameters for calling createBucket -- with this part we'll take the bucket name we'll create&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;bucketParams&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;Bucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Call S3 to create the buckets&lt;/span&gt;
&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createBucket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bucketParams&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Success&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Location&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To create your S3 bucket, with this script, we must run it and give our bucket a name like so: &lt;code&gt;node createBucket.js webiny-s3-bucket-testing&lt;/code&gt;. If it's successful, it will console log the Success message together with the location, which will be the bucket name.&lt;/p&gt;

&lt;h3&gt;
  
  
  Uploading a file to an AWS S3 Bucket
&lt;/h3&gt;

&lt;p&gt;Open the &lt;code&gt;upload.js&lt;/code&gt; file and let's dive in. I will repeat some parts of the snippets, such as the SDK configuration, and the AWS S3 service object as shown in the above snippet. The additional part is that we have two command-line arguments, the first one will be the bucket name where you'll upload your file, and the second argument will be the file itself.&lt;/p&gt;

&lt;p&gt;Let's dive into the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Load the AWS SDK for Node.js&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;AWS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aws-sdk&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Set the region&lt;/span&gt;
&lt;span class="nx"&gt;AWS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;region&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;us-east-1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Create S3 service object&lt;/span&gt;
&lt;span class="nx"&gt;s3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;AWS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;S3&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2006-03-01&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Call S3 to retrieve upload file to specified bucket&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;uploadParams&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;Bucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="na"&gt;Key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;Body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;// Configure the file stream and obtain the upload parameters&lt;/span&gt;
&lt;span class="c1"&gt;// The node.js file system module allows you to work (read, create, update, delete, rename files)&lt;/span&gt;
&lt;span class="c1"&gt;// with the file system on your computer.&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;readingFile&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createReadStream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;readingFile&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;File Error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;uploadParams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;readingFile&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// The path module provides utilities for working with file and directory paths.&lt;/span&gt;
&lt;span class="c1"&gt;// We can access by using this:&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;path&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;uploadParams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;basename&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Call S3 to retrieve upload file to specified bucket&lt;/span&gt;
&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;upload&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;uploadParams&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Upload Success!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Location&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, create an &lt;code&gt;index.txt&lt;/code&gt; file in your folder, and add some text to it.&lt;/p&gt;

&lt;p&gt;Then, run the script by providing two parameters:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The S3 bucket we create in the first snippet webiny-s3-bucket-testing&lt;/li&gt;
&lt;li&gt;The local file you want to upload into that S3 bucket.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The full command &lt;code&gt;node upload.js webiny-s3-bucket-testing index.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdo4is70o5rtimu2b9ath.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fdo4is70o5rtimu2b9ath.png" alt="upload"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🎉 You just uploaded a file into your S3 bucket! &lt;/p&gt;

&lt;h3&gt;
  
  
  Listing objects in an AWS S3 Bucket
&lt;/h3&gt;

&lt;p&gt;Now, open the &lt;code&gt;listObjects.js&lt;/code&gt; file where you'll list the content of this bucket. It's again a repetitive task of configuring the SDK and creating the AWS S3 service object. What this script will do, is that we'll provide the bucket name from which we want to read the objects and the result will be a list of objects (files) or a failure message.&lt;/p&gt;

&lt;p&gt;Let's dive into the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Load the AWS SDK for Node.js&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;AWS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aws-sdk&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Set the region&lt;/span&gt;
&lt;span class="nx"&gt;AWS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;region&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;us-east-1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Create S3 service object&lt;/span&gt;
&lt;span class="nx"&gt;s3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;AWS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;S3&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2006-03-01&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Create the parameters for calling listObjects method&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;bucketParams&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// in here we'll provide the bucket name we created earlier&lt;/span&gt;
  &lt;span class="na"&gt;Bucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;webiny-s3-bucket-testing&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// Call S3 to obtain a list of the objects in the bucket&lt;/span&gt;

&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listObjects&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bucketParams&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Success&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's run the script by running this command: &lt;code&gt;node listObjects.js&lt;/code&gt; Check out the result 😄&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Faonx8mrc3hn3i7nn5qvi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Faonx8mrc3hn3i7nn5qvi.png" alt="listObjects"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Deleting an AWS S3 Bucket
&lt;/h3&gt;

&lt;p&gt;Move to the &lt;code&gt;deleteBucket.js&lt;/code&gt; file, and configure the SDK and create the AWS S3 service object. What you'll use in this script, comparing with the above script, is the &lt;code&gt;deleteBucket&lt;/code&gt; method. But, this case is different, we previously added objects into our bucket, right? We can't delete the AWS S3 buckets if they're not empty. That means you need to delete the objects inside the bucket first, then delete the bucket.&lt;/p&gt;

&lt;p&gt;Let's dive in.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Load the AWS SDK for Node.js&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;AWS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aws-sdk&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Set the region&lt;/span&gt;
&lt;span class="nx"&gt;AWS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;region&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;us-east-1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Create S3 service object&lt;/span&gt;
&lt;span class="nx"&gt;s3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;AWS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;S3&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2006-03-01&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Create params for S3.deleteBucket&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;bucketParams&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// here you'll provide the name of the bucket you want to delete&lt;/span&gt;
  &lt;span class="na"&gt;Bucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;webiny-s3-bucket-testing&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;// We'll first empty the bucket&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;emptyS3Bucket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;listParams&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;Bucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="c1"&gt;// Prefix: dir,&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;listedObjects&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listObjectsV2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;listParams&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;promise&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;listedObjects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Contents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;deleteParams&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;Bucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;Delete&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;Objects&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="nx"&gt;listedObjects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Contents&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(({&lt;/span&gt; &lt;span class="nx"&gt;Key&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;deleteParams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Delete&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Objects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;Key&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deleteObjects&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;deleteParams&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;promise&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;listedObjects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;IsTruncated&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;emptyS3Bucket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bucket&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;emptyS3Directory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bucketParams&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Bucket&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Call S3 to delete the bucket&lt;/span&gt;
&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deleteBucket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bucketParams&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Success&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;code&gt;How-to&lt;/code&gt; on S3 - Cheatsheet
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Download an entire AWS S3 bucket&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;1.1 Install the AWS Command Line Tools&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo easy_install awscli
// or
sudo pip install awscli
// or
brew install awscli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;1.2 Run these commands:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;aws s3 sync s3://&amp;lt;source_bucket&amp;gt; &amp;lt;local_destination&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Example: &lt;code&gt;aws s3 sync s3://mybucket&lt;/code&gt;. Will download all the objects in &lt;code&gt;mybucket&lt;/code&gt; to the current directory. And will output: &lt;code&gt;download: s3://mybucket/test.txt to test.txt&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Are AWS S3 buckets region-specific?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The user interface shows all your buckets, in all regions. But buckets exist in a specific region and you need to specify that region when you create a bucket.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;How to Configure SSL for AWS S3 bucket?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;code&gt;[https://s3.amazonaws.com/bucket_name/images/logo.gif](https://s3.amazonaws.com/bucket_name/images/logo.gif)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you use a custom domain for your bucket, you can use S3 and CloudFront together with your own SSL certificate (or generate a free one via Amazon Certificate Manager): &lt;a href="https://aws.amazon.com/cloudfront/custom-ssl-domains/" rel="noopener noreferrer"&gt;Amazon CloudFront Custom SSL&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Delete AWS S3 buckets&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;aws s3 rb s3://bucket-name&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;By default, the bucket must be empty for the operation to succeed. To remove a bucket that's not empty, you need to include the &lt;code&gt;--force&lt;/code&gt; option. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;aws s3 rb s3://bucket-name --force&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Rename AWS S3 Bucket name&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There is no rename bucket functionality for S3 because there are technically no folders in S3, so we have to handle every file within the bucket.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws s3 mb s3://[new-bucket] // 1. Create a new bucket
aws s3 sync s3://[old-bucket] s3://[new-bucket] // 2. Copy files over
aws s3 rb --force s3://[old-bucket] // 3. Delete the old bucket
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Quick way to list all files in AWS S3 bucket&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;aws s3 ls&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AWS S3 copy files and folders between two buckets&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;aws s3 sync s3://DOC-EXAMPLE-BUCKET-SOURCE s3://DOC-EXAMPLE-BUCKET-TARGET&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Is it better to have multiple s3 buckets or one bucket with sub folders?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;By default, you can create up to 100 buckets in each of your AWS accounts. If you need additional buckets, you can increase your bucket limit by submitting a service limit increase. &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html" rel="noopener noreferrer"&gt;Source&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The total volume of data and the number of objects you can store are unlimited. &lt;a href="https://aws.amazon.com/s3/faqs/" rel="noopener noreferrer"&gt;Source&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;*Object Storage — Also known as object-based storage, is a strategy that manages and manipulates data storage as distinct units, called objects. There are three key components of an object — the content of the object (data stored in the object such as a file or directory), the unique object identifier (ID), and metadata. It stores the metadata as key-pair values and contains information such as name, size, date, security attributes, content type, and URL. Each object has an access control list (ACL) to configure who may access the object.&lt;/p&gt;




&lt;p&gt;Now that you've used AWS SDK for S3, you're able to code the solutions that the AWS S3 Console provides via a few clicks, which is faster but, using the SDK you'll be able to continue developing your applications using the AWS services directly by coding. This is a significant advantage for those interested in building applications using AWS services. In this tutorial, we used the AWS SDK to create buckets, upload data, listing data from the buckets, empty, and afterward deleting buckets via AWS SDK for JavaScript for Node.js.&lt;/p&gt;




&lt;p&gt;If you learned something new today and are interested to follow up on our blogs, &lt;a href="https://landing.mailerlite.com/webforms/landing/g9f1i1" rel="noopener noreferrer"&gt;subscribe&lt;/a&gt; to our newsletter and we'll provide you the best content of the serverless world!&lt;/p&gt;




&lt;p&gt;Thanks for reading! My name is Albiona and I work as a developer relations engineer at &lt;a href="https://www.webiny.com/?utm_source=Dev-to&amp;amp;utm_medium=webiny-blog&amp;amp;utm_campaign=webiny-weekly-tech-blog-cross-promotion-jan-25&amp;amp;utm_content=webiny-get-started-with-aws-s3&amp;amp;utm_term=W00495" rel="noopener noreferrer"&gt;Webiny&lt;/a&gt;. I enjoy learning new tech and building communities around them = ) If you have questions or just want to say hi, reach out to me via &lt;a href="https://twitter.com/albionaitoh" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>beginners</category>
      <category>cloud</category>
      <category>node</category>
    </item>
    <item>
      <title>Get Started with Cloud Computing</title>
      <dc:creator>Albiona</dc:creator>
      <pubDate>Tue, 19 Jan 2021 14:21:04 +0000</pubDate>
      <link>https://dev.to/webiny/get-started-with-cloud-computing-1668</link>
      <guid>https://dev.to/webiny/get-started-with-cloud-computing-1668</guid>
      <description>&lt;p&gt;Nowadays, when working on software systems, you have heard about Cloud Computing technology. Understanding cloud fundamentals is an essential part when getting started with Cloud Computing. Amazon Web Services (AWS) is one of the cloud providers that offer over 300 services. Before starting with AWS, understand cloud concepts such as what is cloud computing, the advantages of using cloud computing, cloud computing types, and cloud deployment models.&lt;/p&gt;

&lt;p&gt;In this article, we'll cover the concepts you need to build that solid foundation to implement Cloud Computing technologies.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Cloud Computing
&lt;/h2&gt;

&lt;p&gt;Cloud computing gives you the option to transform IT infrastructure into a utility - which means you can get into your IT infrastructure via the internet, using computing resources on the cloud. Without the need to install or maintain these resources on-premises.&lt;/p&gt;

&lt;p&gt;What is on-premise you might ask? Going with the on-premise way, you must manage your own servers, hire IT people, payor rent the real-estate for the servers.&lt;/p&gt;

&lt;p&gt;The opposite of on-premise is the cloud providers, who provide you these services via the internet. The cloud providers are companies who own the servers, hire IT people, pay and manage the real estate for the servers. Those companies give you the option to manage the configuration of the cloud services you use, and your code and they take care of the rest.&lt;/p&gt;

&lt;p&gt;Simply put, Cloud Computing offers you on-demand access, through the internet to cloud computing resources, applications, servers (physical and virtual servers), data storage, development tools, networking capabilities, and more — hosted at remote data centers that are managed by cloud service providers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages of Using Cloud Computing
&lt;/h2&gt;

&lt;p&gt;We learned what on-premise IT is, the traditional way of managing IT infrastructure. Based on the differences between on-premise and cloud computing provider solutions, there are some obvious benefits you get when using cloud computing resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lower total cost of ownership (TCO)
&lt;/h3&gt;

&lt;p&gt;For all the attributes of having your on-premise infrastructure that we mentioned such as managing your own servers, hiring the IT people, paying or renting the real-estate for the servers, those all come up with a price, and with the cloud computing technology, you eliminate the capital expenses.&lt;/p&gt;

&lt;h3&gt;
  
  
  Agility
&lt;/h3&gt;

&lt;p&gt;In just a few clicks you're able to get up and running the computing resources you need for your applications — As Webiny's CEO &lt;a href="https://twitter.com/SvenAlHamad"&gt;Sven&lt;/a&gt; noted on the &lt;a href="https://www.serverlesschats.com/"&gt;Serverless Chats podcast&lt;/a&gt; by answering &lt;a href="https://www.jeremydaly.com/"&gt;Jeremy&lt;/a&gt;'s question &lt;a href="https://www.youtube.com/watch?v=9TSmOcLBr0k&amp;amp;t=2039s"&gt;"What are the benefits of serverless for both small and big companies?"&lt;/a&gt; - "When using serverless, the cost of managing infrastructure will go way down, by releasing a big chunk of the budget or resources or working hours, that you can now focus on product iterations, so your product can grow faster. And if your product grows faster, you can out-innovate potential competitors, which can't afford that same level of innovation."&lt;/p&gt;

&lt;h3&gt;
  
  
  Scale and Performance
&lt;/h3&gt;

&lt;p&gt;The two most important benefits you get when switching to cloud computing technologies is when you want your customers to have an amazing user experience using your product, anywhere - that means in the lowest or highest spikes of your product's traffic. Cloud computing services run on a worldwide network, so they're able to provide you the ability to scale and deliver the resources when they're needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Cloud Computing Services
&lt;/h2&gt;

&lt;p&gt;The cloud computing services fall into four different categories: Infrastructure as a Service (&lt;strong&gt;IaaS&lt;/strong&gt;), Platform as a Service (&lt;strong&gt;PaaS&lt;/strong&gt;), Serverless, and Software as a Service (&lt;strong&gt;SaaS&lt;/strong&gt;). They are all built up on top of one another. We'll go through them to understand what they are and the differences between them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Infrastructure as a Service (IaaS)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;IaaS&lt;/strong&gt; represent the building blocks for cloud IT by providing access to networking features, computers, and data storage space. You can use those resources to build your own products. These are offered by different cloud provider companies on a pay-as-you-go basis. Some examples of cloud providers are &lt;a href="https://aws.amazon.com/"&gt;Amazon Web Services (AWS)&lt;/a&gt;, &lt;a href="https://cloud.google.com/"&gt;Google Cloud Platform&lt;/a&gt;, and &lt;a href="https://azure.microsoft.com/en-us/"&gt;Microsoft Azure&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;— Intended for Admins&lt;/p&gt;

&lt;h3&gt;
  
  
  Platform as a Service (PaaS)
&lt;/h3&gt;

&lt;p&gt;I'm assuming you are a software developer? Well, this cloud computing category is designed for you. &lt;strong&gt;PaaS&lt;/strong&gt; offers cloud computing services with an on-demand environment for development, testing, delivering, and managing software applications. This will make it easier for developers to create web or mobile applications, without worrying about the infrastructure, storage, network, and databases needed for development.&lt;/p&gt;

&lt;p&gt;Some examples of PaaS are the &lt;a href="https://aws.amazon.com/lambda/"&gt;AWS Lambda Service&lt;/a&gt;, &lt;a href="https://www.heroku.com/"&gt;Heroku&lt;/a&gt;, etc.&lt;/p&gt;

&lt;p&gt;— Intended for Developers&lt;/p&gt;

&lt;h3&gt;
  
  
  Serverless Computing
&lt;/h3&gt;

&lt;p&gt;I'll mention the definition of serverless computing based on Webiny's guide to serverless ⬇️&lt;/p&gt;

&lt;p&gt;"Serverless means there are no servers you have to operate to run a particular service or an app. Usually, in Serverless architectures, you rely on services that are managed for you. Be that function-as-a-service, storage-as-a-service, and others. Using managed services means all the maintenance and operational tasks are abstracted away. Yes, there are still servers there, but they are no longer your responsibility to manage."&lt;/p&gt;

&lt;p&gt;Some of the examples that offer serverless services are &lt;a href="https://aws.amazon.com/lambda/"&gt;AWS Lambda Service&lt;/a&gt;, &lt;a href="https://workers.cloudflare.com/"&gt;Cloudflare Workers&lt;/a&gt;, &lt;a href="https://cloud.google.com/functions/"&gt;Google Cloud Functions&lt;/a&gt;, &lt;a href="https://www.ibm.com/cloud/functions"&gt;IBM Cloud Functions&lt;/a&gt;, &lt;a href="https://cloud.google.com/knative/"&gt;Knative&lt;/a&gt;, &lt;a href="https://azure.microsoft.com/en-us/services/functions/"&gt;Microsoft Azure Functions&lt;/a&gt;, &lt;a href="https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions001.htm"&gt;Oracle Functions&lt;/a&gt;. When it comes to building serverless applications and APIs on top of these services, &lt;a href="https://www.webiny.com/"&gt;Webiny&lt;/a&gt; takes the lead! Webiny is a serverless framework — a complete plugin-based admin interface and a set of ready-made serverless applications. Learn more about &lt;a href="https://www.webiny.com/"&gt;Webiny&lt;/a&gt; features here.&lt;/p&gt;

&lt;h3&gt;
  
  
  Software as a Service (SaaS)
&lt;/h3&gt;

&lt;p&gt;SaaS takes place when cloud providers offer complete software products. The infrastructure, product maintenance, security its managed by the cloud provider. Some examples of this cloud computing category are &lt;a href="https://www.salesforce.com/"&gt;Salesforce&lt;/a&gt;, &lt;a href="https://mail.google.com/"&gt;Gmail&lt;/a&gt;, &lt;a href="https://www.office.com/?ui=hy-AM&amp;amp;rs=ET"&gt;Office 336&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;— Intended for Customers&lt;/p&gt;

&lt;h2&gt;
  
  
  Cloud Deployment Models
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Public Cloud
&lt;/h3&gt;

&lt;p&gt;With this type of deployment model, you'll have access to anything the cloud provider offers, from &lt;strong&gt;SaaS&lt;/strong&gt; applications, virtual machines (&lt;strong&gt;VMs&lt;/strong&gt;), infrastructure, and development platforms — available to users via the public internet. Different cloud providers offer these services in different pricing models such as subscription-based, or pay-per-use.&lt;/p&gt;

&lt;p&gt;One of the known characteristics of the &lt;strong&gt;Cloud&lt;/strong&gt; is the multi-tenant* environment—the data centers infrastructure is shared by all public cloud customers. This leads to one or more disadvantages of the &lt;strong&gt;Cloud&lt;/strong&gt; such as &lt;strong&gt;limited resources&lt;/strong&gt; → Even though they have incredible computing power, they share their resources with multiple tenants.&lt;/p&gt;

&lt;p&gt;Some examples of companies using the cloud deployment models are &lt;a href="https://www.squarespace.com/website-design"&gt;Squarespace&lt;/a&gt;, &lt;a href="https://basecamp.com/"&gt;Basecamp&lt;/a&gt;, and &lt;a href="https://www.dropbox.com/"&gt;Dropbox&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Multi-tenant&lt;/strong&gt; → When a single instance of a software application serves multiple tenants (or user accounts).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tenant&lt;/strong&gt; → Can be an individual user, but more often is a group of users that share common access and privileges within that instance of a software application.&lt;/p&gt;

&lt;h3&gt;
  
  
  On-Premise || Private Cloud
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;on-premise&lt;/strong&gt; cloud refers to the cloud computing resources being used by one organization or customer → sometimes is called a private cloud. One reason is the security that the on-premise offers for sensitive data for customers such as Government, Hospitals, Enterprises with different regulations. The on-premise cloud is hosted in the customer's data center, but it has the option to combine the hosting on an independent cloud provider's infrastructure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hybrid Cloud
&lt;/h3&gt;

&lt;p&gt;A combination of the public cloud and on-premise → connecting an organization's on-premise cloud services and public clouds into a single infrastructure for all the organization's applications.&lt;/p&gt;

&lt;p&gt;The goal is to have an optimal solution for each of the organization's applications to do the workloads between the two — based on the current requirements.&lt;/p&gt;

&lt;p&gt;Using a &lt;strong&gt;Hybrid cloud&lt;/strong&gt; gives organizations the freedom to meet their business and technical objectives with benefits such as &lt;strong&gt;lower costs&lt;/strong&gt; and &lt;strong&gt;efficiency&lt;/strong&gt; rather than using just public or on-premise cloud.&lt;/p&gt;




&lt;p&gt;Now that you know the cloud computing concepts, I think you are ready to start with some examples of cloud computing services or you can follow the blog on &lt;a href="https://www.webiny.com/blog/5-aws-services-you-need-to-know-for-web-development"&gt;5 AWS services you need for web development&lt;/a&gt;!&lt;/p&gt;




&lt;p&gt;If you learned something new today and are interested to follow up on our blogs, &lt;a href="https://landing.mailerlite.com/webforms/landing/g9f1i1"&gt;subscribe to our newsletter&lt;/a&gt; and we'll provide you the best content of the serverless world!&lt;/p&gt;




&lt;p&gt;Thanks for reading! My name is Albiona and I work as a developer relations engineer at &lt;a href="https://www.webiny.com/"&gt;Webiny&lt;/a&gt;. I enjoy learning new tech and building communities around them = ) If you have questions or just want to say hi, reach out to me via &lt;a href="https://twitter.com/albionaitoh"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>beginners</category>
      <category>cloudskills</category>
    </item>
    <item>
      <title>5 AWS Services you need to know for Web Development</title>
      <dc:creator>Albiona</dc:creator>
      <pubDate>Wed, 13 Jan 2021 13:41:49 +0000</pubDate>
      <link>https://dev.to/webiny/5-aws-services-you-need-to-know-for-web-development-1c58</link>
      <guid>https://dev.to/webiny/5-aws-services-you-need-to-know-for-web-development-1c58</guid>
      <description>&lt;p&gt;If you're getting started with AWS and you're interested to build your web applications using AWS services in a short amount of time, then you're in the right place. AWS offers more than 300 services, and to start developing applications with AWS without the right information might be a huge burden. As for today, we'll provide to you only 5 AWS services you need to know, to develop your web application.&lt;/p&gt;

&lt;p&gt;Without further ado, let's get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Amazon Web Services
&lt;/h2&gt;

&lt;p&gt;Our top 5 picks of AWS services are:&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS S3
&lt;/h3&gt;

&lt;h3&gt;
  
  
  AWS API Gateway
&lt;/h3&gt;

&lt;h3&gt;
  
  
  AWS Lambda
&lt;/h3&gt;

&lt;h3&gt;
  
  
  AWS DynamoDB
&lt;/h3&gt;

&lt;h3&gt;
  
  
  AWS CloudFront
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Extra AWS Service - AWS Cognito
&lt;/h3&gt;




&lt;p&gt;For each service, we will go through &lt;strong&gt;what is the service&lt;/strong&gt;, what are the &lt;strong&gt;benefits&lt;/strong&gt; of using one, &lt;strong&gt;the pricing&lt;/strong&gt;, and &lt;strong&gt;how to get started&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Follow the &lt;a href="https://www.webiny.com/blog/5-aws-services-you-need-to-know-for-web-development?utm_source=Dev-to&amp;amp;utm_medium=webiny-blog&amp;amp;utm_campaign=webiny-weekly-blog-jan-11&amp;amp;utm_content=webiny-5-aws-services-you-need-for-web-development&amp;amp;utm_term=W00473"&gt;article here&lt;/a&gt; to get into the details of the services you need for web development!
&lt;/h3&gt;




&lt;p&gt;Now that you have the tools you need, building your web applications with AWS is an amazing experience considering the benefits it offers for developers. And if you want to go one step further, try &lt;a href="https://www.webiny.com/?utm_source=Dev-to&amp;amp;utm_medium=webiny-blog&amp;amp;utm_campaign=webiny-weekly-blog-jan-11&amp;amp;utm_content=webiny-5-aws-services-you-need-for-web-development&amp;amp;utm_term=W00472"&gt;Webiny&lt;/a&gt; — &lt;a href="https://www.webiny.com/?utm_source=Dev-to&amp;amp;utm_medium=webiny-blog&amp;amp;utm_campaign=webiny-weekly-blog-jan-11&amp;amp;utm_content=webiny-5-aws-services-you-need-for-web-development&amp;amp;utm_term=W00472"&gt;Webiny&lt;/a&gt; is an open-source serverless application framework that brings all those tools together. Start building your serverless applications using Webiny. today 🚀&lt;/p&gt;




&lt;p&gt;Thanks for reading! My name is Albiona and I work as a developer relations engineer at Webiny. I enjoy learning new tech and building communities around them = ) If you have questions or just want to say hi, reach out to me via &lt;a href="https://twitter.com/albionaitoh"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
