<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://jakehendy.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://jakehendy.com/" rel="alternate" type="text/html" /><updated>2026-11-10T18:35:47+00:00</updated><id>https://jakehendy.com/feed.xml</id><title type="html">Jake Hendy</title><subtitle>Jake Hendy; Technical Lead, Fitness Instructor, and more.
</subtitle><author><name>Jake Hendy</name></author><entry><title type="html">Stockholm? Why won’t you make it stop</title><link href="https://jakehendy.com/2025/06/04/stockholm-why-wont-you-make-it-stop/" rel="alternate" type="text/html" title="Stockholm? Why won’t you make it stop" /><published>2025-06-04T00:00:00+00:00</published><updated>2025-06-04T00:00:00+00:00</updated><id>https://jakehendy.com/2025/06/04/stockholm-why-wont-you-make-it-stop</id><content type="html" xml:base="https://jakehendy.com/2025/06/04/stockholm-why-wont-you-make-it-stop/"><![CDATA[<p><em>I’m a little impressed that the Foo Fighters almost sung about this</em>.</p>

<p>The AWS Console, the ability to control hundreds to thousands of resources across the <del>27</del> <del>32</del> 36<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote" rel="footnote">1</a></sup> regions AWS operates in. A single pane of glass for multiple millions of pounds of spending, a UI marvel—at least relative to Microsoft Azure or Google Cloud.</p>

<p>If you’ve been in the AWS Console recently, in a new account or logging in for the first time in a while, you might have noticed you defaulted to the Stockholm <code class="language-plaintext highlighter-rouge">(eu-north-1)</code> region.
Even if you typically spend most of your time anywhere else like Ireland or London, or if you’re physically located anywhere else; you’ll be in Stockholm.</p>

<h2 id="why-stockholm">Why Stockholm</h2>

<p>It’s an open secret that AWS/Amazon assign codes to their buildings. In fact, it’s not a secret, if you look at your favourite Online Map the offices in London have the code on them.</p>

<p>The naming strategy for these is closest major international airport’s IATA code and the distance, as the crow flies, in miles. Amazon Shoreditch’s code of LHR16 is because it’s 16 miles from London Heathrow, which has an IATA code of LHR.</p>

<p>Stockholm’s biggest international airport is Stockholm Arlanda, with the IATA code of ARN. See where this is going?</p>

<p>When you log in to an account for the first time, via that identity provider, the AWS User Preference Service has to drop you <em>somewhere</em>.</p>

<p>Given that the User Preference Service has a list of all regions, and they’re <em>always</em> referred to internally by their codenames, that list will be sorted alphabetically. As such, even though you might run workloads in North Virginia or London and only those Tier 1 regions, Stockholm is the first in the list because of its IATA code.</p>

<p>If you’ve got to pick somewhere to put someone, the place that’s first on the list is as good as any, right?</p>

<h2 id="could-they-do-this-more-intelligently">Could they do this more intelligently?</h2>

<p>Now, I don’t know this for a fact, but Amazon/AWS values consistency above all else. Customer Obsession is though, a tenet held by all teams.</p>

<p>They could drop you in to the region you’re geographically closest to based on your IP address, but with global proxies and networks that’s not guaranteed. If you’re sat at your desk in Chicago or London you might appear in London, or Chicago, or New York, or Singapore, or anywhere.</p>

<p>You’ve now introduced inconsistency in to a user’s workflow and possibly problems.</p>

<blockquote>
  <p><em>login for first time in a while</em>
Why is this instance running?!
<em>shutdown</em>
<em>alarms go off</em>
! Ooops</p>
</blockquote>

<p>Could you drop the user to a region with their oldest resource? Could you drop the user to a region with their biggest set of resources?
AWS has no idea what’s important to you, and after that first drop the User Preference Service will remember which region you selected last time so it doesn’t matter.</p>

<p>The safest, and most consistent option, is to drop the user to a region that’s top of the list.</p>

<h2 id="foo-fighters">Foo fighters?</h2>

<p>The last verse of <em>Arlandria</em>… if we change Arlandria to Arlanda. Of course, the first region that was launched of the <em>proper</em> AWS Network is of course <code class="language-plaintext highlighter-rouge">us-east-1</code>, (North) Virginia.</p>

<blockquote>
  <p>You are not me, Arlandria, Arlandria
You ain’t what I mean, Arlandria, Arlandria
Oh God, you gotta make it stop
My sweet Virginia
Oh God, you gotta make it stop</p>
</blockquote>

<h2 id="how-can-you-tell">How can you tell</h2>

<p>Luckily at work, we block most regions since we’ve no reason to run in them, so nice big red banners appear everywhere and <em>most</em> people twig they’re in the wrong region.</p>

<p>If you don’t have SCPs kicking you out though, well, here’s hoping you don’t panic too hard when you see nothing running.</p>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1" role="doc-endnote">
      <p>Yeah I meant to Google this before going live, thinking it couldn’t be as high as 27. It’s 36 according to Amazon Q or ChatGPT, but 32 if I count in the console. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>Jake Hendy</name></author><category term="aws," /><category term="awsconsole" /><summary type="html"><![CDATA[I’m a little impressed that the Foo Fighters almost sung about this.]]></summary></entry><entry><title type="html">Lock, stock, and an unsmoked wallet</title><link href="https://jakehendy.com/2025/03/10/lock-stock-and-an-unsmoked-wallet/" rel="alternate" type="text/html" title="Lock, stock, and an unsmoked wallet" /><published>2025-03-10T00:00:00+00:00</published><updated>2025-03-10T00:00:00+00:00</updated><id>https://jakehendy.com/2025/03/10/lock-stock-and-an-unsmoked-wallet</id><content type="html" xml:base="https://jakehendy.com/2025/03/10/lock-stock-and-an-unsmoked-wallet/"><![CDATA[<p>I’m the kind of person that finds stocks, shares, and financial instruments interesting. If I didn’t go in to tech, I still probably wouldn’t have gone in to finance, but it’s nice to think I might have.</p>

<p>Whether it’s watching films like <a href="https://en.wikipedia.org/wiki/The_Big_Short_(film)#"><em>The Big Short</em></a> (an impressive 91% accuracy marker) or listening to Podcasts about trading, I’ll consume finance content in any form.
I’ve bought the Financial Times, do I understand most of it? 
No, but the rabbit really likes it as a hutch liner, so I can pretend to be financially literate and he can tear up and piss all over some fatcat.</p>

<p>I’ve a couple of [Indvidiual Savings Accounts (ISAs)][isa] which are managed and invested in green shares; no oil here. They’ve done moderately well, but I’ve always wondered how it all works underneath.</p>

<p>I’m fascinated by <a href="https://www.bloomberg.com/professional/products/bloomberg-terminal/">Bloomberg Terminals</a>, havnig done an interneship at Thomson Reuters and seeing some of the tech behind, it was fascinating.
When I need to focus, sometimes I put on BloombergTV (<em>cough</em> NERD <em>cough</em>) because I’m vaguely interested.
You know that they could roughly predict the US Presidential Election by some financial instruments performance? True story, and quite scary.</p>

<p>Well, last year I actually dipped my toe in and decided to get a Trading212 account.
The promise of a free fractional share, and having a little extra money I didn’t mind (I would) mind losing in case I made some horrific decisions spurred me on.</p>

<p>I was cautious, and bought the dips on a few companies knowing they’d bounce back; like <em>Crowdstrike (CRWD)</em>.
Am I going to do that wanky thing of putting stocktickers after company names? Probably, if I’m going to be a finance bro, I may as well go all in.</p>

<p><em>A finance bro</em> yes, I’m going to write about my trades. Both because I need the experience, but also for low-key low-volume low-risk trades, I think I could possibly help show that it’s not that scary? I avoided Bitcoin like the plague (until 2022, but that’s a blogpost for another day) but the stock market is here forever. So there’s no time like the present.</p>

<h2 id="what-is-this-series-then">What is this series then?</h2>

<p>Well, sometimes to learn about something it helps to write and teach others.</p>

<p>I want to share how I do trading (who knows, maybe I’ll make a YouTube video) but I also want to branch out to other things. How does one go short, and go long, that kinda thing. I roughly know what shorting is (I bet they’re going to lose money) but I’d like to know more.</p>

<p>We’re also going to look at different types of stocks; from companies like Google or Ford, to commodities like gold or tin or wine. Or something else.</p>

<p>There’s no real fixed journey for this, but I would like to make money. Safely, with relatively low risk. But life is expensive, and I’m sure as heck not going to get a good following on OnlyFans, so shares it is!</p>

