↓Skip to main content

Week Notes 2026.02

·4 mins

This is the first post in an experimental series of “week notes” - brief notes on what I’ve been working on over the past week.

Reporting CloudWatch alarms configuration #

Our SOC2 auditor asked for evidence that we have configured CloudWatch alarms for DynamoDB read throttling events. Luckily the AWS CLI supports JMESPath queries, so we can do some simple client-side filtering of the describe-alarms results:

aws cloudwatch describe-alarms  --query "MetricAlarms[?MetricName=='ReadThrottleEvents']"

GitLab OpenTofu module registry permissions #

GitLab has pretty good support for OpenTofu (the Open Source fork of Terraform), providing a state store, module registry, and CI/CD templates (read more here). One of our pipelines was failing with a 403 (Forbidden) error, Error accessing remote module registry.

It turns out that, even though the module registry name space is global for your GitLab group, the project publishing a module has to grant job token permission to the project consuming the module. To grant permission, I had to navigate to the terraform module project in GitLab, go to Settings > CI/CD > Job Token Permissions and grant access to the common parent group.

Deploying CoreOS to AWS #

A low-priority project I’m working on is migrating our company’s Confluence wiki to a static site built with Hugo. The content migration is mostly done, so this week I turned my mind to how to serve the site but restrict access to employees. I thought a nice solution would be to spin up an EC2 instance running Caddy and OAuth2 Proxy. Caddy will serve up the static content, and I’ll configure ForwardAuth to authenticate via the proxy.

Of course I’m using OpenTofu to deploy the EC2 instance, and I thought it would be interesting to deploy a CoreOS server and use ignition to provision the server on first boot. I’m following this guide.

Ignition files are a JSON format intended for machine consumption. They are usually generated from a more human-friendly YAML format called Butane. Amongst other things, this allows you to specify files and directories to be created on the server. This means we can use it to configure Podman Quadlets to run the Caddy and OAuth2 Proxy and systemd services to manage the site content.

OpenTofu first creates an S3 bucket and uploads the ignition file to S3, then creates the EC2 instance:

resource "aws_instance" "caddy_oauth_server" {
  ami                         = local.ami_id
  instance_type               = local.instance_type
  vpc_security_group_ids      = [aws_security_group.caddy_oauth_server.id]
  subnet_id                   = random_shuffle.subnet_id.result[0]
  associate_public_ip_address = true
  key_name                    = data.aws_key_pair.ray.key_name
  get_password_data           = false
  iam_instance_profile        = aws_iam_instance_profile.caddy_oauth_server.name
  user_data = jsonencode({
    ignition = {
      version = "3.5.0"
      config = {
        replace = {
          source = "s3://${module.ignition_files.s3_bucket_id}/caddy-oauth-server/bootstrap.ign"
        }
      }
    }
  })
  root_block_device {
    encrypted   = true
    volume_size = 50
    volume_type = "gp3"
  }
  metadata_options {
    http_endpoint               = "enabled"
    http_tokens                 = "required"
    http_put_response_hop_limit = 2
  }
  depends_on = [
    aws_s3_object.ignition_file
  ]
}

The key thing here is the user_data, which is an ignition file that replaces itself with an ignition file downloaded from S3, allowing us to use a bigger ignition file than would fit in user_data.

I’m about 30% done with this task: the Caddy server is up and running, but I still need to deploy and configure the OAuth2 Proxy and a systemd service to manage the site content.

Planet Guix #

One of my side projects last year was implementing a Planet RSS/Atom aggregator for the Guix project (read more about it here).

I received one pull request this week to add a new blog, taking the total now to 24.

I also modified the Atom feed parser to prefer published date over updated date when both are present, otherwise when we sort the posts by date old (but recently updated) posts appear on the front page.

Databases in Scheme #

This week I stumbled across SRFI 167: Ordered Key Value Store and the related SRFI 168: Generic Tuple Store Database. SRFI 167 defines an interface for key/value stores that could be implemented by different backends, and SRFI 168 builds on this to define a tuple store with a query language inspired by Datomic.

There’s a note on the SRFI documents saying that they contain infelicities and are being worked on outside of the SRFI process, with a view to withdrawing them and replacing with updated ones. Unfortunately the link to the follow-up work is broken so I’m not sure of the state of this project. Still, it might be interesting to experiment with the sample implementations in Guile and perhaps implement an engine using LMDB (for which there are already Guile bindings).

Listening #