InvalidCypherTextException when reading an encrypted DynamoDB table which has been restored from a backup


If you attempt to read encrypted data from a DynamoDB table which has been restored from a backup to a DynamoDB table which doesn’t match the original table name, you may see the following errors:

InvalidCiphertextException: An error occurred (InvalidCiphertextException) when calling the Decrypt operation


UnwrappingError: Failed to unwrap AWS KMS protected materials

In this case:

  • A backup of the DynamoDB table “Notes” had been restored to a new DynamoDB table “Notes-Restored”
  • The table was using encryption at rest
  • One of the columns of the DynamoDB table had been encrypted using a CMK.
  • I was using the boto3 DynamoDB client, and dynamodb-encryption-sdk

TL;DR the restored DynamoDB table must have the same name as the original DynamoDB table, and be restored to the same account that it was originally created in.



Notes on Running Lean by Ash Maurya - Document your Plan A


The first step is to write down your initial vision, and share it with at least one other person.

Too many entrepreneurs keep their hypothesis in their head alone, rather than documenting, which makes it hard to systematically build and test a business.

Since plan A’s are likely to be proven wrong, it’s important to use a format that’s flexible, and quick to create, such as a Lean Canvas (based on Alex Osterwalder’s Business Model Canvas).

These notes are based on the second section of “Running Lean” - Document your plan A



Notes on Running Lean by Ash Maurya - The Three Stages of a Startup


Most entrepreneurs start with a strong initial vision, and a Plan A for realising that vision. Unfortunately, most Plan A’s don’t work.

Reasonably smart people can rationalize anything, but entrepreneurs are especially gifted at this.

It’s important to realise that your initial vision is built largely on untested assumptions.

Lean methodologies can help you systematically test and refine that initial vision.

Running Lean can be distilled down to three steps:

  1. Document your Plan A
  2. Identify the riskiest parts of your plan
  3. Systematically test your plan.

These notes are based on the first section of “Running Lean” - The Three Stages of a Startup



Notes on Hooked: How to Build Habit-Forming Products by Nir Eyal and Ryan Hoover


Forming user habits is an important aspect in ensuring the success of a new company.

  • Why do some products capture widespread attention, while others flop?
  • What makes us engage with certain products out of sheer habit?
  • Is there a pattern underlying how technologies hook us?

This book refers to products in the context of businesses that require ongoing, unprompted user engagement, and therefore need to build user habits.

This book does not cover business models for delivering customer value, or methods for profitable customer acquisition.

These are my personal notes, which I hope others will find useful.



Enabling HTTPS on Elastic Beanstalk without a load balancer


The recommended way to enable HTTPS in Elastic Beanstalk is to use one of AWS’s load balancers such as the Application Load Balancer (ALB) which supports autoscaling, fault tolerance, and other things.

This blog is about hosting a web app prototype on a single EC2 instance, using HTTPS via Let’s Encrypt, without a load balancer.

Using an AWS ALB costs a minimum of about $18 per month, on top of any other charges you currently have, such as $5 for the t2.micro instance that you may be running your prototype on.

So, if you’ve only got one EC2 instance in Elastic Beanstalk for your prototype, and don’t currently want the benefits of an ALB (fault tolerance, auto-scaling, etc), but do want the benefits of HTTPS (protection from interception, man-in-the-middle (MITM) attacks, etc), read on.



Using CKEditor 5 with React via create-react-app


When I first started using CKEditor 5 with create-react-app, I installed CKEditor as an npm module, and imported the ClassicEditor build as recommended by the quickstart.

Development mode (via npm start) worked well, and I was happily integrating CKEditor with React, but as soon as I ran npm run build (which generates the create-react-app production build), I ended up with the following error:

> [email protected] build c:\Dev\scratch\ckeditor-integration
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file:


Read more here:

npm ERR! errno 1
npm ERR! [email protected] build: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Ruh-roh. What to do next? How can I solve this? Is this solvable? Is there another way?



How I host and update on AWS with CloudFlare and Amazon S3 Static Website Hosting


I’ve been hosting this blog on Amazon S3 for a few months now, and thought it would be a good idea to write about how it’s set up, in case future me needs to refer to it, and to give pointers to anybody else who is interested in setting up their own website using Amazon S3, HTTPS, and the CloudFlare CDN.

Hosting this website costs cents per month, and avoids security risks of other blog platforms such as Wordpress by being purely static, consisting just regular HTML files, JavaScript, and images; which means no PHP, .NET, etc. This works well with what I need in a blog.



AWS Solution Architect Associate Exam Study Notes: Application Services


These notes were written while working through the A Cloud Guru AWS Certified Solutions Architect - Associate online course. These notes are partly from the videos, and also from various other online sources. Primarily, they’re notes for me, but you might find them useful too.

Since the AWS platform is changing so quickly, it’s possible that some of these notes may be out of date, so please take that into consideration if you are reading them.