<p>It also serves to help me get better at writing, since I’ll have something to write about… will it be interesting? Maybe once or twice. Probably not.</p>

<h2 id="not-financial-advice">Not financial advice!</h2>

<p>Now comes the super important bit. This isn’t financial advice, you wouldn’t take it from me anyway, but it can’t hurt to balance out the field right? Any activity you perform after reading my blog is entirely of your own volition. If it works out, great. If it doesn’t work out, I’m really sorry.</p>

<h2 id="whats-your-starting-position">What’s your starting position?</h2>

<p>Well, I’ve purchased a few shares in a few different companies. Mostly tech, partly my employer (within guidlines, I hasten to add), and when they’ve dipped.</p>

<p>At the time I thought I’d start writing this blog because it was interesting, I had a 90% rate of returns… however, I missed a few sales since then and I’m now down to about 80%. Still really good, but annoyingly, I’ve missed some.</p>

<p>At the time of writing, mid February, I had £2,790.25 invested.</p>

<p><img src="https://github.com/user-attachments/assets/ac364085-9014-4099-995c-005ae2e949e3" alt="Investment Summary" />
<img src="https://github.com/user-attachments/assets/873ee520-6206-4af1-873e-1b241bb61919" alt="Invested instruments" /></p>

<p>I sold off my Crowdstrike shares as they were peaking, and I didn’t think they’d reach higher than their peak following on from their planet-scale outage.</p>

<p>Palo Alto I’ve held on to, as they hit a peak, mostly because I never got around to actually hitting the sell button.</p>

<p>Nvidia, well, I bought low because their earnings call was on the horizon and with ✨ everything AI ✨ they’re doing super well.
Then DeepSeek came out, shattered standards (pretty well), and a botched RTX5 series launch meant I’ve now lost a bit of money on Nvidia. Which is fine, because we’re not shorting stock, and it will bounce back. It is after all, Nvidia.</p>

<p>There’s one company I won’t mention, even by name, because they’re not going to feature in this series. I’m not in any position to know any inside information, nor do I even want the possibility of impropriety, and it’s easy to just leave them out. I won’t blur them out, because then it looks like I’m hiding something, but they won’t feature in any righting.</p>]]></content><author><name>Jake Hendy</name></author><category term="personal," /><category term="finance," /><category term="fintrade" /><summary type="html"><![CDATA[I’m the kind of person that finds stocks, shares, and financial instruments interesting. If I didn’t go in to tech, I still probably wouldn’t have gone in to finance, but it’s nice to think I might have.]]></summary></entry><entry><title type="html">Thirty years</title><link href="https://jakehendy.com/2025/01/02/Thirty-years/" rel="alternate" type="text/html" title="Thirty years" /><published>2025-01-02T00:00:00+00:00</published><updated>2025-01-02T00:00:00+00:00</updated><id>https://jakehendy.com/2025/01/02/Thirty-years</id><content type="html" xml:base="https://jakehendy.com/2025/01/02/Thirty-years/"><![CDATA[<p>Kicking off a New Year, I’m not really one for making resolutions. If I want to do something, or change something, I don’t see why I should wait for it. Maybe I’ll spend a little time planning it, for sure, but I’ll do it or plan it now.</p>

<p>Life is busy. Everyone is busy. Time is running away from us all, and it feels like it’s running quicker than ever. So with a new year, I think it’s time that <em>I don’t make a resolution</em> but rather a commimtment to my friends and those I hold close to me.</p>

<p>Going in to this year I want to spend more time on those relationships; closing off the world to spend time with those people, for the serious side of life but also the fun side. Ever wondered what your friends would do in a zombie apocalypse or where they’d go? The best concert they’ve ever been to?</p>

<p>Cold-posting on my blog isn’t a very public commitment, but this is more for me, hopefully the results will speak for themselves. Of course some people (hey all two of you, heyy, thanks for stopping by! 👋🏼) will read the blog and they’re more than welcome to chase me down and make sure I follow through. Finding time for friends will also, hopefully, help me find time to <em>write</em> more. Far too much I’ve forgotten already in and little tidbits come through, which I write down somewhere. Every photo (over 37,000 so far… just in the camera roll) I take I try remember the backstory of, helped thanks to all the EXIF data but also taking notes. Even with a myriad of devices, <em>even</em> when I’m at a conference taking photos of slide decks and making notes, I struggle to write that up in to long form content that others can hopefully enjoy.</p>

<p>So in 2025 that’s going to change. One blog post last year, that never left the drafts. One blog post already in 2025. Next year, well, we’ll see 😊</p>]]></content><author><name>Jake Hendy</name></author><category term="personal" /><summary type="html"><![CDATA[Kicking off a New Year, I’m not really one for making resolutions. If I want to do something, or change something, I don’t see why I should wait for it. Maybe I’ll spend a little time planning it, for sure, but I’ll do it or plan it now.]]></summary></entry><entry><title type="html">What does the console actually do?</title><link href="https://jakehendy.com/2023/02/05/What-does-the-console-actually-do/" rel="alternate" type="text/html" title="What does the console actually do?" /><published>2023-02-05T00:00:00+00:00</published><updated>2023-02-05T00:00:00+00:00</updated><id>https://jakehendy.com/2023/02/05/What-does-the-console-actually-do</id><content type="html" xml:base="https://jakehendy.com/2023/02/05/What-does-the-console-actually-do/"><![CDATA[<p>The AWS Console is in my opinion a cornerstone of the AWS ecosystem.  Some laud it’s simplicity, some rank it at the bottom for usability.
Undoubtedly, it’s an important tool for anyone interacting with AWS whether they’re building, maintaining, or learning.</p>

<p>I generally find the AWS Console easy enough to use, whether that’s honed from nearly 10 years of using it I’m not sure. Likewise, I feel quite comfortable using the AWS CLI, the official SDKs like <code class="language-plaintext highlighter-rouge">boto3</code>, or IaC tools like CDK, CloudFormation, or Terraform.
When doing something for the first time I plod around the console to get a feel for timings and seeing it work before taking it to the API (for automation) or IaC (for infra).</p>

<p>AWS is very good at making sure the Service Teams use the same public APIs we all use in the console; there are a few notable exceptions such as Dead-Letter Queue Re-drive in SQS which is a Console-only API. This gives us the familiarity we all expect from AWS and helps them dogfood and keep that customer obsession: if a Service Team can’t confidently build using their own APIs and their internal knowledge, how can a customer?</p>

<p>There is, however, one area that I’d like to see AWS improve going forwards, and that’s the transition from the console to the API.
If you open the Network panel of your favourite browser’s Developer Tools you can watch the requests go out and how the API is used, if you can avoid the plethora of telemetry requests and <code class="language-plaintext highlighter-rouge">List</code>/<code class="language-plaintext highlighter-rouge">Describe</code> actions that power the console and keep the user experience.
Otherwise it’s down to you to take what you just typed/clicked through and then turn it in to an API call, or even translate it in to IaC.</p>

<p>Depending on your browser, you might have to click around to find the Request Payload like I did in Safari: it’s normally a bit easier in Chromium-based browsers.</p>

<p><img src="/images/2023-05-02-what-does-the-console-actually-do/01-devtools-network-overview.png" alt="A sample of network requests" />
<img src="/images/2023-05-02-what-does-the-console-actually-do/02-devtools-sample-payload.png" alt="A sample network request for creating an SQS queue" /></p>

<h2 id="what-about-the-competition">What about the competition?</h2>

<p>If we look at a competitor like Azure, after going through the verbose (which admittedly has it’s pro’s) wizard to launch a Virtual Machine we can download a template for automation. Is it perfect? No, it takes you to another screen to decipher Azure Resource Manager templates but it does give you JSON of the template <em>and</em> JSON of the parameters, a tree view of the JSON model, and a Scripts tab which links you to additional documentation on <em>scripting</em> these templates.</p>

<p><img src="/images/2023-05-02-what-does-the-console-actually-do/03-azure-vm-wizard-overview.png" alt="The end of the Azure Virtual Machine Creation wizard, with an option to view the template" /></p>

<p>Is it pretty? No, it’s JSON rather than Azure CLI. Is the UI better? Not massively no, but it’s functional. I am not an Azure user, but I roughly know what I’m going to get with that template already. Can I transpose it to Terraform for Azure? Not directly, but I can reference values as necessary.</p>

<p><img src="/images/2023-05-02-what-does-the-console-actually-do/04-azure-vm-template.png" alt="The generated Azure Resource Manager template for a sample Virtual Machine" /></p>

