<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="https://www.w3.org/2005/Atom">
  <channel>
    <title>Iain Mitchell</title>
    <description>Iain Mitchell — Software Practitioner, technical leader, and architect based in Manchester, UK. Over 20 years&apos; experience in cybersecurity, media, retail, and pharmaceutical industries.
</description>
    <link>https://iainjmitchell.com/</link>
    <atom:link href="https://iainjmitchell.com/feed.xml" rel="self" type="application/rss+xml" />
    <pubDate>Mon, 16 Mar 2026 14:28:40 +0000</pubDate>
    <lastBuildDate>Mon, 16 Mar 2026 14:28:40 +0000</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>Terraform CDK or AWS CDK</title>
        <description>&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;This post is the write-up of a comparison between &lt;a href=&quot;https://www.hashicorp.com/blog/announcing-cdk-for-terraform-0-1&quot;&gt;Terraform CDK&lt;/a&gt; and &lt;a href=&quot;https://aws.amazon.com/cdk/&quot;&gt;AWS CDK&lt;/a&gt;. Both of these Cloud Development Kits (CDK) are new approaches to writing infrastructure-as-code.  They both provide libraries of infrastructure constructs in a variety of programming languages.  Also included are command-line tools to deploy the infrastructure.&lt;/p&gt;

&lt;p&gt;Like traditional Terraform the Terraform CDK supports multiple cloud providers.  It also supports providers of other types of infrastructure (e.g. other CDN).  Whereas AWS CDK is dedicated to managing AWS infrastructure.&lt;/p&gt;

&lt;p&gt;This assessment focusses on managing AWS infrastructure ONLY.&lt;/p&gt;

&lt;h2 id=&quot;what-was-being-assessed&quot;&gt;What was being assessed?&lt;/h2&gt;
&lt;ol&gt;
  &lt;li&gt;Ease of use
    &lt;ul&gt;
      &lt;li&gt;How easy is it to use the CDK?  Any pain points or features that make the engineers life easier.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Ease of integration into build and deployment pipeline
    &lt;ul&gt;
      &lt;li&gt;The CDKs are executed on a build server as part of a deployment pipeline.  How easy is it to set this up?&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Sharing of common components
    &lt;ul&gt;
      &lt;li&gt;Creating common reusable infrastructure components is an inherent feature of infrastructure-as-code.  The mechanism of sharing these can influence how much reuse actually occurs.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Testing
    &lt;ul&gt;
      &lt;li&gt;How hard is it to test drive the creation of the infrastructure-as-code?&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Code cleanliness
    &lt;ul&gt;
      &lt;li&gt;Do the patterns and design of the CDK encourage cleaner code?&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;test-application&quot;&gt;Test application&lt;/h2&gt;
&lt;p&gt;Both of the CDKs were assessed against creating the same simple application in AWS.  This was a AWS Lambda that read a message from a SQS queue and using data within sent a notification to a &lt;a href=&quot;https://slack.com&quot;&gt;Slack&lt;/a&gt; channel.  It also required a SQS as a Dead Letter Queue (DLQ) for repeated failed invocations.  Additionally, the Lambda needed to read the Slack API credentials from AWS parameter store.&lt;/p&gt;

&lt;p&gt;A summary of the architecture of the test application is in the diagram below.
&lt;img src=&quot;/images/terraform-and-aws-cdk/application-architecture.png&quot; alt=&quot;Test Application Architecture&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://www.typescriptlang.org/&quot;&gt;TypeScript&lt;/a&gt; was chosen as a language for both the Lambda and CDK infrastructure code.  Jenkins, self-hosted in AWS, was used as a build and deployment server.&lt;/p&gt;

&lt;h2 id=&quot;terraform-cdk&quot;&gt;Terraform CDK&lt;/h2&gt;
&lt;h3 id=&quot;1-ease-of-use&quot;&gt;1. Ease of use&lt;/h3&gt;
&lt;p&gt;The initial &lt;a href=&quot;https://learn.hashicorp.com/tutorials/terraform/cdktf&quot;&gt;set-up documentation&lt;/a&gt; made it easy to get started with the CDK.  Unfortunately, the documentation deteriorated after this point.  Context based help within the IDE pointed to the Terraform HCL documentation rather than anything based on the CDK.  Furthermore, for some queries it was not possible to find answers in the community.  This resulted in diving into the source code or applying guesswork.&lt;/p&gt;

&lt;p&gt;The CDK still relies upon &lt;a href=&quot;https://www.terraform.io/docs/language/state/index.html&quot;&gt;Terraform state files&lt;/a&gt; which need to saved to S3 as part of your stack updates.  As a disclaimer, I’m not a fan on this system of tracking infrastructure state away from the source of truth.  But a couple of times the state file became out of sync with the infrastructure in AWS.  Although, this is no different from using the Terraform HCL and you may be happy to accept this risk.&lt;/p&gt;

&lt;h3 id=&quot;2-ease-of-integration-into-build-and-deployment-pipeline&quot;&gt;2. Ease of integration into build and deployment pipeline&lt;/h3&gt;
&lt;p&gt;To be able to run the CDK in Jenkins it requires a few dependencies.  As such, it was necessary to create a Docker container image (see below).&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;FROM node:14-alpine

RUN apk &lt;span class=&quot;nt&quot;&gt;--no-cache&lt;/span&gt; add curl
RUN apk add &lt;span class=&quot;nt&quot;&gt;--no-cache&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        python3 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        py3-pip &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; pip3 &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--upgrade&lt;/span&gt; pip &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; pip3 &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        awscli &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-rf&lt;/span&gt; /var/cache/apk/&lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;
RUN apk add terraform &lt;span class=&quot;nt&quot;&gt;--repository&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;http://dl-cdn.alpinelinux.org/alpine/edge/community
RUN npm &lt;span class=&quot;nb&quot;&gt;install&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-g&lt;/span&gt; cdktf-cli
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;A few of these dependencies are organisation specific, but the important ones to note are:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;AWS CLI&lt;/li&gt;
  &lt;li&gt;Terraform&lt;/li&gt;
  &lt;li&gt;TypeScript Terraform CDK CLI (NPM package)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, Jenkins required a AWS IAM policy for access to the infrastructure that it needed to update.  This was then available to ALL jobs within Jenkins.  Although it could have been more finely controlled by utilising IAM switch role.&lt;/p&gt;

&lt;p&gt;Overall, it took a day to get Terraform CDK running on Jenkins.  Which was hindered at times by the lack of documentation.&lt;/p&gt;

