<?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: Mick Jacobsson</title>
    <description>The latest articles on DEV Community by Mick Jacobsson (@talkncloud).</description>
    <link>https://dev.to/talkncloud</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%2F488059%2Fea990e06-3aec-4187-b01c-ed880ba584ca.png</url>
      <title>DEV Community: Mick Jacobsson</title>
      <link>https://dev.to/talkncloud</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/talkncloud"/>
    <language>en</language>
    <item>
      <title>One simple trick to win Hackathons</title>
      <dc:creator>Mick Jacobsson</dc:creator>
      <pubDate>Sun, 31 Mar 2024 00:36:11 +0000</pubDate>
      <link>https://dev.to/aws-builders/one-simple-trick-to-win-hackathons-420</link>
      <guid>https://dev.to/aws-builders/one-simple-trick-to-win-hackathons-420</guid>
      <description>&lt;p&gt;Everyone has been approaching the AWS PartyRock Hackathon wrong in my opinion. Why try and think of an idea and create a new AI app when you can just use AI to think of the winning idea and write a summary to enter? You can't lose!&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS PartyRock
&lt;/h2&gt;

&lt;p&gt;AWS is recently hosted a &lt;a href="https://awspartyrockhackathon.devpost.com/"&gt;hackathon&lt;/a&gt; (ended on March 11, 2024), where participants were challenged to create an AI app using the PartyRock platform. Essentially, this involves leveraging AWS BedRock technology and offers a fun opportunity to explore AWS's generative AI services.&lt;/p&gt;

&lt;p&gt;If you're familiar with hackathons, this one follows the same format. Contestants will compete in various categories and have the chance to win CASH prizes. So, if a hackathon has a specific format, can we use AI to help us win?&lt;/p&gt;

&lt;h2&gt;
  
  
  Hackathon Hack a.k.a HackaThong
&lt;/h2&gt;

&lt;p&gt;My idea is straightforward: you give the user inputs that I'll use as context for the generative AI to create a winning suggestion. Instead of making this specific to just the AWS PartyRock competition, I'll make it more generic so that it can be reused.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Why HackaThong? I'm Australian, and we refer to rubber-style casual footwear, similar to sandals, as thongs or pluggers.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What do hackathons have in common?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Summary of the hackathon&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Terms and conditions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Criteria for judging&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Examples (often provided to inspire creativity)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This should give enough context for our AI to offer suggestions, but what about the output?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;A winning idea&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A catchy, unique name&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Some artwork to help visualize the idea&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A written summary describing the app&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An application to the competition that we can use as a starting point&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Time to build a thing
&lt;/h2&gt;

&lt;p&gt;I'm going to quickly explain how I built this with PartyRock. But first, I want to recommend a few articles that cover this topic in more detail (and better) than I will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://community.aws/tags/partyrock-hackathon"&gt;https://community.aws/tags/partyrock-hackathon&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://community.aws/content/2bpGEn7TeXH4XkL0Z4j4eSumK0v/master-prompt-engineering-elevate-ai-with-claude-partyrock"&gt;https://community.aws/content/2bpGEn7TeXH4XkL0Z4j4eSumK0v/master-prompt-engineering-elevate-ai-with-claude-partyrock&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I'm going to start with an empty app and just start adding widgets:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wBS9D6dD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1709516755548/9c69b127-c9bb-446a-b53e-a82b15dcb508.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wBS9D6dD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1709516755548/9c69b127-c9bb-446a-b53e-a82b15dcb508.png" alt="" width="800" height="121"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Instead of starting with an empty app you can write a description and PartyRock will have a crack at creating the app you might need.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Based on what we know, we need a lot of input from the user. So, for the first widgets, we'll create several &lt;strong&gt;user input&lt;/strong&gt; types:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gxRp7KIH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1709516960560/6f4eb1e1-e322-49a8-ade2-a8a15754f6c3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gxRp7KIH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1709516960560/6f4eb1e1-e322-49a8-ade2-a8a15754f6c3.png" alt="" width="800" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hopefully this is straightforward, title, placeholders etc.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The first couple of user input widgets are straightforward: they're simple text fields where the user can provide context about what the AI needs to do. Very little setup is neededjust name it and hit save.&lt;/p&gt;

&lt;p&gt;This is where the fun starts. The next few widgets will use the inputs from above to perform the AI magic. We then create an AI-Powered widget and link it to the previous input widgets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7mBQJ0JB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1709676774302/ab9ac73a-be05-4487-bc25-64ec5e6093fd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7mBQJ0JB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1709676774302/ab9ac73a-be05-4487-bc25-64ec5e6093fd.png" alt="" width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ds86hGAC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1709677083941/0b2326f1-8285-442a-8e3a-b9d41a9d9a22.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ds86hGAC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1709677083941/0b2326f1-8285-442a-8e3a-b9d41a9d9a22.png" alt="" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A few things to note:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;You can change the model based on your requirements, there is a brief description of the models &lt;a href="https://aws.amazon.com/bedrock/"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You design your prompt&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;From this point, we continue the process, creating more widgets until the app looks something like what we intended to develop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's talk about the fails
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The AI kept suggesting the same thing. For example, it would suggest a cooking app every time. I had to reword the prompt to resolve this, and even so, it can provide things that are pretty similar.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There is a word limit. Not too surprising. The terms and conditions are super long (expected), so there is a point in the T&amp;amp;Cs that I truncate to accept most of the content.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Initially, regenerating ideas was a bit dumb because I'd simply update the inputs. But,  there is a little refresh button on the widget to resolve this.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it out
&lt;/h2&gt;

&lt;p&gt;You can try out my app on &lt;a href="https://partyrock.aws/u/micks/e3Lmo_nd6/HackaThong"&gt;AWS Party Rock&lt;/a&gt;, it's a little bit of fun. Your mileage may vary on how useful it is to win a hackathon with, but hopefully, you can see some potential in generative AI.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Wtf is construct hub</title>
      <dc:creator>Mick Jacobsson</dc:creator>
      <pubDate>Wed, 14 Feb 2024 01:22:40 +0000</pubDate>
      <link>https://dev.to/aws-builders/wtf-is-construct-hub-1148</link>
      <guid>https://dev.to/aws-builders/wtf-is-construct-hub-1148</guid>
      <description>&lt;p&gt;If you've ever seen my &lt;a href="https://github.com/talkncloud/aws"&gt;github repo&lt;/a&gt; you'll know there are a bunch of cdk style projects in there that are usually paired with a blog explaining the details. These are examples of how to develop your own cdk apps but aren't a good example of a reusable &lt;a href="https://docs.aws.amazon.com/prescriptive-guidance/latest/best-practices-cdk-typescript-iac/constructs-best-practices.html"&gt;construct&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Construct hub was &lt;a href="https://aws.amazon.com/blogs/aws/announcing-general-availability-of-construct-hub-and-aws-cloud-development-kit-version-2/"&gt;launched&lt;/a&gt; towards the end of 2021 (oof, that long already), I vaguely remember the announcement and was keen to understand how it might work. I've always been aware of construct hub, but, tbh it's not front of mind when I'm looking at CDK and I haven't contributed to the catalog.&lt;/p&gt;

&lt;p&gt;Let's take a look at construct hub, I'll also provide a very basic example repo that should help others get into construct hub if they wish.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is construct hub?
&lt;/h3&gt;

&lt;p&gt;What I'm talking about is &lt;a href="https://constructs.dev/"&gt;constructs.dev&lt;/a&gt; aka construct hub.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Find and use open-source Cloud Development Kit (CDK) libraries&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;OK, so what this sounds like is a catalog of all CDK things. This reminds me a little of the npm registry but just for CDK.&lt;/p&gt;

&lt;p&gt;When I got to the homepage I notice a few things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A global search to find CDK libraries&lt;/li&gt;
&lt;li&gt;A search by publisher which appears to list top libraries split by community, AWS and Hashicorp&lt;/li&gt;
&lt;li&gt;Feature packages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So this looks pretty easy navigate we can assume that if I publish to construct hub that I would appear in the catalog as a community package. It makes sense that there would be other categories e.g. AWS and Hashicorp. When you consider the AWS CDK library this would fall under AWS and Hashicorp makes sense for the terraform providers. Terraform gets a little messy because the providers are often developed by third party companies.&lt;/p&gt;

&lt;p&gt;When developing cdk constructs I'm typically following the IntelliSense breadcrumbs and links to the AWS CDK API &lt;a href="https://docs.aws.amazon.com/cdk/api/v2/docs/aws-construct-library.html"&gt;reference&lt;/a&gt;. It looks like constructs hub provides that reference as well (guessing standard doc generation).&lt;/p&gt;

&lt;p&gt;TL;DR&lt;/p&gt;

&lt;p&gt;Construct hub is a catalog of all CDK libraries that have met the requirements (think package tags, license etc) to be ingested into the catalog. Construct hub provides a standard interface to surface documentation and links about the library that should help developers adopt and contribute to the library.&lt;/p&gt;

&lt;p&gt;Note: I mention NPM registry above as a comparison which is still correct imo, but one of the benefits of CDK is the jsii compiler. The benefit here being a library publishing to several different registries e.g. npm and python all discoverable from the same source.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do you get something into construct hub?
&lt;/h3&gt;

&lt;p&gt;This wasn't super obvious to me, I was guessing it was something along the lines of tagging your project with the correct tags (think npm style package.json) and that would be enough. But, there are a few more things.&lt;/p&gt;

&lt;p&gt;If you head over to the &lt;a href="https://constructs.dev/contribute"&gt;contribution&lt;/a&gt; docs on construct hub you will see the requirements:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Must be published to NPM&lt;/li&gt;
&lt;li&gt;Must have license (certain types)&lt;/li&gt;
&lt;li&gt;Must use &lt;a href="https://aws.github.io/jsii/"&gt;jsii&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There is also a link to a &lt;a href="https://dev.to/aws-builders/a-beginner-s-guide-to-create-aws-cdk-construct-library-with-projen-5eh4"&gt;guide&lt;/a&gt; that someone has written that probably explains this better than I can, be sure to check it out.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you do all this right you should see your construct appear in construct hub within about 30 minutes. construct hub seems to be polling at this interval for changes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;While the docs don't say you must use projen it does seem geared around using projen. There are benefits here, projen makes the whole jsii part a tad easier imo. But, projen is super opinionated to the point where it can be frustrating to use. It will come down to where you and your team are at if it's going to work for you. I &lt;a href="https://www.talkncloud.com/project-templating-for-cloud/"&gt;wrote a piece&lt;/a&gt; a while back about project templating (scaffolding) where I touch on projen.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hello Construct Hub, an npm package
&lt;/h3&gt;

&lt;p&gt;I think the best way to understand construct hub will be to publish something into construct hub. We know we need an NPM package and TypeScript works best for me. I'll be using projen to help get started knowing that we need to use jsii, projen will take care of a few things for us (github actions, build, etc).&lt;/p&gt;

&lt;p&gt;I've created a new package &lt;code&gt;hello-construct-hub&lt;/code&gt; and published to &lt;a href="https://constructs.dev/packages/hello-construct-hub"&gt;construct hub&lt;/a&gt;. The basic package is my take on the classic hello world, what is a basic IaC package in AWS I wonder? A bucket seems to be the best example I could think of.&lt;/p&gt;

&lt;p&gt;The construct will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Extend the existing AWS S3 Bucket Construct&lt;/li&gt;
&lt;li&gt;Take a single property: name, this will be to...you guessed it name the bucket&lt;/li&gt;
&lt;li&gt;All defaults remain the same for a bucket (refer to parent class)&lt;/li&gt;
&lt;li&gt;A bucket deployment will upload the readme.md into the bucket&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Diagram
&lt;/h4&gt;

&lt;p&gt;I like diagrams, here is a totally unnecessary simple diagram showing what the new construct provides:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx2dh4vdx9l3bretzgqkq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx2dh4vdx9l3bretzgqkq.png" alt="construct hub bucket diagram" width="431" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, users can use the published package (npm) to create a bucket with a semi predefined naming standard. Room for improvement but you get the idea. You get a simple consistent naming pattern for buckets with a single doc that might help users understand the intent of the bucket.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Because we are using jsii we would also be able to publish this to python as a pip package.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  What issues did I find?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Just projen things, like I said projen is very opinionated so I mainly had issues fighting my existing linters and working within what projen wants me to do (I realise you can override these).&lt;/li&gt;
&lt;li&gt;Github actions failed due to the self mutation action that's added in projen. What this does is run the build steps in an action and compare the output. If there are differences it will commit the changes to your branch. To do this you need a new token in your pipeline (PROJEN_GITHUB_TOKEN). This is optional, the step won't pass until fixed though if you care. The changes are likely docgen API docs that will appear in construct hub which I wanted. Also doing this locally would avoid this.&lt;/li&gt;
&lt;li&gt;You'll need a NPM registry token to publish your package, not an issue to be expected but just calling it out.&lt;/li&gt;
&lt;li&gt;Update your tests, you'll have a boiler plate test that will start failing after you update your construct so be sure to update your tests (not that you'd skip this part...am I right...eh).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Final thoughts
&lt;/h3&gt;

&lt;p&gt;Construct hub is going to suffer the same problem as other registries. Any projen package rightly or wrongly is going to end up in construct hub which may bring the quality of content down or make it harder to find what you're looking for. I wouldn't mind seeing another tag or something as a default for those projects who want to make that effort to publish.&lt;/p&gt;

&lt;p&gt;My initial thoughts before digging further into this was that I didn't really see the value in what construct hub was doing. All of this is available in the various registries that you probably already hang out in. But, once I started using it more and understood how things were presented, I concluded that I really should be using this as my go to. I like the standard layout with links to the repo, I like that the AWS CDK library is available here as well and I think the presentation is slightly better than the AWS version.&lt;/p&gt;

&lt;p&gt;I think my concerns over using projen with construct hub aren't really a problem, in the end you shouldn't need to use projen to get into construct hub. Just do all the things you need and it will appear. The AWS lib is an example of this.&lt;/p&gt;

&lt;p&gt;If you're a heavy CDK TF user I think that the Hashicorp "developed" providers are a little misleading, it would be nice if the original developer flowed through to the platform. The issue likely stems from upstream at the TF provider generation in the AWS CDK TF project. This is minor.&lt;/p&gt;

&lt;p&gt;One last thing that is worth a mention is that if you're starting out with CDK this is a good resource and links to other good resources. So when the questions come your way about getting started you can point them at construct hub and they should be able to get started.&lt;/p&gt;

&lt;p&gt;TL;DR&lt;/p&gt;

&lt;p&gt;Yeah, should probably start using construct even if its to consume other libraries.&lt;/p&gt;

&lt;p&gt;Here is a link to the github repo: &lt;a href="https://github.com/talkncloud/hello-construct-hub"&gt;https://github.com/talkncloud/hello-construct-hub&lt;/a&gt; you'll find the construct hub link in this article or in the repo.&lt;/p&gt;