<h2 id="what-would-i-like">What would I like?</h2>

<p>For some way to see what the API payload is for public APIs, and for private APIs I’d like to be told that it’s a private API. I’d like to see this visualised in the console, hidden by default unless necessary. I don’t want it to translate it to <code class="language-plaintext highlighter-rouge">boto3</code> or anything, I’d like to see the JSON payload it just fired. Heck, for those services that still prefer XML like EC2 and SQS I’ll take that, too.</p>

<p>I’d like to see this persist for my session, stored in the browser’s Local Storage so I can look back at the last few events to see how they replay.</p>

<p>To expose this as an option, I could see it as another icon next to CloudShell to show your API activity.
This could, as a quick example, take you to a new page containing a typical two-pane setup: the left-hand pane with the list of API events, each item has a header with the service name and action and a line underneath of the datetime, and the right-hand pane contains the JSON payload and a link to the API documentation.</p>

<h2 id="isnt-this-cloudtrail">Isn’t this CloudTrail?</h2>

<p>CloudTrail does indeed record management API activity by default, and you absolutely should get used to using the CloudTrail UI in the console because it is really powerful.
CloudTrail does monitor <em>all</em> API activities, and unless you export (or run CloudTrail lake) you can only put one filter on.</p>

<p>You could be in a shared account with other individuals doing ClickOps, or other automated systems could be manipulating resources too. You’re reliant on being able to filter out activity in CloudTrail to find your own, similar to the Network tab, and there’s additional data to sort through in the CloudTrail response. Useful data, but remember we want the API action rather than the management event.</p>

<p>My suggestion focuses on developer experience rather than auditing like CloudTrail does: supporting the building and maintenance of infrastructure.</p>

<h2 id="who-is-this-for">Who is this for?</h2>

<p>I know this isn’t a simple feature to implement and of course comes with its own maintenance headaches, but I think a sizeable group would find this beneficial. We’ve seen a number of community projects spring up around AWS provided content, and I could see this feature providing more: AWS provides the API payload, and a community service (or vendor, like Hashicorp) provides an API Payload to Terraform translation.</p>

<p>There are benefits across the full range of experiences, from those starting out new to AWS wanting to experience the command line, to those familiar with AWS but wanting to automate, to seasoned engineers writing automation against new services.
In fact, I’m pretty sure some elements of the AWS console already have this where you can copy out CLI commands.</p>

<p>I don’t think this will be implemented any time soon, but I do hope it makes its way to the browser team as a possibility for a hack day. I’d love to write a bookmarklet/browser plugin to do this I don’t have the time (I’ve had this idea since before re:invent 2022!), and I suspect there’s additional security in play which will stop sideloading additional scripts etc. I’m not a front-end developer, so it wouldn’t work as well either.</p>]]></content><author><name>Jake Hendy</name></author><category term="aws," /><category term="amazon," /><category term="api" /><summary type="html"><![CDATA[The AWS Console is in my opinion a cornerstone of the AWS ecosystem. Some laud it’s simplicity, some rank it at the bottom for usability. Undoubtedly, it’s an important tool for anyone interacting with AWS whether they’re building, maintaining, or learning.]]></summary></entry><entry><title type="html">Roaming around with Sonos</title><link href="https://jakehendy.com/2021/04/20/Roaming-with-Sonos/" rel="alternate" type="text/html" title="Roaming around with Sonos" /><published>2021-04-20T00:00:00+00:00</published><updated>2021-04-20T00:00:00+00:00</updated><id>https://jakehendy.com/2021/04/20/Roaming-with-Sonos</id><content type="html" xml:base="https://jakehendy.com/2021/04/20/Roaming-with-Sonos/"><![CDATA[<p>Music is a massive part of my home. There are more hours where music is played than where music isn’t played, and yes even when sleeping there is music. Or a soundscape, but definitely noise.</p>

<p>A couple years ago I picked up a Sonos Beam as a (relatively) cheap upgrade to our Lounge TV setup. I had a Sony CT-370 previously and there was an improvement even without the Sonos Sub. Adding the Sonos Sub though, bloody lovely. I’d have loved to get the Sonos Arc, but that was almost double the price when it was announced two months after I bought the Beam, my ears aren’t that aware, and the TV will be upgraded first.</p>

<p>In the Kitchen there was a Bose Mini II SoundLink paired with a first-generation Echo Dot. The SoundLink is pushing 6 years old now (although it feels much older) with its battery life waning, connected via Bluetooth to the Echo Dot. The quality was good, but there were occasionally drop outs and random blips in performance with the Dot and the SoundLink with other devices and services.
There was of course two cables and you have to keep the Echo Dot some distance from the speaker when it’s paired over Bluetooth. Could I have connected them via a 3.5mm aux? Yes, and I did, but also more cables and messy.</p>

<p>Then I got an email about a special event from Sonos which piqued my interest, I added it to my calendar and promptly forgot.
As fate would have it my evening was clear and I joined in for the special event, which revealed the Roam.</p>

<p>Maybe I was having a rough day and wanted to spend money (probably…🙊) , maybe I’m secretly a Sonos fanboy (yes…), maybe I was generally impressed with the product (definitely). I pre-ordered it as soon as the reveal event was over. A two month wait for the device was a long wait <em>but</em> let’s face it, we’ve all had various long wait’s over the past year.</p>

<h2 id="unboxing">Unboxing</h2>

<p>First impressions count, and Sonos did a great job here. The box is made from recyclable and sustainable materials, and there’s a nice little loop to help pull it out of the shipping box.</p>

<p><em>[Editor’s note, all photos here are on the sofa because both the table and the desk are covered with various notebooks and computer parts… terrible planning]</em></p>

<p><img src="https://user-images.githubusercontent.com/545914/115460902-bd173500-a220-11eb-917c-eff7c9908651.jpeg" alt="IMG_2070" /></p>

<p>There’s a cute little pouch for it. I’m not sure how robust it’ll be after thrown around in a bag, and to be honest the furthest it’ll go for me is to the garden and back.</p>

<p><img src="https://user-images.githubusercontent.com/545914/115461787-bc32d300-a221-11eb-9ced-78b9e118b971.jpeg" alt="IMG_2071" /></p>

<p>The getting started guide is tucked away under the Roam, and it’s a nice simple guide. What’s that behind the getting started guide? No idea, haven’t read it yet, was too excited.</p>

<p><img src="https://user-images.githubusercontent.com/545914/115460911-c0122580-a220-11eb-8176-8d0daf2d8360.jpeg" alt="IMG_2072" />
<img src="https://user-images.githubusercontent.com/545914/115460923-c30d1600-a220-11eb-95ce-7f967270f7c7.jpeg" alt="IMG_2073" /></p>

<h2 id="setup">Setup</h2>

<p>I already have the Sonos S2 app up and running, so let’s see how easy this is. The Beam requires you to join a specific WiFi network and all… NFC?! What’s this magic, slide my phone over the middle of the back of the Roam and that’s it?</p>

<p><img src="https://user-images.githubusercontent.com/545914/115462188-411dec80-a222-11eb-8503-1521582f5aad.PNG" alt="IMG_2074" />
<img src="https://user-images.githubusercontent.com/545914/115460939-c7393380-a220-11eb-9709-fa8b0b906b80.PNG" alt="IMG_2075" />
<img src="https://user-images.githubusercontent.com/545914/115460946-c902f700-a220-11eb-8c3b-416b513c6dcc.PNG" alt="IMG_2076" /></p>

<p>Yes, that really is it. It’s incredibly precise, if you do it at the bottom of the Roam it won’t pick it up, but it will helpfully tell you to do it against the Sonos device that is currently chiming.</p>

<p>A quick software update later (does anything <em>not</em> come with a Day 0 patch now?) and it’s running. I go through a separate flow to add Alexa to the device: tap-tap-smile at FaceID to login to Amazon-tap-done.
<img src="https://user-images.githubusercontent.com/545914/115460963-cd2f1480-a220-11eb-8e10-36514583324c.PNG" alt="IMG_2077" />
<img src="https://user-images.githubusercontent.com/545914/115462355-775b6c00-a222-11eb-82a5-d61166ad1881.PNG" alt="IMG_2078" /></p>

<p>Less than 10 minutes from unboxing, including taking some poor photos against the sofa, the Sonos is in the Kitchen playing Planet Rock. And then I get an email from Sonos advising me what to do before my Roam gets here… one step ahead of you here Sonos 😅</p>

