Terraform: Change EC2 user_data without recreating instance

When you have set up your infrastructure with Terraform and then do any change to the user_data of a EC2 instance, Terraform will detect the change and generally do a force-replacement of the instance. In the planning stage this could look something like this: # aws_instance.web_backend must be replaced -/+ resource "aws_instance" "web_backend" { [...] ~ user_data = "1c4e236bd5dec74fecc99d3a3d57679b9b12a927" -> "f8d9add08d4ead74d44af35452c6070dbfcb1576" # forces replacement + user_data_base64 = (known after apply) [...] So what can you do when you want to make changes to user_data but don’t want to destroy your instance and create a new one? ...

June 9, 2022

Getting started with Terraform and Infrastructure as Code

I recently worked with Terraform to codify IT infrastructure, i.e. server deployments, network configurations and other resources. Based on my working notes, I want to give an introduction on how to write infrastructure resource definitions and execute them using Terraform. I’ll be using AWS as a cloud provider in my examples, but many more providers are available. In fact, one of the advantages of using a platform agnostic tool is that you can manage all your infrastructure in one place – not individually for every provider or on-premise platform you use. ...

May 20, 2020

Running ESXi on Intel NUC8i7HVK (with 64 GB of RAM)

I recently bought an Intel NUC8i7HVK to work as an ESXi host. In this post I walk you through the process of installation and initial setup. Hardware The NUC8i7HVK is the top-of-the-line model of the NUC kits and comes with an i7-8809G processor. It ships with neither memory nor storage, so picked up the following additional components: 2 x Samsung 32 GB DDR4-2666, SO-DIMM (M471A4G43MB1-CTD) 1 x Intel SSD 660p Series 1.0 TB, M.2 80 mm (SSDPEKNW010T8x 1) 1 x SanDisk Ultra Fit 16 GB (SDCZ430-016G-G46) An interesting fact to note: in the official specs, Intel mentions 32 GB as the maximum memory size. However, with 32 GB sticks now readily available and 64 GB being listed as the maximum memory size for the i7-8809G, I gave it a shot and installed 2 x 32 GB of RAM. It worked without issues. ...

August 6, 2019