Hello! In a previous article, I showed how to make AWS lambda functions log JSON objects to CloudWatch (⬅️ start there if you're new to JSON logs). The pattern in that post had a flaw: it didn't pass the aws_request_id. I was writing small functions to glue together bits of deployment automation and I didn't … Continue reading CloudWatch JSON Logs: aws_request_id
Author: Adam Burns
PowerShell: Sort Hash Table Into Ordered Dictionary
Hello! PowerShell's Hash Tables are unordered. The keys don't always come back in the same order you entered them: I created the hash in the order a, b, c, d but I got back c, b, d, a. That's normal. PowerShell also has Ordered Dictionaries that work like Hash Tables but preserve order: Today I … Continue reading PowerShell: Sort Hash Table Into Ordered Dictionary
Azure Pipelines: If Statements
Hello! This is about Azure YAML Pipelines, not Azure Classic Pipelines. The docs explain the differences. Everything I show here is in the docs but the pieces are scattered and it took some work to find everything. This article collects what I found. Pipelines support two kinds of conditions. The first isn't an if statement, … Continue reading Azure Pipelines: If Statements
PowerShell On Apple Mac OS X
Hello! I love PowerShell. Its object-oriented nature is welcome relief from the endless string parsing of bash. Good news! PowerShell Core installs on Windows, OS X, and Linux. I made it my default in Terminal on OS X. Here's how. I tested this on OS X Catalina (10.15) with PowerShell Core 7. First, install from … Continue reading PowerShell On Apple Mac OS X
How To Work From Home
Hello! With the expansion of the recent coronavirus, major companies like Microsoft have started asking their teams to work from home to limit exposure. I find remote work is often the most productive, but the transition can be messy. I've been doing it for years, and I've learned some lessons I thought I'd share. ✔️ … Continue reading How To Work From Home
CloudFormation Join: Use Sub Instead
Hello! In CloudFormation, it's common to construct strings with the !Join function. Like this example from AWS's cfn-init docs: Here's the script this renders into: To me, both are messy and hard to read. It abuses multiline string declarations (|) to create single line breaks. Spaces are all over the place. There are YAML - … Continue reading CloudFormation Join: Use Sub Instead
CloudFormation: cfn-lint Pre-Commit Git Hook
Hello! There are a few ways to validate CloudFormation templates, but I mostly use cfn-lint. I run it in my build pipelines, but I also like to run it locally just so I don't have to wait for a build to find out if I did a typo. I work on a lot of templates, … Continue reading CloudFormation: cfn-lint Pre-Commit Git Hook
CodePipeline lambda Function: Complete Example
Hello! It takes a few pieces to assemble a working lambda action for CodePipeline. I like to start from a simple example and build up to what I need. Here's the code I use as a starting point. First, a few notes: My pipeline lambda functions are usually small, often only a few dozen lines … Continue reading CodePipeline lambda Function: Complete Example
PowerShell DSC: Stop On Errors
Hello! I like my code to stop on errors, not continue past them. For example, if a script fails to enable logs for my app I want to know right away. I don't want to find out tomorrow when I need logs that aren't there. The earlier I know about errors, the better. I learned … Continue reading PowerShell DSC: Stop On Errors
PowerShell DSC: Self Signed SSL Certs
Hello! First, this isn't a best practices guide for SSL certificates, it's a how-to for creating functional ones. As always, only use self-signed certs when you've specifically validated that they're a sufficiently secure solution. When I do need self-signed certs and I'm working in Windows, I generate them with PowerShell DSC and its Script Resource. … Continue reading PowerShell DSC: Self Signed SSL Certs