<p><img src="https://user-images.githubusercontent.com/545914/115463050-462f6b80-a223-11eb-9c60-f1b6e96e3179.jpg" alt="C59DA62D-24EF-4763-83BD-495D3EF086EC" /></p>

<p><img src="https://user-images.githubusercontent.com/545914/115462647-cd301400-a222-11eb-88d2-722546ab90e0.jpeg" alt="IMG_2080" /></p>

<h2 id="whats-it-like">What’s it like?</h2>

<p>Amazing. I was playing music before I’d enabled TruePlay and it was doing a stellar job.
Turn TruePlay on and thankfully I don’t have to wave my phone around each time, it’ll do it automagically.</p>

<p><img src="https://user-images.githubusercontent.com/545914/115463243-7ecf4500-a223-11eb-871c-639799e93d9f.PNG" alt="IMG_2081" /></p>

<p>As a friend remarked, it’s not the true calibration you would normally get, but there is a subtle improvement in clarity and quality. It’s two-devices in one, it’s tidier on the side, and the sound quality is great.</p>

<p>I have a terrible bug with the Beam where Spotify wouldn’t connect from my phone. I know I have a troublesome setup (Ubiquiti devices), and as it turns out that when I try it writing this sentence it works perfectly.</p>

<p>I guess I can now cast from my phone to the Beam and the Roam. I can feel the wub (you need to feel the wub of course) with the Beam + Sub, but the Roam sounds incredible considering it’s so small. Especially considering I’m in the lounge writing this, whilst its in the Kitchen.</p>

<h2 id="could-it-be-improved">Could it be improved?</h2>

<p>There are two Alexa profiles in this house, and at the moment I can’t switch out of my Alexa account. Which is fine, because my account is the one with all the lights installed, but it will get annoying very shortly. I wondered if it was a setup thing that would come through in a couple of hours as it took a couple minutes for Alexa to fully enable, however eight hours later its still the same. “I’m sorry, I can’t do that right now” even after being switched off and on.</p>

<p>If you take it off the charger, it’ll turn off completely. There’s no standby mode, so you can’t walk in to the kitchen and ask Alexa straight away. However,  after you push the power button it is on <em>instantly</em>. I’ll keep it plugged in for now, and then treat myself to the wireless charger (retails for £44) some other time.</p>

<p>Tomorrow I’ll go through the Alexa apps and make sure they’re configured properly, because I also need to sort out these lights…</p>

<h2 id="whats-next">What’s next?</h2>

<p>Find an excuse to replace the Echo in my room with a Sonos One. Then find an excuse to add a pair of One’s to the lounge for true surround sound.</p>

<p><strong>I am sold on Sonos.</strong></p>]]></content><author><name>Jake Hendy</name></author><category term="sonos," /><category term="home," /><category term="alexa" /><summary type="html"><![CDATA[Music is a massive part of my home. There are more hours where music is played than where music isn’t played, and yes even when sleeping there is music. Or a soundscape, but definitely noise.]]></summary></entry><entry><title type="html">CD-Okay that’s how you do custom resources</title><link href="https://jakehendy.com/2021/03/23/CDK-Custom-Resources/" rel="alternate" type="text/html" title="CD-Okay that’s how you do custom resources" /><published>2021-03-23T00:00:00+00:00</published><updated>2021-03-23T00:00:00+00:00</updated><id>https://jakehendy.com/2021/03/23/CDK-Custom-Resources</id><content type="html" xml:base="https://jakehendy.com/2021/03/23/CDK-Custom-Resources/"><![CDATA[<p>Recently I’ve needed to use [CDK Custom Resources][cdk-custom-resources] and they’re <em>slightly</em> different from traditional CloudFormation Custom Resources.
The documentation tells you to wrap your response in a <code class="language-plaintext highlighter-rouge">Data</code> key, but it doesn’t explain why.</p>

<p>When you use a CDK custom resource, CDK actually deploys a <a href="https://github.com/aws/aws-cdk/blob/master/packages/%40aws-cdk/custom-resources/lib/provider-framework/runtime/framework.ts">JavaScript lambda</a> which acts as a wrapper around your lambda:
This wrapper does several things which we’ll go in to detail on:</p>

<h2 id="handling-responses-to-cloudformation">Handling Responses to CloudFormation</h2>

<p>This provider lambda will handle the responses to CloudFormation for you, including serialising your data and including the success codes.
Your actual lambda doesn’t need to do anything but execute successfully and return a JSON-serialisable object from its handler.
The provider lambda takes the result of your lambda and includes it in the CFn response so you can use your <code class="language-plaintext highlighter-rouge">getAtt</code>/<code class="language-plaintext highlighter-rouge">get_att</code> methods as you would in the CFn world.</p>

<h2 id="allows-you-to-execute-long-running-tasks">Allows you to execute long running tasks</h2>

<p>Sometimes the work you need to do takes some time, and managing retries of your resources can be a complex engineering challenge.
The provider will invoke your lambda at regular intervals, for your lambda to check if your event operation had completed.</p>

<blockquote>
  <p>But that will only give you 15 minutes?</p>
</blockquote>

<p>Yeap if the provider was just a lambda. The provider starts out as a lambda, but if you specify a <code class="language-plaintext highlighter-rouge">isComplete</code> handler CDK will create you a <a href="https://github.com/aws/aws-cdk/blob/41a2b2ef39a3d2b46ae6e2c6f3480e786e8022b9/packages/%40aws-cdk/custom-resources/lib/provider-framework/provider.ts#L162">Step Function (!)</a> to periodically call your function at regular intervals (that you specify) to a maximum timeout (that you specify), and then handle returns to CloudFormation.</p>

<p>It very much takes away all the pain of managing long-running tasks yourself. Now you may ask is it really that difficult to do long runnning tasks given it’s a state machine or possibly an EC2 and the answer is no, but CDK is all about making things easier and simpler. Why should you manage the long running tasks and state machines when you can focus on determining if the resource is ready yet? Let’s face it, you’re paying for the lambdas and state machines either way, chances are the CDK team will make them as cheap as they can.</p>

<h2 id="if-its-so-simple-why-did-you-get-stuck">If it’s so simple why did you get stuck?</h2>

<p>Well, I thought they were like regular CloudFormation Custom Resource lambdas, but they’re simpler. First let’s look at what a CloudFormation Custom Resource lambda has to do, and don’t <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code-cfnresponsemodule.html#w2ab1c27c24c14b9c15">forget to bundle <code class="language-plaintext highlighter-rouge">cfnresponse</code></a> or make sure you upload it as a ZipFile:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">boto3</span>
<span class="kn">import</span> <span class="nn">cfnresponse</span> <span class="c1"># lol, or inline it
</span>
<span class="n">lambda_</span> <span class="o">=</span> <span class="n">boto3</span><span class="p">.</span><span class="n">client</span><span class="p">(</span><span class="s">'lambda'</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">handler</span><span class="p">(</span><span class="n">event</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
    <span class="n">the_lambda</span>  <span class="o">=</span> <span class="n">lambda_</span><span class="p">.</span><span class="n">get_versions_by_function</span><span class="p">(</span><span class="n">FunctionName</span><span class="o">=</span><span class="s">'KeepUpAppearances'</span><span class="p">)</span>
    <span class="n">versions</span> <span class="o">=</span> <span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="n">version</span><span class="p">[</span><span class="s">"Version"</span><span class="p">])</span> <span class="k">for</span> <span class="n">version</span> <span class="ow">in</span> <span class="n">the_lambda</span><span class="p">[</span><span class="s">'Versions'</span><span class="p">]</span> <span class="k">if</span> <span class="n">version</span><span class="p">[</span><span class="s">"Version"</span><span class="p">]</span> <span class="o">!=</span> <span class="s">'$LATEST'</span><span class="p">]</span>
     <span class="k">print</span><span class="p">(</span><span class="sa">f</span><span class="s">'The following versions are available </span><span class="si">{</span><span class="n">versions</span><span class="o">=</span><span class="si">}</span><span class="s">'</span><span class="p">)</span>
     <span class="n">latest_version</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">versions</span><span class="p">)</span>
     <span class="n">response_data</span> <span class="o">=</span> <span class="p">{</span>
         <span class="s">'LatestVersion'</span><span class="p">:</span> <span class="n">latest_version</span>
     <span class="p">}</span>
     <span class="n">cfnresponse</span><span class="p">.</span><span class="n">send</span><span class="p">(</span><span class="n">event</span><span class="p">,</span> <span class="n">context</span><span class="p">,</span> <span class="n">cfnresponse</span><span class="p">.</span><span class="n">SUCCESS</span><span class="p">,</span> <span class="n">response_data</span><span class="p">,</span> <span class="n">event</span><span class="p">[</span><span class="s">'PhysicalResourceID'</span><span class="p">])</span>