&lt;h3 id=&quot;3-sharing-of-common-components&quot;&gt;3. Sharing of common components&lt;/h3&gt;
&lt;p&gt;Terraform CDK has a concept of scope that’s passed into each of the constructors.  The scope then becomes the current object (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;this&lt;/code&gt;). The LambdaFunction example below demonstrates this.&lt;/p&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;SqsSlackStack&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;TerraformStack&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scope&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Construct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;stackName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;configuration&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;SnsSlackStackConfig&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scope&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;stackName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

        &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;lambda&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;LambdaFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;stackName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;-lambda`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{..};&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Modularisation just requires that the scope is passed into the programming construct (e.g. Class, Factory Method).  This makes creating of independent modules straightforward.  In this case, as TypeScript is being used, these could shared through a public or private &lt;a href=&quot;https://www.npmjs.com/&quot;&gt;NPM&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;One challenge around modularisation is that the AWS provider NPM module is a single mono-module.  As such, a module for SqsQueues still has to include &lt;em&gt;everything AWS&lt;/em&gt; in it’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;node_modules&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;4-testing&quot;&gt;4. Testing&lt;/h3&gt;
&lt;p&gt;At the point of implementing the application there was no unit testing support.  It was possible to test by calling &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cdktf synth&lt;/code&gt; in the shell and asserting on the resulting output.  This was complex and very slow to run.&lt;/p&gt;

&lt;p&gt;Thankfully, a recent update to Terraform CDK has introduced &lt;a href=&quot;https://www.hashicorp.com/blog/cdk-for-terraform-0-6-adds-unit-testing&quot;&gt;better support for unit testing&lt;/a&gt;.  Although at the moment it appears limited to testing through &lt;a href=&quot;https://jestjs.io/&quot;&gt;Jest&lt;/a&gt;.  As this is a new development, it is not possible to assess how usable this addition is.&lt;/p&gt;

&lt;h3 id=&quot;5-code-cleanliness&quot;&gt;5. Code cleanliness&lt;/h3&gt;
&lt;p&gt;The majority of properties on the CDK classes are strongly typed.  A notable exception is that of policy documents.  These require a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;string&lt;/code&gt; of the policy in JSON format.  This leads to storing the policy in a file or performing an inline &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JSON.stringify()&lt;/code&gt; call (see below).  Neither of which lends itself to readable code.&lt;/p&gt;

&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;inboundQueue&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;SqsQueue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;stack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;stackName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;-inbound`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;stackName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;-inbound`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;redrivePolicy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;JSON&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;stringify&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;deadLetterTargetArn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;deadLetterQueue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;arn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
        &lt;span class=&quot;na&quot;&gt;maxReceiveCount&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}),&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;visibilityTimeoutSeconds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;60&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;tags&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;String&lt;/code&gt; values with set values (e.g. Lambda runtime) are handled no differently from other &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;String&lt;/code&gt; values.  The CDK would have benefitted from using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;enum&lt;/code&gt; types to help improve readability and reduce mistakes.&lt;/p&gt;

&lt;p&gt;At times writing the CDK code felt long-winded and similar to writing Terraform HCL.  It would benefit from more abstraction of the AWS concepts.  For example,  a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;addPolicy()&lt;/code&gt; function on the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;IamRole&lt;/code&gt; class rather than creating a  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;IamRolePolicyAttachment&lt;/code&gt; object with the arns of the Policy and Role.&lt;/p&gt;

&lt;h2 id=&quot;aws-cdk&quot;&gt;AWS CDK&lt;/h2&gt;
&lt;h3 id=&quot;1-ease-of-use-1&quot;&gt;1. Ease of use&lt;/h3&gt;
&lt;p&gt;Has dedicated &lt;a href=&quot;https://docs.aws.amazon.com/cdk/api/latest/typescript/api/index.html&quot;&gt;language specific documentation&lt;/a&gt; which mades it very easy to get started and get building.  Wider community is much bigger with more blog posts and opinions on implementing.&lt;/p&gt;

&lt;p&gt;Each service supported by AWS CDK is installed as a separate NPM package (e.g. &lt;a href=&quot;https://www.npmjs.com/package/@aws-cdk/aws-lambda&quot;&gt;Aws Lambda&lt;/a&gt;).  These each have their own documentation and independent versioning.  However, during development occassional minor version incompatibility occurred. So it is advisable to keep these package versions aligned.&lt;/p&gt;

&lt;p&gt;Underneath, AWS CDK is powered by &lt;a href=&quot;https://aws.amazon.com/cloudformation/&quot;&gt;Cloudformation&lt;/a&gt; which has two benefits.  The first is that the change set is always compared with the source of truth (AWS).  Second, changes can viewed through the Cloudformation console in AWS which can help diagnose problems.&lt;/p&gt;

&lt;h3 id=&quot;2-ease-of-integration-into-build-and-deployment-pipeline-1&quot;&gt;2. Ease of integration into build and deployment pipeline&lt;/h3&gt;
&lt;p&gt;The &lt;a href=&quot;https://www.npmjs.com/package/aws-cdk&quot;&gt;AWS CDK NPM module&lt;/a&gt; contains everything required to run the AWS CDK CLI.  It can be installed from the projects package.json.  As such, there is no need for a dedicated docker container image for running in Jenkins.&lt;/p&gt;

&lt;p&gt;Access to resources in AWS are controlled in one of two ways.  First, like Terraform CDK a policy can be assigned to the role that is executing the AWS CDK command.  Second, an independent role can be created for executing a particular stack.  In this case the Jenkins role &lt;em&gt;just&lt;/em&gt; needs access to cloudformation.  The execution role arn is passed in via the CDK command line call (see below).&lt;/p&gt;
&lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;cdk deploy &lt;span class=&quot;nt&quot;&gt;--require-approval&lt;/span&gt; never &lt;span class=&quot;nt&quot;&gt;--role-arn&lt;/span&gt; arn:aws:iam::9888885:role/my-aws-cdk
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Getting AWS CDK running on Jenkins was straightforward and it was working in less than an hour.&lt;/p&gt;

&lt;h3 id=&quot;3-sharing-of-common-components-1&quot;&gt;3. Sharing of common components&lt;/h3&gt;
&lt;p&gt;Like Terraform CDK, the AWS CDK shares the concept of a scope that is passed from Construct to Construct.&lt;/p&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;export&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;NodeSqsLambda&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;extends&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;cdk&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Construct&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kd&quot;&gt;constructor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scope&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;cdk&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Construct&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kr&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;configuration&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;SqsLambdaConfiguration&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;super&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scope&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

        &lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;lambdaFunction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;lambda&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;Function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{..});&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;AWS CDK encourages the use of extending &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cdk.Construct&lt;/code&gt; for your own code modules.  This makes custom components consumed and interacted through the same mechanisms as those provided by AWS.  Like Terraform CDK these modules could be easily shared via an NPM repository.&lt;/p&gt;

&lt;p&gt;The splitting of constructs into separate NPM packages results in custom modules requiring less &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;node_module&lt;/code&gt; baggage.   It also makes their dependencies more visible and deliberate.&lt;/p&gt;

&lt;h3 id=&quot;4-testing-1&quot;&gt;4. Testing&lt;/h3&gt;
&lt;p&gt;AWS CDK provides &lt;a href=&quot;https://docs.aws.amazon.com/cdk/latest/guide/testing.html&quot;&gt;inbuilt assertions and snapshot testing capabilities&lt;/a&gt;.  The assertion framework works by comparing against the yaml Cloudformation output.  The ambiguity of the outputted cloudformation makes test driving the code difficult.  This is especially difficult when there are references to other constructs by ARN. These are often rendered in a confusing manor (see &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;deadLetterTargetArn&lt;/code&gt; below).&lt;/p&gt;
&lt;div class=&quot;language-yaml highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;na&quot;&gt;developmentservicessnsslackawsdevelopmentservicessnsslackawsinboundC75A12B7&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
 &lt;span class=&quot;na&quot;&gt;Type&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;AWS::SQS::Queue&lt;/span&gt;
 &lt;span class=&quot;na&quot;&gt;Properties&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
 &lt;span class=&quot;na&quot;&gt;QueueName&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;development-services-sns-slack-aws-inbound&lt;/span&gt;
 &lt;span class=&quot;na&quot;&gt;RedrivePolicy&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
 &lt;span class=&quot;na&quot;&gt;deadLetterTargetArn&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;s&quot;&gt;Fn::GetAtt:&lt;/span&gt;
             &lt;span class=&quot;s&quot;&gt;- developmentservicessnsslackawsdevelopmentservicessnsslackawsdlq3A3F2AC5&lt;/span&gt;
            &lt;span class=&quot;s&quot;&gt;- Arn&lt;/span&gt;
 &lt;span class=&quot;na&quot;&gt;maxReceiveCount&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;
 &lt;span class=&quot;na&quot;&gt;VisibilityTimeout&lt;/span&gt;&lt;span class=&quot;pi&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;60&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h3 id=&quot;5-code-cleanliness-1&quot;&gt;5. Code cleanliness&lt;/h3&gt;
&lt;p&gt;The Construct Objects in AWS CDK are all strongly typed.  They also have enums and other types to help provide correct values.  For example, a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Function&lt;/code&gt; has a runtime property which is a type of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Runtime&lt;/code&gt;.  This Runtime type is an enum of accepted values (see below).  As a result, the code is clear and there is a shorter feedback loop to discovering invalid values.  This is due to not having to apply against AWS to discover a misspelling.&lt;/p&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;lambdaFunction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;lambda&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;Function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;runtime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;lambda&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Runtime&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;NODEJS_14_X&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;...&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;There are objects and types for most parts of an infrastructure definition.  For example, a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Policy&lt;/code&gt; is defined using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PolicyStatement&lt;/code&gt; objects.&lt;/p&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;ssmPolicy&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Policy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;scope&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;roleName&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;-ssm-policy`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;na&quot;&gt;statements&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;PolicyStatement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;actions&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
                &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;ssm:GetParametersByPath&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;ssm:GetParameters&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;ssm:GetParameter&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;],&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;effect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Effect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;ALLOW&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
            &lt;span class=&quot;na&quot;&gt;resources&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
                &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;arn:aws:ssm:eu-west-1:324234234:parameter/slack/token&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
                &lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;arn:aws:ssm:eu-west-1:324234234:parameter/slack/signing-secret&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&apos;&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;AWS CDK also has abstractions in place to create links between resources.  Usually, linking a Lambda to SQS requires creation of an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;EventSourceMapping&lt;/code&gt; that references the two ARNS.  In AWS CDK the same can be achieved by calling the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;addEventSource&lt;/code&gt; function on the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;LambdaFunction&lt;/code&gt; object.&lt;/p&gt;
