Quick and rough notes
Terratest your Terraform (Plans) [draft]
Problem statement As an infrastructure engineer writing Terraform, I’d like to test code before I apply it. Some constraints: I’d like this to work with Terraform Cloud and workspaces. Workspaces represent app-region-env tuples more or less. They all apply the same code, and each are 99% the same, but some have slight differences. These differences are what I’d like to test....
Terraform and OPA/Conftest/Rego, what a pain in the arse
So this has taken me 24+ hours to figure out. All docs, references to using OPA with Terraform are about testing the plan. I want some static analysis on raw .tf files. An OPA based linter if you will. First thing I ran into was iterating over an object, then being able to use it’s key. In Python I’d do: for k,v in dict. In Rego, we do hash[key], then just go and use key wherever....
Docker Compose + roots/bedrock
A quick start guide Pre-Reqs Docker installed PHP Composer installed Steps composer create-project roots/bedrock my-project cd my-project ln -s web html as Apache will serve /var/www/html by default, this saves us from having to change that Create a docker-compose.yaml with the following: version: '3.1' services: wordpress: image: php:7-apache restart: always ports: - 8080:80 volumes: - .:/var/www db: image: mysql:5.7 restart: always environment: MYSQL_DATABASE: database_name MYSQL_USER: database_user MYSQL_PASSWORD: database_password MYSQL_RANDOM_ROOT_PASSWORD: '1' volumes: - db:/var/lib/mysql volumes: db: vi ....
Neat & Secure: Adding AWS SQS to a Laravel 5.6 Application
Neat & Secure: Adding AWS SQS to a Laravel 5.6 Application Y’know sometime when you’re working on an old codebase? and you wanna do something “new” but the docs don’t really help you much? Yeah? That’s what I’m documenting here. So I’m working on getting a Laravel 5.6 application into AWS Fargate with Terraform. This application began life as a Laravel 5.0 app ~6 years ago, so some of the codebase was somewhat templated from then....
Puppet 4 + Hiera 5 + Hashicorp Vault
Quick guide for setting up Vault with Puppet What doesn’t this cover Building a Production grade Vault cluster Puppet 5 and 6 (Yes, I know Puppet 4 is EOL) Vault Dynamic Secrets The more secure Puppet 6 deferred functions Setup Vault Since I have a Kubernetes cluster, I used the Vault Helm Chart to set this up, I mostly followed this guide to setup Vault in Dev mode, which looks to be easy to then convert to a real Raft based Vault cluster to productionise it afterwards: https://learn....
Link Shortening Bookmarklets
Amazon and eBay love to use ugly links which aren’t nice to share. Here’s two bookmarklets to clean up these URLs before copying them. How to use Create a bookmark in your browser of choice, copy and paste the below code into the URL part of the bookmark, give it a witty name and save. Tested with ebay.co.uk, ebay.com, ebay.de, amazon.co.uk, amazon.com in Chrome eBay javascript:(function(s){var l = /(.*ebay\..*itm.).*\/(\d+).*/.exec(location); prompt('Short URL', l[1]+l[2])})() Amazon javascript:(function(s){var l = /(....