<?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: Antonio Lagrotteria</title>
    <description>The latest articles on DEV Community by Antonio Lagrotteria (@antonio_lagrotteria).</description>
    <link>https://dev.to/antonio_lagrotteria</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%2Fuser%2Fprofile_image%2F722295%2F09163ba4-4fb7-4c02-b234-1b1315a9b795.png</url>
      <title>DEV Community: Antonio Lagrotteria</title>
      <link>https://dev.to/antonio_lagrotteria</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/antonio_lagrotteria"/>
    <language>en</language>
    <item>
      <title>A complete AWS Architecture for Module-federated micro-frontends</title>
      <dc:creator>Antonio Lagrotteria</dc:creator>
      <pubDate>Fri, 24 Dec 2021 15:21:52 +0000</pubDate>
      <link>https://dev.to/aws-builders/a-complete-aws-architecture-for-module-federated-micro-frontends-2meg</link>
      <guid>https://dev.to/aws-builders/a-complete-aws-architecture-for-module-federated-micro-frontends-2meg</guid>
      <description>&lt;p&gt;&lt;strong&gt;Hi, click “Follow me” button on Medium to stay tuned for more articles in this area ;)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Original article: &lt;a href="https://levelup.gitconnected.com/a-complete-aws-architecture-for-module-federated-micro-frontends-a0306ba466e3" rel="noopener noreferrer"&gt;https://levelup.gitconnected.com/a-complete-aws-architecture-for-module-federated-micro-frontends-a0306ba466e3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My next series of articles presents a complete server-less architecture aiming at deploying and hosting client-side mono-repo micro-frontends on AWS, based on &lt;a href="https://webpack.js.org/concepts/module-federation/" rel="noopener noreferrer"&gt;Webpack Module Federation&lt;/a&gt; plugin and &lt;a href="https://github.com/lerna/lerna" rel="noopener noreferrer"&gt;Lerna&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;All AWS resources will be provisioned via CDK, meaning that in a matter of minutes, you will get a production-ready, reliable, and scalable infrastructure deployed to your AWS account, allowing your teams to scale independently and deliver fast business iterations via their independent micro-frontends.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Architecture
&lt;/h2&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%2Fcdn-images-1.medium.com%2Fmax%2F3342%2F1%2AT_OrAE8h81-7u_2x5DWJIw.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%2Fcdn-images-1.medium.com%2Fmax%2F3342%2F1%2AT_OrAE8h81-7u_2x5DWJIw.png" alt="High level architecture"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The architecture consists of 3 main parts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Mono-repo code changes triggering specific deployment pipelines.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deployment pipelines building and deploying bundle artifacts to target AWS resources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Globally scalable hosting infrastructure tailored for client-side micro-frontends.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  A bit on Mono-repo setup
&lt;/h2&gt;

&lt;p&gt;Micro-frontends are part of a mono-repo setup, aka a single repository with sub folders including independent web apps, glued together through the Webpack Module Federation plugin and Lerna. A sneak peek of repo structure can be seen below:&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AWJ7j1CvzaZ9Dn5CNY4doPQ.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AWJ7j1CvzaZ9Dn5CNY4doPQ.png" alt="Mono-repo structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are impatient, you can see how micro-frontends are represented via Module Federation systems in the below gist, which will be discussed in detail in near future.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
In a nutshell, the above code allows us to model micro-frontends as systems which can be lazily loaded as Web components in your app. The trick is to dynamically inject each micro-frontend script in the app page so that they can be remotely loaded by the host /shell app. As said, more to come in the upcoming article. For now, we will look at the 3 sub-architectures mentioned early.

&lt;h2&gt;
  
  
  Mono-repo triggers
&lt;/h2&gt;

&lt;p&gt;The goal of this first step is to capture individual micro-frontend repos changes and trigger them for later use by server-less components.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A8bLIHFGWteY4F7u_OJsafA.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A8bLIHFGWteY4F7u_OJsafA.png" alt="Mono-repo triggers from GitHub"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Developers push the changes to their belonging micro-frontend via Github, though the same can be accomplished for other well known versioning source platforms such as BitBucket. Via a &lt;a href="https://docs.github.com/en/developers/webhooks-and-events/webhooks/about-webhooks" rel="noopener noreferrer"&gt;Github webhook&lt;/a&gt;, changes are handled by a Lambda function exposed as Restful api via an ApiGateway. Main goal of Lambda is to associate the micro-frontend code change with their destination pipeline. A manual walkthrough of this approach can be appreciated &lt;a href="https://levelup.gitconnected.com/a-server-less-ci-cd-approach-for-mono-rep-micro-frontends-e91261bbdf69" rel="noopener noreferrer"&gt;here&lt;/a&gt;, while its CDK implementation will be part of the next article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deployment pipeline
&lt;/h2&gt;

&lt;p&gt;The goal of the second step is to make sure that individual micro-frontend repo changes trigger individual code pipelines. This encourages team independence as if only a micro-frontend is modified (e.g.: mfe-app1), we only want to trigger its related pipeline, and not all the others.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AvQTICQ0SDtJg4VKNL4PAeg.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AvQTICQ0SDtJg4VKNL4PAeg.png" alt="Deployment CI/CD"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once a code change is associated, an AWS Code Pipeline gets started. This includes four main steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The &lt;em&gt;Code Pipeline&lt;/em&gt; itself, which manages the GitHub connection and fetches the associated GitHub source code&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;em&gt;Code Build&lt;/em&gt;, which builds the receiving source code into a build artifact. As micro-frontends are JavaScript based, they will leverage yarn to build them into a set of bundles to be used in the next step.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;em&gt;Code Deploy&lt;/em&gt;. This step takes the built bundled files from previous steps and deploys them to a single Simple Storage Service (S3). Each micro-frontend will be stored in an independent “folder” (or key), so that they can be deployed individually.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;em&gt;Code Build Cache Invalidation&lt;/em&gt;. The last step is yet another Code Build step which ensures that CloudFront cache gets invalidated every time we publish and deploy new artifacts on S3.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hosting infrastructure
&lt;/h2&gt;

