Tag: Terraform

Is Terraform no longer Open Source?

For many developers, licenses have become something they barely even think about. Few if any of the most popular libraries use anything but open and permissive licenses like MIT and even GNU. Gone are also the days when large corporate entities like Microsoft shunned open source. It has never seemed...

26 Terraform Hacks for Effective Infrastructure Automation (With Examples)

Terraform has emerged as a powerful tool for automating provisioning and managing resources across various cloud providers. While many users start with the basics, there are numerous advanced techniques and hacks that can elevate your Terraform expertise to new heights. In this article, we&r...

What’s new in Terraform 1.6: Testing!

HashiCorp recently made Terraform 1.6 generally available. Let’s get into it! terraform test Now module maintainers can write tests for Terraform native to HCL. I’ll be writing a separate, deeper-dive article on the ins and outs of terraform test syntax, but ...

AWS — Provision EKS Cluster Using Terraform Resources

Amazon Elastic Kubernetes Service (EKS) is a managed service that makes it easy to run Kubernetes on AWS. With EKS, you can focus on building and running your applications, while AWS takes care of managing the Kubernetes control plane, worker nodes, and cluster resources. Amazon EKS...

Terraform manage multiple environments

When using Terraform to manage infrastructure, it is common to have multiple environments, such as development, staging, and production. Each environment may have its own set of resources and configurations. To keep the infrastructure code organized and maintainable, it is helpful to use modules. ...

How Does Slack Use Terraform?

At Slack, we use Terraform for managing our Infrastructure, which runs on AWS, DigitalOcean, NS1, and GCP. Even though most of our infrastructure is running on AWS, we have chosen to use Terraform as opposed to using an AWS-native service such as CloudFormation&nbs...

Best Practices For Terraform

Terraform is a tool that lets you create and manage your computer infrastructure, such as servers, databases, and networks, by writing code instead of manually setting things up. It helps you define what you want your infrastructure to look like, and then it takes care of setting everything up and k...

Harnessing Terraform In Deploying a Dating App On AWS

Synopsis In this blog post, I’ll walk you through the steps to deploy a landing page for a dating app I created on the AWS cloud. Along the way, I’d demonstrate how to leverage Terraform, an in-demand infrastructure as code tool. Additionally, I’ll guide you on how to communicat...

A Beginner’s Guide to Infrastructure Automation with Terraform

In this blog, you can learn an introduction to Terraform which is an infrastructure as a code tool. Among the different tools available for IaC, Terraform appeared to be a popular choice. Here we cover some basic concepts of Terraform. Introduction: Terraform is an open-source infrastructu...

Terraform Resources

In the realm of Terraform, the process of orchestrating cloud resources begins with understanding Terraform resources. In this journey, we embark on three fundamental tasks: Task 1 involves creating a security group, Task 2 is about crafting an EC2 instance, and Task 3 guides us...

Setting up a Production-Ready MongoDB Replica Set on Amazon EC2 with Terraform

From the official MongoDB documentation, MongoDB supports x.509 certificate authentication for client authentication and internal authentication of the members of replica sets and sharded clusters. The Documentation further states, MongoDB deployment should use valid certificates generated and si...

Amazon App Deployment: A DevSecOps Approach with Terraform and Jenkins CI/CD

Welcome to our in-depth guide on deploying an Amazon app with a strong focus on security through a DevSecOps approach. In today’s fast-paced digital landscape, building and deploying applications not only requires speed but also airtight security. That’s where DevSecOps comes into play, ...

Best Practices For Terraform

Terraform is a tool that lets you create and manage your computer infrastructure, such as servers, databases, and networks, by writing code instead of manually setting things up. It helps you define what you want your infrastructure to look like, and then it takes care of setting everything up and k...

Linux Homelab Expansion: Part 1 Terraform and Docker

In this blog series, we’ll explore how Docker, Terraform, and KVM can revolutionize your Linux homelab experience. This first part of this series is a focus on Docker and Terraform. I got this idea because I have been interested in learning Terraform as well as learning more about Docker. I kn...

Bootstrap Complete Amazon EKS Clusters with EKS Blueprints for Terraform

