Some Techniques to Enhance Your Terraform Proficiency

Terraform built-in functionality is very feature-rich: functions, expressions, and meta-arguments provide many ways to shape the code and fit it to a particular use case. I want to share a few valuable practices to boost your Terraform expertise in this blog. Some code examples in this article will work with Terraform version 0.15 and onwards. But if you’re still using 0.14 or lower, here’s another motivation for you to upgrade. Conditional resources creation Let’s start from the most popular one (although, still may be new for somebody): whether to create a resource depending on some fact, e....

January 16, 2022 · Serhii Vasylenko

Guide to Using Terraform in CI/CD

Terraform by itself automates a lot of things: it creates, changes, and versions your cloud resources. Although many teams run Terraform locally (sometimes with wrapper scripts), running Terraform in CI/CD can boost the organization’s performance and ensure consistent deployments. In this article, I would like to review different approaches to integrating Terraform into generic deployment pipelines. Where to store the Terraform code Storing Terraform code in the same repository as the application code or maintaining a separate repository for the infrastructure?...

November 24, 2021 · Serhii Vasylenko

Apply Cloudfront Security Headers With Terraform

In November 2021, AWS announced Response Headers Policies — native support of response headers in CloudFront. You can read the full announcement here: Amazon CloudFront introduces Response Headers Policies I said “native” because previously you could set response headers either using CloudFront Functions or Lambda@Edge. And one of the common use cases for that was to set security headers. Now you don’t need to add intermediate requests processing to modify the headers: CloudFront does that for you with no additional fee....

November 5, 2021 · Serhii Vasylenko

Terraforming mac1.metal at AWS

Updated on the 23rd of October, 2021: Terraform AWS provider now supports Dedicated Hosts natively In November 2021, AWS announced the support for Mac mini instances. I believe this is huge, even despite the number of constraints this solution has. This offering opens the door to seamless macOS CI/CD integration into existing AWS infrastructure. So here is a quick-start example of creating the dedicated host and the instance altogether using Terraform....

January 20, 2021 · Serhii Vasylenko

Terraform Workflow — Working Individually and in a Team

The work with Terraform code may become tangled sometimes. Here are some guides on how to streamline it and make it transparent for you and your team. It is extremely helpful in a team, and can benefit you even if you work individually. A good workflow enables you to streamline a process, organize it, and make it less error-prone. This article summaries several approaches when working with Terraform, both individually and in a team....

September 16, 2020 · Serhii Vasylenko