&lt;p&gt;Last but not least, foundational AWS resources need to be provisioned. The goal of this last step is to make sure this happens with a scalable, simple yet smart and reliable architecture.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AzK1QOLn0giIQ_85rkUEUAw.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AzK1QOLn0giIQ_85rkUEUAw.png" alt="Hosting infrastructure with S3 and Cloudfront"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With above sub-architecture, end-users will access the web application via a CloudFront distribution &lt;a href="https://aws.amazon.com/waf/" rel="noopener noreferrer"&gt;protected by WAF&lt;/a&gt; , given the micro-frontends are customer-facing optimized applications. CloudFront connects to the private S3 bucket via an &lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html" rel="noopener noreferrer"&gt;OAI &lt;/a&gt;identity, ensuring data is publicly accessible only via the CDN and not directly from the bucket. CloudFront uses a &lt;a href="https://aws.amazon.com/lambda/edge/" rel="noopener noreferrer"&gt;Lambda@Edge&lt;/a&gt; function for proper dispatching towards different origins coming from the single bucket.&lt;/p&gt;

&lt;h2&gt;
  
  
  CDK to rule them all
&lt;/h2&gt;

&lt;p&gt;All above will be provisioned via a CDK application which includes three stacks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The foundation stack. This provisions the foundational AWS resources used to host the app including S3 bucket, a Lambda@Edge function, a CloudFront distribution and various IAM policies, roles and OAI to support correct privacy and security.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The second stack is an implicit one because it gets created when provisioning the Lambda@Edge function via the CDK Experimental CloudFront API, as it has to deploy the Lambda@Edge on a specific AWS region (us-east-1 is used by default for all edge functions).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The ci/cd deploymemt stack. Its job is to provision all AWS resources associated to ApiGateway and the Code Pipeline.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;This article leaves intentionally a cliffhanger feeling as there is a lot to cover. It gives an high level overview of a de-facto server-less AWS architecture for hosting and deploying mono-repo micro-frontends based on Module Federation Webpack plugin. Following articles will deep dive in how this was achieved, so better stay tuned ;)&lt;/p&gt;

</description>
      <category>aws</category>
      <category>microfrontends</category>
      <category>javascript</category>
    </item>
    <item>
      <title>A “Find Corona Test Centers” PWA powered by Amplify Geo and Location Search</title>
      <dc:creator>Antonio Lagrotteria</dc:creator>
      <pubDate>Tue, 30 Nov 2021 16:14:38 +0000</pubDate>
      <link>https://dev.to/aws-builders/a-find-corona-test-centers-pwa-powered-by-amplify-geo-and-location-search-3kll</link>
      <guid>https://dev.to/aws-builders/a-find-corona-test-centers-pwa-powered-by-amplify-geo-and-location-search-3kll</guid>
      <description>&lt;p&gt;Given the recent sad increase of Corona cases in Denmark and my involvement in the Frontend and Serverless cohorts in the AWS Community Builders, I decided to combine the two topics by creating a React application (web-based but also being a Progressive Web App) aiming at searching for Covid19 test centers in Denmark.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ANz_-ieAHldj8uV-pJ1o8jw.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ANz_-ieAHldj8uV-pJ1o8jw.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I will use &lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/09/amplify-geo-aws-amplify/" rel="noopener noreferrer"&gt;Amplify Geo&lt;/a&gt;, which adds location-aware features to web applications and &lt;a href="https://aws.amazon.com/location/" rel="noopener noreferrer"&gt;Amazon Location Service&lt;/a&gt;, which provide secure, reliable and high-quality geospatial data from established global providers such as &lt;a href="https://www.esri.com/en-us/home" rel="noopener noreferrer"&gt;Esri &lt;/a&gt;and &lt;a href="https://www.here.com/" rel="noopener noreferrer"&gt;Here.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Data is available via Rest API from &lt;a href="https://coronasmitte.dk/#" rel="noopener noreferrer"&gt;Coronasmitte&lt;/a&gt; and &lt;a href="https://www.cphmed.com/" rel="noopener noreferrer"&gt;CphMed&lt;/a&gt;, two very valuable web sites where to find centers information too.&lt;/p&gt;

&lt;p&gt;Finally, the app will be deployed on a CloudFront distribution linked with a S3 origin. You can browse the web-app &lt;a href="https://d9ky8dr7mk98u.cloudfront.net/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;This article assumes that you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;know how to create a &lt;a href="https://create-react-app.dev/docs/making-a-progressive-web-app/" rel="noopener noreferrer"&gt;Progressive React app&lt;/a&gt; via Create React App tool &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;know how to &lt;a href="https://docs.amplify.aws/cli/start/install/" rel="noopener noreferrer"&gt;configure and initialize&lt;/a&gt; Amplify in the project&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;get familiar wit the Geo’s &lt;a href="https://docs.amplify.aws/lib/geo/maps/q/platform/js/#sample-application" rel="noopener noreferrer"&gt;Getting Started guide&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  App use cases
&lt;/h2&gt;