&lt;div class=&quot;language-typescript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;lambdaFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addEventSource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;SqsEventSource&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;queue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Finally, as mentioned AWS CDK encourages any custom components to extend &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cdk.Construct&lt;/code&gt;.  This results in a more unified look and feel of the codebase.&lt;/p&gt;

&lt;h2 id=&quot;other-thoughts&quot;&gt;Other thoughts&lt;/h2&gt;
&lt;p&gt;An advantage that Terraform CDK has is that it also supports other cloud and infrastructure providers.  If your organisation has multiple cloud partners and a strong desire to use the same tooling then Terraform CDK is probably for you.&lt;/p&gt;

&lt;p&gt;However, the Terraform CDK and AWS CDK are similar enough in their concepts that switching between the two is not jarring.  There are far more differences between the AWS and Azure Terraform CDK components.  Other types of infrastructure can also be managed through alternative means.  For example, Fastly can be managed through TypeScript by using a &lt;a href=&quot;https://www.npmjs.com/package/fastly&quot;&gt;NPM package&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;AWS CDK is the more mature and fully featured of the two CDKs.  The high standard of documentation made it far easier to use.  Writing code was cleaner and more concise.  It was straightforward to get working on Jenkins and had more flexibility in choice of security models.&lt;/p&gt;

&lt;p&gt;Both CDKs supported modularisation and distribution of packages via NPM.  Though AWS CDK did encourage a more consistent approach to writing custom modules.  Unit testing is also now supported in both of the CDKs.&lt;/p&gt;

&lt;p&gt;Even if you work in an organisation that uses different cloud providers it may be worth considering using AWS CDK.  The two CDKs are similar and it would not be too jarring to move between them (e.g. AWS CDK for AWS and Terraform CDK for Azure).&lt;/p&gt;

&lt;p&gt;If you are writing infrastructure-as-code for AWS then the AWS CDK is currently the better of the two.  But, if you are currently using Terraform HCL or Cloudformation you will find either of these CDKs a significant improvement.&lt;/p&gt;

</description>
        <pubDate>Wed, 08 Sep 2021 09:00:00 +0000</pubDate>
        <link>https://iainjmitchell.com/blog/terraform-and-aws-cdk</link>
        <guid isPermaLink="true">https://iainjmitchell.com/blog/terraform-and-aws-cdk</guid>
        
        
        <category>operability,</category>
        
        <category>aws</category>
        
      </item>
    
      <item>
        <title>Release and Deployment</title>
        <description>&lt;p&gt;First a question,&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;What do you want your software release and deployment process to be like?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you had no constraints from your organisation what would it look like?&lt;/p&gt;

&lt;p&gt;There are two predominant factors around release and deployment:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Automation - How much do you &lt;em&gt;want&lt;/em&gt; to automate?  On one side of the scale is a manual release process with no automation.  At the opposite end of the scale is  everything automated with few (if any) manual gates .  This is would involve automation of deployment, testing, security scans,  automatic rollbacks etc.&lt;/li&gt;
  &lt;li&gt;Trust - There are two elements of Trust. The first is how much the organisation trusts the product teams?  Do they have change approval boards and release windows. Or do they trust the team to deploy whenever they choose?  The second consideration is how much trust there is within the team.  Is the team confident that everyone will conform to standards and guidelines?  Or is trust lower that means that it requires a more formal process?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Using these two factors we can make a axis for comparing different approaches to software release and deployment.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/release-and-deployment/trust-and-automation.png&quot; alt=&quot;Axis for automation v trust&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Looking at this axis can you pinpoint where your attitude to release and deployment lies?  Do you have a preference towards more manual gates (lower trust)?  And how much do you expect to happen without human intervention (automation level)?&lt;/p&gt;

&lt;p&gt;Onto these axis I have placed well known techniques for release and deployment of software.
&lt;img src=&quot;/images/release-and-deployment/techniques.png&quot; alt=&quot;Techniques&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Let me explain by reasoning behind these placements….&lt;/p&gt;

&lt;h3 id=&quot;change-approval-board-cab-and-manual-deploy&quot;&gt;Change Approval Board (CAB) and Manual Deploy&lt;/h3&gt;
&lt;p&gt;In the bottom corner is a situation with CABs and little done to automate the deployment process.  The need for approval is an indicator that there is an expectation that the team will break the product.  Which demonstrates a low level of trust in the abilities and professionalism of the team.&lt;/p&gt;

&lt;p&gt;The throttling of releases by this approval discourages the team from automating.  Control of access to environments may even prevent the running of automation.&lt;/p&gt;

&lt;h3 id=&quot;pull-requests-pr-on-feature-branches&quot;&gt;Pull Requests (PR) on Feature Branches&lt;/h3&gt;
&lt;p&gt;This is often a situation where there is more automation. For example, there is often a build server that runs when integration occurs.  Trust appears higher within the organisation as auditable PR reduces need for wider approval.  Yet, the enforced PR itself demonstrates a lower level of trust within the team itself.  Which is &lt;em&gt;exactly&lt;/em&gt; the intent of PRs.&lt;/p&gt;

&lt;p&gt;In Open Source project you don’t know who is working on your project. Having an enforced review process might be a good idea, &lt;a href=&quot;https://www.theregister.com/2018/11/26/npm_repo_bitcoin_stealer/&quot;&gt;especially if you don’t want to spread Malware&lt;/a&gt;. The downside to this is a culture of lower trust. This can lead to dominant people becoming the arbiters of what is ‘good’ for the codebase.  Furthermore, having system barriers that prevent pushing to mainline impacts trust.  This result in lower empowerment and frustration (i.e. needing to create a branch and PR for a README change).&lt;/p&gt;

&lt;h3 id=&quot;continuous-integration-ci&quot;&gt;Continuous Integration (CI)&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://martinfowler.com/articles/continuousIntegration.html&quot;&gt;Martin Fowler’s post about CI&lt;/a&gt; is well worth a read as it clears up  many misconceptions about CI. A common misconception is that you are &lt;em&gt;doing&lt;/em&gt; CI if you have a build server.&lt;/p&gt;