</code></pre></div></div>

<p>In one CDK application with two custom resources I’ve managed to get CloudFormation to bundle <code class="language-plaintext highlighter-rouge">cfnresponse</code> in for only one…</p>

<p>What about in CDK land then?</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">import</span> <span class="nn">boto3</span>


<span class="n">lambda_</span> <span class="o">=</span> <span class="n">boto3</span><span class="p">.</span><span class="n">client</span><span class="p">(</span><span class="s">'lambda'</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">handler</span><span class="p">(</span><span class="n">event</span><span class="p">,</span> <span class="n">context</span><span class="p">):</span>
    <span class="n">the_lambda</span>  <span class="o">=</span> <span class="n">lambda_</span><span class="p">.</span><span class="n">get_versions_by_function</span><span class="p">(</span><span class="n">FunctionName</span><span class="o">=</span><span class="s">'KeepUpAppearances'</span><span class="p">)</span>
    <span class="n">versions</span> <span class="o">=</span> <span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="n">version</span><span class="p">[</span><span class="s">"Version"</span><span class="p">])</span> <span class="k">for</span> <span class="n">version</span> <span class="ow">in</span> <span class="n">the_lambda</span><span class="p">[</span><span class="s">'Versions'</span><span class="p">]</span> <span class="k">if</span> <span class="n">version</span><span class="p">[</span><span class="s">"Version"</span><span class="p">]</span> <span class="o">!=</span> <span class="s">'$LATEST'</span><span class="p">]</span>
     <span class="k">print</span><span class="p">(</span><span class="sa">f</span><span class="s">'The following versions are available </span><span class="si">{</span><span class="n">versions</span><span class="o">=</span><span class="si">}</span><span class="s">'</span><span class="p">)</span>
     <span class="n">latest_version</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">versions</span><span class="p">)</span>
     <span class="n">response_data</span> <span class="o">=</span> <span class="p">{</span>
         <span class="s">'LatestVersion'</span><span class="p">:</span> <span class="n">latest_version</span>
     <span class="p">}</span>
     <span class="k">return</span> <span class="p">{</span>
         <span class="s">'Data'</span><span class="p">:</span> <span class="n">response_data</span>
     <span class="p">}</span>
     
</code></pre></div></div>

<p>In this very simple example, it doesn’t change much, but you still don’t have to worry about that pesky cfnresponse.</p>

<p>You have to make sure that you wrap the data you want to be made available in that <code class="language-plaintext highlighter-rouge">Data</code> key though.</p>

<p>The <a href="https://github.com/aws/aws-cdk/blob/41a2b2ef39a3d2b46ae6e2c6f3480e786e8022b9/packages/%40aws-cdk/custom-resources/lib/provider-framework/runtime/framework.ts#L26"><code class="language-plaintext highlighter-rouge">onEvent</code> handler</a> method invokes the lambda, then coalesces the response data back in to a super object in the <a href="https://github.com/aws/aws-cdk/blob/25e8d04d7266a2642f11154750bef49a31b1892e/packages/%40aws-cdk/custom-resources/lib/provider-framework/runtime/framework.ts#L153"><code class="language-plaintext highlighter-rouge">createResponseEvent</code></a>: with this little JavaScript magic (the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax">spread operator</a>):</p>

<div class="language-typescript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">return</span> <span class="p">{</span>
    <span class="p">...</span><span class="nx">cfnRequest</span><span class="p">,</span>
    <span class="p">...</span><span class="nx">onEventResult</span><span class="p">,</span>
    <span class="na">PhysicalResourceId</span><span class="p">:</span> <span class="nx">physicalResourceId</span><span class="p">,</span>
  <span class="p">};</span>
</code></pre></div></div>

<p>where <code class="language-plaintext highlighter-rouge">onEventResult</code> is the response of our lambda. This super object is then used in the <a href="https://github.com/aws/aws-cdk/blob/25e8d04d7266a2642f11154750bef49a31b1892e/packages/%40aws-cdk/custom-resources/lib/provider-framework/runtime/cfn-response.ts#L33"><code class="language-plaintext highlighter-rouge">cfnResponse.submitResponse</code></a> method:</p>

<div class="language-typescript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">export</span> <span class="k">async</span> <span class="kd">function</span> <span class="nx">submitResponse</span><span class="p">(</span><span class="nx">status</span><span class="p">:</span> <span class="dl">'</span><span class="s1">SUCCESS</span><span class="dl">'</span> <span class="o">|</span> <span class="dl">'</span><span class="s1">FAILED</span><span class="dl">'</span><span class="p">,</span> <span class="nx">event</span><span class="p">:</span> <span class="nx">CloudFormationEventContext</span><span class="p">,</span> <span class="nx">options</span><span class="p">:</span> <span class="nx">CloudFormationResponseOptions</span> <span class="o">=</span> <span class="p">{</span> <span class="p">})</span> <span class="p">{</span>
  <span class="kd">const</span> <span class="nx">json</span><span class="p">:</span> <span class="nx">AWSLambda</span><span class="p">.</span><span class="nx">CloudFormationCustomResourceResponse</span> <span class="o">=</span> <span class="p">{</span>
    <span class="na">Status</span><span class="p">:</span> <span class="nx">status</span><span class="p">,</span>
    <span class="na">Reason</span><span class="p">:</span> <span class="nx">options</span><span class="p">.</span><span class="nx">reason</span> <span class="o">||</span> <span class="nx">status</span><span class="p">,</span>
    <span class="na">StackId</span><span class="p">:</span> <span class="nx">event</span><span class="p">.</span><span class="nx">StackId</span><span class="p">,</span>
    <span class="na">RequestId</span><span class="p">:</span> <span class="nx">event</span><span class="p">.</span><span class="nx">RequestId</span><span class="p">,</span>
    <span class="na">PhysicalResourceId</span><span class="p">:</span> <span class="nx">event</span><span class="p">.</span><span class="nx">PhysicalResourceId</span> <span class="o">||</span> <span class="nx">MISSING_PHYSICAL_ID_MARKER</span><span class="p">,</span>
    <span class="na">LogicalResourceId</span><span class="p">:</span> <span class="nx">event</span><span class="p">.</span><span class="nx">LogicalResourceId</span><span class="p">,</span>
    <span class="na">NoEcho</span><span class="p">:</span> <span class="nx">options</span><span class="p">.</span><span class="nx">noEcho</span><span class="p">,</span>
    <span class="na">Data</span><span class="p">:</span> <span class="nx">event</span><span class="p">.</span><span class="nx">Data</span><span class="p">,</span>
  <span class="p">};</span>

  <span class="nx">log</span><span class="p">(</span><span class="dl">'</span><span class="s1">submit response to cloudformation</span><span class="dl">'</span><span class="p">,</span> <span class="nx">json</span><span class="p">);</span>

  <span class="kd">const</span> <span class="nx">responseBody</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">json</span><span class="p">);</span>

  <span class="kd">const</span> <span class="nx">parsedUrl</span> <span class="o">=</span> <span class="nx">url</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">event</span><span class="p">.</span><span class="nx">ResponseURL</span><span class="p">);</span>
  <span class="k">await</span> <span class="nx">httpRequest</span><span class="p">({</span>
    <span class="na">hostname</span><span class="p">:</span> <span class="nx">parsedUrl</span><span class="p">.</span><span class="nx">hostname</span><span class="p">,</span>
    <span class="na">path</span><span class="p">:</span> <span class="nx">parsedUrl</span><span class="p">.</span><span class="nx">path</span><span class="p">,</span>
    <span class="na">method</span><span class="p">:</span> <span class="dl">'</span><span class="s1">PUT</span><span class="dl">'</span><span class="p">,</span>
    <span class="na">headers</span><span class="p">:</span> <span class="p">{</span>
      <span class="dl">'</span><span class="s1">content-type</span><span class="dl">'</span><span class="p">:</span> <span class="dl">''</span><span class="p">,</span>
      <span class="dl">'</span><span class="s1">content-length</span><span class="dl">'</span><span class="p">:</span> <span class="nx">responseBody</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
    <span class="p">},</span>
  <span class="p">},</span> <span class="nx">responseBody</span><span class="p">);</span>
<span class="p">}</span>
</code></pre></div></div>

<h2 id="summary">Summary</h2>

<p>When I first looked in to this I was really confused why there was a need to wrap your response in <code class="language-plaintext highlighter-rouge">Data</code>, but it makes sense considering you could return anything. The Custom Resources implementation under the hood is really impressive, and now I understand it more I can certainly see more ways to use it; from large scale  ingestion with SQS + Lambda (where my <code class="language-plaintext highlighter-rouge">onEvent</code> can generate millions of messages and <code class="language-plaintext highlighter-rouge">isComplete</code> can check if the queue is empty) to EC2 fleet setup.</p>]]></content><author><name>Jake Hendy</name></author><category term="cdk," /><category term="aws" /><summary type="html"><![CDATA[Recently I’ve needed to use [CDK Custom Resources][cdk-custom-resources] and they’re slightly different from traditional CloudFormation Custom Resources. The documentation tells you to wrap your response in a Data key, but it doesn’t explain why.]]></summary></entry><entry><title type="html">Parameters, please</title><link href="https://jakehendy.com/2021/03/16/Parameters-please/" rel="alternate" type="text/html" title="Parameters, please" /><published>2021-03-16T00:00:00+00:00</published><updated>2021-03-16T00:00:00+00:00</updated><id>https://jakehendy.com/2021/03/16/Parameters-please</id><content type="html" xml:base="https://jakehendy.com/2021/03/16/Parameters-please/"><![CDATA[<p>A great friend recently asked if I could help an individual in the CDK slack channel. This individual had a DynamoDB table in one CDK stack and wanted to depend on it in another for a producer/consumer of data in that table.
The individual then changed the logical ID of that resource and boomalaboomala it went boom.</p>