&lt;p&gt;Users of this application will be able to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate an interactive Geo map with locations and group of locations (aka clusters), with ability to search for locations via an address bar, and getting suggestions via the Location Search service.&lt;/li&gt;
&lt;/ul&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AEp8NUZT9RLsuDv5TXqCYaA%402x.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AEp8NUZT9RLsuDv5TXqCYaA%402x.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access to valuable Test center information such as address, opening hours, waiting time, type (Antigen or PCR) and more when clicking on the specific location — which in turns open a popup.&lt;/li&gt;
&lt;/ul&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A4CuFIDYzj7fk9aMqwZ6xYw%402x.jpeg" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A4CuFIDYzj7fk9aMqwZ6xYw%402x.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Amplify Geo main components
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://docs.amplify.aws/lib/geo/maps/q/platform/js/#sample-application" rel="noopener noreferrer"&gt;Getting Started guide&lt;/a&gt; is pretty comprehensive so I will not repeat much of the steps in this article. Instead let’s look at two main components in Amplify Geo: Maps and Location Search.&lt;/p&gt;

&lt;h3&gt;
  
  
  Maps
&lt;/h3&gt;

&lt;p&gt;Based on the &lt;a href="https://github.com/maplibre/maplibre-gl-js" rel="noopener noreferrer"&gt;MapLibre GL&lt;/a&gt; library, Amplify Geo &lt;a href="https://docs.amplify.aws/lib/geo/maps/q/platform/js/" rel="noopener noreferrer"&gt;Maps&lt;/a&gt; visualize interactive vector maps on the web mostly by abstracting its usage via the &lt;em&gt;maplibre-gl-js-amplify&lt;/em&gt; package, which exposes, among others, two very important methods:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;createMap&lt;/em&gt;, very self-explanatory method initializing the map default properties such as zoom level, center of the map, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;drawPoints&lt;/em&gt;, which, given the coordinates, organizes them into clusters (groups of locations) and unclustered (markers indicating a specific test centre) options, used to modify the look and feel of the elements in the map.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Full code can be found in &lt;a href="https://github.com/aladevlearning/app-corona/blob/main/src/components/CoronaMap/CoronaCentresMap.js" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Below snippet shows the implementations of above methods.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Location Search
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.amplify.aws/lib/geo/search/q/platform/js/" rel="noopener noreferrer"&gt;Location Search&lt;/a&gt; enables search of locations such as addresses, cities by using Esri or Here Geo Location platforms behind the scenes. By combining it with a couple of React components (&lt;a href="https://react-autosuggest.js.org/" rel="noopener noreferrer"&gt;AutoSuggest&lt;/a&gt; and &lt;a href="https://github.com/nkbt/react-debounce-input" rel="noopener noreferrer"&gt;DebounceInput&lt;/a&gt; — Github code &lt;a href="https://github.com/aladevlearning/app-corona/blob/main/src/components/SearchField/SearchField.js" rel="noopener noreferrer"&gt;here&lt;/a&gt;), users are able to input a text, which eventually pops a series of suggestions found by the Location Search via the &lt;em&gt;Geo.searchByText&lt;/em&gt; method.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Progressive Web App Gotchas
&lt;/h2&gt;

&lt;p&gt;At the time of the writing the PWA can be installed on Chrome Desktop and Android (via three dots menu and Install App item). For IOS you can manually add the app to home screen manually, obtaining something like below:&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A4r6bStcolTmp35QriqWkyQ.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A4r6bStcolTmp35QriqWkyQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Assess app security and performance
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.webpagetest.org/" rel="noopener noreferrer"&gt;WebPageTest&lt;/a&gt; is an established web site that can be used to measure the security and performance of your web page. After initial screening, it was clear that some actions needed to be done:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Control-cache headers should be set to S3 buckets for caching purposes, by adding metadata to all objects in bucket by editing and &lt;em&gt;Add Metadata&lt;/em&gt; option:&lt;/li&gt;
&lt;/ul&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AFcacOwGQTE_gZ3O7mk098g.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AFcacOwGQTE_gZ3O7mk098g.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a Custom Policy adding security related headers, thanks to a &lt;a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/example-function-add-security-headers.html" rel="noopener noreferrer"&gt;recent release&lt;/a&gt; under &lt;em&gt;Policies&lt;/em&gt; -&amp;gt; &lt;em&gt;Response Headers&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&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%2Fcdn-images-1.medium.com%2Fmax%2F3156%2F1%2AYmeVogXZnJtOX8W5MquQGg.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%2Fcdn-images-1.medium.com%2Fmax%2F3156%2F1%2AYmeVogXZnJtOX8W5MquQGg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Edit distribution &lt;em&gt;Behaviour&lt;/em&gt; by associating  a Cache Policy and a Response Headers policy we just created.&lt;/li&gt;
&lt;/ul&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AOjz8AHT0862fWb98xYxX5w.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AOjz8AHT0862fWb98xYxX5w.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After above changes we went from a full blood report to a much nicer view:&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%2Fcdn-images-1.medium.com%2Fmax%2F2656%2F1%2AoQ0DFewcT0g43wBx_4W9CQ.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%2Fcdn-images-1.medium.com%2Fmax%2F2656%2F1%2AoQ0DFewcT0g43wBx_4W9CQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Above were not part of the default Amplify &lt;em&gt;add hosting&lt;/em&gt; command, but recent releases about &lt;a href="https://aws.amazon.com/blogs/mobile/extend-amplify-backend-with-custom-aws-resource-using-aws-cdk-or-cloudformation/" rel="noopener noreferrer"&gt;custom resources&lt;/a&gt;, &lt;a href="https://aws.amazon.com/blogs/mobile/export-amplify-backends-to-cdk-and-use-with-existing-deployment-pipelines/" rel="noopener noreferrer"&gt;export&lt;/a&gt; and &lt;a href="https://aws.amazon.com/blogs/mobile/override-amplify-generated-backend-resources-using-cdk/" rel="noopener noreferrer"&gt;override&lt;/a&gt; can help in automating that via a CDK stack.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Amplify Geo makes extremely easy and quick to setup up a secure and scalable map functionality and infrastructure in hours.&lt;/p&gt;

