RSSAmplifier

Blog

Francesco Boffa

Recent content on Francesco Boffa

francescoboffa.comRSS feed ↗27 posts

Latest posts

About me

Hello 👋, I’m Francesco. 
 I’m British and Italian, living in Rome. I write code, a lot of code . 
 I’m a passionate learner of anything in any field, whether it’s
Programming, Medicine, Economy, Law or Philosophy. 
 I’ve worked as: 
 
 CTO @ ORDR 
 Architect and infrastructure engeineer @ Indigo Ligthouse Group 
 Senior DevOps -…

Privacy policy

This website does not collect, store or use any personal information about its
visitors or data that could be used to identify an individual. 
 It does not use cookies or other tracking technologies for personal
identification purposes.

What is an AWS ARN

An AWS ARN is a unique identifier assigned to resources within the AWS ecosystem. It enables users to unambiguously reference and manage resources across various AWS services. ARNs are essential for specifying resources when creating IAM policies, defining CloudFormation templates, or using AWS CLI commands and SDKs. 
 Structure of an AWS ARN 
 The general structure of an ARN is as…

Setting up S3 Bucket Notifications with Terraform

S3 bucket notifications are a useful feature of Amazon’s Simple Storage Service (S3) that allow you to receive notifications when certain events occur in your S3 bucket. These notifications can be sent to a variety of targets, such as an AWS Lambda function, an Amazon SNS topic, or an SQS queue. In this post, we will focus on setting up S3 bucket notifications using Terraform. 
…

Using Terraform modules to manage infrastructure as code

Terraform is a popular tool for managing infrastructure as code (IaC). It allows you to define your infrastructure in a declarative manner, and to manage it using the same tools and processes that you use for your application code. One of the key features of Terraform is the ability to use modules to organize and reuse your infrastructure code. 
 What are Terraform modules? 
 Terraform…

Using AWS CloudTrail for Auditing and Compliance with Terraform

AWS CloudTrail is an AWS service that enables users to monitor and retain events related to their AWS account activity. These events include API calls made through the AWS Management Console, AWS CLI, and SDKs, as well as changes made to AWS resources. This can be useful for compliance, operational troubleshooting, and security purposes. 
 In this article, we will go over how to set up and…

Automating Docker container deployment with Ansible

In today’s world of cloud-based infrastructure and microservices, containerization has become a popular approach for deploying and managing applications. Docker is one of the most widely-used tools for containerization, and it allows you to package your applications and their dependencies into self-contained units that can be easily deployed and managed. 
 While Docker provides a…

The most common EC2 instance types. Guide to choosing the right one.

Introduction 
 Amazon Elastic Compute Cloud (EC2) is a web service that provides secure, scalable, and flexible computing capacity in the cloud. EC2 allows users to launch and manage virtual machines (known as instances) with a variety of operating systems and configurations. 
 Choosing the right EC2 instance type is crucial for optimizing the performance and cost of your workloads.…

Introduction to EC2 and launching your first EC2 instance

Amazon Elastic Compute Cloud (EC2) is a cloud computing service that allows you to run virtual machines, or instances, in the cloud. EC2 is a popular service on AWS because it provides a flexible, scalable, and secure environment for running a wide range of applications and workloads. 
 Compared to traditional server offerings, EC2 comes with several benefits to users, including: 
 
…

Introduction to Ansible and running your first Ansible playbook

Ansible is an open-source automation tool that allows you to manage and configure your infrastructure from a single, central location. It is written in Python and uses a simple, human-readable language to define the tasks that you want to automate. This makes it easy to use, even for those who are new to automation and scripting. 
 One of the key benefits of using Ansible is that it is…

Setting up an AWS account and understanding the AWS Management Console

Amazon Web Services (AWS) is a cloud computing platform that offers a wide range of services and tools for building, deploying, and managing applications and infrastructure. AWS is a popular choice for cloud computing because it provides a scalable, reliable, and secure environment for businesses to run their applications and store their data. 
 AWS offers a wide range of services, including…

Building an x86_64 cross compiler for OS Development

Before we even start writing “Hello world”, we need a C++ compiler. And no, the g++ you have will not work. 
 The reason for this is that your linux provided compiler has been specifically built to work on linux, use linux system headers and produce linux binaries. 
 What we need is a compiler that can generate “generic x86_64” binaries with no expectations of where…

Starting a new Operating System project

Since I was just a kid, I’ve always felt the need to go deeper into the details of “how does it work”. 
 It was only a matter of time until I started learning x86 assembly on my Windows XP. Eventually I found the OSDev community , and started my long OSDev journey. 
 Do I have my own functional OS right now? Absolutely not. The goal has always been to learn more and more…

Invoke a Lambda function whenever a file is uploaded to S3

This post is about the Cloud superpowers. You see, most of us use S3 as a dumb,
cheap, durable storage. And it’s perfectly fine as such. However, you are
missing out, big time. 
 One of my favourite tricks with S3 is its ability to trigger a Lambda function
whenever a file is uploaded, usually to automatically transform it, or notify a
third party. 
 Story time 
…

Hosting a static website on AWS S3 with Terraform

Hosting a static website in Amazon S3 is quite simple. In fact, this very
website is hosted as such. 
 However, every single time I configured something by hand on the AWS Console,