&lt;p&gt;Image banner credits: Photo by &lt;a href="https://unsplash.com/@mattwridley?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash"&gt;Matt Ridley&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/white-paper-plane-on-white-background-Lyl8RL7imrw?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>cdk</category>
    </item>
    <item>
      <title>The death of forestry.io</title>
      <dc:creator>Mick Jacobsson</dc:creator>
      <pubDate>Sun, 04 Feb 2024 04:24:31 +0000</pubDate>
      <link>https://dev.to/aws-builders/the-death-of-forestryio-1pi</link>
      <guid>https://dev.to/aws-builders/the-death-of-forestryio-1pi</guid>
      <description>&lt;p&gt;When I migrated from &lt;a href="https://www.talkncloud.com/ghost-pro-migration-hugo-static-aws/"&gt;Ghost Pro to hugo&lt;/a&gt; I stumbled across &lt;a href="https://tina.io/forestry/"&gt;forestry.io&lt;/a&gt;, a CMS for my static site. It seemed to be everything I was looking for, something to bridge that small gap between writing markdown content and having a nice editor with workflows. It wasn't perfect but I stuck with it.&lt;/p&gt;

&lt;p&gt;What has replaced forestry.io and is it any good?&lt;/p&gt;

&lt;h3&gt;
  
  
  Why though?
&lt;/h3&gt;

&lt;p&gt;Like I said, It bridges a small gap. You don't need forestry, you can just use the IDE of choice and churn out markdown but it gets a little old. I like the finer things in life and one of those is lightweight CMS.&lt;/p&gt;

&lt;p&gt;Something we should clear up before we go further. I'm not happy about this at all. I'm only "trying" out forestry on a small single site for personal use. Considering they've ended forestry and moved onto another project is something to consider before moving to the alternative. Sh*t happens.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I'll talk about something that I'd like when we wrap up at the end.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  TinaCMS
&lt;/h3&gt;

&lt;p&gt;If you've used forestry.io you would already know that it has been replaced with &lt;a href="https://tina.io/"&gt;TinaCMS&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Forestry.io team is focused on building TinaCMS, the next iteration of our vision. See the migration guide or test it with the following command.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Not really any clues here as to what has happened. The internet probably knows but I'm not chasing the juicy details, I want progress. That is TinaCMS for now so we'll take a look a migrating.&lt;/p&gt;

&lt;p&gt;The good news is that TinaCMS appears to be built some sort of migration around forestry to the new "vision". So lets try that and see how it goes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Another migration
&lt;/h3&gt;

&lt;p&gt;Yes, I was less than thrilled at migrating to something else.&lt;/p&gt;

&lt;p&gt;Good news, the docs look pretty decent. Easily to follow and they include videos for those who prefer that approach. Following the migration &lt;a href="https://tina.io/docs/forestry/migrate/"&gt;guides&lt;/a&gt; we can see it's pretty simple, go to your web root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx @tinacms/cli@latest init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pretty much just answer Y to everything.&lt;/p&gt;

&lt;p&gt;What you'll hopefully end up with is a new tina configuration file with package management and some shiny new additions to your gitignore. The main config.ts is where I've been finding most of the interesting bits and pieces, I had to play around with the path the most for both root and media. So check that out.&lt;/p&gt;

&lt;p&gt;Next you'll need to start your local development server, tina has something for that too, this is what it looks like for my local hugo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx tinacms dev - c &lt;span class="s2"&gt;"hugo server -D -p 1313"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will launch the web server locally and you can access the web admin site on...you guessed it http://localhost:1313.&lt;/p&gt;

&lt;p&gt;Now, if everything went OK you should see your content. You'll see your existing pages, media etc.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: Mess around with the config.ts path for content and media if you don't see your site content.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Using Tina
&lt;/h3&gt;

&lt;p&gt;The user interface isn't too exciting, not that it needs to be. Creating a new page is straight forward, because Tina completed a migration I'm assuming it has collected all of my previous key fields (can be seen in config) and now they become inputs for a new page. For example, I have a field named type which I use to manage &lt;a href="https://tina.io/docs/drafts/drafts-fields/"&gt;drafts&lt;/a&gt; and features. This helps me to work on pages over a period of time without making a mistake a making it live. The other is to push pages to the top that i want featured, this is usually my latest articles.&lt;/p&gt;

&lt;p&gt;The user interface looks something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F20ww1cm8aymlusaa4q1g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F20ww1cm8aymlusaa4q1g.png" alt="TinaCMS Admin" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Wen Cloud?
&lt;/h3&gt;

&lt;p&gt;Tbh, I'm little hesitant to fully invest time into TinaCMS right now. I'm grateful that the migration was pretty smooth but generally didn't like having to migrate and spend time on this. I was using forestry cloud for a while and preferred the hosted cloud admin of forestry even with it's problems. For now, I'll continue to test out using TinaCMS with the local admin to update content and think about how I want to move forward.&lt;/p&gt;

&lt;p&gt;I don't mind the idea how hosting the admin part of out my hosting in AWS but would need to manage secure access, which is something I wanted to avoid for this site. I like to keep this isolated where possible to some extent.&lt;/p&gt;

&lt;h3&gt;
  
  
  Is there another way?
&lt;/h3&gt;

&lt;p&gt;What do I really want in a content editor. Over the years I've used enterprise level CMS and have hated them but they usually have a place. I've used open source ones which have been somewhere in between and usually more acceptable given the cost.&lt;/p&gt;

&lt;p&gt;When I first started going down the path of static sites I was hooked, this is the way. Fast, affordable hosting of static content, but managing that content is a bit clunky.&lt;/p&gt;

&lt;p&gt;I don't want a hosted CMS to manage my content. I'm a simple guy, I wonder if there is something in Visual Studio Code that can provide the editor experience I want coupled with a local development server for viewing changes...&lt;/p&gt;

&lt;p&gt;I'd be keen to hear if you come across this already and have any suggestions???&lt;/p&gt;

&lt;p&gt;Quick mention for further reading, this site is hosted on AWS for cheaps, like cents, I wrote an article about how I do that if you're interested: &lt;a href="https://www.talkncloud.com/ghost-pro-migration-hugo-static-aws/"&gt;https://www.talkncloud.com/ghost-pro-migration-hugo-static-aws/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Image banner credits: Photo by &lt;a href="https://unsplash.com/@marnovais?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash"&gt;Marcelo Novais&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/brown-bare-tree-on-white-sand-during-daytime-6w_t3n-WTtI?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cms</category>
      <category>webdev</category>
    </item>
    <item>
      <title>No fuss no muss TypeScript Lambda with CDK</title>
      <dc:creator>Mick Jacobsson</dc:creator>
      <pubDate>Sat, 18 Mar 2023 04:25:29 +0000</pubDate>
      <link>https://dev.to/aws-builders/no-fuss-no-muss-typescript-lambda-with-cdk-5a30</link>
      <guid>https://dev.to/aws-builders/no-fuss-no-muss-typescript-lambda-with-cdk-5a30</guid>
      <description>&lt;p&gt;One of the great things about AWS Lambda is the flexibility to develop functions in a bunch of different languages like Python, Node.js, Go and some others. CDK allows us to easily create and maintain these functions (among other things) but if you need to build any assets or use typescript for Lambda you'll need to handle this before you can deploy the function. This isn't uncommon and many folk would be doing this already in pipelines etc but there is a super easy way to do this in CDK that might just come in handy...&lt;/p&gt;

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

&lt;p&gt;Creating a new Lambda function in CDK is pretty straight forward, it only takes a few lines of code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;lambda&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Function&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="na"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;lambda&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Runtime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NODEJS_18_X&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;index.handler&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;code&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;lambda&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Code&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromAsset&lt;/span&gt;&lt;span class="p"&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;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;__dirname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;lambda-handler&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;p&gt;Source: &lt;a href="https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html"&gt;https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.Function.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This of course will work perfect fine for any Lambda's that you've written that don't need any further build steps or you've already built.&lt;/p&gt;

&lt;p&gt;But what if...&lt;/p&gt;

&lt;h3&gt;
  
  
  The other way with typescript
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;nodeJsFunction&lt;/code&gt; CDK construct (available in the aws-lib) provides build capability with &lt;code&gt;esbuild&lt;/code&gt;. I recommend checking out the &lt;a href="https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_nodejs-readme.html"&gt;documentation&lt;/a&gt; it goes into great detail covering a bunch of different scenarios.&lt;/p&gt;

&lt;p&gt;If you follow the construct way of structuring and naming your files you can create a very simple typescript lambda with a few lines of code, like the previous example but this also builds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nx"&gt;lambdaFunction&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;lambda&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;NodejsFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;demo&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="na"&gt;functionName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;talkncloud-demo-function&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;p&gt;The above code snippet will build the typescript lambda if it's located in the same directory as your stack and follows the same naming convention with &lt;code&gt;.id&lt;/code&gt; on the end. It is also expected that the handler is named &lt;code&gt;handler&lt;/code&gt;, you've probably seen this in the other constructs.&lt;/p&gt;

&lt;p&gt;Of course, you don't have to do it this way, you can structure your project however you want, you'll just need to update the props to your location (see my code example at the end).&lt;/p&gt;

&lt;h4&gt;
  
  
  Building
&lt;/h4&gt;

&lt;p&gt;To use this method of building you'll need to either have &lt;code&gt;esbuild&lt;/code&gt; installed or &lt;code&gt;docker&lt;/code&gt;. If CDK can't find esbuild it will run a container with everything needed to run the build. Pretty sweet.&lt;/p&gt;

&lt;p&gt;There are no extra steps required to run the build, this construct works in nicely with your existing workflow, simply run CDK synth:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cdk synth
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CDK Synth will automatically run esbuild with any specific configuration you've supplied and generate the build files.&lt;/p&gt;

&lt;h4&gt;
  
  
  Testing
&lt;/h4&gt;

&lt;p&gt;If you want to test your new typescript lambda locally you can easily do this with &lt;code&gt;sam&lt;/code&gt;. To this you'll first need to be authenticated (aws login) and have docker running, for tips on easy authentication tooling check out my &lt;a href="https://www.talkncloud.com/aws-sso-multiple-accounts/"&gt;previous post&lt;/a&gt;. Oh, and you'll need &lt;a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html"&gt;sam&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;sam &lt;span class="nb"&gt;local &lt;/span&gt;invoke demo &lt;span class="nt"&gt;-t&lt;/span&gt; cdk.out/MyStack.template.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can find more documentation on locally testing Lambda with sam including testing with events in the official &lt;a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-cdk-getting-started.html"&gt;docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: this assumes you've run synth first&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Final thoughts
&lt;/h3&gt;

&lt;p&gt;The nodeJsFunction is handy way for you to leverage esbuild that fits in nicely with CDK. The construct has been built in a way that provides a lot of flexible and consideration for different requirements such as mono repos, customization and package dependencies. If you're already using a different build process or you're looking for alternative to smooth out the process I recommend checking it out.&lt;/p&gt;

&lt;p&gt;I've added some sample code to the talkncloud repo, if you'd like to check it out it will deploy a working lamdba function written in typescript using the construct mentioned in this post.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/talkncloud/aws/tree/main/lambda-nodejs"&gt;https://github.com/talkncloud/aws/tree/main/lambda-nodejs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Are you already using this construct, how's it going for you, any tips?&lt;/p&gt;

&lt;p&gt;Credits: Article photo by &lt;a href="https://unsplash.com/@reskp?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Jametlene Reskp&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/W36m2sQkjzM?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>typescript</category>
      <category>lambda</category>
    </item>
    <item>
      <title>Easy as SSO tooling with Granted AWS</title>
      <dc:creator>Mick Jacobsson</dc:creator>
      <pubDate>Sun, 12 Mar 2023 06:05:17 +0000</pubDate>
      <link>https://dev.to/aws-builders/easy-as-sso-tooling-with-granted-aws-12n9</link>
      <guid>https://dev.to/aws-builders/easy-as-sso-tooling-with-granted-aws-12n9</guid>
      <description>&lt;p&gt;No doubt about it, &lt;a href="https://aws.amazon.com/iam/identity-center/"&gt;AWS SSO&lt;/a&gt; (or should I say IAM Identity Centre?) is a great addition to the overall access management and security in AWS. But, as you mature in the cloud with a touch of &lt;a href="https://aws.amazon.com/organizations/"&gt;AWS Organizations&lt;/a&gt; and dash of &lt;a href="https://aws.amazon.com/architecture/well-architected/"&gt;well-architected framework&lt;/a&gt; you'll soon have many AWS accounts and managing all of those accounts kind of sucks.&lt;/p&gt;

&lt;p&gt;I should mention, I really didn't want to change tooling again, I was using a bunch of different tools to manage CLI and web access and the thought of configuring a new tool or tools didn't sound like a fun time but I was also very much over the default tools from AWS.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's the problem?
&lt;/h3&gt;

&lt;p&gt;OK, let's set the scene using the example above, you have multiple AWS accounts in the same organization. Let's say you have development, non-production and production accounts, each one being a separate AWS account.&lt;/p&gt;

&lt;h4&gt;
  
  
  Web Console
&lt;/h4&gt;

&lt;p&gt;Using a browser (choose your poison) jump over to your AWS SSO start url and select the account and role to access the management console. This should launch a new tab or window with the management console for that account, now do it again for another account...the previous sessions is no longer valid. Let's say you wanted to compare development to production in the management (pretty common), you can't easily do that (incognito / private).&lt;/p&gt;

&lt;h4&gt;
  
  
  Local CLI
&lt;/h4&gt;

&lt;p&gt;This one is less of issue but you can use the &lt;code&gt;aws cli&lt;/code&gt; to start sessions using your organization SSO just fine. It can just get out of control quickly when you have many accounts, you have to review your config or just remember the names of your profiles.&lt;/p&gt;

&lt;h4&gt;
  
  
  Previous workarounds
&lt;/h4&gt;

&lt;p&gt;Before SSO there were (are) a few brilliant projects out there that really helped out:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/tilfinltd/aws-extend-switch-roles"&gt;AWS Extend Switch Roles&lt;/a&gt; Chrome browser extension&lt;/p&gt;

&lt;p&gt;This is a neat tool that would label your browser session with a different colour and name which made it obvious which account you were in. I really enjoyed this part of the extension as well as being able to switch accounts easily. It didn't support AWS SSO sometime ago but there is mention of it now.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EOdPwjTy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://github.com/tilfinltd/aws-extend-switch-roles/raw/images/ScreenShot_1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EOdPwjTy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://github.com/tilfinltd/aws-extend-switch-roles/raw/images/ScreenShot_1.png" alt="AWS Extend Switch Roles Screen Shot" title="AWS Extend Switch Roles Screen Shot" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/victorskl/yawsso"&gt;YAWSSO&lt;/a&gt; cli tool&lt;/p&gt;

&lt;p&gt;A handy little tool to sync up your SSO session tokens with the old style AWS CLI tokens to make it work with other tools like AWS CDK.&lt;/p&gt;

&lt;p&gt;You start to get the idea, this is just a couple of examples, I didn't mention any vault or azure login tools which come to mind. The state of account access and management is spread across many different projects and is a delicate ecosystem.&lt;/p&gt;

&lt;p&gt;If I were to summarize what a solution might look it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Handle multiple concurrent sessions in the web based management console&lt;/li&gt;
&lt;li&gt;Easily identify which account and role you're using&lt;/li&gt;
&lt;li&gt;A better way to manage CLI access for multiple accounts without having to remember all of the details&lt;/li&gt;
&lt;li&gt;Ideally one tool to manage the lot without workarounds for syncing etc&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The search
&lt;/h3&gt;