&lt;p&gt;In regards of PWA area I may add in future a &lt;a href="https://github.com/as-ideas/add-to-homescreen-react" rel="noopener noreferrer"&gt;component&lt;/a&gt; which can popup the installation process proactively.&lt;/p&gt;

&lt;p&gt;As I am still in Free Tier zone, I am also very interested in keeping an eye on &lt;a href="https://docs.amplify.aws/cli/geo/maps/#map-pricing-plan" rel="noopener noreferrer"&gt;pricing&lt;/a&gt; and will definitely update this section if something worth mentioning pops up.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.amplify.aws/lib/geo/getting-started/q/platform/js/" rel="noopener noreferrer"&gt;https://docs.amplify.aws/lib/geo/getting-started/q/platform/js&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>AppSync Lambda authorizers via new Amplify Custom Resources</title>
      <dc:creator>Antonio Lagrotteria</dc:creator>
      <pubDate>Thu, 18 Nov 2021 15:56:36 +0000</pubDate>
      <link>https://dev.to/aws-builders/appsync-lambda-authorizers-via-new-amplify-custom-resources-28gf</link>
      <guid>https://dev.to/aws-builders/appsync-lambda-authorizers-via-new-amplify-custom-resources-28gf</guid>
      <description>&lt;p&gt;&lt;a href="https://aws.amazon.com/amplify/" rel="noopener noreferrer"&gt;Amplify&lt;/a&gt; and &lt;a href="https://aws.amazon.com/appsync/" rel="noopener noreferrer"&gt;AppSync&lt;/a&gt; allow customers to consume a fully managed GraphQL API endpoint in minutes and gracefully handle authorization. This article shows how you can leverage the newly recently introduced &lt;a href="https://docs.amplify.aws/cli/custom/cdk/" rel="noopener noreferrer"&gt;AWS Custom Resources&lt;/a&gt; to add the new &lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/07/aws-appsync-supports-custom-authorization-with-aws-lambda-graphsql-apis/" rel="noopener noreferrer"&gt;AWS Lambda&lt;/a&gt; authorization mode via CDK. We will integrate this endpoint with a very simple React web-app.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AX8wJfgMbeIaItSJM_uMzhg.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AX8wJfgMbeIaItSJM_uMzhg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Fun fact
&lt;/h2&gt;

&lt;p&gt;The first version of this article was based on independently provision the needed AWS resources via CDK, on its own folder/project. Nevertheless  in the &lt;a href="https://aws.amazon.com/developer/community/community-builders/" rel="noopener noreferrer"&gt;AWS Community Builders&lt;/a&gt; Slack channel, I came to know that &lt;a href="https://docs.amplify.aws/cli/custom/cdk/#reference-amplify-environment-name" rel="noopener noreferrer"&gt;a related feature&lt;/a&gt; was being released by the AWS Amplify team which brought me to revisit the article with slightly different but cleaner implementation. This synthetizes the awesomeness of the program. You can find the &lt;a href="https://github.com/aladevlearning/appsync-lambda-authorizers/tree/before-custom-resources" rel="noopener noreferrer"&gt;before&lt;/a&gt; and &lt;a href="https://github.com/aladevlearning/appsync-lambda-authorizers/tree/after-custom-resources" rel="noopener noreferrer"&gt;after&lt;/a&gt; custom resources implementation in GitHub.&lt;/p&gt;

&lt;h2&gt;
  
  
  Add Custom resources
&lt;/h2&gt;

&lt;p&gt;With latest Amplify now you can &lt;a href="https://docs.amplify.aws/cli/custom/cdk" rel="noopener noreferrer"&gt;add custom resources&lt;/a&gt; by defining CDK stacks. A typical approach before this was to separate your CDK into a &lt;em&gt;cdk&lt;/em&gt; or &lt;em&gt;infra&lt;/em&gt; folder within your project. Now you can have it within the Amplify backend. Issues the below commands:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -g @aws-amplify/cli
amplify add custom
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Currently you can define custom resources by either &lt;em&gt;CDK&lt;/em&gt; or &lt;em&gt;CloudFormation&lt;/em&gt; templates, we will opt for the first choice and provide a name for the custom Resource e.g. &lt;em&gt;lambdaAuthorizerCustomResource&lt;/em&gt;. This generates a skeleton CDK stack under the &lt;em&gt;amplify/backend/custom/&lt;/em&gt; path.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AWM50WFpUMqOsI11bYsVs6Q.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AWM50WFpUMqOsI11bYsVs6Q.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before we modify the pre-generated &lt;em&gt;cdk-stack.ts file&lt;/em&gt; and create a &lt;em&gt;cdk.ts&lt;/em&gt;, let’s look at the content of the CDK stack in the next section.&lt;/p&gt;
&lt;h2&gt;
  
  
  Provision GraphQL via CDK
&lt;/h2&gt;