I ended up regretting and blaming my laziness. 
 Here’s a very simple Terraform stack to get started: 
 variable host {
 type = string 
 default = 'myblog.com' 
 }
 
 data…

Copy a whole directory to a remote host (or to S3)

If you&rsquo;ve been using SSH for any amount of time, you probably already had the&#xA;need to copy a local file to your remote host. &#xA; For that you can use scp (secure copy). You specify the local file name, the&#xA;target host and the user to be used to ssh , and the destination path on the&#xA;server: &#xA; scp my_file.txt <user>@<hostname_or_ip>:/home/admin&#xA; What if you need to copy…

AWS single server Autoscaling Group with automatic DNS record

In the previous post we went through a whole lot&#xA;of trouble to maintain an EBS Volume and to make sure it automatically mounts&#xA;on boot for our stateful service. &#xA; Accompaining that with an AWS Autoscaling Group, we now have a &ldquo;Mostly&#xA;Available&rdquo; service that automatically recovers, with a static data disk. &#xA; The last bit of the equation however is making sure that we…

AWS EBS-based stateful services (with Terraform code)

In 2025, pretty much every single software product that might ever&#xA;be run on a Cloud infrastructure will support some form of High Availability&#xA;deployment. &#xA; In the best scenarios these will depend on an external data store, and we will&#xA;be able to keep the Application servers truly immutable (or even with read-only&#xA;disks!). Sometimes, the application we are trying to set up is…

Concatenating strings in Terraform

Sometimes the easiest tasks can drive us mad. Mainly because we try to adapt our&#xA;existing knowledge of some tools to the new tools we&rsquo;re using. &#xA; If you try to use Terraform like any other programming language, you are setting&#xA;yourself up for failure. &#xA; Way too many times I&rsquo;ve googled &ldquo;loops in terraform&rdquo; or &ldquo;conditions in…

Print based debugging with Ansible

We have all been there. Your Ansible playbook refuses to work. &#xA; Unfortunately, Ansible does not shine when it comes to debugging. It&rsquo;s not&#xA;uncommon to get a cryptic error message like this: &#xA; fatal: [localhost]: FAILED! => {'changed': false, 'msg': 'I'm on holiday. I don't want to work.'}&#xA; You probably spent the last hour trying to understand what the error message&#xA;means…

How to create a directory with Ansible

You can create a directory with Ansible using the file module, setting&#xA; state to directory . &#xA; - name : Creates directory &#xA; file :&#xA; path : /home/user/my/quite/nested/directory &#xA; state : directory &#xA; This will create the directory and all necessary intermediate ones that&#xA;didn&rsquo;t previously exist. &#xA; As always with file you can additionally specify the owner and…

Schedule lambda function runs like a cron with Terraform on AWS

Scheduled tasks in &ldquo;the cloud&rdquo; are a nightmare. If you want something to be run&#xA; once every 10 minutes for example, you can&rsquo;t just put that in every application&#xA;server crontab . Your task would be executed every 10 minutes by all of your&#xA;servers, probably at the same time. &#xA; An alternative solution is having a dedicated single cron server that performs&#xA;all of…

Restrict traffic to your AWS ALB to Cloudflare IP addresses

I love Cloudflare . I use them on this blog, I&rsquo;ve&#xA;used them for all of my domains, side-projects and in every single company I&rsquo;ve&#xA;worked for. I think they are an amazing company doing the internet a great&#xA;service, although with some controversy about centralising the world traffic. &#xA; You think the same and wish to funnel all of your visitors traffic through them. &#xA;…

Attach multiple IAM Policies to a Role with Terraform

For all the good things that come with AWS, simplicity is not always one of them. &#xA; The permissions attached to an IAM Role come from it&rsquo;s Policies. And of course&#xA;there is more than one way to do this. &#xA; Using inline IAM policies &#xA; I&rsquo;ve never been a fan of inline policies. They&rsquo;re easy to set up in the AWS&#xA;console and then you would generally forget about…

Use AWS Managed Policies in Terraform

When sketching out a demo stack for a new app or AWS service, it may make more&#xA;sense to use an AWS provided IAM policy rather than carefully targeting the&#xA;actions and resources for a custom policy. &#xA; Another use case of AWS provided policies might be, for example, when creating&#xA;an EKS (managed Kubernetes) cluster: it&rsquo;s probably wiser to use the provided&#xA;…

S3 Path-Style vs Virtual-Host-Style Hosting

In this post, we explore the differences between the Path-style and Virtual-Host-style hosting on Amazon S3. &#xA; What is Path-Style hosting &#xA; Path-style hosting is a way in which you access your S3 bucket objects. In this format, the bucket name is included as part of the path within the URL, followed by the object key. The structure of the URL is: &#xA;…

Using S3 to Store your PostgreSQL or MySQL backups

Few things can strike fear in the hearts of IT professionals like the thought of restoring a database backup 👻. &#xA; Yet, having a reliable backup solution is more critical than ever in today&rsquo;s data-driven world. A failure to adequately prepare can result in significant financial losses, damage to your company&rsquo;s reputation, and even legal liabilities. Don&rsquo;t be the one who…