&lt;p&gt;Like most problems I started with the typical search for AWS SSO CLI and console related tools to help out. One of the write-ups that stood out for me was from &lt;code&gt;Corey Quinn&lt;/code&gt; - &lt;a href="https://www.lastweekinaws.com/blog/taking-aws-account-logins-for-granted/"&gt;taking aws logins for granted&lt;/a&gt; (fun fact: the title of this article was almost identical without me even noticing, you win this round Corey). The article really hit home the problems I was having and suggested the use of &lt;a href="https://github.com/common-fate/granted"&gt;Granted&lt;/a&gt; (github link) (&lt;a href="https://granted.dev/"&gt;Granted.dev&lt;/a&gt; has some nice info).&lt;/p&gt;

&lt;p&gt;Now for me, Granted really solved all of the shortcomings in the AWS CLI and web management console particularly around multiple accounts but also added a few nice features I didn't know I needed until now...&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Granted AWS Logins&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When I think about Granted it does everything that I wanted and more, it's super easy to install, super easy to configure and super easy to use. I'm not going to go into much detail on the install and configuration, the &lt;a href="https://docs.commonfate.io/granted/getting-started"&gt;Granted docs&lt;/a&gt; are excellent and say it better than I can.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I'm going to assume you already have the aws CLI configured, I won't really be talking about creating configs in details.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Installation on MacOS is a simple brew tap and install, this will add the developer repo and install the Granted tools. Once it's installed you'll need to run through the configuration.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Before you begin I strongly recommend installing Firefox for your browser as containers are better than Chrome's incognito. Do you self a favour and install Firefox.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once you've installed Granted the configuration is pretty simple, you'll notice a program &lt;code&gt;granted&lt;/code&gt; which can be run from the terminal. When you run this the first time a CLI wizard will guide you through the steps to auto-configure your granted setup using your existing aws configs and add the extension to your browser.&lt;/p&gt;

&lt;p&gt;This typically takes less than a minute.&lt;/p&gt;

&lt;p&gt;Configuration done....&lt;/p&gt;

&lt;p&gt;To use &lt;code&gt;granted&lt;/code&gt; you will use the &lt;code&gt;assume&lt;/code&gt; command from the terminal, the &lt;code&gt;assume&lt;/code&gt;command will provide a list of profiles that you would like to assume. If you don't have a valid token already it will run you through the login setups (similar to AWS SSO), if you do have a valid session it will refresh your token.&lt;/p&gt;

&lt;p&gt;Here is a screen shot from the granted docs showing what happens when you run assume, notice the dropdown like menu, this is ordered by frequency (configurable):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v6M3WURp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://docs.commonfate.io/assets/images/cli-screenshot-8656056bb94eeeab63f53864150b568a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v6M3WURp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://docs.commonfate.io/assets/images/cli-screenshot-8656056bb94eeeab63f53864150b568a.png" alt="A screenshot of Granted showing a selection menu for AWS profiles" title="granted aws profiles" width="800" height="325"&gt;&lt;/a&gt;If you want to start an AWS web management console session you just add a parameter &lt;code&gt;assume -c&lt;/code&gt;. The screenshot from the granted docs below showing what Granted looks like in the browser:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oEEkSwKy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://docs.commonfate.io/assets/images/tab-containers-90cb491e1bb40924c6b3a57fff78baf8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oEEkSwKy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://docs.commonfate.io/assets/images/tab-containers-90cb491e1bb40924c6b3a57fff78baf8.png" alt="A screenshot of the AWS Console on Firefox with two tabs: the first tab is blue and is the 'role-a' profile, and the second tab is orange and is the 'role-b' profile" title="granted web console screenshot" width="800" height="665"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice the different colour lines in the tabs, one is blue and one is orange, notice the &lt;code&gt;role-b&lt;/code&gt; in orange with an icon. Helping you to identify which session you are in but also allow concurrent sessions, each running in it's own firefox container.&lt;/p&gt;

&lt;h3&gt;
  
  
  You wanted more?
&lt;/h3&gt;

&lt;p&gt;Like I said, Granted does much more and most of the options are configurable to some extent:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.commonfate.io/granted/usage/storing-iam-credentials-securely"&gt;Encrypted session tokens&lt;/a&gt; (Keyring for Mac)&lt;/li&gt;
&lt;li&gt;Customise colours and icons&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.commonfate.io/granted/usage/profile-registry"&gt;Sync your profiles&lt;/a&gt; to a repo to share with your team (we all want that)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.commonfate.io/granted/usage/dotenv"&gt;Dot env variable&lt;/a&gt; export for those local development times&lt;/li&gt;
&lt;li&gt;Don't have any SSO configs yet? &lt;a href="https://docs.commonfate.io/granted/usage/automatic-config-generation"&gt;Granted can generate&lt;/a&gt; them from your SSO session&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And the list goes on...&lt;/p&gt;

&lt;h3&gt;
  
  
  Final thoughts
&lt;/h3&gt;

&lt;p&gt;Stop what you're doing and setup Granted, not tomorrow, not next week, just do it now. I promise it is a simple as it sounds and you'll be wishing you had done it sooner. Everything just works and it greatly improves your workflow and easier to work with others using it also. Be sure to check to the Granted docs if you want specifics on what was discussed today. Shout out to Corey from Last Week In AWS for the initial write up which got me headed in the right direction.&lt;/p&gt;

&lt;p&gt;Do you have an alternative that works for you? Maybe better than Granted? Please share, I'd love to hear from others about what works for them.&lt;/p&gt;

&lt;p&gt;Credits: Article photo by &lt;a href="https://unsplash.com/@studioblackthorns?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Studio Blackthorns&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/JNEJsMI5c3M?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>tooling</category>
      <category>cli</category>
    </item>
    <item>
      <title>Project templating cloud</title>
      <dc:creator>Mick Jacobsson</dc:creator>
      <pubDate>Tue, 21 Feb 2023 21:49:07 +0000</pubDate>
      <link>https://dev.to/aws-builders/project-templating-cloud-388e</link>
      <guid>https://dev.to/aws-builders/project-templating-cloud-388e</guid>
      <description>&lt;p&gt;So you've started using &lt;a href="https://docs.aws.amazon.com/cdk/v2/guide/home.html"&gt;AWS CDK&lt;/a&gt;, you've shipped a few projects, you've shared your findings with your team and now they've started using CDK...then you start to notice the subtle differences in how developers have created their projects, dot files, style, folder structure and the usage of custom constructs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How do you start a new project? "Easy as, I just copy and paste it from a previous project and change out the bits I need"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You start to see the problem, If we use a typical CDK project as an example, you might have AWS CDK constructs, your constructs and your team dot files plus any other custom configs needed, CI/CD etc.&lt;/p&gt;

&lt;p&gt;How do you promote consistency for apps outside of just constructs that isn't too hard to maintain and easily shared?&lt;/p&gt;

&lt;h3&gt;
  
  
  What can we do?
&lt;/h3&gt;

&lt;p&gt;I reached out to the devtools folk in &lt;a href="https://aws.amazon.com/developer/community/community-builders/"&gt;AWS Community Builder&lt;/a&gt;, surely there are others who have faced the same problem? What kind of tools were others usings? Not too surprising, &lt;code&gt;projen&lt;/code&gt; got a mention as did &lt;code&gt;cdk init&lt;/code&gt; and older popular choices like &lt;code&gt;yeoman&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I next combined the options from above with others found online:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Comments&lt;/th&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CDK init&lt;/td&gt;
&lt;td&gt;Built-in scaffolding tool&lt;/td&gt;
&lt;td&gt;typescript&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Projen&lt;/td&gt;
&lt;td&gt;Popular in the CDK community&lt;/td&gt;
&lt;td&gt;typescript&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hygen&lt;/td&gt;
&lt;td&gt;Newer tool, aiming to tackle project local templating (not limited to)&lt;/td&gt;
&lt;td&gt;javascript&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Yeoman&lt;/td&gt;
&lt;td&gt;Has been around for a long time, stable, good understanding of the problem&lt;/td&gt;
&lt;td&gt;javascript&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h4&gt;
  
  
  Key considerations
&lt;/h4&gt;

&lt;p&gt;When I talk about templating or scaffolding there are a few things that come to mind that would be considered, key considerations. It can be easy to suggest that templating is a simple file copy and the need for more developed tools might be unnecessary. Also worth noting that often templating, scaffolding, project generators are synonymous with each other. I'll try to highlight some of the key considerations but as you read you might start to think of more:&lt;/p&gt;

&lt;h5&gt;
  
  
  Composition
&lt;/h5&gt;

&lt;p&gt;Something that I identified in the earlier example is code reuse, once your team have a working project that is agreed within the team, we just want to use that for all similar projects moving forward. We want to layer or compose many templates or files to produce a single project output.&lt;/p&gt;

&lt;p&gt;Something I touched on earlier is code reuse, once you have a working project you want to identify the different layers of your template. The project generator that you end up using should help support that workflow. We want to compose many layers or templates that produce a single project output. An example for CDK might be an empty CDK project and then more complex patterns on top e.g. web app, web API etc. The final template is one you'd likely change the most and the base CDK template could be updated, those changes would be consistent across all projects that use the base layer.&lt;/p&gt;

&lt;h5&gt;
  
  
  Placeholders
&lt;/h5&gt;

&lt;p&gt;When I refer to placeholders I refer to string replacement at a minimum but often this includes transformation e.g. to uppercase. Because our templates are generic you will often want to replace generic placeholders like a project name with the actual name. You may have seen examples of this such as handlebars e.g. &lt;code&gt;{{ swapThis }}&lt;/code&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Global vs Local
&lt;/h5&gt;

&lt;p&gt;A global generator would live outside of the project, its likely installed as an NPM package and you can call it whenever you want to produce a whole project (can do partials, but I'll focus on complete). Local generators often reside within the project, they are maintained in the same repo, they will often be able to render components.&lt;/p&gt;

&lt;h5&gt;
  
  
  Package
&lt;/h5&gt;

&lt;p&gt;Once a new template has been created we want to be able to distribute, maintain and version the templates. This will likely be through the use of existing package managers such as NPM.&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's do some stuff
&lt;/h3&gt;

&lt;p&gt;I'm going to look at &lt;strong&gt;Projen&lt;/strong&gt;, &lt;strong&gt;Hygen&lt;/strong&gt; and &lt;strong&gt;Yeoman&lt;/strong&gt;. The built-in CDK scaffolder can be used but isn't strictly a project templating or generator tool. When you run cdk init for a typescript CDK app project you'll get something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw3rn21g0nik1edspiywa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw3rn21g0nik1edspiywa.png" alt="cdk init folder" width="800" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Cdk init will be OK for plenty of people, use what works for you and your team.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There isn't any other customization here for CDK init, job done, this is why we won't be looking at it any more detail and moving onto the others.&lt;/p&gt;

&lt;h3&gt;
  
  
  Projen
&lt;/h3&gt;

&lt;p&gt;I recommend visiting the github page for &lt;a href="https://github.com/projen/projen"&gt;projen&lt;/a&gt; and flicking through the documentation as I won't do it justice. Projen aims to:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Define and maintain complex project configuration through code", sounds great!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you've been using CDK for a while you've probably heard of or used projen, it's getting lots of traction and is popular in the community.&lt;/p&gt;

&lt;p&gt;Let's take a look at the basics:&lt;/p&gt;

&lt;h4&gt;
  
  
  Install
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx projen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  New project
&lt;/h4&gt;

&lt;p&gt;Creating a project, as in working project output to be used by users is simple enough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx projen new awscdk-app-ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are multiple project types not limited to CDK, check out the full list of &lt;a href="https://github.com/projen/projen#project-types"&gt;project types&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  How projen works
&lt;/h4&gt;

&lt;p&gt;In the example above we've create a CDK app, not a custom construct. The way projen handles configuration of your project is through the &lt;code&gt;.projenrc.js&lt;/code&gt; file located in the root of the project.&lt;/p&gt;

&lt;p&gt;The projen way is to handle all configuration of your project through code, you will notice that all of the dot files are now read-only. Instead if you want to modify the package.json for example you will need to use the &lt;code&gt;.projenrc.js&lt;/code&gt; to define your properties:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;awscdk&lt;/span&gt; &lt;span class="p"&gt;}&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;projen&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;project&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;awscdk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AwsCdkTypeScriptApp&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;cdkVersion&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2.1.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;defaultReleaseBranch&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="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;projen-example&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

  &lt;span class="na"&gt;deps&lt;/span&gt;&lt;span class="p"&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;prettier&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="c1"&gt;// simple example of adding dependency&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nx"&gt;project&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;synth&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you've updated the projen file you can re-run projen to apply those changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx projen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;a href="https://projen.io/api/API.html"&gt;API reference&lt;/a&gt; for projen is extensive and there is a fair bit of chatter on the internet available to get you going. But, if you like idea of boilerplate projects and the projen ways I recommend checking it out. Even if you don't it's worth keeping any eye on the project to see what's coming or if you can help out.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hygen
&lt;/h3&gt;

&lt;p&gt;I stumbled across &lt;a href="https://github.com/jondot/hygen"&gt;hygen&lt;/a&gt; while looking for solutions to project generators and was pleasantly surprised. Like the previous example, checkout the project page to get the full write up, here is what hygen is about:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Hygen is the simple, fast, and scalable code generator that lives &lt;em&gt;in&lt;/em&gt; your project."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What I like about this one is that everything in the quote about is so true once you start to unpack everything hygen has to offer.&lt;/p&gt;

&lt;h4&gt;
  
  
  Install
&lt;/h4&gt;

&lt;p&gt;The &lt;a href="https://github.com/jondot/hygen#quick-start"&gt;quickstart guide on github&lt;/a&gt; has a bunch of different ways to hit the ground running, I'll show you using npm:&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;span class="nt"&gt;-g&lt;/span&gt; hygen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  New Project
&lt;/h4&gt;

&lt;p&gt;I'm going to step through this at a high-level showing project local mode, this is what hygen is all about but know that it isn't limited to local and docs show you how to create a global generator. When in project local mode your template lives a long side your project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;hygen init self
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll notice when you do this you get a bunch of files and folders you've never seen before, this is the hygen templating at work. Your core project would live at the top level and hygen would read the _templates folder (if present) for available options.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5lzw2hggidkrepfjp9c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5lzw2hggidkrepfjp9c.png" alt="hygen folder" width="800" height="619"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  How Hygen works
&lt;/h4&gt;

&lt;p&gt;As mentioned above, the default is to run in project local mode, the files added to your local project instruct hygen how to run. Out of the box you get generator documentation and prompting which provides a UI for users to step through. Hygen handles file copying and manipulation using &lt;a href="https://www.hygen.io/docs/templates#frontmatter"&gt;frontmatter&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="o"&gt;---&lt;/span&gt;

&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;stack&lt;/span&gt;&lt;span class="o"&gt;-&amp;lt;%=&lt;/span&gt;&lt;span class="nx"&gt;name&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;ts&lt;/span&gt;