&lt;p&gt;Continually Integrating involves the team regularly pushing/merging code to mainline.  Thus, it is essential to have automation around build and running of tests.  Furthermore, it also demonstrates a higher level of trust within the team.  As they are trusting that any agreed practices (e.g. peer review, standards) are happening.&lt;/p&gt;

&lt;p&gt;Yet, there is not absolute trust as gates remain to testing and/or production.  This could originate from the organisation, team or a combination of both.  These gates also make it unlikely that the team will pursue further automation.  Such as full deployment pipelines, security scans and in-live testing.  It is also feasible that the deployment to other environments could still be manual.&lt;/p&gt;

&lt;h3 id=&quot;continuous-delivery-cd&quot;&gt;Continuous Delivery (CD)&lt;/h3&gt;
&lt;p&gt;CD is the &lt;a href=&quot;https://www.martinfowler.com/bliki/ContinuousDelivery.html&quot;&gt;ability to release to production at anytime&lt;/a&gt;.  An interesting facet of this is that mainline has to constantly be in a releasable state.  This requires higher trust within the team and organisation.  As both would need reassuring that releases will not cause impact to customers.  Furthermore, the move to CD will also increase the level of automation.  This could include: full deployment pipelines, security scanning and monitoring of production environment.&lt;/p&gt;

&lt;h3 id=&quot;continuous-deployment-cdp&quot;&gt;Continuous Deployment (CDP)&lt;/h3&gt;
&lt;p&gt;In the top corner in the zone of high trust and automation is CDP. Every code push/merge to mainline is deployed automatically to production.  Reaching this point requires a high level of organisation and team trust. There is no gate to deployment and engineers are trusted to avoid customer outages.&lt;/p&gt;

&lt;p&gt;Accompanying this is an automate everything approach to software release and deployment.  Which may include in-live testing, service observability and automatic rollbacks when deployments fail.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;The approach to software release and deployment is as much as about &lt;strong&gt;trust&lt;/strong&gt; as it is about &lt;strong&gt;automation&lt;/strong&gt;.  The level of trust can be determined at both the organisation and team level.  As it is possible to have an organisation with absolute trust but a team who feel they need to impose gates.&lt;/p&gt;

&lt;p&gt;The post also ran through where many software release and deployment techniques lie on the axis of trust and automation.  This can be used to help understand why a particular technique has been chosen.  Or determine an appropriate strategy for release and deployment.&lt;/p&gt;
</description>
        <pubDate>Wed, 08 Sep 2021 09:00:00 +0000</pubDate>
        <link>https://iainjmitchell.com/blog/release-and-deployment</link>
        <guid isPermaLink="true">https://iainjmitchell.com/blog/release-and-deployment</guid>
        
        
        <category>operability</category>
        
      </item>
    
      <item>
        <title>Time Tracking</title>
        <description>&lt;p&gt;Time tracking is a very emotive subject with even the mention of the words likely to cause offense or an immediate defensive stance.  This is hardly surprising when many peoples experience of time tracking is either a corporate Orwellian nightmare or a misguided attempt to attribute cost to projects or initiatives.&lt;/p&gt;

&lt;p&gt;Many years ago when I worked in a call centre they had a tracking system built into the phones with a series of codes to enter for reasons that included breaks and visiting the toilet.  It’s not clear what they were trying to measure with the latter, perhaps they were interested in who had the weakest bladder? It was all very creepy, not helped by the knowledge that a supervisor spent most of the time watching the real time statuses of all the staff and checked on people who had been on extended toilet breaks.  Unfortunately for many sectors this has only got worse and worryingly the &lt;a href=&quot;https://www.theverge.com/2019/4/25/18516004/amazon-warehouse-fulfillment-centers-productivity-firing-terminations&quot;&gt;supervisors are being replaced with AI&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In spite of my bad experiences of time tracking, I’ve recently decided to start tracking my own time within work.  The motivation for this is that in a technical leadership role my own time becomes subjected to the System Trap of &lt;a href=&quot;./tragedy-of-the-commons&quot;&gt;Tragedy of the Commons&lt;/a&gt;.  I have multiple people, initiatives, aims, requests all fighting for my attention.&lt;/p&gt;

&lt;p&gt;For a while I have been using an &lt;a href=&quot;https://en.wikipedia.org/wiki/Time_management#The_Eisenhower_Method&quot;&gt;Eisenhower Matrix&lt;/a&gt; to help determine where I should spend my time, but the missing data is how much of my time I am spending on this versus other 
day-to-day activities.  This is where &lt;em&gt;I believe&lt;/em&gt; the time tracking data would be useful.  There is also a possibility of using this data to educate those who are fighting for my time, as visualising and educating is a way out of this System Trap.&lt;/p&gt;

&lt;p&gt;My Minimum Viable Product(MVP) for time capture is using a Google Sheet to record the time data and the various activity ‘tags’ that I wish to record time against.  With this data recorded it is straightforward to build visualisations of the information.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/time-tracking.png&quot; alt=&quot;An image of my time tracking system&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In the image above it shows the visualisation that I use in my time tracker.  For a selected start date and number of days it will generate a log of the activities and a pie chart of the percentage of each activity tag.&lt;/p&gt;

&lt;p&gt;What have I learned so far?  I’ve noticed that there is an element of &lt;a href=&quot;https://en.wikipedia.org/wiki/Observer_effect_(physics)&quot;&gt;Observer Effect&lt;/a&gt; occurring.  The fact that I am now recording what I’m doing has caused me to think more about how I am using my time.  It certainly seems like I am procrastinating less and being more selective about which activities I am doing.&lt;/p&gt;

&lt;p&gt;It is only an experiment at the moment and it will be interesting to see whether I stick to it and whether it proves to be useful information (is the value of the information worth the measurement?).  Perhaps I should also be mindful that I never get to the level of adding toilet breaks!&lt;/p&gt;

&lt;p&gt;If you’d like to try this out yourself there is a public copy of my spreadsheet that you can take a copy of &lt;a href=&quot;https://docs.google.com/spreadsheets/d/1bPe5f_boGq-iqGYX7TVr3K3F3dkWyAv2hT_R3oe7G5g&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
</description>
        <pubDate>Tue, 27 Jul 2021 09:00:00 +0000</pubDate>
        <link>https://iainjmitchell.com/blog/time-tracking</link>
        <guid isPermaLink="true">https://iainjmitchell.com/blog/time-tracking</guid>
        
        
        <category>management,</category>
        
        <category>systems</category>
        
        <category>thinking</category>
        
      </item>
    
      <item>
        <title>Alerting, Monitoring, and Diagnostics</title>
        <description>&lt;p&gt;Inevitably your software will fail.&lt;/p&gt;

&lt;p&gt;Requirements around detection and diagnosing of software problems are often neglected. At best they are the last thing considered and are reactionary.  Hence, solutions can be muddled and confusing; often unclear about which problem they are trying to address.&lt;/p&gt;

&lt;p&gt;Furthermore, the direction is often dictated by the companies choice of Dashboard/Alerting tooling.  Rather than engineering having the time and freedom to consider what they need.&lt;/p&gt;

&lt;p&gt;In this post, I will run through the differences between Alerting, Monitoring, and Diagnostics of software systems looking at good practices and potential pitfalls.&lt;/p&gt;

&lt;h2 id=&quot;alerting&quot;&gt;Alerting&lt;/h2&gt;

&lt;blockquote&gt;
  &lt;p&gt;“It’s a dangerous world, man. You’ve gotta keep your eyes and ears peeled and be on the alert all the time.”&lt;/p&gt;

  &lt;p&gt;Vinnie Paul&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Imagine, it’s half past six on a Saturday morning and a critical software system starts to deteriorate, by nine this has escalated into a full outage.  However, also consider another less critical system that starts to deteriorate but continues to run.&lt;/p&gt;