&lt;p&gt;Being a huge fan of &lt;a href="https://docs.aws.amazon.com/whitepapers/latest/introduction-devops-aws/infrastructure-as-code.html" rel="noopener noreferrer"&gt;Infrastructure as Code&lt;/a&gt; principle, I decided to create the GraphQL endpoint by using AWS CDK for Typescript language. Essentially, CDK abstracts CloudFormation stacks in a programmatic way. Below stack will provision:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;an AppSync GraphQL endpoint based on a &lt;a href="https://github.com/aladevlearning/appsync-lambda-authorizers/blob/main/cdk/graphql/schema.graphql" rel="noopener noreferrer"&gt;schema.graphql&lt;/a&gt; defining the model and a Lambda authorizer configuration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An &lt;em&gt;Authorizer&lt;/em&gt; Lambda function with its necessary IAM policies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A business-related &lt;em&gt;Payments&lt;/em&gt; Lambda function containing CRUD operation on as on a defined model (here the &lt;em&gt;Payment&lt;/em&gt; model) via its &lt;a href="https://graphql.org/learn/execution/" rel="noopener noreferrer"&gt;GraphQL resolvers&lt;/a&gt;. This Lambda is attached as a &lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-datasource.html" rel="noopener noreferrer"&gt;datasource to AppSync&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A DynamoDB table to persist the models.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Full code, outputting the GraphQL endpoint, can be found &lt;a href="https://github.com/aladevlearning/appsync-lambda-authorizers/blob/after-custom-resources/authorizer-app/client/amplify/backend/custom/lambdaAuthorizerCustomResource/cdk-stack.ts" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;

&lt;p&gt;&lt;br&gt;&lt;br&gt;
It is important to note that now you can use Amplify project metadata such as &lt;strong&gt;&lt;em&gt;project&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;environment&lt;/em&gt;&lt;/strong&gt; name  to define your resources at run-time.&lt;/p&gt;

&lt;p&gt;At the time of the writing I had to create a &lt;em&gt;cdk.ts&lt;/em&gt; file in order to initialize the stack and associate it with the app:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
Finally, let’s build and deploy the changes:
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;amplify build
cdk deploy --app "npx ts-node cdk.ts" --parameters env=dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Above steps could be manually performed AWS Console, but just with more steps and error-prone risk. Here below we show the visual output of the CDK:&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ASbWdB8ooe3YRocDetuPbcw.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ASbWdB8ooe3YRocDetuPbcw.gif"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Lens on Lambdas
&lt;/h2&gt;

&lt;p&gt;We have provisioned two Lambda functions: one  “&lt;em&gt;glueing&lt;/em&gt;” AppSync with DynamoDB as &lt;em&gt;datasource&lt;/em&gt; and one performing authorization checks. &lt;strong&gt;IMPORTANT:&lt;/strong&gt; Notice they have been prefixed with the data coming from our CDK stack: &lt;strong&gt;authorizerappdev.&lt;/strong&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Datasource Lambda
&lt;/h3&gt;

&lt;p&gt;The &lt;em&gt;Datasource&lt;/em&gt; Lambda leverages AWS SDK to perform CRUD actions on DynamoDB table. Below snippet showcases listing of payments, the rest can be looked at &lt;a href="https://github.com/aladevlearning/appsync-lambda-authorizers/tree/main/cdk/resources/payments" rel="noopener noreferrer"&gt;Github repo&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Authorizer Lambda
&lt;/h3&gt;

&lt;p&gt;AppSync forwards any client requests to this function, by providing an authentication token. For this PoC, I leverage an RSA key pair to verify the payload of an incoming JWT token and its signing via a public key previously generated. This is done by using the &lt;a href="https://github.com/auth0/node-jsonwebtoken" rel="noopener noreferrer"&gt;jsonwebtoken&lt;/a&gt; package.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
At this stage we just need a client consuming the GraphQL endpoint, so let’s look at it in details in the next section.
&lt;h2&gt;
  
  
  Integration with Amplify
&lt;/h2&gt;

&lt;p&gt;At the time of the writing (November 2021), the new Lambda authorizer is not yet available via Amplify CLI. This entails that we need to setup a manual integration with AppSync, which though is very simple.&lt;/p&gt;