&lt;span class="o"&gt;---&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Stack&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;StackProps&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;aws-cdk-lib&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Construct&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;constructs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="err"&gt;&amp;lt;%=&lt;/span&gt;&lt;span class="nc"&gt;name&lt;/span&gt;&lt;span class="o"&gt;%&amp;gt;&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Stack&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;scope&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Construct&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;StackProps&lt;/span&gt; &lt;span class="o"&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;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;scope&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// define resources here...&lt;/span&gt;
&lt;span class="p"&gt;}}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll notice the --- delimiter in the header, this is frontmatter. The basic example above is showing that this file will be copied into the root source directory and a variable for &lt;code&gt;name&lt;/code&gt; has been used. The variable placeholders are using &lt;a href="https://github.com/tj/ejs"&gt;ejs&lt;/a&gt;, which is a popular templating framework and quite powerful.&lt;/p&gt;

&lt;p&gt;Now that you've added a source template in hygen you can commit your local generator with your project and teams can initialize the project at any time using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;hygen generator new &lt;span class="nt"&gt;--name&lt;/span&gt; talkncloud
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a basic example, but you can start to see how you might create CDK templates and share them with your team. I recommend checking out the &lt;a href="https://www.hygen.io/"&gt;hygen website&lt;/a&gt;, it's an active project and the documentation is quite good.&lt;/p&gt;

&lt;h3&gt;
  
  
  Yeoman
&lt;/h3&gt;

&lt;p&gt;We've reached the end and I saved &lt;code&gt;yeoman&lt;/code&gt; for last for many reasons, but the main one being yeoman is like the og of generators, it's been around for donkeys, well before CDK came about at least. So, what does yeoman try to achieve:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Yeoman helps you to kickstart new projects, prescribing best practices and tools to help you stay productive.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The &lt;a href="https://yeoman.io/learning/index.html"&gt;yeoman website&lt;/a&gt; does a better job at detailing this than I'll do, check it out when you get time.&lt;/p&gt;

&lt;h4&gt;
  
  
  Install
&lt;/h4&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;span class="nt"&gt;-g&lt;/span&gt; yo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  New project
&lt;/h4&gt;

&lt;p&gt;Once you have install &lt;code&gt;yeoman&lt;/code&gt; you can run the cli using the &lt;code&gt;yo&lt;/code&gt; command. You'll be presented with a few options:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yeoman-example git:&lt;span class="o"&gt;(&lt;/span&gt;main&lt;span class="o"&gt;)&lt;/span&gt; ✗ yo

? &lt;span class="s1"&gt;'Allo mike! What would you like to do? (Use arrow keys)

Run a generator

──────────────

❯ Install a generator

Find some help

Get me out of here!

──────────────
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Yeoman has a public repository for &lt;a href="https://yeoman.io/generators/"&gt;community provided generators&lt;/a&gt; (templates), from the cli you can search those. We'll be making our own basic generator and to do that we are going to use the yeoman &lt;a href="https://dev.tonpm%20install%20-g%20yo%20generator-generator"&gt;generator-generator&lt;/a&gt; package...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewox2bx6phem6u8nvodq.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewox2bx6phem6u8nvodq.jpeg" alt="yo dawg, I heard you like generators" width="554" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source:&lt;/em&gt; &lt;a href="https://github.com/yeoman/generator-generator"&gt;&lt;em&gt;https://github.com/yeoman/generator-generator&lt;/em&gt;&lt;/a&gt; &lt;em&gt;(this always cracks me up, hahaha)&lt;/em&gt;&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;span class="nt"&gt;-g&lt;/span&gt; yo generator-generator
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpz2od04ecv8eqvdg0ngk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpz2od04ecv8eqvdg0ngk.png" alt="screenshot showing the yeoman generator folder structure" width="800" height="619"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The generator above has provided a boilerplate generator we can use to create our first generator. The dummy file included is part of the &lt;code&gt;app&lt;/code&gt; generator, I've added the CDK example from the previous examples, hopefully you can see how the &lt;code&gt;generators/app/templates&lt;/code&gt; folder is where you'd place your template files for the &lt;code&gt;app&lt;/code&gt;generator. App might be a CDK API GW Lambda Route53 pattern that you'd like to share with your team.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: If you'd like to use typescript there is an&lt;/em&gt; &lt;a href="https://github.com/gliviu/generator-typescript-template"&gt;&lt;em&gt;example project here&lt;/em&gt;&lt;/a&gt; &lt;em&gt;to get you started.&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  How it works
&lt;/h4&gt;

&lt;p&gt;There is quite a bit to yeoman under the hood, check out the &lt;a href="https://yeoman.io/authoring/index.html"&gt;getting started&lt;/a&gt; guide for authoring generators. You may have noticed in the generator above there are several methods:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="nf"&gt;prompting&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nf"&gt;writing&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nf"&gt;install&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you would have guessed it, yeoman also provides UI for prompting users for options that you can use in your template. These can then be used to conditionally do whatever you want or perform string replacement / transformation using ejs templating. Then you can write out your files and perform installation of package dependencies, what this does is once someone uses your generators it will run npm install (or whatever package manager).&lt;/p&gt;

&lt;p&gt;You can start to see that there has been a fair amount of thought put into yeoman in how generators need to work which is why this is often a popular choice, you may also find more out of the box integration options with other services.&lt;/p&gt;

&lt;h3&gt;
  
  
  Supporting these projects
&lt;/h3&gt;

&lt;p&gt;The projects mentioned today are all open-source projects, you can help out these projects by:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Project&lt;/th&gt;
&lt;th&gt;Contribute Code&lt;/th&gt;
&lt;th&gt;Contribute Cash&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Projen&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/projen/projen/blob/main/CONTRIBUTING.md"&gt;contributing&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hygen&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/jondot/hygen#contributing"&gt;contributing&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Yeoman&lt;/td&gt;
&lt;td&gt;&lt;a href="https://yeoman.io/contributing/"&gt;contributing&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://opencollective.com/yeoman"&gt;opencollective&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;I'm sure if you're reading this you've probably used various scaffolders in the past and maybe thought it would be good to extend that for your own use. The generators discussed are a few of the popular ones and there are others, not all project generators are the same and some will work better for your team than others. I do know that using project generators will help your team and organization to produce consistent projects with all of the sensible defaults you want to provide which is a great place to be.&lt;/p&gt;

&lt;p&gt;The code samples mentioned in this article can be found in the talkncloud github repository, while these aren't complete CDK projects the purpose is to show the outputs from the various generators:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/talkncloud/aws/tree/main/project-templating"&gt;talkncloud github repo - project templating&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Credits: Article banner photo by &lt;a href="https://unsplash.com/@helloimnik?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Nik&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/zYdYz7JlevE?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Migrating from Ghost Pro to Hugo static on AWS for 24 cents</title>
      <dc:creator>Mick Jacobsson</dc:creator>
      <pubDate>Fri, 31 Dec 2021 05:28:33 +0000</pubDate>
      <link>https://dev.to/aws-builders/migrating-from-ghost-pro-to-hugo-static-on-aws-for-24-cents-3noe</link>
      <guid>https://dev.to/aws-builders/migrating-from-ghost-pro-to-hugo-static-on-aws-for-24-cents-3noe</guid>
      <description>&lt;p&gt;Confession, I've been using a managed service provider for my blog instead of self hosting on AWS...feels good to get that out. I've been using &lt;a href="https://ghost.org?via=mick55"&gt;Ghost Pro&lt;/a&gt; to host this site since I started over 12 months ago. You see when it comes to writing or starting anything really I'm a fan of just writing, don't sweat the details, sit down and start typing. Which is why I didn't self host, the plan was to get something going first to get my writing fix, pause, review and then migrate later to something else if I wanted to.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ghost Pro
&lt;/h3&gt;

&lt;p&gt;It's better to write something than not at all. So when I started I did a quick scan of the market for the best "blog" platform that suited my needs and &lt;a href="https://ghost.org?via=mick55"&gt;Ghost Pro&lt;/a&gt; does that. It has heaps of integrations, looks great and the web CMS frontend is easy to use which means I can write and publish from anywhere.&lt;/p&gt;

&lt;p&gt;One of the really cool things that I liked about Ghost Pro was that it's open source, so if going with a managed service isn't for you then you can self host. More information is available on the &lt;a href="https://github.com/tryghost/ghost"&gt;ghost repo&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Straight from the repo...&lt;/p&gt;

&lt;p&gt;"The easiest way to get a production instance deployed is with our official Ghost(Pro) managed service. It takes about 2 minutes to launch a new site with worldwide CDN, backups, security and maintenance all done for you..."&lt;/p&gt;

&lt;p&gt;You can see why I went with Ghost Pro in the first place, if you're just starting out and want to take that hands off approach I highly recommend going with &lt;a href="https://ghost.org?via=mick55"&gt;Ghost Pro&lt;/a&gt;. Great platform and helps the community:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ghost.org?via=mick55"&gt;Ghost Pro&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why switch?
&lt;/h3&gt;

&lt;p&gt;To be honest, I have no problems switching back to Ghost Pro tomorrow or continuing to work with customers using Ghost Pro, it really comes down to your requirements, timelines and skills. If you have no time, go ghost, if you lack the skills right now, go ghost, if you have lots of common integrations go ghost. I actually tested out ghost pro with &lt;a href="https://www.talkncloud.com/ghost-with-ecommerce/"&gt;ecommerce and wrote about when I started this blog&lt;/a&gt;, my swag for sale on this site was easy as with ghost (reminds me, I need to add some cloud shirt designs, lacking right now).&lt;/p&gt;

&lt;p&gt;If everything is so great with Ghost Pro than why switch? It's a good question. There are a few reasons, one of the main personal reasons is that I like to host my services. I write about these services, designs and share code I should be hosting them and I want to host them. One of the other key reasons is the underlying architecture design that suits my needs, my blogs doesn't change too much other than the written articles. I don't have loads of fancy integrations right now. I am a big fan of static sites because of the simplicity, fewer resources, security and low overheads. So my end goal was to always switch over to a static site of some sort in the future.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a static site?
&lt;/h3&gt;

&lt;p&gt;Firstly, what is a static website and how does it differ from a traditional website? A static site is exactly that, it can be a simple index.html flat file that is read from the client directly perhaps from S3 and displayed. There is no hosted compute server. A traditional website like wordpress would consist of a compute resource like EC2 and a database like postgres maybe using RDS. You can start to see the differences and benefits and we haven't discussed, scale, security or cost.&lt;/p&gt;

&lt;h3&gt;
  
  
  Game Plan
&lt;/h3&gt;

&lt;p&gt;I only really had a few basic requirements to get started:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Some sort of migration from ghost to the new framework&lt;/li&gt;
&lt;li&gt;Static site framework that supports markdown&lt;/li&gt;
&lt;li&gt;Good page load speeds&lt;/li&gt;
&lt;li&gt;Theme or templating, preferred free themes or decent marketplace&lt;/li&gt;
&lt;li&gt;Something basic and automated that allows me to publish new content&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you start to break it down, this is a pretty tall order. When I was using Ghost Pro I'd simply go to the web admin interface, type away and publish content. I didn't need to think about any of this.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Stack
&lt;/h3&gt;

&lt;p&gt;I started off by researching what others had done, I had made a bunch of assumptions based on what I know on how the site was going to be hosted but I was unsure on the static website framework.&lt;/p&gt;

&lt;p&gt;I ended up selecting &lt;a href="https://gohugo.io/"&gt;hugo&lt;/a&gt; for the website framework because it's popular and it boasts about speed, who doesn't like a fast loading website? I went through a few different tests on my local setup to make sure it was a good fit. My only complaint so far is that I find the directory structure and templating syntax a little confusing compared to others I've used in the past.&lt;/p&gt;

&lt;p&gt;Here is the full stack list:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hugo static website framework&lt;/li&gt;
&lt;li&gt;AWS S3&lt;/li&gt;
&lt;li&gt;AWS CloudFront&lt;/li&gt;
&lt;li&gt;AWS Route53&lt;/li&gt;
&lt;li&gt;CDK&lt;/li&gt;
&lt;li&gt;Github&lt;/li&gt;
&lt;li&gt;Forestry.io&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The Design
&lt;/h3&gt;

&lt;p&gt;It's much easier to understand with a picture...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa8dge71t8cu6c4yv4uib.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa8dge71t8cu6c4yv4uib.png" alt="talkncloud hugo static on AWS design" width="699" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The design shows that readers will access the domain via the registration and records in Route53, this will direct them to our alias record CloudFront CDN and we'll add some certificates for security and so that visitors get that warm fuzzy feeling of security with a nice padlock in the browser and no errors. I'm using Lambda@Edge (cool stuff) here to fix up some of the path handling for the static site (more on this later) and then finally we hit the bucket with our static files.&lt;/p&gt;

&lt;p&gt;There are a few other considerations here, like cloudfront OAI (origin access identity), we can force our users down the cloudfront path and remove the need for our bucket to be public which is great.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Pretty cool, how do the files get updated though?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Maintenance workflow
&lt;/h3&gt;

&lt;p&gt;Most modern web applications need to be built now, by that I mean there is a build stage in the process. The site is often developed using a framework that speeds up development and code needs to be processed or built into an output that the browser understands e.g. our static files, like an index.html.&lt;/p&gt;

&lt;p&gt;I don't want to be building on my local development setup and then dragging some files over to S3 and then potentially invalidating the cloudfront CDN so that my changes are live for viewers.&lt;/p&gt;

&lt;p&gt;So, here is the workflow I've come up with for now:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdcegms6ow81gdaqc22di.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdcegms6ow81gdaqc22di.png" alt="talkncloud hugo maintenance workflow" width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So we can see from the workflow design above when admins (authors) make changes to the repo it will kick off the workflow. I've designed this one so that it only happens on a specific branch so that we don't waste unnecessary build time or deploy unwanted changes, so to start the workflow you'll need to raise a PR.&lt;/p&gt;

&lt;p&gt;I've developed my own workflow for this one which basically installs and configures hugo, then runs the build, some basic testing and then finally the deploy. I'm using hugo's built-in deployment feature which works well with AWS S3, &lt;a href="https://gohugo.io/hosting-and-deployment/hugo-deploy/"&gt;here is an example from the config file from hugo&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[[deployment.targets]]&lt;/span&gt;
&lt;span class="c"&gt;# An arbitrary name for this target.&lt;/span&gt;
&lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"mydeployment"&lt;/span&gt;
&lt;span class="c"&gt;# The Go Cloud Development Kit URL to deploy to. Examples:&lt;/span&gt;
&lt;span class="c"&gt;# GCS; see https://gocloud.dev/howto/blob/#gcs&lt;/span&gt;
&lt;span class="c"&gt;# URL = "gs://&amp;lt;Bucket Name&amp;gt;"&lt;/span&gt;

&lt;span class="c"&gt;# S3; see https://gocloud.dev/howto/blob/#s3&lt;/span&gt;
&lt;span class="c"&gt;# For S3-compatible endpoints, see https://gocloud.dev/howto/blob/#s3-compatible&lt;/span&gt;
&lt;span class="c"&gt;# URL = "s3://&amp;lt;Bucket Name&amp;gt;?region=&amp;lt;AWS region&amp;gt;"&lt;/span&gt;

&lt;span class="c"&gt;# Azure Blob Storage; see https://gocloud.dev/howto/blob/#azure&lt;/span&gt;
&lt;span class="c"&gt;# URL = "azblob://$web"&lt;/span&gt;