&lt;p&gt;The purpose of alerting is to give appropriate notifications to those who support software systems.  Or to put it another way, what do you want to know about in the middle of the night?&lt;/p&gt;

&lt;p&gt;Consequently, having levels of alerting is essential if you don’t want to be woken up for something mundane.  A typical example of alert levels would be low, medium, and high. With only the latter triggering the nocturnal surprise.&lt;/p&gt;

&lt;p&gt;Furthermore, it is also important to be able to send alert messages to multiple sources. This ‘fanning’ of messages allows the alert to be sent to multiple mediums (e.g. Slack, email, SMS) and potentially to different groups of people (e.g. engineers, service support).&lt;/p&gt;

&lt;p&gt;The diagram below illustrates a simple but effective alerting system that I have seen in use for a product hosted on AWS.  The definition of the alerting alarms is handled in CloudWatch, these can then be assigned a level by attaching the appropriate SNS topic (High, Medium or Low).  These topics send the alarm out to any number of interested subscribers by various mechanism (i.e. email, Slack).  Splitting topics by alerting level enables the subscribers choose the level of alerting ‘noise’ they desire.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/alerting-monitoring-diagnostics/alerting.png&quot; alt=&quot;Alerting example&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;monitoring&quot;&gt;Monitoring&lt;/h2&gt;
&lt;blockquote&gt;
  &lt;p&gt;I know enough of the world now to have almost lost the capacity of being much surprised by anything&lt;/p&gt;

  &lt;p&gt;Charles Dickens, David Copperfield&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The central purpose of monitoring is to clearly show if your applications are healthy.  I’m referring here to the information you glance at to see if everything is okay.  Typically, this is the dashboard you have displayed in the office.&lt;/p&gt;

&lt;p&gt;Primarily, this dashboard should be driven by the same alerting process I described in the previous section.  Colour can be an effective communication aid for monitoring dashboards.  Typically I’ve seen critical alerts use hues of red to draw the observers attention.  Conversely, greens are used when everything is okay.&lt;/p&gt;

&lt;p&gt;Furthermore, these dashboards may also contain contextual information to help the viewer make sense of the alerts.  For example, it might be useful to show traffic levels or status of an underlying third party system.  However, it is important to remember that less is more with monitoring dashboards.  It is not about the detail, it is a call to action to investigate the problem.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/alerting-monitoring-diagnostics/monitoring.png&quot; alt=&quot;Monitoring example&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The diagram above shows a sketch I’ve made to illustrate what a clear and informative monitoring dashboard might look like.  Something is clearly wrong with the Cat API, perhaps this is causing the latency with the Animal Website?  Oh wait, the website requests seem to have gone up quite a bit, perhaps that is worth investigating?&lt;/p&gt;

&lt;p&gt;It is worth mentioning that many leading tools on the market are not tailored for making monitoring visuals.  Products such as &lt;a href=&quot;https://www.elastic.co/kibana&quot;&gt;Kibana&lt;/a&gt;, &lt;a href=&quot;https://grafana.com/&quot;&gt;Graphana&lt;/a&gt;, and &lt;a href=&quot;https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html&quot;&gt;Cloudwatch Dashboards&lt;/a&gt; are all based around making dashboards for a defined time frame (such as last 3hrs, last day etc).  There’s usually an option to adjust this period in the top corner of the screen.  So, why is this a problem?&lt;/p&gt;

&lt;p&gt;Firstly, some of the data is pushed real time to the dashboard rather than being queried for a particular time frame.  This makes integration with alerting data sources problematic, if not next to impossible with these tools.&lt;/p&gt;

&lt;p&gt;Secondly, the context data that you might want to display might not be as simple as a single time period.  For example, what if for one graph you need to see the last three hours of data whereas a neighbouring graph you want to see the data for the same period yesterday.&lt;/p&gt;

&lt;p&gt;For these reasons, I’ve often seen teams resort to using Open Source tools like &lt;a href=&quot;https://smashing.github.io/&quot;&gt;Smashing&lt;/a&gt; or building their own solutions for clear and informative monitoring.&lt;/p&gt;

&lt;h2 id=&quot;diagnostics&quot;&gt;Diagnostics&lt;/h2&gt;

&lt;blockquote&gt;
  &lt;p&gt;“It’s a funny thing about looking for things. If you hunt for a needle in a haystack you don’t find it. If you don’t give a darn whether you ever see the needle or not it runs into you the first time you lean against the stack.”&lt;/p&gt;

  &lt;p&gt;P.G. Wodehouse&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Imagine you’ve had an alert or your monitoring dashboard has turned a shade of rouge.  You know that one of your systems is failing, but what is causing it?  This is where detail becomes important, you need as much as possible to help you diagnose and resolve the issue.  Sources of diagnostic information include application logs, instrumentation metrics from infrastructure, and logs of external services (such as Web Application Firewalls and API Management).&lt;/p&gt;

&lt;p&gt;However, be aware that there can be too much detail to sieve through, especially in the middle of the night!  It is important to just log and capture information that is likely to be useful.   Consider how ‘chatty’ your logs are, will they make it easier or harder to find that needle in the haystack?  Another consideration is how long you retain your diagnostic information for, holding logs and metrics longer help spot long-term patterns, but at a higher cost and more data to search through.  It is important to find the right balance for your team, not just falling back to default positions (e.g. whole organisation stores logs for 12 months).&lt;/p&gt;

&lt;p&gt;Tooling wise, diagnostics is the forté of products such as &lt;a href=&quot;https://www.elastic.co/kibana&quot;&gt;Kibana&lt;/a&gt;, &lt;a href=&quot;https://grafana.com/&quot;&gt;Graphana&lt;/a&gt;, and &lt;a href=&quot;https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html&quot;&gt;Cloudwatch Dashboards&lt;/a&gt;.  The ability of these products to bring together numerous data sources and build in-depth visualisations based upon time ranges is ideal for supporting diagnostics.&lt;/p&gt;

&lt;p&gt;If your system contains many moving parts (i.e. Microservices) it may be worth considering a Distributed Tracing solution, such as &lt;a href=&quot;https://zipkin.io/&quot;&gt;Zipkin&lt;/a&gt; or &lt;a href=&quot;https://aws.amazon.com/xray/&quot;&gt;AWS X-Ray&lt;/a&gt;.  These utilise a common identifier for requests through the system, which enables the user interface of these tools to provide timings and points of failure between the various parts of your system.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;In this post I have covered the differences between Alerting, Monitoring, and Diagnostics on software systems.  The diagram below illustrates how the amount of detail increases from Alerting to Monitoring and then surges in the Diagnostics arena.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/alerting-monitoring-diagnostics/summary.png&quot; alt=&quot;Summary&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Each of these use cases have unique requirements that call for different approaches and different tool-sets.  But combined together they help to form a coherent picture of the state of a software system.&lt;/p&gt;
</description>
        <pubDate>Wed, 04 Nov 2020 09:00:00 +0000</pubDate>
        <link>https://iainjmitchell.com/blog/alerting-monitoring-diagnostics</link>
        <guid isPermaLink="true">https://iainjmitchell.com/blog/alerting-monitoring-diagnostics</guid>
        
        
        <category>operability</category>
        
      </item>
    
      <item>
        <title>Job Title Diffusion Causal Loop Diagram</title>
        <description>&lt;p&gt;In my &lt;a href=&quot;/blog/law-of-job-title-diffusion&quot;&gt;previous post&lt;/a&gt; I covered the phenomenon of &lt;strong&gt;Job Title Diffusion&lt;/strong&gt;.  That is the impact of a variety of job titles can have on a organisation.&lt;/p&gt;

