Alan Edwardes

Cloud Software & Game Development
  • About
  • Projects
  • Blog

Most Used Tags

  • estranged
  • git
  • light
  • website
  • game
  • asset
  • level
  • editor
  • jenkins
  • code
  • file
  • lambda
  • player
  • unreal
  • dns
  • amazon
  • script
  • cloudfront
  • email
  • blueprint
  • engine
  • world
  • streaming
  • s3
  • shadow

Posts in 2021

  • The Art of Mirror's Edge on 11th of Apr
  • Serving Static Websites Using Lambda@Edge on 20th of Mar
  • Thread Safe Random in C♯ on 16th of Mar
  • Spotting Fake Indie Game Key Requests on 11th of Mar
  • Jenkins Library for Unreal Engine 4 on 13th of Feb
  • Three Approaches to Readable Materials in First Person Games on 7th of Feb
  • Cheap Synthetic Monitoring with AWS Lambda on 24th of Jan

Posts in 2020

  • Generating Mipmaps for Render Targets in UE4 on 24th of Dec
  • Routing DNS over HTTPS Using Raspberry Pi on 6th of Oct
  • Tips for Building Games with Unreal Engine 4 on 3rd of Oct
  • Serving Localised Assets from S3 Using Lambda@Edge on 17th of May

Posts in 2019

  • Automating macOS Notarization for UE4 on 23rd of Nov

Posts in 2018

  • ISO Country Code to Unicode Flag in C♯ and JavaScript on 22nd of Jul
  • Serverless Git LFS for Game Development on 6th of Jan
  • Adding Custom Map Checks in UE4 on 3rd of Jan

Posts in 2017

  • Building and Deploying a React App Using AWS Lambda on 24th of Dec
  • Git HTTP Username and Password in Environment Variables on 22nd of Dec
  • Capturing and Uploading Screenshots in UE4 on 20th of Dec
  • Using Capsule Shadows on Large Objects in UE4 on 8th of Dec

Word "lambda"

Viewing subset of posts matching the word "lambda".

Serving Static Websites Using Lambda@Edge

Posted March 20th, 2021, updated April 4th, 2021 in cloud-software

A typical approach to static websites on AWS involves a CloudFront distribution pointed at an S3 bucket.

One drawback to this approach is that in the event of a cache miss, CloudFront must retrieve the content from S3. If the bucket is in Ireland and the edge cache is in Australia, this will mean a round trip between those points.

In reality this latency isn't really a problem since it's only evident on a cache miss, but (more as as an experiment than anything else) I decided to write a proof of concept to serve static content entirely from the edge cache.

Continue Reading »

Cheap Synthetic Monitoring with AWS Lambda

Posted January 24th, 2021 in cloud-software

I have a few miscellaneous services which I host for various personal things; MediaWiki, Jenkins, Grafana, Rocket Chat, etc. These are usually hosted on VPS machines with Docker, which means a "one size fits all" monitoring solution is hard.

If I were operating as a business, I would just opt for an off-the-shelf synthetic monitoring solution with a support contract and call it done, but in a personal capacity I don't particularly want to pay.

I had a few criteria:

  • Cheap/free
  • Ability to write synthetic checks using HTTP requests (not a headless browser, that is a bit OTT)
  • Synthetic checks preferably in C#
  • Alerting via email for when the checks fail
  • Hosted redundantly & managed (e.g. AWS, not on a VPS)
  • Low/zero maintenance

Continue Reading »

Serving Localised Assets from S3 Using Lambda@Edge

Posted May 17th, 2020 in cloud-software

Using Lambda@Edge, you can route users to different assets depending on their browser language, country or device (to name a few). In this post I am going to focus on the Accept-Language header, to detect the user's locale.

Demo

Example image served using this technique:

The text 'GB' for users visiting from the UK, 'US' from the US, 'CA' from Canada, 'EN' for other English speakers and 'GLOBAL' for anyone else.

Depending on your browser language, you will see:

  • "GB" for "English (United Kingdom)" (region-test.png.en-GB)
  • "US" for "English (United States)" (region-test.png.en-US)
  • "CA" for "English (Canada)" (region-test.png.en-CA)
  • "EN" for "English" (region-test.png.en)
  • "GLOBAL" if set to anything else (region-test.png)

Continue Reading »

Serverless Git LFS for Game Development

Posted January 6th, 2018, updated July 18th, 2020 in cloud-software

For Estranged, I needed a simple, cheap way of storing binary files. All solutions I tested required me to host a server, or me to pay someone to host a server. I wanted to avoid the flat fee for a constantly running server, and use something completely serverless with a pay-for-what-you-use model.

I settled on using a GitHub private git repository (free) and an LFS (large file storage) backend using Amazon Lambda, Amazon S3 and Amazon API Gateway.

This write-up is a follow up to my older YouTube video covering the manual setup. This guide uses a template for a 1-click deployment of all resources mentioned in the video.

Continue Reading »

Building and Deploying a React App Using AWS Lambda

Posted December 24th, 2017 in cloud-software

If you use React with a static frontend web app, the deployment steps may comprise of the following:

  • Run npm install
  • Run npm test
  • Run npm build
  • Deploy build folder to Amazon S3 & invalidate CDN cache

The first part of the build only requires node.js & npm, and the second part can be written in JavaScript too as a package.json script (I'll go into that more below).

Since node and npm are both available on Lambda, we can write a Lambda function invoked using a post-commit webhook (from GitHub or BitBucket), which builds and deploys the React application.

A few advantages to doing this:

  • You don't need any orchestration infrastructure (Jenkins) or cost overhead of BitBucket pipelines and similar solutions
  • Since the environment is completely managed, the only changes you may need to make are updating the Node.js runtime version as Amazon release newer versions
  • Access to the S3 bucket is controlled using IAM roles, no access key/secret

Continue Reading »

Æ

© 2021 Alan Edwardes