<p>The logical ID I hear you ask? Okay quick detour, this part highlighted:</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">from</span> <span class="nn">aws_cdk</span> <span class="kn">import</span> <span class="p">(</span><span class="n">core</span><span class="p">,</span> <span class="n">aws_s3</span> <span class="k">as</span> <span class="n">s3</span><span class="p">)</span>

<span class="k">class</span> <span class="nc">ExampleStack</span><span class="p">(</span><span class="n">core</span><span class="p">.</span><span class="n">Stack</span><span class="p">):</span>
    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">scope</span><span class="p">:</span> <span class="n">core</span><span class="p">.</span><span class="n">Construct</span><span class="p">,</span> <span class="nb">id</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
        <span class="nb">super</span><span class="p">().</span><span class="n">__init__</span><span class="p">(</span><span class="n">scope</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>

        <span class="bp">self</span><span class="p">.</span><span class="n">hyacinthe</span> <span class="o">=</span> <span class="n">s3</span><span class="p">.</span><span class="n">Bucket</span><span class="p">(</span>
            <span class="bp">self</span><span class="p">,</span> 
            <span class="s">"ItIsPronouncedBookay"</span><span class="p">,</span> <span class="c1"># &lt;-- this is the Logical ID
</span>            <span class="n">bucket_name</span> <span class="o">=</span> <span class="s">"hyacinth"</span>
        <span class="p">)</span>
</code></pre></div></div>

<p>Changing the logical ID in CloudFormation generally means that it is a different resource. CloudFormation will both try to delete it and recreate it, with some fun things happening.</p>

<p>I did it with a Lambda, and didn’t update the function name, and CloudFormation complained that the function already existed. <em>Like yes of course it exists</em>… ohhh it’s a new thing to you. Of course, I changed the lambda function name and then it was fixed. Function deployed, accolades collected, yadayadayada.</p>

<p><strong>Back on topic.</strong></p>

<p>This individual had <code class="language-plaintext highlighter-rouge">overrideLogicalIds</code> turned on for some reason, I didn’t explore why but one assumes that since this is non-default behaviour they reasonably knew what they were doing. Even if they didn’t, the solution reasonably remains.</p>

<p>The individual had a CfnExport (which CDK generates for you under the hood when you pass classes/Stacks/Constructs around) which was failing every time because the Logical ID kept changing. How do you get around this? With our trust friend AWSSMPM!</p>

<h2 id="aws-systems-manager-parameter-store">AWS Systems Manager Parameter Store</h2>

<p>Systems Manager is something that I don’t work with a lot of (mostly dealing with serverless) but there are two features of it I absolutely adore; Parameter Store, and Session Manager. Today we’re covering Parameter Store.</p>

<p><strong>Parameter store can store parameters of anything!</strong></p>

<p>You know AWS Secrets Manager? Before we had that (which was only a few years ago) we used Parameter Store and IAM policies, because if you managed to break the several security boundaries we already had you probably had a reasonable level of access anyway and would discover the secret.</p>

<p><em>[Editor’s note: I am fortunate to work in an organisation with a mature AWS Organisation that has sensible defaults and good layers of security, so we could relax the normal security rigmarole in a few select cases!]</em></p>

<p>You can store parameters for applications in there too, or the AMI IDs for your regularly-baked golden AMIs. You are baking them, right?</p>

<p>Parameter Store also enjoys first class support in <em>native</em> CloudFormation with <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/dynamic-references.html#dynamic-references-ssm">Dynamic References</a>. The problem with Dynamic References for SSM at least is that you must specify a version; and “$LATEST” is not a version unlike in the lambda world. This makes sense, because it is supposed to be a stable build. Parameters are owned by the account, and if you’re the only one in that account that’s great—but that’s not the case. Remember, the foundations AWS create (like dynamic references and their uses) must work for everybody.</p>

<p>There are two solutions.</p>

<h3 id="update-your-applications">Update your applications</h3>

<p>If you control the code for your applications this is brilliant, as you can probably change references that use environment variables to get parameters from parameter store, or have code that runs alongside them to set those environment variables.</p>

<p>Create a new parameter in your CDK class that exports and that’s it, the value is updated each time the stack is deployed.
Your applications can fetch this on startup, regularly in code execution, or when a resource is provisioned.</p>

<p>As an example if you update the parameter, you scan scale out your EC2s to pick up the new parameter and see if it works, if it doesn’t you can quickly revert and reprovision and done. Your CFn deploy time will probably slightly improve</p>

<h3 id="paramexim">ParamExim</h3>

<p>Export it and re-import it.</p>

<blockquote>
  <p>But Jake you just said that you can’t use Latest, and I want to use the latest</p>
</blockquote>

<p>This is absolutely right, you cannot do this in pure CloudFormation with Dynamic References.</p>

<p>The power of the CDK however, allows you to do so much more than simply dynamic references. In fact, in the CDK’s <a href="https://docs.aws.amazon.com/cdk/latest/guide/get_ssm_value.html">very own guide</a> for using Parameter Store they offer support for getting the latest <em>at deploy time</em>. Not synth time when you execute <code class="language-plaintext highlighter-rouge">cdk deploy</code> and get your template, but when that template is actually <code class="language-plaintext highlighter-rouge">cloudformation:CreateChangeSet</code>‘d and deployed.</p>

<blockquote>
  <p>But Jake, I’m not using CDK yet</p>
</blockquote>

<p>First I strongly suggest you start moving as much as you can. You can use CDK as a wrapper as it has first class support for CloudFormation, which is paradoxical as it is CFn.</p>

<p><img src="https://i.imgflip.com/51ze1g.jpg" alt="Yo I heard you like CDK" /></p>

<p>Then, you can use AWS Custom Resources. If CDK didn’t have such wonderful first class support for getting the latest, you could use an AWS CDK Custom Resource to <a href="https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_custom-resources.AwsCustomResource.html">wrap an AWS API Call</a>.
Your Custom Resources can depend on a single Lambda Function that is deployed once in your account, because a Custom Resource is either backed by SNS or Lambda, the ARN for either is the Service Token. If you deploy a single Lambda Function in an account and you give it a name, you can re-create that ARN easily:</p>

<p><code class="language-plaintext highlighter-rouge">!Sub 'arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:ParameterStoreLookup'</code></p>

<p>That’s all there is to it.</p>

<h2 id="wrapup">Wrapup</h2>

<p>If your resources are tightly coupled, you don’t need to worry about logical IDs changing, and your configuration can be fixed in Infrastructure-as-Code and you don’t need to support changing it on the fly then carry on passing stacks/constructs/CFN Exports around.</p>

<p>If your resources need to be loosely coupled, consider using Parameter Store to act as the bring and break the hard dependency.</p>

<p>Any questions, feel free to hit me on Twitter!</p>]]></content><author><name>Jake Hendy</name></author><category term="aws," /><category term="iac," /><category term="jakes-builders-library" /><summary type="html"><![CDATA[A great friend recently asked if I could help an individual in the CDK slack channel. This individual had a DynamoDB table in one CDK stack and wanted to depend on it in another for a producer/consumer of data in that table. The individual then changed the logical ID of that resource and boomalaboomala it went boom.]]></summary></entry><entry><title type="html">New trainers</title><link href="https://jakehendy.com/2021/03/13/New-trainers/" rel="alternate" type="text/html" title="New trainers" /><published>2021-03-13T00:00:00+00:00</published><updated>2021-03-13T00:00:00+00:00</updated><id>https://jakehendy.com/2021/03/13/New-trainers</id><content type="html" xml:base="https://jakehendy.com/2021/03/13/New-trainers/"><![CDATA[<p>After 15 months of wearing my trainers three to four times a week for BODYCOMBAT, The Trip, and then in lockdown GRIT,  BODYPUMP, even short runs, they asked to retire.
In the summer I wanted an actual pair of running trainers so started to hunt around; my Asics trainers barely lasted 6 months, my Reeboks were a lottery as to whether they were comfortable that day, but I’ve always had success with Nikes. My Metcon’s were holding up well but I’d been in to store to find them.
I had tried to find <em>the</em> pair online but with so much choice I was stuck, the online tool was somewhat helpful but I couldn’t narrow it down.
I messaged Nike on Twitter to see if they had any suggestions; they were <em>so</em> helpful and they recommended the perfect pair.</p>