&lt;p&gt;Assuming you have &lt;a href="https://docs.amplify.aws/cli/start/install/" rel="noopener noreferrer"&gt;&lt;em&gt;configured&lt;/em&gt; and &lt;em&gt;initiated&lt;/em&gt; Amplify&lt;/a&gt; in your project, All you need to do is to manually add this snippet as part of the Amplify &lt;em&gt;configure&lt;/em&gt; method, usually located in your App.js/ts file — if using React.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
To demonstrate the JWT verification, I have created a very dumb &lt;a href="https://github.com/aladevlearning/appsync-lambda-authorizers/blob/main/authorizer-app/client/src/App.js" rel="noopener noreferrer"&gt;React UI&lt;/a&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AQm1WWMtV3ShqYazZV8LgvQ.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AQm1WWMtV3ShqYazZV8LgvQ.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A JWT token gets generated by calling a local &lt;a href="https://www.fastify.io/" rel="noopener noreferrer"&gt;Fastify&lt;/a&gt;NodeJs server exposing a &lt;em&gt;generate-token&lt;/em&gt; endpoint. Details can be found &lt;a href="https://github.com/aladevlearning/appsync-lambda-authorizers/blob/after-custom-resources/authorizer-app/backend/server.js" rel="noopener noreferrer"&gt;here&lt;/a&gt;. The endpoint uses a private key in order to sign the generated JWT token, which then will be verified, as shown earlier, by the Lambda Authorizer function. In this case we just send a naïve foo/bar payload, but in real life must be much more complex and following &lt;a href="https://tools.ietf.org/id/draft-spencer-oauth-claims-00.html" rel="noopener noreferrer"&gt;Oauth claims&lt;/a&gt; more strictly. The call is performed by calling the API endpoint and providing a GraphQL query and the JWT token.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Lambda authorizers and Custom Resources are yet another weapon to the Amplify and AppSync arsenal, opening for a myriad of use cases and combinations of single and multiple authorizers and third-party integrations. This article is intended as a starting point for customers to start using the Lambda Authorizer feature and just showed a very simple implementation which can then be extended for more further refinement.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/about-aws/whats-new/2021/07/aws-appsync-supports-custom-authorization-with-aws-lambda-graphsql-apis/" rel="noopener noreferrer"&gt;&lt;strong&gt;AWS AppSync now supports custom authorization with AWS Lambda for GraphQL APIs&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://aws.amazon.com/blogs/mobile/building-scalable-graphql-apis-on-aws-with-cdk-and-aws-appsync/" rel="noopener noreferrer"&gt;&lt;strong&gt;Building Scalable GraphQL APIs on AWS with CDK, TypeScript, AWS AppSync, Amazon DynamoDB, and AWS…&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A server-less CI/CD approach for mono-repo micro-frontends</title>
      <dc:creator>Antonio Lagrotteria</dc:creator>
      <pubDate>Sat, 06 Nov 2021 13:39:33 +0000</pubDate>
      <link>https://dev.to/aws-builders/a-server-less-cicd-approach-for-mono-repo-micro-frontends-32m6</link>
      <guid>https://dev.to/aws-builders/a-server-less-cicd-approach-for-mono-repo-micro-frontends-32m6</guid>
      <description>&lt;p&gt;This article provides a CI/CD pipeline approach for a GitHub mono-repo-based micro-frontend architecture in AWS, leveraging a series of AWS server-less services such as AWS &lt;a href="https://aws.amazon.com/codepipeline" rel="noopener noreferrer"&gt;CodePipeline&lt;/a&gt;, &lt;a href="https://aws.amazon.com/codebuild" rel="noopener noreferrer"&gt;CodeBuild &lt;/a&gt;and &lt;a href="https://aws.amazon.com/codedeploy/" rel="noopener noreferrer"&gt;CodeDeploy&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Micro-frontends come with an increase of the complexity of managing the infrastructure, which makes it crucial for organizations to carefully invest their time in supporting continuous integration (CI), continuous deployment (CD) pipelines and automatic tools that scale along with the organization.&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%2Fcdn-images-1.medium.com%2Fmax%2F2400%2F1%2AIHjJA1RJpWif1UtWcjiD1g.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%2Fcdn-images-1.medium.com%2Fmax%2F2400%2F1%2AIHjJA1RJpWif1UtWcjiD1g.png" alt="A CI/CD for building mono repo micro-frontends"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The proposed approach provides a scalable option for organizations to scale their tech micro-frontend ecosystem, keep teams autonomous and let them focus on business and early feedback with a fast release cycle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some context: Mono and Poly repos
&lt;/h2&gt;

&lt;p&gt;Before diving in the architecture, let’s mention the main approaches for structuring a micro-frontend module.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Mono repos:&lt;/strong&gt; all the teams work on a single repository&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Poly (multi)-repos:&lt;/strong&gt; each domain specific micro-frontend is located in its own repository and owned by a single team.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This PoC will focus on a hands-on, detailed and pragmatic CI/CD setup based on a mono-repo with main branch as source of the pipelines changes. For a great overview and detailed comparison I recommend an upcoming &lt;a href="https://www.buildingmicrofrontends.com/" rel="noopener noreferrer"&gt;book &lt;/a&gt;from Luca Mezzalira.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;The architecture is based on a scenario where a company is implementing micro-frontends on a mono GitHub repository and wishes to implement a server-less CI/CD pipeline in AWS.&lt;/p&gt;

&lt;p&gt;For this PoC, the mono-repo contains two trivial Angular micro-frontends, &lt;em&gt;mfe-accounts&lt;/em&gt; and &lt;em&gt;mfe-payments&lt;/em&gt;, though this model allows you to write each module independently with any framework of choice:&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AbxYzUMH6TnjmGRwkXgC6GQ.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AbxYzUMH6TnjmGRwkXgC6GQ.png" alt="Mono-repo structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The scenario involves some steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Developers push their code to the main branch in GitHub, which will trigger a push event via &lt;a href="https://docs.github.com/en/developers/webhooks-and-events/webhooks/about-webhooks" rel="noopener noreferrer"&gt;GitHub webhooks&lt;/a&gt; to an &lt;a href="https://aws.amazon.com/api-gateway/" rel="noopener noreferrer"&gt;AWS API Gateway&lt;/a&gt; responsible to handle the event.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The API Gateway triggers an &lt;a href="https://aws.amazon.com/lambda/" rel="noopener noreferrer"&gt;AWS Lambda&lt;/a&gt; function which authenticates the request, analyses the event and, based on affected files, triggers a pipeline for the micro-frontend where the files belong to.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;One or more pipelines start building, testing and deployment actions via &lt;a href="https://aws.amazon.com/codepipeline/" rel="noopener noreferrer"&gt;AWS CodePipeline&lt;/a&gt;, &lt;a href="https://aws.amazon.com/codebuild/" rel="noopener noreferrer"&gt;CodeBuild &lt;/a&gt;and &lt;a href="https://aws.amazon.com/codedeploy/" rel="noopener noreferrer"&gt;CodeDeploy&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Changes are available in S3 bucket and exposed on a &lt;a href="https://aws.amazon.com/cloudfront/" rel="noopener noreferrer"&gt;Cloudfront&lt;/a&gt; distribution.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Lets deep dive in the setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  API gateway setup
&lt;/h2&gt;

&lt;p&gt;GitHub allows to setup integrations towards its events, such as repository pushes, via &lt;a href="https://docs.github.com/en/developers/webhooks-and-events/webhooks/about-webhooks" rel="noopener noreferrer"&gt;webhooks&lt;/a&gt;, which POST a GitHub event data payload towards an endpoint. Let’s expose a RESTful API in AWS via API Gateway containing a single POST endpoints as shown below:&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ANqZHmyRKTLt-7k8nCyIcZg.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ANqZHmyRKTLt-7k8nCyIcZg.gif" alt="Create API Gateway"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In above screen, we use a &lt;a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html" rel="noopener noreferrer"&gt;Lambda integration proxy&lt;/a&gt; because our associated “Hello World” Lambda will need to access the API Gateway request headers in order to authenticate GitHub upcoming requests. With the API in place, let’s create the webhook.&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub Webhook setup
&lt;/h2&gt;

