<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hugo on agh1973</title><link>https://blog.agh1973.com/tags/hugo/</link><description>Recent content in Hugo on agh1973</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 22 May 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.agh1973.com/tags/hugo/index.xml" rel="self" type="application/rss+xml"/><item><title>Projen</title><link>https://blog.agh1973.com/posts/projen/</link><pubDate>Sat, 22 May 2021 00:00:00 +0000</pubDate><guid>https://blog.agh1973.com/posts/projen/</guid><description>&lt;h2 id="introduction"&gt;
 Introduction
 &lt;a class="heading-link" href="#introduction"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;One of the things that&amp;rsquo;s worth noting about the hugo-cdk project
is how much, well&amp;hellip; boilerplate is involved.&lt;/p&gt;
&lt;p&gt;We have:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.gitignore&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.npmignore&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.prettierrc.js&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;jest.config.js&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;package-lock.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;package.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tsconfig.json&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And none of these are really central to the actual project code.
And&amp;hellip; they&amp;rsquo;re also pretty important files.
Which&amp;hellip; I don&amp;rsquo;t really understand as well as I&amp;rsquo;d like to.
For example, I&amp;rsquo;d like to do a really great job of linting,
but I don&amp;rsquo;t want to spend a bunch of time learning the
intricacies of &lt;code&gt;eslint&lt;/code&gt;. Surely there must be a better way than
googling around the interwebs for someone else&amp;rsquo;s configs?&lt;/p&gt;</description></item><item><title>Deploying a Static Site on AWS with CDK</title><link>https://blog.agh1973.com/posts/cdk-deploying-static-site/</link><pubDate>Wed, 02 Dec 2020 00:00:00 +0000</pubDate><guid>https://blog.agh1973.com/posts/cdk-deploying-static-site/</guid><description>&lt;h2 id="introduction"&gt;
 Introduction
 &lt;a class="heading-link" href="#introduction"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;We&amp;rsquo;ve covered a bunch of other ground, but now it&amp;rsquo;s time to actually deploy the static site.&lt;/p&gt;
&lt;h3 id="a-static-site"&gt;
 A Static Site
 &lt;a class="heading-link" href="#a-static-site"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Referring back to our diagram, it&amp;rsquo;s clear that the first thing