In this blog post, we will explore Amazon EKS Blueprints for Terraform, a set of patterns that make it easier and quicker for users to provision complete Amazon Elastic Kubernetes Service(EKS) clusters. If you are new to Terraform or interested in other Terraform concepts, these Terraform tu...

AWS — Provision EKS Cluster Using Terraform Resources

Amazon Elastic Kubernetes Service (EKS) is a managed service that makes it easy to run Kubernetes on AWS. With EKS, you can focus on building and running your applications, while AWS takes care of managing the Kubernetes control plane, worker nodes, and cluster resources. Amazon EKS...

Lessons Learned From Writing a Terraform Provider

I wanted to build my own Terraform provider for a long time but never had a real chance because of the strong community that built providers for every major service. However, finally, after a couple of years of waiting, I got a chance to build a provider from scratch. It was a challenging but ext...

AWS Cross-account Infrastructure Deployment Pipeline with Terraform

Making a decision on which CI/CD tool to use will depend on your needs & project requirements as there are a number of CI/CD tools such as Gitlab, GitHub, Travis, TeamCity, Jenkins, and a lot more. If you want to take advantage of the integrations across services in the AWS ecosystem, don't ...

Deploying Terraform using GitHub actions

When working with AWS services I have been using Terraform as my Infra As Code. In the project I am currently working on I have a CI/CD pipeline for deploying project code using GitHub actions. However, I would now like to extend my pipeline to deploy any infrastructure changes when there are any. ...

Terraform AWS Provider — Everything you need to know about Multi-Account Authentication and Configuration

There are multiple options available to configure the authentication between Terraform and AWS. But the two entry points are IAM users and IAM Identity Center Users (SSO). The Authentication is configured in the Terraform AWS Provider, To choose an option will depend among other things if you are ex...

How Does Slack Use Terraform?

At Slack, we use Terraform for managing our Infrastructure, which runs on AWS, DigitalOcean, NS1, and GCP. Even though most of our infrastructure is running on AWS, we have chosen to use Terraform as opposed to using an AWS-native service such as CloudFormation&nbs...

Getting started with Terraform functions — V1.0

When I first started with Terraform to write configuration to deploy infrastructure on AWS and GCP, I did not know how powerful Terraform is. I wrote configuration code like an armature — repeated code blocks, hardcoded values, bloated and inflexible infrastructure configuration code. It...

Best Way to structure your Terraform projects — Part 1!

Often times, one of the common questions that get asked by folks who are starting their IAC automation using Terraform is: What are the best practices to be followed in structuring my Terraform project? The answer often is “It depends..” There is no single solution which wil...

Terraform Vs OpenTofu

Recently, Hashicorp announced a license change for its products, including Terraform. It’s been open source under an MPL v2 license for almost a decade; however now it’s moving under a BSL v1.1 license. The Mozilla Public License 2.0 (MPL 2.0) and the Business Source License...

DevOps project using Terraform, Jenkins, and EKS

Terraform needs to store state information somewhere. We are going to keep it in AWS S3 storage. So head over to your AWS panel and create a bucket. The bucket name has to be unique. So I am going to create it with the name: mubin-devops-cicd-terraform-eks , you’ll have to keep some...

Terraform? Wtf?

On August 10, Hashicorp announced licensing changes to Terraform along with many of their open source products. My paint skills >>>> yours Why? To summarize, they accuse other vendors to use their OSS for their commercial goals, without contributing back but without mentioning ...

Deploying an Apache Cassandra Cluster in AWS with Terraform

In this guide, we’ll take you through the process of setting up an Apache Cassandra cluster in AWS using Terraform, an infrastructure-as-code tool. Apache Cassandra is a powerful NoSQL database known for its scalability and fault tolerance, making it a popular choice for distributed ...

Creating a Tf module and publishing it to the Terraform registry

Through this article you will learn to create a terraform module for a static website and publish it to the terraform registry. Before going ahead, you need to have some basic understanding of terraform. Step-1: Create an account on terraform registry. Step-2: Create a directory in your ...

What’s new in Terraform 1.6: Testing!

HashiCorp recently made Terraform 1.6 generally available. Let’s get into it! terraform test Now module maintainers can write tests for Terraform native to HCL. I’ll be writing a separate, deeper-dive article on the ins and outs of terraform test syntax, but ...

