AWS Lambda function to build a Hugo website
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


AWS Lambda function to build a Hugo website. Inspired by Ryan Brown's hugo-lambda

Blog Post,

Files - The actual function that gets ran - Helper information to build the zip file


The idea of this repo is to build a zip package that you can deploy to AWS Lambda. The lambda function fires on a SNS event, which is publishing GitHub events. In a nutshell,

  1. Publish the site contents repo to a AWS SNS Topic. In GitHub, repo settings -> Webhooks
  • Recommended: IAM user for the credentials in GitHub.
  1. Subscribe the AWS Lambda function to the SNS topic. (No special IAM permissions are needed for this)
  2. Lambda function's job is to build the static content and push to a S3 bucket of the same name as the repo name
  • Lambda function will need to have IAM permissions to read/list/put/delete S3 bucket objects and Cloudwatch Logging permissions.

Zip File

The zip file was needed because the function needs boto3 library (for ease, the awscli libraries) - an alternative implementation might re-write aws s3 sync in native python then this zip file becomes mostly moot.

  1. Launch a t2.nano, running the published supported AMI (
  2. Run
  3. Fetch resulting zip file
  4. Upload to AWS Lambda
  5. Remember to shutdown the t2.nano if not being used


  • It might be nice to package up the zip file generation in a CloudFormation Stack
  • It would be very nice to package up the entire function/SNS topic in a CloudFormation Stack as well