after the CodeBuild, which we are doing separately, is an S3 bucket.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-typescript" data-lang="typescript"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;export&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;class&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;StaticSite&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;extends&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;cdk&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Construct&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;constructor&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;scope&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;cdk.Construct&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;id&lt;/span&gt;: &lt;span style="color:#66d9ef"&gt;string&lt;/span&gt;) {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;super&lt;/span&gt;(&lt;span style="color:#a6e22e"&gt;scope&lt;/span&gt;, &lt;span style="color:#a6e22e"&gt;id&lt;/span&gt;);
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;const&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;bucket&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;new&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;s3&lt;/span&gt;.&lt;span style="color:#a6e22e"&gt;Bucket&lt;/span&gt;(&lt;span style="color:#66d9ef"&gt;this&lt;/span&gt;, &lt;span style="color:#e6db74"&gt;&amp;#39;Bucket&amp;#39;&lt;/span&gt;, {});
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This gets our first layer of boiler-plate out of the way.
We&amp;rsquo;ve declared &lt;code&gt;StaticSite&lt;/code&gt; as a class and based it on the &lt;code&gt;cdk.Construct&lt;/code&gt;.
Then we declared an S3 bucket. With no properties.
Ok, but&amp;hellip; S3 buckets are more useful when they have names.
And&amp;hellip; our website is going to have a name.
S3 bucket names are required to be globally unique,
and dns names are by definition globally unique.
Let&amp;rsquo;s use the name of the website for the name of the bucket.
This has the added benefit of improving the discoverability of the system
since you can pretty quickly associate the DNS and the S3 bucket
when the have the same name.&lt;/p&gt;</description></item><item><title>Node Lambdas - A Better Way</title><link>https://blog.agh1973.com/posts/node-lambdas/</link><pubDate>Sun, 04 Oct 2020 00:00:00 +0000</pubDate><guid>https://blog.agh1973.com/posts/node-lambdas/</guid><description>&lt;h2 id="introduction"&gt;
 Introduction
 &lt;a class="heading-link" href="#introduction"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;In &lt;a href="../getting-started-with-cdk" &gt;Getting Started with CDK&lt;/a&gt;,
I wrote &amp;ldquo;I noticed that cdk has a pattern of using a lambdas directory
and then having sub-directories for every lambda&amp;rdquo;.
Well, I was wrong, or maybe things have just changed.
Either way, we&amp;rsquo;re going to update &lt;code&gt;hugo-cdk&lt;/code&gt; to follow the new pattern.&lt;/p&gt;
&lt;h3 id="the-new-pattern"&gt;
 The New Pattern
 &lt;a class="heading-link" href="#the-new-pattern"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;Recently, cdk was updated to add bundling support.
We didn&amp;rsquo;t need bundling with our previous lambda, because it doesn&amp;rsquo;t depend on any libraries.
The new pattern is still a more elegant approach,
so lets take a look at the fancy but plainly named
&lt;a href="https://docs.aws.amazon.com/cdk/api/latest/docs/aws-lambda-nodejs-readme.html" class="external-link" target="_blank" rel="noopener"&gt;aws-lambda-nodejs&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>CDK Composition</title><link>https://blog.agh1973.com/posts/cdk-composition/</link><pubDate>Thu, 10 Sep 2020 00:00:00 +0000</pubDate><guid>https://blog.agh1973.com/posts/cdk-composition/</guid><description>&lt;h2 id="introduction"&gt;
 Introduction
 &lt;a class="heading-link" href="#introduction"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;So far in this series, we have
&lt;a href="../getting-started-with-hugo" &gt;set up the basics of a Hugo blog and push the code to GitHub&lt;/a&gt;
and &lt;a href="../getting-started-with-cdk" &gt;bootstrapped a cdk application and used it to deployed a lambda&lt;/a&gt;.
Then your faithless narrator wandered off for a month,
and when he came back nagged you about &lt;a href="../upgrading-cdk" &gt;upgrading cdk&lt;/a&gt;.
Our next step is to deploy the rest of what was described
in &lt;a href="../serving-static-site-with-aws" &gt;serving static sites with AWS&lt;/a&gt;.
That&amp;rsquo;s going to require us to add a few more things to our cdk app,
so now is a good time to talk about apps, stacks and constructs.&lt;/p&gt;</description></item><item><title>Getting Started with CDK</title><link>https://blog.agh1973.com/posts/getting-started-with-cdk/</link><pubDate>Thu, 06 Aug 2020 00:00:00 +0000</pubDate><guid>https://blog.agh1973.com/posts/getting-started-with-cdk/</guid><description>&lt;h2 id="introduction"&gt;
 Introduction
 &lt;a class="heading-link" href="#introduction"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://github.com/aws/aws-cdk" class="external-link" target="_blank" rel="noopener"&gt;aws-cdk&lt;/a&gt; was the new hotness at AWS re:Invent 2019,
going from about 4 presentations in 2018 to something like 40 presentations.
That&amp;rsquo;s an order of magnitude increase.
And that is the kind of thing that gets my attention.
cdk offers &lt;a href="https://www.google.com/search?q=define&amp;#43;iac" class="external-link" target="_blank" rel="noopener"&gt;IaC&lt;/a&gt; that is&amp;hellip; code.
It&amp;rsquo;s not a &lt;a href="https://en.wikipedia.org/wiki/Domain-specific_language" class="external-link" target="_blank" rel="noopener"&gt;dsl&lt;/a&gt; (looking at you, Terraform).
Nor is it an attempt to overwhelm you with JSON or YAML verbosity.
It&amp;rsquo;s&amp;hellip; just&amp;hellip; TypeScript.
And that turns out to be powerful.&lt;/p&gt;</description></item><item><title>Serving a Static Site with AWS</title><link>https://blog.agh1973.com/posts/serving-static-site-with-aws/</link><pubDate>Sun, 02 Aug 2020 00:00:00 +0000</pubDate><guid>https://blog.agh1973.com/posts/serving-static-site-with-aws/</guid><description>&lt;h2 id="do-something-easy-in-aws"&gt;
 Do Something Easy in AWS
 &lt;a class="heading-link" href="#do-something-easy-in-aws"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;AWS is all about making &lt;a href="https://aws.amazon.com/blogs/aws/we_build_muck_s/" class="external-link" target="_blank" rel="noopener"&gt;undifferentiated heavy lifting&lt;/a&gt; easy.
Here, I will talk about serving static web content.
The AWS way to serve static web content involves putting that content in an S3 bucket,
and then delivering it using their CloudFront CDN.
There are a few other parts involved, but here are the things you will need to bring to the party.&lt;/p&gt;</description></item><item><title>Getting Started With Hugo</title><link>https://blog.agh1973.com/posts/getting-started-with-hugo/</link><pubDate>Wed, 22 Jul 2020 00:00:00 +0000</pubDate><guid>https://blog.agh1973.com/posts/getting-started-with-hugo/</guid><description>&lt;h2 id="introduction"&gt;
 Introduction
 &lt;a class="heading-link" href="#introduction"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;I guess every Hugo based technical blog has a mandatory first post
on the topic of getting started with Hugo. This is gonna be a short one&amp;hellip;
because so far, Hugo has been entirely straight forward to use.
Took me about 20 minutes to get this working.&lt;/p&gt;
&lt;h3 id="why-another-blog-dude"&gt;
 Why Another Blog, Dude
 &lt;a class="heading-link" href="#why-another-blog-dude"&gt;
 &lt;i class="fa-solid fa-link" aria-hidden="true" title="Link to heading"&gt;&lt;/i&gt;
 &lt;span class="sr-only"&gt;Link to heading&lt;/span&gt;
 &lt;/a&gt;
&lt;/h3&gt;
&lt;p&gt;First of all, my pronouns are &amp;ldquo;them/they&amp;rdquo; or &amp;ldquo;he/him/brah&amp;rdquo;.
And second, because while I&amp;rsquo;ve done CI for Hugo before, I had forgotten how.
I spent about an hour talking the ear off &lt;a href="https://github.com/maxxiimo" class="external-link" target="_blank" rel="noopener"&gt;Chris&lt;/a&gt;
about how cool AWS static content delivery was.
And how I could blast together something in the also-very-cool
&lt;a href="https://github.com/aws/aws-cdk" class="external-link" target="_blank" rel="noopener"&gt;aws-cdk&lt;/a&gt; in like an hour for his Hugo sites.
Then life happened and&amp;hellip; I was a bad friend.&lt;/p&gt;</description></item></channel></rss>