&lt;p&gt;Once the API Gateway has been deployed in a stage, it is time to create a GitHub webhook, (refer to this &lt;a href="https://docs.github.com/en/github/setting-up-and-managing-your-enterprise/managing-organizations-in-your-enterprise-account/configuring-webhooks-for-organization-events-in-your-enterprise-account" rel="noopener noreferrer"&gt;intuitive guide&lt;/a&gt;). &lt;strong&gt;&lt;em&gt;Important&lt;/em&gt;&lt;/strong&gt;: provide a secret to make sure that our Lambda can accept requests only coming from the webhook (more on this later).&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AJQxroMYLlDxW0Rq6rORHuA.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AJQxroMYLlDxW0Rq6rORHuA.gif" alt="Create a GitHub webhook"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The integration is ready! Pushing a file to the repository will result in a “Hello world” message triggered by the Lambda, which can be seen under its stream logs in &lt;a href="https://aws.amazon.com/cloudwatch/" rel="noopener noreferrer"&gt;Cloudwatch&lt;/a&gt;. Let’s now update Lambda code to make sure that we support CI/CD for any micro-frontends in your repo.&lt;/p&gt;

&lt;h2&gt;
  
  
  Micro-frontend strategy on Lambda setup
&lt;/h2&gt;

&lt;p&gt;The ultimate goal of the Lambda function is that given a GitHub push event containing repo commits, then it triggers one or more pipelines for any affected micro-frontend. Let’s look in details at below gist:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First, Lambda authenticates requests only coming from the GitHub webhook by validating the SHA256 request header via a HMAC256 security check, using the crypto module. This check is based on the secret defined in the GitHub webhook earlier and also stored in AWS Secret Manager (follow &lt;a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/tutorials_basic.html" rel="noopener noreferrer"&gt;this tutorial&lt;/a&gt;). Lambda will access the secret in a secure way via the IAM action &lt;em&gt;secretsmanager:GetSecretValue&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once validated, the payload is used to infer which micro-frontends have been affected, by extracting its name from the added/modified and removed files from the commits list.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If any micro-frontend has changed, we trigger a new build in &lt;a href="https://aws.amazon.com/codepipeline/" rel="noopener noreferrer"&gt;AWS CodePipeline&lt;/a&gt; which will build and deploy the micro-frontend. For simplicity the pipeline is called the same as the micro-frontend which is going to build. The AWS SDK client library requires an IAM role allowing &lt;em&gt;codepipeline:StartPipelineExecution&lt;/em&gt; action to access the resource&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Overall Lambda code can be seen &lt;a href="https://github.com/aladevlearning/microfrontends-pipeline/blob/main/aws/lambdas/pipeline-ci/index.js" rel="noopener noreferrer"&gt;here&lt;/a&gt;. Now it is time to create the pipeline itself, which is part of the next section.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code Pipeline setup
&lt;/h2&gt;

&lt;p&gt;The creation of a Code Pipeline in AWS involves many steps and concepts, so I will try to keep it simple. Code Pipeline helps to automate release pipelines for fast and reliable application and infrastructure updates. Each steps, here called &lt;em&gt;stages&lt;/em&gt;, perform actions on the involved build artifacts. I will look into how:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create the pipeline by choosing some settings&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add a Source stage, answering the question “from where does the code to build come from?”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add a Build stage: “how do I build the source code you just provided?”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add a Deploy stage: “how and where do I deploy the build artifact you just provided?”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main idea will be to isolate each CodePipeline and CodeBuild project to give flexibility and ownership to each team to manage that process within the team. Optimizations such as reuse of pipelines for similar projects and CloudFormation template are out of scope.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create pipeline by choosing settings
&lt;/h3&gt;

&lt;p&gt;First, create a pipeline by providing a name matching the building micro-frontend and default settings, as shown below.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AS1ImESpU2mpnRv-LVsdoMA.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AS1ImESpU2mpnRv-LVsdoMA.gif" alt="First step of creating a pipeline."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Source Stage
&lt;/h3&gt;

&lt;p&gt;This stage links the source code to be processed with Code Pipeline. We will connect CodePipeline with our GitHub repo by clicking the Connect button and initiating a wizard.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ANpEkKgDO3-eb-VLZ3_RCZQ.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ANpEkKgDO3-eb-VLZ3_RCZQ.png" alt="Connect Pipeline with GitHub"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the end of the wizard, as shown below, you will be able:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;to access your GitHub repo (&lt;em&gt;aladevlearning/microfrontends-pipeline&lt;/em&gt; in my case)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;to select the *main *branch&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;to unselect the &lt;em&gt;Start pipeline on source code changes&lt;/em&gt;, as we want to have it handled by the Lambda function&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;and click Next to proceed to the next stage.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Above steps can be seen in below gif.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A2qMyfsPlTH1g3183CwJXxw.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2A2qMyfsPlTH1g3183CwJXxw.gif" alt="Add source stage in CodePipeline"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Build Stage
&lt;/h3&gt;

&lt;p&gt;This stage is responsible to build the source received in previous stage. It will create or reuse an existing *CodeBuild *project, which instructs the pipeline on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;how to run the build, via a &lt;em&gt;builspec.yml&lt;/em&gt; file.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;where CodeBuild will practically make the build&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In regards to &lt;em&gt;buildspec.yml&lt;/em&gt; we can decide whether having a common file for all micro-frontends or having one for each of them. This highly depends on whether all micro-frontends adhere to same framework of choice and same build / test steps. By keeping them separate you give each team independence on how to build it, at the cost of slightly more complex overview on build process and governance. For our micro-frontend, the file looks like below:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
A &lt;em&gt;buildspec.yaml&lt;/em&gt; consists of intuitive phases for installing/prepping the environment, building the code and instructing how to structure the artifacts. After getting the micro-frontend name from the pipeline initiator, the file installs dependencies and zips the final artifact, which will be deployed to S3 bucket specified in the Deploy section. See &lt;a href="https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html" rel="noopener noreferrer"&gt;this guide for more details&lt;/a&gt;.

&lt;p&gt;Finally, the building process requires an environment (aka: machine) where to run.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ArmXTOdRcT99YFm78HdnDsw.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ArmXTOdRcT99YFm78HdnDsw.gif" alt="Create a Code Build project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Above gif shows how CodeBuild configuration is based on a &lt;em&gt;build environment, *which represents a combination of operating system, programming language runtime, and tools that are used to run a build. We also selected a specific *buildspec.yml&lt;/em&gt; file location as each micro-frontend could differ in terms of build process and pipeline (e.g. one could be an Angular project and another be a React one, or both still using same framework but being built with different steps).&lt;/p&gt;

&lt;p&gt;Once the Code build project is setup, we set the build provider to be Code Build, we select the newly created Code Build project (&lt;em&gt;mfe-accounts-build&lt;/em&gt;) and continue to the final stage.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AYlPorAgo2sNf5lfw-We5nQ.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AYlPorAgo2sNf5lfw-We5nQ.gif" alt="Create Build stage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Build project created, let’s move to the final stage of CodePipeline.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deploy Stage
&lt;/h3&gt;

&lt;p&gt;Finally, we want to deploy our artifact on S3. In order to do that, we need to &lt;a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html" rel="noopener noreferrer"&gt;create S3 buckets&lt;/a&gt; where the artifact will be independently deployed. As CodeBuild will zip the built artifact, we check the &lt;em&gt;Extract file before deploy *settings and set the *Canned ACL&lt;/em&gt; to public-read, given we want to be able to see the deployed artifacts in S3.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AscmER-OcW5nDxIUHzEMPJA.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AscmER-OcW5nDxIUHzEMPJA.gif" alt="Create Deploy stage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s great! Your code is now deployed in S3 which allows to associate it with &lt;a href="https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-serve-static-website/" rel="noopener noreferrer"&gt;a CloudFront distribution&lt;/a&gt; for better deployment. Above steps for the CodePipeline should be repeated for any micro-frontend. This level of redundancy will allow each team to be independent and autonomous, tweak their CI/CD to&lt;/p&gt;

&lt;h2&gt;
  
  
  Result
&lt;/h2&gt;

&lt;p&gt;Upon push to repository affecting the micro-frontend containing the change, one or more code pipelines will start.&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ATxua6bFrunxGlwrBttboIA.gif" 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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2ATxua6bFrunxGlwrBttboIA.gif" alt="Pipelines coming alive"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Successful pipelines will look like this:&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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AGrH0Um70FpOdan4SIkFVmw.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%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2AGrH0Um70FpOdan4SIkFVmw.png" alt="Successful pipeline"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The deployed artifact is located under the specified S3 bucket:&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%2Fcdn-images-1.medium.com%2Fmax%2F3120%2F1%2AIsniGXK_oAwKXdtXUp6bhA.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%2Fcdn-images-1.medium.com%2Fmax%2F3120%2F1%2AIsniGXK_oAwKXdtXUp6bhA.png" alt="S3 bucket for deployed micro-frontend"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Associated with a Cloudfront distribution, our deployed micro-frontend will look as this:&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%2Fcdn-images-1.medium.com%2Fmax%2F3840%2F1%2ADuW0-nm785bugWCnNMPXPA.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%2Fcdn-images-1.medium.com%2Fmax%2F3840%2F1%2ADuW0-nm785bugWCnNMPXPA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Full code can be found &lt;a href="https://github.com/aladevlearning/microfrontends-pipeline" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary and ideas
&lt;/h2&gt;

&lt;p&gt;This article went in depth to provide a 10 minutes setup to make a seamless CI/CD pipeline for a mono-repo based frontend architecture. This should be seen as a workable, though initial approach which can be explored in so many ways, proving yet again how great and creative is to build things in AWS. Some ideas could be:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Have different pipelines to cover different needs, such as different framework, test suite, integration and functional testing, multi stage environment, etc…&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;publish artifacts in different AWS Accounts, one for test and one for production, to keep isolation and security in place.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extend approach for feature branch CI/CD, where you could created branch deployments for early prototyping and feedback, without blocking the main branch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Make the above as a CloudFormation template. This is a must to elevate this approach and consistently repeat it for any micro-frontend.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CloudFront invalidation step. If interested in adding CloudFront in the pipeline, a cache invalidation step via a Lambda function may be necessary to make sure all latest changes are correctly propagated to the consumers (or maybe AWS will take it as feedback and expose it as this seems a pretty used pattern).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/blogs/devops/complete-ci-cd-with-aws-codecommit-aws-codebuild-aws-codedeploy-and-aws-codepipeline/" rel="noopener noreferrer"&gt;&lt;strong&gt;Complete CI/CD with AWS CodeCommit, AWS CodeBuild, AWS CodeDeploy, and AWS CodePipeline | Amazon Web…&lt;/strong&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.buildingmicrofrontends.com" rel="noopener noreferrer"&gt;&lt;strong&gt;Building Micro-Frontends: the book&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>amplify</category>
      <category>microfrontends</category>
      <category>appsync</category>
    </item>
  </channel>
</rss>