<p>With my Metcons losing their edge (quite literally, I was sliding around in them) I reached out to Nike to see if they could do some magic again.</p>

<h2 id="air-zoom-superrep-2">Air Zoom SuperRep 2</h2>

<p>Within an hour Nike had asked me some questions and had made a recommendation for these <a href="https://www.nike.com/gb/t/air-zoom-superrep-2-hiit-class-shoe-tW0vmL">Air Zooms</a>. At £105 they weren’t cheap, so I asked about the return’s policy if the fit turned out wrong.</p>

<p>It turns out that being a Nike member (which costs nothing) gives you a 60-day no-quibble return period. I could wear them a few times and send them back, with a full refund. On top of that, you get decent discounts when it’s your birthday; across all product lines?</p>

<p>Ordered Tuesday, arrived Friday. I put them on to break them in, I’ve done it before when I’ve worn trainers to a gym class fresh and <em>oh my shit</em> did they hurt. They’re an interesting lace design, and the way the sole is moulded really helps keep them on your feet. Which also means that they really hurt and I took them off after 15 minutes.</p>

<p>I pulled the laces apart and tried again later and they fit so well, the tongue had slipped down and was pushing my foot down.</p>

<p>Today I wore them for my first GRIT class and I could instantly feel how much more supportive they were. They were better at supporting my foot during lateral movement and moving in and out of lunges. I could feel the arch support however it wasn’t painful in my foot, some trainers I’ve tried on have quite rigid arch support which doesn’t play well with my fallen arches. There is some support under the toe joint which was slightly painful, however that’s the kind of breaking in that’s only done during classes.
My feet were tired and slightly sore post workout, however for trainers that have been in the house barely 24 hours I am really excited to wear them on Monday night when I teach.</p>

<p>Thanks Nike! You’re epic &lt;3</p>

<p><img src="https://user-images.githubusercontent.com/545914/111037477-14ed9f80-841c-11eb-9037-ebc08012426b.jpeg" alt="Me in my air zooms after GRIT" /></p>]]></content><author><name>Jake Hendy</name></author><category term="life," /><category term="lockdown," /><category term="fitness" /><summary type="html"><![CDATA[After 15 months of wearing my trainers three to four times a week for BODYCOMBAT, The Trip, and then in lockdown GRIT, BODYPUMP, even short runs, they asked to retire. In the summer I wanted an actual pair of running trainers so started to hunt around; my Asics trainers barely lasted 6 months, my Reeboks were a lottery as to whether they were comfortable that day, but I’ve always had success with Nikes. My Metcon’s were holding up well but I’d been in to store to find them. I had tried to find the pair online but with so much choice I was stuck, the online tool was somewhat helpful but I couldn’t narrow it down. I messaged Nike on Twitter to see if they had any suggestions; they were so helpful and they recommended the perfect pair.]]></summary></entry><entry><title type="html">Nostalgia</title><link href="https://jakehendy.com/2021/02/21/nostalgia/" rel="alternate" type="text/html" title="Nostalgia" /><published>2021-02-21T00:00:00+00:00</published><updated>2021-02-21T00:00:00+00:00</updated><id>https://jakehendy.com/2021/02/21/nostalgia</id><content type="html" xml:base="https://jakehendy.com/2021/02/21/nostalgia/"><![CDATA[<p>It’s time for my annual post… just over a year since my last one. And wow, what a year and a bit it has been.
I thought with the pandemic I’d have written more, but oddly enough as the lockdowns have gone on I feel like I have less spare time than I did beforehand, hence why this blog nor Clouds@LHR has been updated for over a year and 15 days.
Recently on a walk with my girlfriend (hereby referred to as Char) we were talking about “old things” (as much as things are old in your mid-twenties); the TV series we used to watch from <a href="https://cbbc-on-choice.fandom.com/wiki/Playdays"><em>Playdays</em></a> to <a href="https://en.wikipedia.org/wiki/Come_Outside"><em>Come Outside</em></a>, <a href="https://cbbc.fandom.com/wiki/Cats_Eyes"><em>Cat’s Eyes</em></a> and <a href="https://en.wikipedia.org/wiki/El_Nombre"><em>El Nombre</em></a>. I excitedly told her about the first computers we had, an IBM Aptiva with Windows 98SE which featured many fantastic MS Paint renditions that have ~sadly~ been lost to time, and how I at a young age discovered Lotus Notes and printed 13 pages of the letter h (??? 🤯) repeated in purple. When it was cheaper to buy ink, rather than a whole new printer. Good times, good times…</p>

<p>I remember starting every work day writing Clouds@LHR quickly, firing off the latest updates. My “first” re:invent covering it with Clouds@LHR and I never caught up, which was a real shame. I’ve [got plans][clouds_at_lhr_gh] to partially automate it but they’re still plans, rather than concrete code…</p>

<p>So what has happened since my last meaningful Clouds@LHR?</p>

<p>I saw Hamilton in London with Char and some friends which was <em>incredible</em>. To sing a whole show?? I was amazed by that as well as the story. The next day I dragged Char to the Bank of England museum which she found more interesting than she’d admit (how often do you get to hold a whole gold bar?). Then whilst sat in a Pret-a-Manger (oddly enough we actually struggled to find one after BoE, even though there were four within five minutes of our hotel) I received some hurried texts from a friend that our troll group had been exposed; a campaign between 10 of us to tease and prank-back another friend had been exposed. It wasn’t until 4 hours later on the train that I was finally able to read the hundred odd (and growing…) messages in Slack and thus discovered we’d been truly rumbled. That campaign however led to a great group forming which I count my lucky stars to be a part of every day for the laughs we’ve shared and the wonderous things I’ve learned.</p>

<p>The first weeks of lockdown were very tough, but they had some excitement about them. I was gutted I couldn’t see Char properly any more (as we still live at home albeit quite literally around the corner) but we were very fortunate to be able to FaceTime easily. I remember buying the first barbell set the night the gym’s were announced to close, where I looked at one set and refreshed it five minutes later to see it out of stock. The excitement wasn’t a joyous excitement, it was one of a new journey where I had no idea what the next day to week would hold. I was fortunate to have a decent home working environment already from the days I’d previously homeworked and didn’t have to share it with the rest of the house.
I bought networked cameras and upgraded my home network (there’s an ubiqiuti post that’s been in draft for ooh, 9 months at least) so Char could still see our pet rabbits. Turns out not commmuting to the office and paying for coffees every day has a nice positive effect on the bank balance. From there, it was bleak at times and blurry yet we pushed through and found our way, from virtual date nights to watching Masterclasses and making pasta at home, to being allowed to * <em>gasp</em> * hold hands in the summer! We were extremely fortunate to have such good weather, and I think that’s what has made Lockdown III the hardest yet.</p>