How to import Terraform null resource

Hashicorp Terraform is one of the mainly used tool to create infrastructures as code (IaC) and allow DevOps to manage and version infrastructures easily. Terraform can manage a lot of resources thanks to its large community of providers, but there are some cases where a physical resource is not b...

Migrating AWS Infrastructure From Terraform to AWS CDK

Introduction Managing cloud infrastructure has evolved with tools like Terraform and the AWS Cloud Development Kit (AWS CDK) leading the way. Terraform has been a trusted ally for many, helping to set up and manage infrastructure smoothly. But now, AWS CDK is stepping up, promising more features ...

Using Terraform Test for testing your terraform code

Hashicorp has introduced its testing framework officially (terraform test). Note: This testing framework is available in Terraform v1.6.0 and later. Terraform tests let authors validate that module configuration updates do not introduce breaking changes. Tests run against test-specific, short-...

AWS — Provision EKS Cluster Using Terraform Resources

Amazon Elastic Kubernetes Service (EKS) is a managed service that makes it easy to run Kubernetes on AWS. With EKS, you can focus on building and running your applications, while AWS takes care of managing the Kubernetes control plane, worker nodes, and cluster resources. Amazon EKS...

Best Practices For Terraform

Terraform is a tool that lets you create and manage your computer infrastructure, such as servers, databases, and networks, by writing code instead of manually setting things up. It helps you define what you want your infrastructure to look like, and then it takes care of setting everything up and k...

azapi_resource: An alternative for Scripting in Terraform

What is azapi_resource? azapi_resource is a custom Terraform resource available through the AzureRM provider. It allows you to interact with the Azure Management API directly. While most Terraform resources are designed to create and manage infrastructure resources like virtual machines...

Why you should break down your Terraform into Stacks

Introduction This article introduces one of the most common Terraform problems that Terramate was designed to solve: How to decompose code into more manageable components while maintaining system integrity and reliability. We are not concerned here with Terraform modules, for a while...

Terraform & Rancher K3s on AWS: Crafting Automated Three-Tier Architectures

Modern cloud-native applications demand architectures that are scalable, resilient, and maintainable. With the three-tier architecture model taking center stage in this paradigm, it is the backbone of many production-grade deployments, allowing for separation of concerns and effective scalability. ...

5 Simple Steps to Master Terraform IaM Roles | Slauth.io

Venturing into the vast realm of cloud infrastructure, IAM roles stand as critical pillars, anchoring your security blueprint. As more businesses set sail into cloud migration or expansion, the pressing challenge remains: overseeing who or what gets the privilege of accessing your services. 61% o...

Terraform tips & tricks: loops, if-statements, and gotchas

Update, November 17, 2016: We took this blog post series, expanded it, and turned it into a book called Terraform: Up & Running! Update, July 8, 2019: We’ve updated this blog post series for Terraform 0.12 and released the 2nd edition of Terraform: Up & Running! Update,...

Running Terraform in an Azure DevOps Pipeline: A Comprehensive Guide

In today’s world of cloud infrastructure and agile development practices, Infrastructure as Code (IaC) is crucial for simplifying the provisioning and management of resources. Terraform is a popular IaC tool that allows you to define and automate your cloud infrastructure. In this blog post, w...

kafka terraform: Mongey/kafka provider setup

Obtaining bootstrap servers and ca.cert are straight forward. Getting cert.pem and key.pem requires some work. Below describe how to obtain these fields. Bootstrap Servers bootstrap_server can be obtained either from console UI: Amazon MSK / Clusters / <c...

Terraform Azure: Tests

Intro With the exciting new announcement for Terraform Tests I couldn’t help but take them for a test drive. For our use case we will build on a prior post Terraform Azure: Reusable SQL Database Configurations. In the last post we created a module to deploy SQL Servers. Today...

Elevate Your Terraform Game by leveraging for loops in Terraform

With a for loop, you can iterate through the keys and values of a map, applying custom logic to each element. This logic can involve filtering out certain elements, generating new keys or values, and creating entirely new maps based on the original data. In this blog post, we’re diving d...

Terraform Modules