&lt;p&gt;Recently, I’ve had to examine this in more detail and found that a &lt;strong&gt;Causal Loop Diagram&lt;/strong&gt; really helped to illustrate and understand the problem (see &lt;a href=&quot;/blog/ability-to-cope&quot;&gt;this post&lt;/a&gt; for more details about Causal Loop Diagrams).  What I ended up with is the diagram below.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/job-title-diffusion.jpg&quot; alt=&quot;Causal Loop Diagram of Job Title Diffusion&quot; /&gt;&lt;/p&gt;

&lt;p&gt;As a refresher, the &lt;strong&gt;S&lt;/strong&gt; links move in the &lt;strong&gt;Same&lt;/strong&gt; direction and the &lt;strong&gt;O&lt;/strong&gt; links move in the &lt;strong&gt;Opposite&lt;/strong&gt; direction.  For example, as the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;variety of job roles&lt;/code&gt; increase in a team also the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;variety of technology and code&lt;/code&gt; increases in the team (S link).  Also, as the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;variety of job roles&lt;/code&gt; increases the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;variety of work an individual can pick up&lt;/code&gt; decreases (O link).&lt;/p&gt;

&lt;p&gt;There is a &lt;strong&gt;Reinforcement Loop&lt;/strong&gt; going from &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;variety of job roles&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;variety of work an individual can pick up&lt;/code&gt; to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pressure to recruit specialists&lt;/code&gt; and back to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;variety of job roles&lt;/code&gt;.  This often manifests itself in a &lt;strong&gt;vicious circle&lt;/strong&gt; that drives the number of each type of specialist which reinforces the siloing of job role and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;variety of technology and code&lt;/code&gt; in the team.&lt;/p&gt;

&lt;p&gt;I’ve also recorded that having more individuals who can only pick up certain types of work can cause &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pressure for more work in-progress&lt;/code&gt; which will negatively impact the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;amount of work delivered&lt;/code&gt; (work takes longer to complete and is impacted by workers being unavailable).  This in turn creates &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pressure to recruit more specialists&lt;/code&gt; and fuels our &lt;strong&gt;Reinforcement Loop&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;There are two output &lt;em&gt;dangles&lt;/em&gt; from the system.  The first of these is the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bus factor risk&lt;/code&gt; of the team, this is a rather macabre idea of how much the team would be impacted by an individual being hit by a bus (a bus factor of 1 would be only one person knows about this part of the system).  Second, is the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pressure on team cost&lt;/code&gt; which is driven by the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pressure on small team size&lt;/code&gt;, which in turn is driven by &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;variety of job roles in the team&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Finally, I’ve added the intervention I suggested in my previous post as an input &lt;em&gt;dangle&lt;/em&gt;.  This is highlighted in yellow and named &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;encourage people to work outside their specialism&lt;/code&gt;.  This impacts the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;variety of work that an individual can pick up&lt;/code&gt; and starts to turn the &lt;strong&gt;Reinforcement Loop&lt;/strong&gt; into a &lt;strong&gt;virtuous&lt;/strong&gt;, rather than &lt;strong&gt;vicious&lt;/strong&gt;, circle.&lt;/p&gt;
</description>
        <pubDate>Sun, 27 Sep 2020 09:00:00 +0000</pubDate>
        <link>https://iainjmitchell.com/blog/job-titles-causal-loop</link>
        <guid isPermaLink="true">https://iainjmitchell.com/blog/job-titles-causal-loop</guid>
        
        
        <category>management,</category>
        
        <category>systems</category>
        
        <category>thinking</category>
        
      </item>
    
      <item>
        <title>Law of Job Title Diffusion</title>
        <description>&lt;p&gt;I’ve been trying to put into words a phenomenon that I’ve increasingly seen in software organisations.  This is my first attempt in describing what I’ve called the &lt;strong&gt;Law of Job Title Diffusion&lt;/strong&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;An organisations number of tools, languages, frameworks and source code repositories increases with every job title introduced.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;My hypothesis is that in organisations with lower numbers of engineering job titles there are fewer programming languages, frameworks and tools in play.  The source code is also more likely to be concentrated in a smaller number of repositories.&lt;/p&gt;

&lt;p&gt;Imagine an engineering team where individuals do have particular talents, but work collaboratively to get work done.  Technology decisions will be taken more holistically, such as writing automated testing in the same language used to build the actual solution or using the same JSON parsing library across the board.  Thus reducing the number of languages and frameworks in play.  Furthermore, the code for solution, tests and infrastructure is more likely to live in the same source control repository.&lt;/p&gt;

&lt;p&gt;Conversely, a team with dedicated Software Engineers in Test, Frontend Engineers and Platform Engineers is more likely to have multiple language choices (e.g. Scala for tests, Python for infrastructure, Javascript for frontend and Java for backend).  Moreover, they are also likely to store their code in different places.  For example, separate repositories for infrastructure, automated testing and source code.&lt;/p&gt;

&lt;p&gt;Is it possible to break this law? Possibly, if job titles are seen as more consultative rather than specialisms and there is a genuine culture of solving problems together.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Sometimes different problems do require solutions, so a different language or framework might be the right choice.  However, this should be a conscious choice rather than a by-product of having different job titles!&lt;/em&gt;&lt;/p&gt;

</description>
        <pubDate>Tue, 01 Sep 2020 09:00:00 +0000</pubDate>
        <link>https://iainjmitchell.com/blog/law-of-job-title-diffusion</link>
        <guid isPermaLink="true">https://iainjmitchell.com/blog/law-of-job-title-diffusion</guid>
        
        
        <category>management</category>
        
      </item>
    
      <item>
        <title>Asynchronous meetings</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;Asynchronous - not simultaneous or concurrent in time : not synchronous&lt;/p&gt;
  &lt;h6 id=&quot;httpswwwmerriam-webstercomdictionaryasynchronous&quot;&gt;&lt;a href=&quot;https://www.merriam-webster.com/dictionary/asynchronous&quot;&gt;https://www.merriam-webster.com/dictionary/asynchronous&lt;/a&gt;&lt;/h6&gt;
&lt;/blockquote&gt;

&lt;p&gt;The current pandemic has suddenly thrust many of us into remote ways of working.  This post looks at Asynchronous (Async) Meetings, how to make them effective and how to conduct one in a tool such as Slack/Microsoft Teams.&lt;/p&gt;

&lt;h2 id=&quot;what-is-an-async-meeting&quot;&gt;What is an Async meeting?&lt;/h2&gt;

&lt;p&gt;An Async meeting doesn’t require all participants to meet and discuss a topic at the same time.  Instead, the meeting happens in written form via a shared document or in a channel of a tool such as Slack or Microsoft Teams.&lt;/p&gt;

&lt;p&gt;This style of meeting is beneficial to remote working, as it helps reduce fatigue caused by excessive amount of time on video calls.  Furthermore, it can be advantageous when participants have different working patterns.&lt;/p&gt;

&lt;p&gt;Additionally, they also give the opportunity for longer contemplation of the questions and responses.  This should lead to better results and engagement, as it empowers those who are considered in their responses.&lt;/p&gt;

&lt;h2 id=&quot;what-makes-an-effective-async-meeting&quot;&gt;What makes an effective Async meeting?&lt;/h2&gt;

&lt;p&gt;Fortunately, many of the practices of effective meetings apply to Async meetings.&lt;/p&gt;

&lt;p&gt;The first of these is to have a clear problem statement, which gives the participants the context and objective of the meeting. This could be a question that needs answering or a decision that needs making.&lt;/p&gt;

&lt;p&gt;Secondly, the meeting needs a clear agenda. What are the sub-points that need discussing to get to reach the objective of the meeting? In async meetings these work better being a series of direct questions.  As this removes ambiguity and discourages meandering off topic.&lt;/p&gt;

&lt;p&gt;Thirdly, have clear outcomes and actions of the meeting. As in standard meetings, actions need to be documented, have responsible person(s) and be followed up on.&lt;/p&gt;