&lt;span class="c"&gt;# You can use a "prefix=" query parameter to target a subfolder of the bucket:&lt;/span&gt;
&lt;span class="c"&gt;# URL = "gs://&amp;lt;Bucket Name&amp;gt;?prefix=a/subfolder/"&lt;/span&gt;

&lt;span class="c"&gt;# If you are using a CloudFront CDN, deploy will invalidate the cache as needed.&lt;/span&gt;
&lt;span class="py"&gt;cloudFrontDistributionID&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="err"&gt;&amp;lt;ID&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see that you'll supply your bucket and cloudfront CDN, you can also have multiple environments e.g. prod, non-prod (targets). Simply running the hugo deploy will use this config with your AWS cli access to deploy and invalidate the CDN. Pretty neat.&lt;/p&gt;

&lt;p&gt;So, now from here, all we need to do is make our changes in a normal source code repo, do a pull request and our workflow will take care of the rest. Once the actions have been completed the static website changes will be live. Easy peesy, fairly well automated.&lt;/p&gt;

&lt;h3&gt;
  
  
  Client-side development
&lt;/h3&gt;

&lt;p&gt;As I commented earlier, I write mostly in markdown, it works for me. Actually, when I was using &lt;a href="https://ghost.org?via=mick55"&gt;Ghost Pro&lt;/a&gt; I would mostly use the markdown editor for all my posts. But, now how do we make changes from the client, what does it look like?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fungmpasrbwvy24kx3qwq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fungmpasrbwvy24kx3qwq.png" alt="example md file for hugo" width="800" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The image above is a dummy markdown file I've written. I'm using Visual Studio Code and I've simply created a new plain text md file. Markdown has its own syntax which helps you style the document. I'll leave you to research that, it's straight forward and easy to hang of.&lt;/p&gt;

&lt;p&gt;For the majority of the content, that is the words this will be fine, it gets a little harder when you need more complex styling. I've decided to trial &lt;a href="https://forestry.io/"&gt;forestry.io&lt;/a&gt; for a couple of reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Would I miss the web based editor from Ghost and can this fill the gap?&lt;/li&gt;
&lt;li&gt;Future projects and working with clients&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Forestry.io basically aims to fill the gap as a CMS for static site generators, this isn't just for hugo. It hooks into your code repository and puts a web CMS frontend around it so that you can manage your site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fukzt8zsrp5etc6q26i9e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fukzt8zsrp5etc6q26i9e.png" alt="simple wysiwyg editor with forestry" width="800" height="686"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see here you get a simple WYSIWYG editor so that if you're not familiar with markdown you can jump straight. Even if you are familiar it can be time saving it other ways.&lt;/p&gt;

&lt;p&gt;I might do a more detailed write up on forestry.io, I'm still trying it out, I have found some issues that I've overcome. It's not all it's cracked up to be and I don't know if I'll stick with it. I like the general idea and where it's headed though and it's certainly something I'll be keeping an eye on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lambda@edge
&lt;/h3&gt;

&lt;p&gt;Argh, this one kinda of grinds my gears a little. I like Lambda@edge don't get me wrong, I think it's quite powerful but it would have been great if AWS handled this out of the box knowing that this is for static site hosting.&lt;/p&gt;

&lt;p&gt;Anyway, so, if you have a standard website serving a very flat static structure of one level e.g. /index.html, /contact.html then everything is fine but if you have sub directories like /blog/awesome-sauce/index.html then it doesn't work. To work around this you need to handle the path matching with something like Lambda so that it can access the files correctly.&lt;/p&gt;

&lt;p&gt;Thankfully AWS have done a &lt;a href="https://aws.amazon.com/blogs/compute/implementing-default-directory-indexes-in-amazon-s3-backed-amazon-cloudfront-origins-using-lambdaedge/"&gt;pretty great write up on the problem&lt;/a&gt; with some example code that does work. Have a read, grab the code, change it as needed (if at all), problem solved, moving on...&lt;/p&gt;

&lt;h3&gt;
  
  
  Migrating the data
&lt;/h3&gt;

&lt;p&gt;One of my key requirements was to be able to migrate the data from Ghost to Hugo, there isn't much point migrating to a static design if you have to rewrite all of the posts.&lt;/p&gt;

&lt;p&gt;Ghost provides an export function from within the admin panel which outputs a json dump of the content without the images. To get the images you just need to contact support and they'll provide a link with your site configuration so that you can download all of the content.&lt;/p&gt;

&lt;p&gt;The Hugo open source community has provided a tool to migrate from ghost to hugo, you simply use the cli tool to point it at your ghost export and it will convert it for you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/jbarone/ghostToHugo"&gt;ghostToHugo&lt;/a&gt; is the converter, it didn't work for me, I found that if you had a bookmark with a nil description it would cause the tool to fail. I've fixed the bug and committed it back to the repo so it works if you have the same problem as I did. You can check out my &lt;a href="https://github.com/jbarone/ghostToHugo/commit/5a36592edb20559c7a220c8f304b68ae2455cda9"&gt;commit&lt;/a&gt; here.&lt;/p&gt;

&lt;p&gt;The output of the data in Hugo format was mostly OK, I had some issues with some of the images that needed fixing but this was easy done with a bulk find and replace.&lt;/p&gt;

&lt;h3&gt;
  
  
  Styling hugo
&lt;/h3&gt;

&lt;p&gt;One of the things I liked about Hugo was that there were more open source created themes than others (to me anyway). This is great and helps when you're starting out to see what others have done with practical examples.&lt;/p&gt;

&lt;p&gt;I tried a bunch of different themes, I didn't want to get to far into customization if I didn't have to but in the end I did. I landed on &lt;a href="https://github.com/gethugothemes/geeky-hugo"&gt;geek-hugo&lt;/a&gt; by &lt;a href="https://themefisher.com/"&gt;themefisher&lt;/a&gt; it is open source and looked like a good starting point for me.&lt;/p&gt;

&lt;p&gt;The majority of my time went into customizing the theme. The main changes I made were to convert it do dark mode, widen the formatting and add in some custom styling changes that I liked, human readable times etc, bump some of the margins around. It was straight forward enough to update. If you are starting out using this theme let me know and I can help out.&lt;/p&gt;

&lt;h3&gt;
  
  
  Performance
&lt;/h3&gt;

&lt;p&gt;Using Google Lighthouse you can run tests on your test which give you a wealth of information. If we look at general scores we can see that the site is hitting &lt;strong&gt;high 80's&lt;/strong&gt; across the board which isn't bad at all, always room for improvement.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3sgpmy779d2x92zrvhd9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3sgpmy779d2x92zrvhd9.png" alt="talkncloud lighthouse performance" width="800" height="607"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Costs
&lt;/h3&gt;

&lt;p&gt;OK, so this will probably be a big draw card for many. When I was using &lt;a href="https://ghost.org/?via=mick55"&gt;Ghost Pro&lt;/a&gt; I was paying &lt;strong&gt;$36 USD&lt;/strong&gt; per month, this was for the fully managed service that gave me full customization.&lt;/p&gt;

&lt;p&gt;AWS Cost estimates for this stack:&lt;/p&gt;

&lt;h4&gt;
  
  
  Estimates
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Service&lt;/th&gt;
&lt;th&gt;Comments&lt;/th&gt;
&lt;th&gt;Cost (USD)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;S3&lt;/td&gt;
&lt;td&gt;1GB&lt;/td&gt;
&lt;td&gt;$0.03&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloudfront&lt;/td&gt;
&lt;td&gt;1GB, 100k reqs&lt;/td&gt;
&lt;td&gt;$0.21&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lambda&lt;/td&gt;
&lt;td&gt;100k reqs, 128MB, 3 sec&lt;/td&gt;
&lt;td&gt;$0.00&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Total: &lt;strong&gt;$0.24 USD&lt;/strong&gt; per month&lt;/p&gt;

&lt;p&gt;I've included some Cloudfront costs to cover readers that might hit the site from non-edge locations but just know that with Cloudfront you get 1TB and 10M requests in the free tier.&lt;/p&gt;

&lt;p&gt;Note: None of these included domain registration. If you want to bring a custom domain remember to throw another $10-12 bucks per year on your final figures. Forestry.io and github are both free for this use case.&lt;/p&gt;

&lt;p&gt;Per my previous comments, the money for Ghost helps the open source community so this isn't a direct comparison per say. It's fine to spend a little extra for good but you can use these numbers to compare with closed source enterprise offerings.&lt;/p&gt;

&lt;h3&gt;
  
  
  Final thoughts
&lt;/h3&gt;

&lt;p&gt;This pattern for static hosting is pretty standard on AWS, using this pattern reduces a lot of the maintenance and scaling considerations thanks to AWS and static frameworks. If you're looking for one of the lowest cost solutions this would certainly be up there, you can also host something like this on Github pages for free which is another option. I enjoy having control and flexibility over the architecture and once it's in AWS I can continue to expand into other services as needed. &lt;a href="https://ghost.org/?via=mick55"&gt;Ghost Pro&lt;/a&gt; is one of the best options if you want to be completely hands off and need a more end to end solution, a perfect option for non technical people and helps support the community.&lt;/p&gt;

&lt;p&gt;Have a think about your current website or customer websites and see if static fits the needs, it is most definitely the right way to go if you can swing it.&lt;/p&gt;

&lt;p&gt;I haven't provided a CDK project this time around, I'll spend a few minutes to get something out of the next day or two that I can share that should help people get going with AWS static hosting and hugo.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloudfront</category>
      <category>hugo</category>
      <category>talkncloud</category>
    </item>
    <item>
      <title>AWS Lambda Graviton2, cheap and slow</title>
      <dc:creator>Mick Jacobsson</dc:creator>
      <pubDate>Sat, 16 Oct 2021 09:57:11 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-lambda-graviton2-cheap-and-slow-51ld</link>
      <guid>https://dev.to/aws-builders/aws-lambda-graviton2-cheap-and-slow-51ld</guid>
      <description>&lt;p&gt;I was pretty pumped when I saw the announcement for AWS Lambda &lt;a href="https://aws.amazon.com/ec2/graviton/" rel="noopener noreferrer"&gt;Graviton2&lt;/a&gt; support for a couple of reasons, performance and cost. AWS have provided Graviton2 support for EC2 for a while now so it's good to see this flow into Lambda especially if it's going to save us a buck and it's faster, whats not to like?&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/" rel="noopener noreferrer"&gt;official AWS blog&lt;/a&gt; has done a pretty good write up detailing how to use the new architecture type, strategies for migrating by running both your x86 and arm functions and they've used an open-source project to optimize the workload. Probably the most thorough write up we've seen for a while from AWS, which is great!&lt;/p&gt;

&lt;p&gt;Just a side note, I'll be talking about performance, cost and usability, there are other benefits to running Graviton2. You can read about some of the other benefits on the &lt;a href="https://aws.amazon.com/ec2/graviton/" rel="noopener noreferrer"&gt;AWS Graviton2 page&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Video: If you want to out check devs in the shed (shout out to the local AWS Devs in the shed, Paul Kukiel and Matt Coles), this is first info I saw about Lambda Graviton2 that popped up in my feed: &lt;a href="https://www.youtube.com/watch?v=adAvn_NxLU8" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=adAvn_NxLU8&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  The Test Environment
&lt;/h3&gt;

&lt;p&gt;I had a bit of a look around before tackling this one and found some previous &lt;a href="https://aws.amazon.com/blogs/compute/load-testing-a-web-applications-serverless-backend/" rel="noopener noreferrer"&gt;writeups&lt;/a&gt; which used some well known tools. Shout out to Tai Nguygen Bui, I found &lt;a href="https://medium.com/the-theam-journey/benchmarking-aws-lambda-runtimes-in-2019-part-i-b1ee459a293d" rel="noopener noreferrer"&gt;his write up&lt;/a&gt; to be quite detailed and dips into API GW performance as well. In the end I selected &lt;a href="https://artillery.io/" rel="noopener noreferrer"&gt;https://artillery.io/&lt;/a&gt; and a simple AWS API GW setup...and of course, everything is developed using 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%2Fwww.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2Fdesign-1.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.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2Fdesign-1.png" alt="design-1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All of the testing has been completed using ap-southeast-2 (Sydney) region, any pricing is in USD from us-east-1 to make it easier.&lt;/p&gt;

&lt;p&gt;We can see from the image above the setup is simple, we have a client using the artillery.io toolkit which is from an external network outside of AWS, this requests the API-GW using the various paths which then invoke the Lambda function and return the results.&lt;/p&gt;

&lt;p&gt;The Lambda functions have been developed using Python and each function is the same as far as code. I added containers because I was curious about cold starts with arm and this would be the best way to find out.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: for the containers I updated the boto client as seen in the Dockerfile, this is the same on x86 and arm&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  The Code and configuration
&lt;/h3&gt;

&lt;p&gt;If you'd like to play along you can replicate the environment by provisioning the stack with CDK in your account:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/talkncloud/aws/tree/main/lambda-graviton2" rel="noopener noreferrer"&gt;https://github.com/talkncloud/aws/tree/main/lambda-graviton2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to run the artillery.io tests you'll need to copy the perf.sample.yaml over to perf.yaml. You will also need to update the x-api-key with your API key and obviously the endpoint url as well.&lt;/p&gt;

&lt;p&gt;You can use environment variables you prefer, see the commented out section below. Also note the region.&lt;/p&gt;

&lt;p&gt;Sample perf.yaml&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;config:
  target: "https://TALKNCLOUD.execute-api.ap-southeast-2.amazonaws.com/kaboom"
  phases:
    - duration: 900
      arrivalRate: 30
  defaults:
    headers:
      # x-api-key: "{{ $processEnvironment.SERVICE_API_KEY }}"
      x-api-key: "SOMEKEYGENERATED"
scenarios:
  - flow:
      - get:
          url: "/x86"
      - get:
          url: "/arm"
      - get:
          url: "/x86container"
      - get:
          url: "/armcontainer"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What this will do is throw 27,000 requests at the API-GW which will in turn invoke each one of our lambda functions over a 15 minute window. It's a pretty nice little tool, the end result will show if we had any errors like non HTTP 200's.&lt;/p&gt;

&lt;p&gt;The actual performance test itself is simple enough, the AWS blog digs into prime numbers. I wanted something different. I didn't find anything simple enough for what I wanted, but I did see a nice little snippet that runs some simple calcuations. I've added some some string concatenation to it and picked an end for the loop. It's simple enough to produce a bit of load for us to talk about.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;listAppend = []
for item in range(10):
    someString = "i like"
    someString = someString + " pie"
    listAppend.append(someString)

    # number calculation
    # Source / Credit: https://github.com/alexdedyura/cpu-benchmark
    for x in range(1,1000):
      3.141592 * 2**x
    for x in range(1,10000):
      float(x) / 3.141592
    for x in range(1,10000):
      float(3.141592) / x

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

&lt;/div&gt;



&lt;p&gt;There are a few other bits and pieces that return a message in the payload but again, less important, feel free to dig into that if you like.&lt;/p&gt;

&lt;h3&gt;
  
  
  What did I find?
&lt;/h3&gt;

&lt;p&gt;When I first developed this testing I was only looking at a simple hello world using the x86 and arm. As you can imagine the response would be so quick it wouldn't be that interesting. I won't be discussing anything outside of Lambda e.g. the time from the client start to finish or the API GW performance. I'm only interested in how long lambda took and what does that mean for billing.&lt;/p&gt;