In the dynamic world of infrastructure automation, Terraform has emerged as a game-changer. Central to harnessing its power are Terraform modules. In this blog series, we’ll dive deep into the fascinating realm of Terraform Modules. We’ll begin by unraveling the core concepts, explori...

Mastering Terraform with Visual Studio Code Dev Containers

Are you struggling with achieving consistency in your team’s local development environment setup? Do you find it challenging to ensure that all developers have the same setup or meet the required specifications? Especially for Terraform. In this article, I will introduce you to a ...

Terraform: count, for_each, and for loops

In the previous post, we got an overview of the Terraform data types — Terraform: introduction to data types — primitives and complex. Now let’s see how these types can be used in loops. Terraform supports three types of cycles: count: the simplest, used with a giv...

Pulumi vs. Terraform: Choosing your IaC Tool

Selecting the appropriate cloud engineering platform is crucial. Although there are numerous solutions available that implement IaC, this article will concentrate on two remarkable IaC tools: Pulumi and Terraform. Evaluating these tools in terms of features, ease of use, and community...

Terraform meta-arguments you cannot live without — count and for_each

Most enterprises these days cannot live without Terraform — The most popular infrastructure as a code tool out there. The key feature that makes Terraform a powerhouse in handling diverse infrastructure scenarios is the meta-arguments, especially count and for_each. Read abou...

Setting up a Production-Ready MongoDB Replica Set on Amazon EC2 with Terraform

MongoDB is a widely-used NoSQL database known for its scalability and flexibility. In a production environment, achieving high availability and data redundancy is crucial. In this tutorial, we will guide you through the process of setting up a production-ready three-member MongoDB Replica Set on Ama...

GitHub Actions: deploying Dev/Prod environments with Terraform

Now that we have Terraform code ready to deploy an AWS Elastic Kubernetes Service cluster (see Terraform: Building EKS, part 1 — VPC, Subnets and Endpoints and subsequent parts), it’s time to think about automation, that is, creating pipelines in CI/CD that would create new env...

Launching a Web server in AWS with the help of Terraform

here we are giving the provider name and then we are telling our region name in which region we would like to launch our EC2 instance. here I have used us-east-1 which is the region name of N. Virginia, and then I have used profile as default, through this we are telling the credentials of our accou...

Tools to Visualize Your Terraform Plan

What is Terraform? Terraform is a free and open-source infrastructure as code (IAC) that can help to automate the deployment, configuration, and management of remote servers. Terraform can manage both existing service providers and custom in-house solutions. Read more about Terraform here...

Provision Amazon EKS Cluster Using Terraform Modules

Amazon Elastic Kubernetes Service (EKS) is a managed service that makes it easy to run Kubernetes on AWS. With EKS, you can focus on building and running your applications, while AWS takes care of managing the Kubernetes control plane, worker nodes, and cluster resources. EKS offers a number...

Terraform Resources

In the realm of Terraform, the process of orchestrating cloud resources begins with understanding Terraform resources. In this journey, we embark on three fundamental tasks: Task 1 involves creating a security group, Task 2 is about crafting an EC2 instance, and Task 3 guides us...

Linux Homelab Expansion: Part 1 Terraform and Docker

In this blog series, we’ll explore how Docker, Terraform, and KVM can revolutionize your Linux homelab experience. This first part of this series is a focus on Docker and Terraform. I got this idea because I have been interested in learning Terraform as well as learning more about Docker. I kn...

How to create reusable infrastructure with Terraform modules

This is Part 4 of the Comprehensive Guide to Terraform series. In Part 1, you learned why we picked Terraform as our IAC tool of choice and not Chef, Puppet, Ansible, Pulumi, or CloudFormation. In Part 2, you got started with the basic syntax and features of Terraform and used th...

Reverse Terraform Infrastructure-as-code (IaC) from existing infrastructure

TerraCognita is an open-source tool that allows you to generate infrastructure-as-code (IaC) from existing infrastructure deployed on various cloud providers, including AWS, GCP, and Azure. It helps automate the process of creating IaC by scanning and reverse engineering the existing cloud infrastru...

Storing Terraform State in Gitlab

Storing Terraform state in Gitlab is not much different then storing in AWS, Lets make changes for storing state in Gitlab Create a project “Terraform” in Gitlab also note project id, which is 1 in my case Update Terraform code Generate Personal Access Token form ...