&lt;p&gt;It is also essential to have a chair of the meeting. As with synchronous meetings this role keeps contributors on topic. Additionally, they are responsible for setting the timetable and reminding participants to contribute.&lt;/p&gt;

&lt;p&gt;A unique requirement of Async meetings is timeboxes. Without these a conversation could last days, weeks or even months! The chair should set these and ensure that all participants are aware of the deadlines.&lt;/p&gt;

&lt;p&gt;Finally, it is important to get commitment from each of the participants to contribute to the meeting.  Without this there is a possibility that the meeting will not progress, or that a key stakeholder will dispute the outcome of the meeting.&lt;/p&gt;

&lt;h2 id=&quot;running-an-async-meeting-in-slackmicrosoft-teams&quot;&gt;Running an Async meeting in Slack/Microsoft Teams&lt;/h2&gt;

&lt;p&gt;Tools such as &lt;a href=&quot;https://slack.com&quot;&gt;Slack&lt;/a&gt; and &lt;a href=&quot;https://teams.microsoft.com&quot;&gt;Microsoft Teams&lt;/a&gt; are a perfect medium for running Async meetings. Here are a few hints to using the effectively.&lt;/p&gt;

&lt;p&gt;To begin with, have a dedicated channel for the meeting.  This should be well named and be archived once the meeting has concluded.  Furthermore, this should be private to virtually close the door on the meeting. Though this shouldn’t discourage from adding useful participants at any point in the meeting.&lt;/p&gt;

&lt;p&gt;Secondly, use threads within the channels for each question or sub-point that is being discussed. This makes it much easier for the participants to navigate and review the meeting.&lt;/p&gt;

&lt;p&gt;Next, when chairing a meeting use tools like polls and reminders to help the participants reach consensus.  Reminders are particularly useful to automate the manual chasing that this would otherwise entail.  If an appropriate tool is not available on the platform (e.g whiteboard) then simply link from the channel.  Be careful not to move the conversation outside the original channel.&lt;/p&gt;

&lt;p&gt;Incidentally, it is also important to remind participants not to constantly check and react to the meeting. Ideally, they should be checking the channel a few times a day rather than being at is beck and call.  If the latter happens the meeting has slipped into being a long running synchronous conversation and is potentially worse than the video call that you’re trying to avoid!&lt;/p&gt;

&lt;p&gt;Finally, ensure that the meeting channel is closed once a meeting has ended. This shuts the door on the meeting and removes it from the participants cognitive load.  However, it is useful to archive the meeting channel as it may needed in the future to understand why a certain decision was made.&lt;/p&gt;

&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Async meetings can be an effective alternative to video calls and potentially even face-to-face meetings.  They also give the opportunity for participants to have more time to consider questions, responses and their contributions.&lt;/p&gt;

&lt;p&gt;Nevertheless, it is not as simple as creating a Slack channel and inviting a few participants.  The meetings require specific agendas and strong chairing.&lt;/p&gt;
</description>
        <pubDate>Thu, 06 Aug 2020 09:00:00 +0000</pubDate>
        <link>https://iainjmitchell.com/blog/async-meetings</link>
        <guid isPermaLink="true">https://iainjmitchell.com/blog/async-meetings</guid>
        
        
        <category>management,</category>
        
        <category>remote</category>
        
      </item>
    
      <item>
        <title>Causal Loop Diagrams: Ability to Cope</title>
        <description>&lt;p&gt;This is my favourite diagram at the moment….&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/ability-to-cope.jpg&quot; alt=&quot;Causal Loop Diagram of Ability to Cope&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I’ve shared it with countless colleagues, as I feel it really demonstrates the vicious circle that many Software Teams/Departments find themselves in.&lt;/p&gt;

&lt;p&gt;It is shamelessly copied and adapted from an example in the book &lt;a href=&quot;https://www.goodreads.com/book/show/811882.Seeing_the_Forest_for_the_Trees&quot;&gt;Seeing the Forest For the Trees&lt;/a&gt;.  The example in the book is based upon a back-office function of a financial organisation, yet it shares many of the traits of departments and teams in Software.&lt;/p&gt;

&lt;p&gt;This type of diagram is called a &lt;strong&gt;Causal Loop Diagram&lt;/strong&gt; and is used to show the interactions between parts of a system.  Each link between elements is annotated with either an S or O.  These inform the reader whether the connected elements move in the same (S) or opposite (O) direction.&lt;/p&gt;

&lt;p&gt;What is the diagram above conveying to us?  If we start from &lt;em&gt;volume and variety of initiatives&lt;/em&gt;, when this increases (as often happens in Software) the &lt;em&gt;workload&lt;/em&gt; moves in the same direction (S) - it also increases!  Consequently, an increase in &lt;em&gt;workload&lt;/em&gt; will cause a decrease in the &lt;em&gt;ability to cope&lt;/em&gt;, as this moves in the opposite direction (O).&lt;/p&gt;

&lt;p&gt;As a result of this the &lt;em&gt;incidence of error&lt;/em&gt; will increase, as this moves in the opposite direction of &lt;em&gt;ability to cope&lt;/em&gt;.  The increased number of errors will cause the &lt;em&gt;strain in management&lt;/em&gt; to move in the same direction (increase).  Finally, this strain will cause the same direction movement in the &lt;em&gt;workload&lt;/em&gt;, thus increasing this further.  Which completes this &lt;strong&gt;vicious circle&lt;/strong&gt; that if left unchecked will continue to deteriorate.&lt;/p&gt;

&lt;p&gt;There is also an additional information about how staff levels, cost and delays impact this loop externally.  Furthermore, it also shows how &lt;em&gt;service quality&lt;/em&gt; is impacted by this &lt;strong&gt;vicious circle&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The loop that is causing the vicious circle is an example of a &lt;strong&gt;reinforcement loop&lt;/strong&gt;.  These types of loop will continue to spin until some action is taken, in this example the influencing factor is the &lt;em&gt;volume and variety of initiatives&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;All reinforcement loops can create &lt;strong&gt;vicious&lt;/strong&gt; or &lt;strong&gt;virtuous&lt;/strong&gt; circles, it depends on the influencing factor(s).  In our example above, if the &lt;em&gt;volume and variety of initiatives&lt;/em&gt; is at a more manageable level it will decrease the &lt;em&gt;workload&lt;/em&gt;.  This in turn will increase the &lt;em&gt;ability to cope&lt;/em&gt;, which will reduce the &lt;em&gt;incidence of errors&lt;/em&gt;.  For this reason the &lt;em&gt;strain on management&lt;/em&gt; will be reduced which then leads to a reduction in &lt;em&gt;workload&lt;/em&gt;.  We now have a &lt;strong&gt;virtuous&lt;/strong&gt; circle!&lt;/p&gt;

&lt;p&gt;Hence, this &lt;strong&gt;causal loop diagram&lt;/strong&gt; illustrates that the flow of work into teams is the most important lever to control both the ability of team members to cope and the sustainability of delivery.  This is probably not a surprise to many software teams, but this diagram and &lt;strong&gt;causal loop diagrams&lt;/strong&gt; in general are a great way of illustrating systemic traps that organisations get themselves into.&lt;/p&gt;
</description>
        <pubDate>Thu, 18 Jun 2020 09:00:00 +0000</pubDate>
        <link>https://iainjmitchell.com/blog/ability-to-cope</link>
        <guid isPermaLink="true">https://iainjmitchell.com/blog/ability-to-cope</guid>
        
        
        <category>systems</category>
        
        <category>thinking,</category>
        
        <category>management</category>
        
      </item>
    
      <item>
        <title>A Year in Retrospective</title>
        <description>&lt;div class=&quot;hero&quot;&gt;
  &lt;p&gt;&lt;img src=&quot;../images/san-fran-art.png&quot; alt=&quot;Staircase at San Francisco Modern Art Gallery&quot; class=&quot;hero__image&quot; /&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Recently, I completed a year of holding weekly personal retrospectives.  In this post I’ll look at how I run my retrospectives, what has gone well, what hasn’t worked and finally why I’ve managed to keep to this routine for a year.&lt;/p&gt;