&lt;h3&gt;
  
  
  First of the summary results from artillery
&lt;/h3&gt;

&lt;p&gt;Test table summary (after cold start)&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Scenarios launched&lt;/td&gt;
&lt;td&gt;27,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scenarios completed&lt;/td&gt;
&lt;td&gt;27,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Requests completed&lt;/td&gt;
&lt;td&gt;108,000&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mean response/sec&lt;/td&gt;
&lt;td&gt;119.61&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Response time (msec) min&lt;/td&gt;
&lt;td&gt;158&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Response time (msec) max&lt;/td&gt;
&lt;td&gt;4551&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Response time (msec) median&lt;/td&gt;
&lt;td&gt;564&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Response time (msec) p95&lt;/td&gt;
&lt;td&gt;631&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Response time (msec) p99&lt;/td&gt;
&lt;td&gt;691&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Codes (HTTP) 200&lt;/td&gt;
&lt;td&gt;108,000&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;As above, this is after the cold start. What I mean to say is I split the testing to make it easier for me to look at warm invokes only e.g. no initialization. The table above is showing that we made over 100k successful requests.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  CloudWatch function comparison
&lt;/h3&gt;

&lt;p&gt;The chart below is showing the function duration for all functions, this is the 15 minute of testing with 27,000 hits per function.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: I performed a cold start first to split the charts out, which I'll show next.&lt;/p&gt;
&lt;/blockquote&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.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-11.38.09-am.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.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-11.38.09-am.png" alt="Screen-Shot-2021-10-16-at-11.38.09-am"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is the cold start, this is me basically running the test and then canceling it. The Lambda function hadn't been invoked for days prior to these results.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-11.38.48-am.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.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-11.38.48-am.png" alt="Screen-Shot-2021-10-16-at-11.38.48-am"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For both of these charts I've set the statistic to Max and Period to 1 Second. The average of the same period less the cold start shows another useful story:&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.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-1.36.30-pm.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.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-1.36.30-pm.png" alt="Screen-Shot-2021-10-16-at-1.36.30-pm"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Whats interesting about these charts?
&lt;/h3&gt;

&lt;p&gt;First thing, the obvious was the performance, I'm just not seeing the performance I was expecting given all the hype of Gravtion2 support for Lambda. The second was the cold start, wowzers, would you look at that arm container cold-start, it's a good 7 seconds slower than x86.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I thought maybe the arm container was larger in size compared to x86, this might help explain something. The arm container is larger, 1MB. Not enough to explain it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  X-ray, digging a little deeper
&lt;/h3&gt;

&lt;p&gt;I'm a big fan of AWS x-ray, it's so simple to enable and provides some nice easy to use visibility of our setup. I took a closer look at the arm container startup using x-ray to confirm:&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.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-10.36.30-am-1.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.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-10.36.30-am-1.png" alt="Screen-Shot-2021-10-16-at-10.36.30-am-1"&gt;&lt;/a&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%2Fwww.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-10.36.19-am-1.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.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-10.36.19-am-1.png" alt="Screen-Shot-2021-10-16-at-10.36.19-am-1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I grabbed this by sorting by response time in x-ray and selecting the highest one. We can see the initialization time of 8.7 seconds.&lt;/p&gt;

&lt;p&gt;For comparison, here is the next highest x86 container:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-10.34.19-am-1.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.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-10.34.19-am-1.png" alt="Screen-Shot-2021-10-16-at-10.34.19-am-1"&gt;&lt;/a&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%2Fwww.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-10.34.06-am-1.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.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-10.34.06-am-1.png" alt="Screen-Shot-2021-10-16-at-10.34.06-am-1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Longer cold starts aren't the end the world, it was just something interesting I found along the way and unexpected. If we take a look at what the arm container is doing once its warmed up, it ticks along as per normal:&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.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-1.55.00-pm.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.talkncloud.com%2Fcontent%2Fimages%2F2021%2F10%2FScreen-Shot-2021-10-16-at-1.55.00-pm.png" alt="Screen-Shot-2021-10-16-at-1.55.00-pm"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can see the arm container trace, warmed up, not requiring initialization. Good stuff.&lt;/p&gt;
&lt;h3&gt;
  
  
  Duration stats table
&lt;/h3&gt;

&lt;p&gt;Using CloudWatch insights I was able to query the function data to show the duration in milliseconds for each function, billed versus actual. Again, this shouldn't be too surprising after seeing the cloudwatch charts above. &lt;/p&gt;

&lt;p&gt;The surprising numbers being that x86 was quicker all round, not surprising after seeing the cloudwatch charts. &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Function&lt;/th&gt;
&lt;th&gt;BilledDurationMS (Total)&lt;/th&gt;
&lt;th&gt;DurationInMS (Total)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ArmContainer&lt;/td&gt;
&lt;td&gt;15216876&lt;/td&gt;
&lt;td&gt;15180466.08&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;x86Container&lt;/td&gt;
&lt;td&gt;13304215&lt;/td&gt;
&lt;td&gt;13234641.51&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Arm&lt;/td&gt;
&lt;td&gt;14985048&lt;/td&gt;
&lt;td&gt;14971569.68&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;x86&lt;/td&gt;
&lt;td&gt;12938295&lt;/td&gt;
&lt;td&gt;12924734.27&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h3&gt;
  
  
  Switching to Graviton2 with CDK
&lt;/h3&gt;

