AWS SNS for CloudWatch alarm email notifications

Do you want to learn how to setup email notifications to tell you about important events that happen in CloudWatch? In this article you’ll discover how to setup the AWS Simple Notification Service (SNS) to send you emails whenever a CloudWatch alarm gets triggered. We’ll run through a full working example, setting up the alarm and SNS resources, and demonstrating the notifications coming through in real time. What is AWS SNS?...

May 1, 2020 · Tom Gregory

Shipping AWS EC2 logs to CloudWatch with the CloudWatch agent

Want to learn how to monitor EC2 logs automatically without having to manually log into servers? Well, in this article we’ll explore how to setup the CloudWatch agent on an EC2 instance to easily stream your logs to AWS. We’ll also setup a simple alarm for when the logs contain certain text that we want to watch out for, all within a worked example. Why would you want to ship your EC2 logs to CloudWatch in the first place?...

April 24, 2020 · Tom Gregory

When to use an AWS S3 VPC endpoint

What is an S3 VPC endpoint? To understand what an S3 VPC endpoint is, we first need to know what problem it solves. Imagine we want to get access to S3 from an AWS resource. In the example below, we have an EC2 instance that needs to copy a file from an S3 bucket: This works, because: the EC2 instance is in a public subnet, so has access to the internet therefore the EC2 instance can reach the AWS S3 URL to copy the file from the S3 bucket Public subnets A public subnet is simply one that has a route to the internet....

April 10, 2020 · Tom Gregory

When to create different subnets in AWS VPCs

Configuring subnets and VPCs can be confusing when you’re setting up AWS infrastructure. There’s plenty of documentation about what subnets are, and how to create them, but not necessarily when and why you’d create them. In this article you’ll learn why you’d want to create multiple subnets in the first place. First off though, here’s a quick recap of all the network related infrastructure that lives in a VPC. If you’re familiar with this, just skip to the main section of the article....

January 24, 2020 · Tom Gregory

Recursive AWS Lambda Functions in Node.js JavaScript

AWS Lambda functions are a great way to execute short-running processes without worrying about what hardware they’re going to run on. Sometimes though, we have a requirement to execute a longer-lived process, but unfortunately AWS imposes a 15 minute execution limit. Fear not though, because in this article you’ll learn how to write recursive Node.js JavaScript Lambda functions which call themselves, bypassing the execution time limit. 1. Overview In October 2018 AWS increased the Lambda execution time limit to 15 minutes:...

January 3, 2020 · Tom Gregory

Creating AWS CloudFormation Resources With The Service Role

1. Introduction CloudFormation is a useful tool when working with AWS to define your infrastructure as code, or at least a YAML or JSON template. These templates allow us to make almost any change imaginable within the AWS ecosystem. In this article we’ll take a look at how to practice the principle of least privilege with CloudFormation, with a working example making use of the CloudFormation service role. This will allow the CloudFormation stack to make changes by assuming that role, completely separately from the user or role who initiates the change in the first place....

October 10, 2019 · Tom Gregory