&lt;p&gt;My weekly personal retrospective takes the following format:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Meditation&lt;/li&gt;
  &lt;li&gt;How am I?&lt;/li&gt;
  &lt;li&gt;Feedback&lt;/li&gt;
  &lt;li&gt;What has gone well?&lt;/li&gt;
  &lt;li&gt;What can I improve?&lt;/li&gt;
  &lt;li&gt;Review last weeks goals&lt;/li&gt;
  &lt;li&gt;Set weeks goals&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Initially, I perform 10 minutes of mindfulness meditation to clear my mind ready to reflect. This is followed by asking myself how am I?  Which is aimed at discovering how I’m feeling mentally.  Am I anxious, tired, happy, sad?&lt;/p&gt;

&lt;p&gt;Next I focus upon the feedback I’ve received in the past week.  I record any positive and constructive feedback  and spend a moment to reflect upon it.  This feeds into the next two sections ‘what has gone well’ and ‘what can I improve’.  Hopefully these parts are fairly self explanatory, but it is worth stating that I focus on all aspects of my life not just work.  For example, last week I included teaching my 5 year old son how to ride a bike without stabilisers.&lt;/p&gt;

&lt;p&gt;Subsequently I review the goals I have set myself in the previous retrospective, recording whether they have been met, worked towards or neglected.  Finally, this leads to setting the goals for the next week.  These could be goals from the previous week that are still outstanding or goals based on improvements that I previously identified. I always ensure a Work In Progress (WIP) limit of two for weekly goals, any more is counter productive.  Having a WIP of two allows me to have a goal inside and outside work.&lt;/p&gt;

&lt;p&gt;What has gone well with my year of weekly retrospectives?  To begin with the recording of positive feedback and what has gone well has helped lift my spirit, especially when I feel like I’ve had a bad week^.&lt;/p&gt;

&lt;p&gt;Furthermore, I have found having targeted goals have helped me complete long term projects, such as building a bike for my father and various work initiatives.&lt;/p&gt;

&lt;p&gt;Conversely, what hasn’t worked with my personal retrospectives? Initially I tried to run my retro at 15:30 on a Friday, but I found that I often deferred it to Monday morning.  This was due to work commitments or just generally winding down for the weekend.  Therefore I now shifted the retro to always be first thing on a Monday.&lt;/p&gt;

&lt;p&gt;Secondly, I experimented for a period using data from &lt;a href=&quot;https://todoist.com&quot;&gt;Todoist&lt;/a&gt; to reflect on where I was spending my time.  I’ve been using Todoist for a number of years as a task list for &lt;a href=&quot;https://en.m.wikipedia.org/wiki/Getting_Things_Done&quot;&gt;Getting Things Done (GTD)&lt;/a&gt;. As the tasks are categorised together by type of work I hypothesised that this data would give me a real indication as to where my efforts were going. It quickly came apparent that the data was unreliable, as many things I did just weren’t recorded in Todoist. Therefore I chose to abandon this part of the retrospective.&lt;/p&gt;

&lt;p&gt;To conclude this post I want to reflect upon why I have managed to keep my personal retrospectives going for a year? My previous attempts have lasted mere weeks, abandoned due to neglect or simply being too busy.  So, what has been different this time?&lt;/p&gt;

&lt;p&gt;From the beginning, I have made the retrospective part of my routine. There is a calendar entry for the event itself. But, more importantly, I have a check-in every morning to review my current goals.  Consequently, I am far more likely to work towards and complete these goals. Which in turn is a positive reinforcement loop to continued use of a personal retrospective.&lt;/p&gt;

&lt;p&gt;Incidentally, by publishing  this blog post I can mark one of my goals for this week as done!&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;^ I have recently been introduced to the concept of &lt;a href=&quot;https://en.m.wikipedia.org/wiki/Gratitude_journal&quot;&gt;Gratitude Journalling&lt;/a&gt;, which also highlights the virtues of positive reflection upon mental health.&lt;/p&gt;
</description>
        <pubDate>Thu, 14 May 2020 09:00:00 +0000</pubDate>
        <link>https://iainjmitchell.com/blog/a-year-in-retrospective</link>
        <guid isPermaLink="true">https://iainjmitchell.com/blog/a-year-in-retrospective</guid>
        
        
        <category>reflection,</category>
        
        <category>agile</category>
        
      </item>
    
      <item>
        <title>Acceptance Testing</title>
        <description>&lt;p&gt;Last week I had the following DM on Twitter from &lt;a href=&quot;https://twitter.com/rahabm&quot;&gt;@rahabm&lt;/a&gt; about the current state of Acceptance Testing&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Hi Iain. I remember that testing used to be taken serious back in the UK. What is the current state on Acceptance Testing these days ? What are your thoughts on who should write and implement an acceptance test ? 😀&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I commented at the end of my rant back to @rahabm that I should probably write a blog post about this, so here it is!&lt;/p&gt;

&lt;p&gt;To begin with, what do we mean by &lt;strong&gt;Acceptance Test&lt;/strong&gt;?  If we use &lt;a href=&quot;https://martinfowler.com/bliki/TestPyramid.html&quot;&gt;Mike Cohn’s Testing Pyramid&lt;/a&gt; we are referring to the User Interface or system boundary test, which is the very top of the pyramid.  For a website this would be a form of browser automation with code performing the clicks and inputting normally performed by humans.&lt;/p&gt;

&lt;p&gt;As the &lt;strong&gt;Testing Pyramid&lt;/strong&gt; suggests, we should write as few of these as possible.  They are time consuming to write, maintain and run, plus have a much slower feedback loop than unit tests.  If there are too many of these they can impact a teams cadence of delivery and discourage continuous integration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Acceptance Tests&lt;/strong&gt; should focus on critical user journeys rather than specific functionality.  For example, for an e-commerce site you would expect there to be an &lt;strong&gt;Acceptance Test&lt;/strong&gt; that selects a number of items and completes payment.  They are also usually focussed upon positive outcomes, rather than &lt;em&gt;xyz&lt;/em&gt; failed.&lt;/p&gt;

&lt;h2 id=&quot;who-should-write-acceptance-tests&quot;&gt;Who should write Acceptance Tests?&lt;/h2&gt;

&lt;p&gt;Some organisations have dedicated people, sometimes called &lt;em&gt;Software Engineers in Test&lt;/em&gt;, to write &lt;strong&gt;Acceptance Tests&lt;/strong&gt;.  I would suggest not doing this as:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;It will encourage more of these tests to be written, as it helps to occupy this persons time.&lt;/li&gt;
  &lt;li&gt;Often this person will work by themselves, becoming a bottleneck and a &lt;a href=&quot;https://en.wikipedia.org/wiki/Bus_factor&quot;&gt;bus factor of one&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;They may follow different coding practices and/or languages than the rest of the engineering team.  I have seen entire test suites thrown away when the test engineer leaves the team for this reason.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A preferable solution is to employ a QA who thinks about quality in the system holistically and works with the engineering team to work out how to test it better.  This person is NOT primarily a coder, but is happy to pair or join a mob with engineers to ensure quality.&lt;/p&gt;
</description>
        <pubDate>Wed, 31 Jul 2019 10:39:51 +0000</pubDate>
        <link>https://iainjmitchell.com/blog/acceptance-testing</link>
        <guid isPermaLink="true">https://iainjmitchell.com/blog/acceptance-testing</guid>
        
        
        <category>testing,</category>
        
        <category>software</category>
        
        <category>management</category>
        
      </item>
    
  </channel>
</rss>