The “Best” Terraform CD pipeline with GitHub Actions

Continuous Deployment pipelines for Terraform are an essential component of safe cloud infrastructure management. Let’s take a look at developing a robust, simple, and scalable pipeline for Terraform Deployments using native GitHub Actions. An initial draft of this article was much more phi...

How to Configure Azure Databricks Unity Catalog with Terraform Part 4

In this story, we will learn how to configure Azure Databricks Unity Catalog with Terraform, and we will talk about how to design External Storage Accounts for Multiple Applications. In particular, we will learn: Creating Databricks External Storage Account for Multiple Applications ...

Infrastructure As Code + Pipeline: Deployment of Network Resources and Compute in the OCI in a 100% automated way using GitHub, Terraform Cloud and Terraform IaC

A company specializing in luxury furniture sales, needed to provision an infrastructure (Networking + Compute) in the OCI, to host its website called Niture. As a prerequisite for this project, I had to use Infrastructure as Code (IaC). The main IaC tools I used for this project were GitHub,...

Deploy Azure Databricks using Terraform

We can now provision Azure and Databricks infrastructure via Terraform as IaC. In this tutorial, I’m going to show you how. Requirements Terraform installed Azure CLI installed Azure account (free plan is enough) Terraform Code To get the latest version of this code please...

How to Deploy AWS Autoscaling Groups with Terraform

In this article, we will take a look into how to manage and deploy autoscaling groups in Amazon Web Services (AWS), explaining what they are, their purpose and functions, and how they differ from a launch configuration group, before showing how to create an auto-scaling group with Terraform examples...

Terraform Patterns, Observed

While Terraform is primarily a configuration language that abstracts the APIs of another platform, there are logic expressions available in Terraform allowing developers to introduce inferences and abstractions, improving the flexibility (or general accessibility) of a solution, without introducing ...

Terraform deployment template for Gitlab

A few months ago I published an article on a Gitlab pipeline template to replace environment variables references in source code with the actual environment variables. A basic first step towards a more mature tool stack, that made life easier for the engineers in my team. Recently I spe...

Awesome Terraform providers

Random Provider The random provider is a provider that generates random values of various types, such as random_id, random_integer, random_string, random_password, etc. These resources can be used to create unique identifiers or passwords for other resources. Use Cases Some of the...

Crossplane vs Terraform: Choosing the Best IaC Solution for Your Needs

Infrastructure as Code (IaC) is the practice of managing and provisioning IT infrastructure through code, rather than manual processes. IaC enables organizations to automate the deployment, scaling, and management of their infrastructure, resulting in faster, more reliable, and more efficient operat...

Terraform | Beyond IF-ELSE

When it comes to managing infrastructure with Terraform, I’ve discovered that conditionals are an indispensable tool for creating dynamic and flexible configurations. In this post, we will go through some of the techniques in Terraform using ternary expressions and functions to handle com...

How to manage Terraform state

This is Part 3 of the Comprehensive Guide to Terraform series. In Part 1, you learned why we picked Terraform as our IAC tool of choice and not Chef, Puppet, Ansible, Pulumi, or CloudFormation. In Part 2, you got started with the basic syntax and features of Terraform and used th...

A reason to stop using the Terraform null_resource

The Terraform null_resource was introduced in 2014 and, according to Hashicorp¹, it is the 3rd most-downloaded provider in the Terraform Registry. This resource is widely used because it acts as an empty container or resource shell. Inside this container, users can define and execu...

GCP Dataflow Flex Template Pipeline — Part 4 (Docker and Terraform Setup)

In the Part 3 of this project, we created the pipeline with all the requirements needed to deploy it for a Cloud Dataflow job. In this part, we will be creating Docker file and setup our terraform configuration. So, lets get started. Before we start, lets take a look at the folder struc...

Infrastructure as Code with Terraform

What is Terraform? Terraform is an infrastructure as code (IaC) tool that allows you to create, manage, and update infrastructure resources such as virtual machines, networks, and storage in a repeatable, scalable, and automated way. Task 1: Install Terraform on your system. Create an EC...

Create virtual machine in VMware using terraform