<p>Lockdown 2 came and thankfully we’d had the lounge plastered already so we could crack on with getting paint on the walls. Not being able to do many things probably helped here, as the only thing we could do was paint… We still didn’t have a sofa and were picking out what LVT floors we wanted. December rolled around and I picked up 12 sheets of 9mm plywood, because whatever floor was going down it needed plywood on it. Chiseling up 30 year old hearth tiles and then drilling down into concrete for screws was a Saturday morning I’d be happy not to repeat again… over 900 screws later (in Lockdown III) and then the lounge was covered in Plywood, with the LVT sat in the hallway ready to go down. It wasn’t until the week before the sofa was delivered (almost 2 months later than expected) that the glue and tiles actually went down. For a first job, we did pretty good. Within a week (still working full time) the lounge was covered and the day after we finished the sofa arrived. We’d had no sofa from October through to mid-January, and it still feels just as good as the first time I sat/reclined/immediately napped.</p>

<p>Lockdown III, with the soaring statistics (the sad ones first, then the happy ones with the vaccination numbers), has been the hardest yet. Last week my graphics card of seven years died, the first computer build I did. I’d joined the Met Office September 2nd 2013, and ordered my computer parts a few days before Christmas 2013. My GeForce 780 Ti lasted me all the way through the kitchen being remodelled, a dodgy powersupply taking out motherboard, CPU, and a stick of RAM, to the lounge-diner being redecorated. It’s the absolute epitome of first-world-problems, but I spent around £400 on a top-end graphics card then and to spend £700 or more on an equivalent-top-tier card now that I probably won’t get another seven years out of feels like a waste of money, notwithstanding the incredible price hikes and (un)availability of the latest generations. Even the previous generations are ludicrously expensive and only slightly-more available. The nostalgia of playing CS:GO, Battlefield 3, 4, GTA V at 144Hz on my first gaming PC will always be a fond memory. Never got in to being a content creator on the side like I wanted to, but with the way the past 365 days have been, who knows what the next 365 hold. Do I miss gaming? Yes, but not as much as I would have if it was in the first lockdown. I feel like I’ve adjusted and broadened my horizons; from trying new cooking to making more cocktails to actually reading—although not actually finishing a book—and more. I realised it had been a year since I’d been to London for Hamilton, three since my lip was cut open, and all the things I’ve mentioned and more that bring me a smile.</p>

<p>I’m forever grateful to have my family, my beautiful girlfriend, an incredible group of friends and acquaintances, beloved pets, great health and to live in a city that has fared <em>relatively well</em>, in such a weird (and at-times wonderful) time. It’s a cliche but I’m a very fortunate bean, and I remember that every single day.</p>

<p>Now that this blog is written, I’ve completed my goal of writing a blog post more than once every two years. Next step, can I do two blog posts within two weeks?</p>]]></content><author><name>Jake Hendy</name></author><category term="life," /><category term="lockdown," /><category term="living" /><summary type="html"><![CDATA[It’s time for my annual post… just over a year since my last one. And wow, what a year and a bit it has been. I thought with the pandemic I’d have written more, but oddly enough as the lockdowns have gone on I feel like I have less spare time than I did beforehand, hence why this blog nor Clouds@LHR has been updated for over a year and 15 days. Recently on a walk with my girlfriend (hereby referred to as Char) we were talking about “old things” (as much as things are old in your mid-twenties); the TV series we used to watch from Playdays to Come Outside, Cat’s Eyes and El Nombre. I excitedly told her about the first computers we had, an IBM Aptiva with Windows 98SE which featured many fantastic MS Paint renditions that have ~sadly~ been lost to time, and how I at a young age discovered Lotus Notes and printed 13 pages of the letter h (??? 🤯) repeated in purple. When it was cheaper to buy ink, rather than a whole new printer. Good times, good times…]]></summary></entry><entry><title type="html">Bastions on AWS</title><link href="https://jakehendy.com/2020/01/29/Bastions-on-AWS/" rel="alternate" type="text/html" title="Bastions on AWS" /><published>2020-01-29T00:00:00+00:00</published><updated>2020-01-29T00:00:00+00:00</updated><id>https://jakehendy.com/2020/01/29/Bastions-on-AWS</id><content type="html" xml:base="https://jakehendy.com/2020/01/29/Bastions-on-AWS/"><![CDATA[<p>Sometimes your services and platforms on AWS still require you to have a network, even when you’re serverless.
For the platform at work my team is responsible for this is the boat we continually sail in, taking advantage of AWS Fargate, S3, ElastiCache, but not AWS Bastion Service.
Why? Because it doesn’t exist yet—fully at least. Sometimes, you just need to get on a local network and play with things. 💻</p>

<p>There is AWS Systems Manager Session Manager (hereafter referred to as AWS SM), but that only works as an interface on to existing EC2s, so in this post I’ll provide steps on how to build a secure, cost-efficient way to access your network using AWS SM.</p>

<h2 id="repeatable-bastions">Repeatable Bastions</h2>

<p>Create a specific AMI (as part of your build process, automate it as you need to) or—if internet access is permitted—use a user-init script to create the basis of your bastion:</p>

<ul>
  <li>updating system dependencies</li>
  <li>installing the minimum/common software</li>
  <li>configuring SSH keys/certificates for communication within the network (but not for user logon)</li>
  <li>configuring logging etc</li>
</ul>

<p>Don’t forget to setup log forwarding to CloudWatch logs as appropriate as well, follow the <a href="https://www.ncsc.gov.uk/guidance/introduction-logging-security-purposes">NCSC guidance on log retention</a> as a minimum.</p>

<h2 id="bastions-lost-in-the-amazon">Bastions lost in the Amazon</h2>

<p>We only want our Bastions accessible to Amazon, so create a Launch Configuration with no public IP and the security groups required for internal access.
Add the AWS SSM Agent to your AMI/User Init Script, if you’re on a recent version of Amazon Linux{1/2}/Ubuntu/Windows, you’ll already have the SSM agent installed.
Provide them with the appropriate security groups to access the internal resources, or alternatively you can create multiple bastions for different security zones.</p>

<p>If your region and required applications permit, you can use AMD-variants of your bastions (e.g. <code class="language-plaintext highlighter-rouge">t3a</code>, <code class="language-plaintext highlighter-rouge">m5a</code>) or ARM-variants with the <code class="language-plaintext highlighter-rouge">a1</code>/<code class="language-plaintext highlighter-rouge">a2</code> instance families, saving even more money.</p>

<h2 id="configure-your-session-manager">Configure your Session Manager</h2>

<p><a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started.html">Configure Session Manager</a> and ensure your operators’ IAM roles/users have permission to create SessionManager sessions.
You’ll need to ensure your IAM user has the ability to create Session Manager sessions.
Remember Session Manager is on a per account basis, so where you intend to launch your bastions is where you’ll need Session Manager set up.</p>

<p>You have the option of forwarding the whole session console to CloudWatch logs. Such a feature will be very useful when you’re writing your post-incident report or providing example output for your ops teams.
If your terminal/console session is likely to contain sensitive details ensure you enable encryption in your CloudWatch logs with a suitable KMS key.</p>

<h2 id="bastions-there-when-you-need-them">Bastions there when you need them</h2>

<p>Use an EC2 auto-scaling group with a min of 0, desired of 0, a max of 1, and then change the desired value when you need—and are subsequently finished with—your bastion.
If your network architecture only allows access within the same AZ, you can create 3 scaling groups for each AZ.</p>

<p>This means that your bastion is only there when necessary, reducing cost and the potential attack surface for your system. You can even go further and add a <a href="https://www.linux.com/tutorials/put-talking-cow-your-linux-message-day/">Message Of The Day</a> to give some advice to an operator that’s using a bastion, or add a crontab to kill the bastion after a number of days (unless a file exists) to help reduce reliance on that single instance.
This pattern is used on a cloud system at <code class="language-plaintext highlighter-rouge">[REDACTED]</code>, they love it 🤩</p>

<h2 id="fin"><em>Fin</em></h2>

<p>That’s all there is; you now have a Bastion that:</p>

<ul>
  <li>doesn’t exist until an operator needs it,</li>
  <li>that contains all the software they’ll need,</li>
  <li>isn’t open to the internet, but can be accessed using PuTTY or an operators browser,</li>
  <li>is fully auditable using your existing patterns with CloudWatch Logs.</li>
</ul>]]></content><author><name>Jake Hendy</name></author><category term="aws," /><category term="architecture" /><summary type="html"><![CDATA[Sometimes your services and platforms on AWS still require you to have a network, even when you’re serverless. For the platform at work my team is responsible for this is the boat we continually sail in, taking advantage of AWS Fargate, S3, ElastiCache, but not AWS Bastion Service. Why? Because it doesn’t exist yet—fully at least. Sometimes, you just need to get on a local network and play with things. 💻]]></summary></entry></feed>