&lt;p&gt;I wanted to talk briefly on how you go about implementing Graviton2 with CDK, the AWS blog has a better write up if you want to use the console but I'll touch on CDK only.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: You'll need to be on the latest version of CDK to do this.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When you develop a function in CDK there is a new property for functions which is architecture, if you don't specify it defaults to x86, cool cool, no problems. But, if you want to choose an arch you are presented with an array, why would you need an array of architecture????&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Lambda arm (graviton2)
const lambdaArm = new lambda.Function(this, "lambda-arm", {
  functionName: "talkncloud-lambda-arm",
  description: "performance testing lambda to compare x86 to arm",
  runtime: lambda.Runtime.PYTHON_3_8,
  architectures: [lambda.Architecture.ARM_64],
  code: lambda.Code.fromAsset("./src/lambda/perf"),
  handler: "lambda.handler",
  tracing: lambda.Tracing.ACTIVE,
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's not entirely clear, the CDK team have already updated the documentation &lt;a href="https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-readme.html#architecture" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-readme.html#architecture&lt;/a&gt; which shows why this might be needed for layers but not really the core function. Once more, if you do this manually in the AWS console you are presented with a radio button, x86 or arm not both. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: this is as of CDK version 1.125.0&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you're interested in reading the CDK github changelog, others are also asking this question. I suspect it will be fixed in a future release:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/aws/aws-cdk/commit/b3ba35e9b8b157303a29350031885eff0c73b05b" rel="noopener noreferrer"&gt;https://github.com/aws/aws-cdk/commit/b3ba35e9b8b157303a29350031885eff0c73b05b&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Other than updating CDK and specifying the architecture thats all thats needed to deploy an arm/Graviton2 lambda function using CDK.&lt;/p&gt;

&lt;h3&gt;
  
  
  Containers and multi-arch
&lt;/h3&gt;

&lt;p&gt;One thing that I didn't really think of when I started going down the arm path was building containers without having an arm processor. I'm using cloud9 for some of my container work and it doesn't run on Graviton2, when you provision using CDK it abstracts alot of the heavy lifting for you and it failed during the container build for arm due to the arch mismatch.&lt;/p&gt;

&lt;p&gt;This just wasn't something that I thought of initially, it's very obvious now, but just something to think about if you need to use containers and Lambda, you'll need to eat some engineering time to get it running.&lt;/p&gt;

&lt;p&gt;Docker &lt;a href="https://docs.docker.com/buildx/working-with-buildx/" rel="noopener noreferrer"&gt;buidx&lt;/a&gt; seems to be the answer, so at the end of the day the tools behind the scenes are changing which should make it easier. It runs an emulator so that you can build the container for different supported architectures. I followed &lt;a href="https://aws.amazon.com/blogs/compute/how-to-quickly-setup-an-experimental-environment-to-run-containers-on-x86-and-aws-graviton2-based-amazon-ec2-instances-effort-to-port-a-container-based-application-from-x86-to-graviton2/" rel="noopener noreferrer"&gt;this AWS blog&lt;/a&gt; to setup my environment. Just scroll down to "Creating a multi-arch image builder" and you should be good to go.&lt;/p&gt;

&lt;p&gt;Now, if you run provision the CDK stack with containers it will build successfully. &lt;/p&gt;

&lt;h3&gt;
  
  
  Wrapping up
&lt;/h3&gt;

&lt;p&gt;One thing that I haven't discussed is that Lambda with Graviton2 is cheaper, it's &lt;a href="https://aws.amazon.com/lambda/pricing/" rel="noopener noreferrer"&gt;actually priced differently&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;us-east-1 128MB price per 1ms:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Arch&lt;/th&gt;
&lt;th&gt;Price (USD)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;x86&lt;/td&gt;
&lt;td&gt;$0.0000000021&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;arm&lt;/td&gt;
&lt;td&gt;$0.0000000017&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;When I read the initial information coming from AWS and checked out the blogs, I was under the impression that it was cheaper because it was faster. Faster meant less milliseconds duration and less billing. But, no, as you can see from the AWS pricing its just cheaper in general.&lt;/p&gt;

&lt;p&gt;I was expecting this to be more clear cut than it was, I wanted Graviton2 to be the clear winner hands down but it just wasn't the case. When you factor in a little more dev time in multi-arch containers (if needed or keeping options open) and potentially having issues with library support there is a little more to consider than what you might think.&lt;/p&gt;

&lt;p&gt;This is just a simple case of your mileage may vary, if you're hitting the free tier and other features of Graviton2 don't float your boat you'll probably do nothing. If you're paying serious dollars for Lambda right now then I'd be doing side by side comparison to make sure you get what you expect, every app is different.&lt;/p&gt;

&lt;p&gt;I'm open to suggestions and feedback on the testing, this didn't touch on an scaling or other scenarios so there is a bit more that could be done. Any other tests you can think of? If you've switched to Graviton2 with Lambda, how has it been?&lt;/p&gt;

</description>
      <category>aws</category>
      <category>lambda</category>
      <category>graviton2</category>
    </item>
    <item>
      <title>Core 2 M5 IoT Stack AWS EduKit Unboxing</title>
      <dc:creator>Mick Jacobsson</dc:creator>
      <pubDate>Thu, 22 Jul 2021 15:11:34 +0000</pubDate>
      <link>https://dev.to/aws-builders/core-2-m5-iot-stack-aws-edukit-unboxing-1gp0</link>
      <guid>https://dev.to/aws-builders/core-2-m5-iot-stack-aws-edukit-unboxing-1gp0</guid>
      <description>&lt;p&gt;I have no idea how I missed this one, I only just caught this on my network someone (can't recall who) was promoting the last days to register for the &lt;a href="https://www.hackster.io/contests/Healthy-Spaces-with-AWS"&gt;hackster healthy spaces challenge&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I didn't end up registering for the free hardware but I went ahead and purchased one and registered for the event. I'm going to run through unboxing the Core 2 M5 Stack and first impressions.&lt;br&gt;
Where cloud?&lt;/p&gt;

&lt;p&gt;OK, you're probably wondering where the cloud part comes in and if you know me, more specially where does the AWS part come in. Well, this is the M5Stack Core2 ESP32 IoT Development Education Kit for AWS which as you've probably gathered is geared towards using the device with AWS IoT, it's also branded with AWS logos.&lt;br&gt;
Why this kit?&lt;/p&gt;

&lt;p&gt;Apart from just being keen on AWS in general, this device looked pretty cool on the surface. In the past I've dabbled in various micro controllers and typically what I've found has been more challenging is once you start adding a bunch of sensors the bread board gets pretty busy and it's usually not so plug n play. If you want battery than that will be another challenge. This device has a bunch of built in sensors (and LiPO) built-in that you can start using with little effort, helps for prototyping quickly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Unboxing
&lt;/h3&gt;

&lt;p&gt;The box itself is cool, branded in the M5 stack logo on the cardboard and tape. I like this subtle detail. The overall weight of the unit is very light, the approximate weight is around 100 grams.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpz7xm3ws5qx0d9xisly.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpz7xm3ws5qx0d9xisly.png" alt="core2 m5 close" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2wmljjdo5rlces8p1oao.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2wmljjdo5rlces8p1oao.png" alt="core2 m5 open" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Upon opening the box you'll be greeted with a pretty decent chunk of bubble wrap. The actual contents of the box are pretty small. I should note that I purchased an additional cable that I wanted and an additional sensor. I'd be curious to hear if the box is smaller if you just get the Core 2 on its own?&lt;/p&gt;

&lt;p&gt;The actual Core 2 packaging reminds me of a matchbox, sliding the contents outwards. I really liked the AWS branding on the packaging but in general don't expect Apple quality packaging. There is a sticker that needs to be removed before you can slide it out which is a little tricky or you'll need a knife or something.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg23on4g3gmqw7ebka05n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg23on4g3gmqw7ebka05n.png" alt="core2 m5 inside" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe80abru7crffzz6uew7u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe80abru7crffzz6uew7u.png" alt="core2 m5 matchbox" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see from the size, it's quite a small footprint, it easily fits in the palm of my hand.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F03o7yvkvnbht9y4w1fe4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F03o7yvkvnbht9y4w1fe4.png" alt="palm of hand" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Whats in the box
&lt;/h3&gt;

&lt;p&gt;Firstly, there are no instructions in the box, there is no QR code or anything on the box guiding you to what you're supposed to do next. The box is limited to the following items:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Core 2 M5 Stack device
2. USB-C to USB-A cable
3. Allen key / hex wrench
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Naturally, by including a tool I'm going to open this thing...     &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fig6ylxtpp7h0zi4pozdl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fig6ylxtpp7h0zi4pozdl.png" alt="exploring" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspqc1blcc6f1g866zdt6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspqc1blcc6f1g866zdt6.png" alt="underneath" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What's inside the box inside the Core 2
&lt;/h3&gt;

&lt;p&gt;Once you remove the four hex screws you get a better look inside the Core 2, you'll notice the battery and the small ESP32 board. Separating the cover is a little tricky, you kind of need to pry it open and be careful not to bend the pins but it's not to bad.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F71pjirj5y7vt9eflemyp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F71pjirj5y7vt9eflemyp.png" alt="inside the stack" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: Take note of the different length screws, it's a tad annoying that they are different lengths.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspy4hnlwptfdfd18zuwn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspy4hnlwptfdfd18zuwn.png" alt="screw length" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The specs&lt;/p&gt;

&lt;p&gt;It's probably easy to just show you the diagram from the supplier as it lists out the specs pretty nicely.&lt;/p&gt;

&lt;p&gt;Here are some key take aways:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* ESP32 16MB
* USB-C interface for connection, power etc
* Capacitive colour touch screen
* Microphone
* Speaker
* Vibration motor (kind of like your smart phone when it vibrates)
* RGB lights either side of the unit
* Led light
* Micro SD card slot
* Battery - 500mAh lithium
* 2.4Ghz Wifi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The M5 store has the most details if you want to dig further into it&lt;br&gt;
&lt;a href="https://shop.m5stack.com/collections/m5-core/products/m5stack-core2-esp32-iot-development-kit-for-aws-iot-edukit"&gt;https://shop.m5stack.com/collections/m5-core/products/m5stack-core2-esp32-iot-development-kit-for-aws-iot-edukit&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F74mkq17uzmapqz58xrc2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F74mkq17uzmapqz58xrc2.png" alt="core2 m5 promo image" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The construction of the casing is pretty impressive, there are no sharp corners or manufacturing defects on my unit. The screen is protected by a plastic film that you can peel back and dispose of. There is a nice subtle M5 imprinted on the side of the unit which is nice detail. Apart from the unit being AWS orange there is no AWS logo or wording on the case itself.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bonus component
&lt;/h3&gt;

&lt;p&gt;I did purchase an additional sensor, a microphone. I was curious to see what the quality of additional sensors was like and for my hackster project I need to use a microphone. I was unsure what the quality of the built-in mic would be so it was a just in case purchase (deadlines)&lt;/p&gt;

&lt;p&gt;The mic sensor is pretty sweet. Again, the construction of the casing for the sensor is great and the cable is plugs in snugly. The sensor comes in its only little case. Which reminds me of gameboy game cases for some reason, ha! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyv6bhcxlxecea8rv39rh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyv6bhcxlxecea8rv39rh.png" alt="mic check" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Boot up
&lt;/h3&gt;

&lt;p&gt;There is a small power button that you press to power up the beast, it only takes a moment, you've got to be quick if you want to snap a pic of the AWS logo but it's glorious!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7u5kknt0fqwvqg3ncu1a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7u5kknt0fqwvqg3ncu1a.png" alt="it's alive" width="800" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The lack of instructions becomes less of an issue as the touch screen welcomes you and has a bit of demo of the various sensors included with the device.&lt;/p&gt;

&lt;p&gt;The welcome program will have you swipe through and interact with the device to activate the vibration sensor, use the microphone, toggle controls and others like the gyro. Don't expect the same touch responsiveness as your phone, I think it's pretty good considering, I did find that when I loaded one of demo firmwares the controls weren't as good as the demo loaded from factory. I'm guessing there is an activate area or something that needs to be programmed. I haven't gotten that far.&lt;/p&gt;

&lt;p&gt;The final screen is a url to the &lt;a href="https://edukit.workshop.aws/"&gt;AWS EduKit website&lt;/a&gt; to begin going through the "hello-world" samples.&lt;/p&gt;

&lt;h3&gt;
  
  
  Ignore the help
&lt;/h3&gt;

&lt;p&gt;So, I did the obvious which was ignore the instructions, how hard could it be? I continued to fumble my way though thinking there must be a way to connect this to the wifi or there must be a mobile app. Again, none of this was obvious.&lt;/p&gt;

&lt;p&gt;Don't do what I did, &lt;a href="https://edukit.workshop.aws/"&gt;read the instructions from AWS&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mac OS Cable Connection
&lt;/h3&gt;

&lt;p&gt;If you're running Apple devices like a macbook you might run into trouble with the USB-C connection. When you plug the M5 in it loads a driver and creates a serial connection which you use to interface with. Connecting through my dock / hub didn't work, I had to connect to directly. Booo...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you're running a macbook usb-c only, make sure you have a cable e.g. USB-C to USB-C (not included). I can confirm the genuine Apple USB-C display, USB adapter worked if you have one of those.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  A tale of two buttons
&lt;/h3&gt;

&lt;p&gt;One thing I found kinda of funny was the power and reset buttons, there are two buttons. For some reason I thought there was only one button but you held it down to reset the device. This is the most common type of button I've seen on IoT devices. The M5 has two separate buttons, one for power and one for reset, they are identical but on different sides. Subtle.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodgbskbys5t79pvx9u1e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fodgbskbys5t79pvx9u1e.png" alt="power button" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Initial connections, IDE
&lt;/h3&gt;

&lt;p&gt;Good news! The M5 uses PlatformIO which integrates with Visual Studio Code, so you get that familiar IDE. I did find the PlatformIO extension to be pretty chunky and generally not very intuitive though. In my opinion it's the separate menu systems inside the extension which add to the confusion for me, it doesn't take long to work it out, so this is minor.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2zk62sjzz8t6hvrrdo5o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2zk62sjzz8t6hvrrdo5o.png" alt="platformio ide" width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you've connected the device and confirmed you actual have a serial connection available, loading firmware is pretty easy. I went ahead and loaded the getting started firmware, this firmware has a very basic spinning fan on the display that you can control.&lt;/p&gt;

&lt;p&gt;To toggle the controls remotely you can use the cli or you can use the mobile app. Follow the AWS EduKit guide to find the app.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: Restart the device once you've loaded the firmware and watch the terminal output on your computer. The QR code needed for claiming and registration is in the terminal output.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Recap key tips
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* If you're running Apple Mac or USB-C only host, buy a USB-C &amp;lt;&amp;gt; USB-C cable

&lt;ul&gt;
&lt;li&gt;Restart the M5 once flashed, monitor the output for the QR code for claiming&lt;/li&gt;
&lt;li&gt;Read the manual (shocker)&lt;/li&gt;
&lt;li&gt;Note the screws if you take it apart as they are different lengths
&lt;/li&gt;
&lt;/ul&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;


Final Thoughts
&lt;/h3&gt;


&lt;p&gt;As an owner of multiple generations of raspberry pi's, various hats, cases, feathers and other mc's i'm impressed by the build quality most. The case construction, fitting and detail that has gone into it is really impressive for the price (~$49.90 USD). Shipping was pretty quick at around 5-7 days to Australia.&lt;/p&gt;

&lt;p&gt;I thought the on-boarding wasn't as smooth as other IoT devices that I've used in the past, which would be scan a QR code, download app, register and toggle various buttons through the app. There are a few more steps to jump through to get going.&lt;/p&gt;

&lt;p&gt;The platformIO IDE looks pretty powerful, bit of a learning curve there, I would have liked a more basic interface. One thing to note is that the platformIO IDE caters to many different types of devices which is probably why its feature rich.&lt;/p&gt;

&lt;p&gt;In summary, I'm happy with the purchase so far, I'm looking forward to having a play with the Core 2 M5 and AWS IoT. Hopefully I'll have some more info to share soon!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>iot</category>
      <category>core2m5</category>
      <category>hackster</category>
    </item>
    <item>
      <title>AWS SCS-C01 Security Specialty Certification Recap Jun 2021</title>
      <dc:creator>Mick Jacobsson</dc:creator>
      <pubDate>Mon, 14 Jun 2021 11:18:31 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-scs-c01-security-specialty-certification-recap-jun-2021-5c0</link>
      <guid>https://dev.to/aws-builders/aws-scs-c01-security-specialty-certification-recap-jun-2021-5c0</guid>
      <description>&lt;p&gt;I am fresh off the AWS Security Specialty exam for 2021 having successfully sat for the exam last week. What a doozy! I've 4 other AWS certifications and for me, personally I found this one to be the most challenging. I do practice security in my day to day to ensure I am building secure systems and enjoy discussing designs with security professionals but I'm not in a dedicated security team or SysOps role so I'm not living and breathing security everyday.&lt;/p&gt;

&lt;p&gt;In this post I'll give you a run down on the exam, what you can expect on the day and what materials I used to prepare for the exam.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is the Security Specialty Exam?
&lt;/h3&gt;

&lt;p&gt;As usual the official AWS doco gives you the best info on the exam. It's basically an exam for security professionals (shocker), so, think security in transit, rest, shared responsibility model, users, design, access to resources etc.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;AWS recommend 2 years hands on experience securing workloads in AWS&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As above, I'm not in a day to day security role but treat security very seriously and I have more than the 2 years experience. It's a recommendation not a requirement, if you're ready you're ready, don't let that stop you.&lt;br&gt;
Exam Booking&lt;/p&gt;

&lt;p&gt;Covid has introduced a little more flexibility with exam testing and now you sit the exam in the comfort of your own home. All you need is a computer, internet, camera and microphone. Laptops are good for this. I went with pearson vue, this is the same provider I'd be using if I had to go into the physical testing office.&lt;/p&gt;

&lt;p&gt;I already had an account as I've used them before. One thing I noticed was that there were so many time slots, you could basically register and sit the exam the same day from I could see and there slots every hour or less. This is really cool and incredibly flexible. This means I can book the exam around my work and personal life (you can sit an exam around mid-night if you want to).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Even though I've done these types of exams before, I complete the system test before the exam every time. It's just a simulation of the exam software before the actual test so that you know you're good to go.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Exam day remotely is no different from when you had to go into the physical testing office. It's the same application, same format, same flow, same flag, review etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Exam (the bit you probably came for)
&lt;/h3&gt;

&lt;p&gt;OK, let's get down to it, this is likely why you are here. I'll try to give you as much information as possible hopefully without overstepping. I'll break it up into sections as best I can. Obviously on the day your mileage may vary so prep as much as you can or think you need and go for it.&lt;/p&gt;

&lt;h4&gt;
  
  
  Security Services
&lt;/h4&gt;

&lt;p&gt;This one seems obvious. Know the AWS services that are related to security, know the names and what they do. This is useful for any AWS exam, I find that many of the questions will rely on you knowing how the services fit together so understanding what they are is a good step in the right direction.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9xry0tibf8hnigodg9k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9xry0tibf8hnigodg9k.png" alt="alt text" width="448" height="1160"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: Get to know the architecture diagram symbols, create some designs. They don't have to be perfect.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Updating workloads
&lt;/h4&gt;

&lt;p&gt;When you provision servers in AWS remember to think of the shared security model. What part are you responsible for in the model? If deploy a virtual server how might you keep it updated using AWS and how might you check that it is updated? When we talk about updating servers we need to think of scale an automation, you don't want to be manually patching 100 servers. Hopefully that gives you a hint.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: There are great services available in AWS that inspect your systems and provide reports. These types of services are valuable in many situations.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Post incident response
&lt;/h4&gt;

&lt;p&gt;You're going about your business and then all of sudden there has been a breach. A security incident. What would you do?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Where are the logs?&lt;/li&gt;
&lt;li&gt;How can you isolate it?&lt;/li&gt;
&lt;li&gt;What services may have detected the incident?&lt;/li&gt;
&lt;li&gt;Did someone use access keys? How can you check, can you disable the keys and how?&lt;/li&gt;
&lt;li&gt;How can you check the state policy before and after?&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Encryption at rest and transit
&lt;/h4&gt;

&lt;p&gt;This where knowing the services comes in handy, you might get asked about protecting data in transit but it's easy to fall into a trap if you don't how certain services can provide this.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Buckets

&lt;ul&gt;
&lt;li&gt;Different types of encryption&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Load balancers

&lt;ul&gt;
&lt;li&gt;Different types of load balancers&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: Speaking of load balancers, consider high availability design, multiple EC2 servers etc&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Network Design
&lt;/h4&gt;

&lt;p&gt;As per the AWS best practice you are most likely already familiar with how to design secure workloads. You should be familiar with how to design private and public subnets, what might go into those and why.&lt;/p&gt;

&lt;p&gt;You should be familiar with VPC's and when to use direct connect and/or VPN and why. Understand that there are other networking services as well like transit gateway and VPC peering.&lt;/p&gt;

&lt;p&gt;If you have a bunch of networking floating around your AWS accounts how might you get a better a look at that. Can you turn on additional logging at the VPC level. If you turn on additional logging, where does it go? Can you search it, can you visualize it, can you customize it?&lt;/p&gt;

&lt;p&gt;Security groups and Network Access Control Lists (NACL) will more than likely come up. You can deploy an EC2 without a security group and when you think about networks NACLS are always there. Know the difference between the two and how ordering might work.&lt;/p&gt;

&lt;h4&gt;
  
  
  Security Design
&lt;/h4&gt;

&lt;p&gt;I wasn't expecting too much of this, well any to be honest. But, as I'm a serverless guy it kinda worked out well for me. Think about traditional architecture design like a 2 tier web application hosted on virtual servers in AWS. What would that look like if its a static web site hosted in s3 and what key components can you think of? What would you need to do to secure it, to provide access, to encrypt the communications.&lt;/p&gt;

&lt;h4&gt;
  
  
  Security automation and notification
&lt;/h4&gt;

&lt;p&gt;Again, understanding the different services goes along way here. There is a key difference between being notified of a security event and automation. If you want to be notified via email or similar in AWS what would you use? It's more than likely going to be SNS. But, if you think of what services have information related to security can they be integrated into SNS, what if you want to act on that information what else could you use?&lt;/p&gt;

&lt;h4&gt;
  
  
  Logging
&lt;/h4&gt;

&lt;p&gt;Knowing how to enable logging in AWS is a big part of security. How do you know whats happening in your account if its not logged? How do you audit access and activity.&lt;/p&gt;

&lt;p&gt;You should be pretty familiar with CloudWatch and CloudTrail, how are they different? What information can you search in each, can you export it? Can you archive it?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: There are other services that can be used to stream data into AWS and then visualized.&lt;br&gt;
Tip: AWS Organizations plays are part here, how does logging look like with many accounts.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Users
&lt;/h4&gt;

&lt;p&gt;Hopefully you're not one of those people who create an AWS account and use the root account for everything. If you are, stop. Why is that a bad idea and how might you protect the root account?&lt;/p&gt;

&lt;p&gt;What are the different concepts inside IAM, what is a role or a group and how do they differ.&lt;/p&gt;

&lt;p&gt;If you're an enterprise customer how might they want to provide access to AWS, they probably have Active Directory. Can they connect that somehow to IAM?&lt;/p&gt;

&lt;p&gt;When it comes to policies get to know the basics, what are IAM policies, study them, make them, break them. Know the difference between IAM policies and bucket policies.&lt;/p&gt;

&lt;h4&gt;
  
  
  AWS knows all your secrets or do they?
&lt;/h4&gt;

&lt;p&gt;In AWS there are heaps of different ways to store secrets if you really think about it. Hey, if you're Corey Quinn you might even store them in Route 53 as a cheap database (joke). But, in reality there are probably like two services in AWS where you can store secrets. Thats going to be Secret Manager and System Manager Parameter Store.&lt;/p&gt;

&lt;p&gt;Just get to know them at a high level, one has a bit more functionality when it comes to secret storage. Honestly, I have used Secret Manager to store some creds before, I know Parameter Store can but I've just used Secret Manager as its purpose built and provides more management. It was news to me that people were storing secrets in Parameter Store other than just well parameters. But, anyway. It is cheaper, so theres that?&lt;/p&gt;

&lt;h3&gt;
  
  
  What did I use to prep
&lt;/h3&gt;

&lt;p&gt;Everyone's study style is different, I myself am a hands on kinda of learner, I need to get in and build it, break in to understand it. So I like to use practice exams with decent explanations and also pair that with the console to get a better understanding if I need to.&lt;/p&gt;

&lt;p&gt;I use Jon Bonso's Tutorial Dojo, I've recommended him before (no affiliation):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://portal.tutorialsdojo.com/courses/aws-certified-security-specialty-practice-exams/"&gt;https://portal.tutorialsdojo.com/courses/aws-certified-security-specialty-practice-exams/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I will say that this particular one wasn't as good as the others I've studied with Jon. I usually like this resource as it provides a bunch of different practice exams in varying modes, review and timed. The responses are usually filled with helpful responses and links to AWS materials so that you can work out where you went wrong or find or more.&lt;/p&gt;

&lt;p&gt;However, the security responses and the questions just seemed bit lacking for some of the questions. I also found that it was very repetitive, there were many KMS questions. Maybe previous exams have had an overload of KMS related questions or something.&lt;/p&gt;

&lt;p&gt;Never the less, this is the sole resource I used.&lt;/p&gt;

&lt;h3&gt;
  
  
  My Tips
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Write down the services and come up with your own explanation for them&lt;/li&gt;
&lt;li&gt;Create architecture diagrams, draw.io is good&lt;/li&gt;
&lt;li&gt;If you don't have access to practice exams, write your own questions&lt;/li&gt;
&lt;li&gt;Get your hands dirty, you 100% need to use these services, get into the console and start building&lt;/li&gt;
&lt;li&gt;Get some sleep, if it's the night before the exam don't stay up cramming.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Try not to sweat it, if at the end of the day you don't pass you can always retake the exam. This sucks because it's expensive and you've put this time in, but it's not for nothing you have just had first hand experience on the exam and now you can use that for the next time.&lt;/p&gt;

&lt;h3&gt;
  
  
  How do you learn?
&lt;/h3&gt;

&lt;p&gt;I am interested in hearing from others about how they learn, what resources they use and what works for them. I am researching a project to help out in this space, so reach out if you can.&lt;/p&gt;

&lt;h3&gt;
  
  
  Happy days
&lt;/h3&gt;

&lt;p&gt;Hopefully this guide has been useful for somebody out there studying for the exam. This is one of the more difficult exams, I found that the variety of the questions and the number of services in the questions to be generally challenging.&lt;/p&gt;

&lt;p&gt;If you've studied security before or are familiar with the practices around security design, encryption, policy etc this will help to go along way but you'll still need to understand how AWS tackle it and what services are used.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>security</category>
      <category>awscommunity</category>
    </item>
    <item>
      <title>AWS She Builds Day June 2021 - Loud and Clear</title>
      <dc:creator>Mick Jacobsson</dc:creator>
      <pubDate>Thu, 10 Jun 2021 11:37:21 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-she-builds-day-june-2021-loud-and-clear-3bgc</link>
      <guid>https://dev.to/aws-builders/aws-she-builds-day-june-2021-loud-and-clear-3bgc</guid>
      <description>&lt;p&gt;Every now and then I'd see or hear about AWS She Builds, there was a cool logo, bright colours and some new faces. Enough was enough it was time to find out once and for all what AWS She Builds was all about.&lt;/p&gt;

&lt;p&gt;Full disclosure this is my experience as a male attending AWS She Builds Day June 2021 Virtual event.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I'll go into more details later, but if you're a woman there are a couple of stand out programs you should be aware of right now!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;AWS She Builds Mentor Program&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A 12 week mentor program that is open for applications, spots are limited and applications close June 30th 2021.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://awsshebuildsmentoringprogram.splashthat.com/"&gt;https://awsshebuildsmentoringprogram.splashthat.com/&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AWS She Builds CloudU&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;CloudU is an AWS training and certification program with the aim of becoming a certified AWS Cloud Practitioner during the 8 week program. It looks like you have until the 28th of June 2021 to register (or its starts the 28th?).&lt;/p&gt;

&lt;p&gt;Both of these programs will help to connect you with like minded women in the tech industry, you don't have to be an expert or experienced. You don't need to be a software engineer or developer. Take a look at the links above and register if it looks like something you might be into. If you're on the fence about it, do it anyway!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://awscloudushebuildcpeapj.splashthat.com/"&gt;https://awscloudushebuildcpeapj.splashthat.com/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is AWS She Builds Day?
&lt;/h3&gt;

&lt;p&gt;You might have guessed already but, AWS She Builds Day is an event for women in tech to come together and discuss tech, network, leadership and more. This is an inclusive event, everyone is welcome to attend (I didn't sneak in). Expect to hear from a wide range female leaders from AWS and other companies around the globe with discussions varying from non-technical (leadership, career) to technical (yay building stuff!).&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS She Builds Day 2021
&lt;/h3&gt;

&lt;p&gt;I have no idea if these events are always virtual but this year She Builds was virtual, hosted out of Sydney Australia (go Australia!). Although the event this year was hosted in Australia the event features women from around the world. The virtual event was streamed live on Twitch via the AWS channel and included some engaging chat with prizes!!!. I've only used twitch a few times now, I signed up for another AWS event that was on twitch and I've gotta say I really like it like for these events. It works well and it's easy to engage with others. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.twitch.tv/aws"&gt;https://www.twitch.tv/aws&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Tip: If you are going to attend an AWS event with twitch I recommend registering for an twitch.tv account. This way you can participate in the conversation. You don't have to, you can view you just won't be able to ask questions etc.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here is a link to the agenda this year to give you a better idea of the line up: &lt;a href="https://aws-shebuilds-day-june.splashthat.com/"&gt;https://aws-shebuilds-day-june.splashthat.com/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Highlights
&lt;/h3&gt;

&lt;p&gt;Here are my highlights from the event this year, this isn't an exhaustive list, this is what I found stood out from my point of view. Be sure to watch the replay so you can find your own highlights from the event.&lt;/p&gt;

&lt;h3&gt;
  
  
  Equality in tech through salary transparency
&lt;/h3&gt;

&lt;p&gt;Kesha Williams created Salary Overflow developed on AWS, "think of it as Stack Overflow for Salaries". Kesha created Salary Overflow to help bring transparency to tech salaries, the application is free to register. You can search for salaries by role name, location and drill further into the details. Kesha walks us through the goal of Salary Overflow, the architecture design and quick demo of the interface.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.salaryoverflow.com/"&gt;https://www.salaryoverflow.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I found Kesha quite inspiring as a builder, the presentation was clear and the q&amp;amp;a was great. It's clear that Kesha enjoys building but also really enjoys sharing that knowledge and encourages others "share what they learn". &lt;/p&gt;

&lt;h3&gt;
  
  
  Program Updates
&lt;/h3&gt;

&lt;p&gt;As I mentioned above, there were several program updates. It's important to act fast on all of the programs as they appear to have end dates and some have limited spots. There are some great support programs on offer here, I strongly encourage everyone to apply. The mentor program will connect you with women at AWS and honestly, everyone at AWS that I've met has been great to work with so you won't be disappointed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://awsshebuildsmentoringprogram.splashthat.com/"&gt;https://awsshebuildsmentoringprogram.splashthat.com/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://awscloudushebuildcpeapj.splashthat.com/"&gt;https://awscloudushebuildcpeapj.splashthat.com/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.thedreamcollective.com.au/programs/she-dares/"&gt;https://www.thedreamcollective.com.au/programs/she-dares/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Technical Presentations
&lt;/h3&gt;

&lt;p&gt;Anita Miller gives us an overview of Apache Kafka, the key components and why you might want to use it. Anita also explains how you can reduce administrative overhead by using AWS MSK and some of the benefits in doing so. I haven't spent much time looking into Kafka but found that Anita's overview was easy to understand and also provided practical examples of why you might want to use Kafka, MSK or Kinesis.&lt;/p&gt;

&lt;p&gt;Ekaterina Gasparian (Kate, I wrote down Kate?) from Canva is using machine learning to help drive a better user experience. I am a big fan of Canva and found the use cases very interesting. Kate goes into details about some of the challenges about presenting content to users that is accurate and meaningful using AWS Personalize. I can see how this would reduce the amount of time it takes a user to create content but also helps to surface content the user is interested in. Some of this is aided by machine learning on AWS and more complex cases using Sage Maker. I'm butchering this, watch the stream and you'll get a better understanding of what Kate's is working on it's very cool!&lt;br&gt;
Leadership&lt;/p&gt;

&lt;p&gt;There is a Female Exec Leaders Panel discussion featuring six panel members hosted by Kim Bonilla (She Builds founder &amp;amp; President). There was discussion around mentorship that stuck with me and it was really around how mentors can come and go and that's OK. Further discussion about mentors and sponsors, when and why you might need them and how the relationship works which I found very insightful and has given me a bit to think about. I personally wasn't familiar with the sponsor arrangement and hearing about these leaders discuss the two really connected some dots for me. I'll give a special mention to Vanessa Alves from Brazil, such an energized passionate speaker (my notes actually say, Vanessa was awesome).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I haven't listed each panel member, there are too many, catch the full list of speakers on the agenda: &lt;a href="https://aws-shebuilds-day-june.splashthat.com/"&gt;https://aws-shebuilds-day-june.splashthat.com/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Sarah James has written a book "Are you Ready to Change the World? Thoughts on Technology Leadership for the Future". This is an excellent interview with well thought out questions and gives you some insight into Sarah and her experience as leader as well as her book. I was impressed by the session and picked up a copy myself, I'm looking forward to the read. I might follow up with a post on thoughts after I've finished.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;No affiliation or links etc&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://www.amazon.com.au/Are-You-Ready-Change-World-ebook/dp/B08BK4XNFY"&gt;https://www.amazon.com.au/Are-You-Ready-Change-World-ebook/dp/B08BK4XNFY&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Juliette Murphy tells us all her secrets! No seriously, Juliette is the Co-Founder of FloodMapp and gives us her top 5 secrets to leadership. I won't give them away here but I will say that I found them very useful and there is something for everyone in the secrets that can be applied by everyone no matter the role or experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Finishing up
&lt;/h3&gt;

&lt;p&gt;Alrighty, it's been great to get some insights into this community which really promotes women in tech, diversity and inclusivenes. This write up was a very quick summary of the stand outs to the AWS She Builds Day 2021. I'm just scratching the surface on the event, hopefully the replay links from the day will be out shortly so we can share with others.&lt;/p&gt;

&lt;p&gt;Shout out to Kim Bonilla and the rest of the She Builds team for a great event! It was very well organized, awesome line up of speakers and great content. If you get a chance to attend the next She Builds event be sure to check it out, go to the live sessions if you can, that way you can engage with the speakers. You might even get your hands on some sweet merch and other prizes ;).&lt;/p&gt;

&lt;p&gt;If you're just hearing about AWS She Builds and you want to find out more, there is a LinkedIn group that should put you in touch with plenty of women in tech: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/groups/13977813/"&gt;https://www.linkedin.com/groups/13977813/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If I can be of help, feel free to reach out. &lt;/p&gt;

</description>
      <category>aws</category>
      <category>shebuilds</category>
      <category>awscommunity</category>
    </item>
    <item>
      <title>AWS official lambda layers with AWS CDK</title>
      <dc:creator>Mick Jacobsson</dc:creator>
      <pubDate>Tue, 01 Jun 2021 10:04:18 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-official-lambda-layers-with-aws-cdk-5hn5</link>
      <guid>https://dev.to/aws-builders/aws-official-lambda-layers-with-aws-cdk-5hn5</guid>
      <description>&lt;p&gt;This is my first official post since joining the AWS community builders and well it's not super exciting but none the less it was a source of frustration for me so it might be for others...lambda layers.&lt;/p&gt;

&lt;p&gt;If you've been writing lambda functions for a while, maybe before layers, you might not be aware of layers. &lt;a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html"&gt;The basic idea of layers&lt;/a&gt; is to separate out your code so that you can better share and reuse your functions. For most people this might be libraries or modules, python is a good example where you might have several common libraries across many functions.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This sounds pretty basic, what gives?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It gets a little more complicated when you have different environments, AWS has a specific environment and for the most part it's not a problem. But, every now and then you'll come across a module that isn't compatible. Like I did today. AWS has created a few public lambda layers so now I'll walk through how to use them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Finding the Lambda Layer AWS Resource Name (ARN)
&lt;/h3&gt;

&lt;p&gt;If you head over to the AWS management console and go to Lambda and then click on an existing function. If you don't have a function just make a dummy one for now. Once you click on your function, head to the very bottom of the page and you'll see a section for layers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr76hfo8hk7l66pbwj8oj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr76hfo8hk7l66pbwj8oj.png" alt="alt text" width="800" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now you can select Add a layer&lt;/p&gt;

&lt;p&gt;The very first screen that you go to next will let you choose from the very few AWS official layers, custom or by ARN. The options are pretty straight forward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AWS created layers&lt;/li&gt;
&lt;li&gt;Layers created by you / your org&lt;/li&gt;
&lt;li&gt;Layers shared or accessible external e.g. community / public&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdwfpmg4s8wcg2uwg5znf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdwfpmg4s8wcg2uwg5znf.png" alt="alt text" width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my case, I wanted numpy which is part of the AWSLambda-Python38-SciPy1x layer. Select the version (I've only ever seen 1 version at a time, anyone else noticed multiple versions?) go ahead and select add.&lt;/p&gt;

&lt;p&gt;You should be redirected back to the console and now you can see your new lambda added to your lambda function with a new ARN:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmbsoimln30ogajmpg9ts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmbsoimln30ogajmpg9ts.png" alt="alt text" width="800" height="97"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Keep that ARN, we'll come back to that...&lt;/p&gt;

&lt;h3&gt;
  
  
  CDK to the rescue!
&lt;/h3&gt;

&lt;p&gt;Now we are finally getting to the CDK, I'm going to assume you have a CDK project already with Lambda function and like me you're trying to add a Lambda layer from an ARN like the AWS official layer above.&lt;/p&gt;

&lt;p&gt;If you don't have a CDK project or you're unsure you can check one of my previous posts, open source on github (look in the lib/lambda folder):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/talkncloud/aws/tree/main/athena-appsync"&gt;https://github.com/talkncloud/aws/tree/main/athena-appsync&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you do have some code, here is an example of adding the layer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;myLambdaFunction.addLayers(
    lambda.LayerVersion.fromLayerVersionArn(this, 'awsNumpyLayer', 'arn:aws:lambda:ap-southeast-2:817496625479:layer:AWSLambda-Python38-SciPy1x:29')
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! Now if you deploy your stack you'll have the SciPy AWS Official Lambda layer added to your function. If you're wondering if you need to do anything special in your function, no, just import the module as per normal and it will be accessible in your function.&lt;/p&gt;

&lt;h3&gt;
  
  
  Can we skip some steps?
&lt;/h3&gt;

&lt;p&gt;Look, I mean, I agree, if you just want to use numpy this sounds like way too many steps. I did go searching for a list of AWS layers and didn't get very far. If you know of a list reach out, I'd be keen to have a look. When you start searching out there you'll find various ARN's for different layers but it seems like it's all over the place.&lt;/p&gt;

&lt;p&gt;There is another reason for doing this rather than creating you're own, this particular package, numpy needs to be compiled using the AWS environment rather than just uploading it with your function. You can create your own layers with the AWS Linux Container (maybe another post?) but if you're in a bind and just need numpy this will get you out of a jam.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrapping up
&lt;/h3&gt;

&lt;p&gt;Hopefully this will be of use to someone, personally it just wasn't obvious to me how to get the AWS official ARN and then use it in CDK. I was actually thinking i'd be able to reference the name (alias?) somehow in CDK but once you have the ARN it makes more sense. If you are using layers quite heavily I'd be interested to hear from anyone on their workflow for building modules that are Lambda friendly.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cdk</category>
      <category>lambda</category>
    </item>
  </channel>
</rss>