To create a virtual machine in VMware using Terraform, you will need to follow these steps: Install Terraform on your local machine if you do not already have it. Install the VMware vSphere provider for Terraform by following the instructions at https://registry.terraform.io/providers/v...

Introducing The Border0 Terraform Provider

Terraform has become an essential tool for many developers who manage infrastructure and applications running in the cloud. Border0 customers build on cloud providers such as AWS, so it makes sense we added official support for Terraform and make sure you can easily create Border0 Sockets for all yo...

How to manage multiple environments with Terraform using branches

This is part 2 of the How to manage multiple environments with Terraform blog post series. In the first part of the series, you saw how to use workspaces to manage multiple environments with Terraform. In this post, I’ll show you how to manage multiple environments with Terrafor...

Deploy Cloud Functions on GCP with Terraform (2nd Gen Environment)

The 2nd generation of Cloud Functions is a significant advancement in the serverless computing space. It builds upon the success of the first generation and introduces several key enhancements that empower developers to build more robust and scalable applications. Let’s go deeper into the 2nd ...

Setting Up Terraform Backend with S3: A Step-by-Step Guide

This article provides a detailed step-by-step guide to setting up a Terraform backend with Amazon S3. The guide is aimed at those who are new to Terraform and want to learn how to use it to manage their infrastructure in the cloud. The article explains what Terraform is, the benefits of using Amazon...

Migrating from Terraform to OpenTofu

Infrastructure as Code (IaC) tools have revolutionized the way we manage and provision cloud resources. Terraform has been a go-to choice for many DevOps and infrastructure teams, but on August 10, 2023, a significant shift occurred in the world of Infrastructure as Code (IaC). On that day HashiCorp...

Terraform Basics: Installation and EC2 Instance Provisioning

Terraform is an open-source tool that helps implement IaC. It allows you to write code in a specific language called HashiCorp Configuration Language (HCL) to describe the desired state of your infrastructure. When you run Terraform, it reads your code...

An Introduction to Terraform

The official Terraform Getting Started documentation does a good job of introducing the individual elements of Terraform (i.e. resources, input variables, output variables, etc), so in this guide, we’re going to focus on how to put those elements together to create a fairly real-worl...

Terraform Cloud Project Bootcamp with Andrew Brown — 2.6.0 Terraform Cloud and Multi Homes

1. Switch back to Terraform Cloud We have been developing and executing locally in Gitpod workspace. In this last episode, Andrew and Andrew walk us through the migration process to move back from the local environment to ‘Terraform Cloud while executing locally’. ...

Terraform Drift Detection: How to Detect Drift and Remediate Cloud Infrastructure Drift

In the dynamic realm of cloud computing, enterprise-level organizations necessitate a robust strategy to monitor their infrastructure. A pivotal component of this strategy is terraform drift detection, which is essential in pinpointing and amending any disparities between the infrastructure’s ...

Make Terraform as diagram

This adage holds especially true when navigating the intricacies of terraforming infrastructures. Visualization is a cornerstone best practice in Terraform. In a Nutshell: Brainboard stands out as the premier cloud infrastructure diagram designer. It empowers users to auto-generate cloud arc...

Day 71 — Terraform Interview Questions

As part of our comprehensive 90-day DevOps Challenge, today marks the 71st day and we have came to end of terraform series. This article has learnings which we saw in previous articles of terraform to prepare you for interview. Questions: 1. What is Terraform and how it is different from o...

Terraform Basics: A Comprehensive Guide

Terraform, an open-source tool developed by HashiCorp, is changing the landscape of infrastructure management. It allows you to define and provide data center infrastructure using a declarative configuration language. This language is both human-readable and machine-readable, which means you can use...

What is terraform Backend & How used it

Terraform is an open-source infrastructure as code (IaC) tool that allows developers to provision and manage cloud resources in a declarative way. It helps teams to automate the deployment of infrastructure by defining configurations that can be shared and versioned, reducing errors and improving co...

Understanding Variable Interpolation in Terraform

The World of Terraform Terraform is like our personal architect for the cloud. It helps us build and manage our digital kingdom, be it servers, databases, or any other tech marvel. To work its magic, Terraform uses something called “Variable Interpolation,” which is like pieces of inf...