Terraform

Splitting Terraform Modules into Separate Git Repositories

October 24, 2023

In the world of Infrastructure as Code (IaC) , Terraform has emerged as a powerful tool for managing infrastructure resources.


Read More

Managing Multiple Environments with Terraform Workspaces

September 2, 2023

Managing infrastructure across multiple environments such as development, staging, and production can be a daunting task.


Read More

Controlling and Understanding Parallelism Impact on the DAG

September 1, 2023

When working with large-scale infrastructure deployments, managing the provisioning and orchestration of resources efficiently becomes crucial.


Read More

Private Application Load Balancer for EKS in Terraform

August 30, 2023

Amazon Web Services (AWS) provides a powerful combination of services for building, deploying, and managing applications.


Read More

How to Generate Terraform using a Bash Shell script

June 23, 2023

To generate Terraform code using a Bash shell script, you can utilize Python within the script.


Read More

How to Generate Terraform using Python

June 22, 2023

To generate Terraform code using Python, you can utilize the power of the language and various libraries to dynamically create and manipulate the Terraform configuration files.


Read More

Make EKS cluster private with NodeGroup access

June 21, 2023

The Theory To make an Amazon Elastic Kubernetes Service (EKS) cluster private and allow nodes to join through a node group, you need to follow a few steps.


Read More

How to connect an API Gateway to Inline Lambda in Terraform

June 16, 2023

To connect an API Gateway to an inline Lambda function using Terraform, you can follow these steps:


Read More

How to create a Site-to-Site VPN in Terraform

June 11, 2023

To create a site-to-site VPN using Terraform, you can use the aws_vpn_gateway and aws_vpn_connection resources from the AWS provider.


Read More

How to create a Lambda in Terraform

June 7, 2023

To create an AWS Lambda function using Terraform, you need to define the necessary resources in a Terraform configuration file.


Read More

How to create a Bastion server in Terraform

June 6, 2023

To create a Bastion server using Terraform, you need to define the necessary resources in a Terraform configuration file.


Read More

How to you create a Cross Account Role in Terraform

June 4, 2023

To create a cross-account role in Terraform, you need to perform the following steps:


Read More

How to create Public and Private Subnets in Terraform

June 1, 2023

To create public and private subnets in Terraform, you can use the AWS provider to define your network configuration.


Read More

Create Internet Gateway & Assign to EC2 in Terraform

May 30, 2023

To create an Internet gateway and assign it to an EC2 instance using Terraform, you can follow these steps:


Read More

How to configure Terraform to use Local Providers from Nexus

May 29, 2023

If your organization has blocked registry.terraform.io and has instead downloaded the provider binaries to Nexus, then you can do the following to still make your Terraform execute correctly.


Read More

How to Deploy a Java Application in AWS ECS using Terraform

May 23, 2023

In order to deploy a Java application into AWS ECS (Elastic Container Service) using Terraform, we need to consider a few different things.


Read More

How to set the Hostname on a Linux server with Terraform

May 22, 2023

If you need to set the hostname on a linux server, and you are using Terraform, then you can do the following:


Read More

How to Create a Simple Chatbot in Python

April 9, 2023

This is a simple chatbot in Python using the NLTK library.


Read More

Create Transit Gateway with Attachments in Terraform

April 8, 2023

The following example Terraform code snippet creates a Transit Gateway with VPC and VPN attachments:


Read More

How to Create an AWS EC2 Instance in Terraform

April 7, 2023

The following Terraform code snippet creates an EC2 instance for you.


Read More

A Primer on Terraform Concepts

April 6, 2023

Terraform is an open-source tool for building, changing, and versioning infrastructure safely and efficiently.


Read More

How to Delete all Resources Except One in Terraform

October 23, 2022

If you need to delete all resources created by Terraform, except for a single, specific one, then you can do the following:


Read More

How to create an AWS Lambda in Terraform

June 27, 2022

Step 1 – Lambda Code in Python The following code expects a python file with the contents as follows in a file called python/script1.


Read More

[Solved] Instance Profile already exists in Terraform

June 26, 2022

If you get the Instance Profile already exists error when running your Terraform apply, then it is either because an instance profile with that name already existed in the account, or because the previous terraform destroy did not remove it.


Read More

How to use a Backend-Config File for Terraform S3 State Configuration

June 16, 2022

If you are using S3 as the backend for your state management in Terraform, then you can create environment specific configuration files where you store the bucket, region among other things to be pulled in automatically when switching environments.


Read More

How to Refresh State in Terraform

June 15, 2022

Sometimes your infrastructure may be out of sync with your Terraform state because resources may have been amended or deleted manually.


Read More

How to write If/Else Statements in Terraform

June 13, 2022

If/Else statements are conditional statements that perform decisions based on some known state, or variable.


Read More

How to Remove a Resource from Terraform State

June 4, 2022

Terraform state reflects the most up to date reference of the infrastructure.


Read More

How to Delete a Specific Resource in Terraform

June 3, 2022

Running terraform destroy will tear down the whole stack associated to some terraform code.


Read More

How to Create a DynamoDB Lock Table for Terraform

June 2, 2022

Provision the DynamoDB Table resource "aws_dynamodb_table" "dynamodb-terraform-state-lock" { name = "terraform-state-lock-dynamo" hash_key = "LockID" read_capacity = 20 write_capacity = 20 attribute { name = "LockID" type = "S" } } Configure the DynamoDB table in Terraform Backend terraform { backend "s3" { encrypt = true bucket = "your-unique-bucket-name" dynamodb_table = "terraform-state-lock-dynamo" key = "terraform.


Read More

How to add Comments in Terraform

June 1, 2022

Terraform , a powerful Infrastructure as Code (IaC) tool, allows you to define and provision infrastructure resources.


Read More

How to log/debug in Terraform

May 31, 2022

If you have Terraform reporting an error but want more information, then you can configure debug logging.


Read More

How to add a Lambda Environment Variable in Terraform

May 15, 2022

If you have an aws_lambda_function block that needs to make use of environment variables, then you can simply do the following:


Read More

How to Generate a Random Number/String in Terraform

March 29, 2022

If you need to generate a random number or string in Terraform, then you can use the following:


Read More

[Solved] Unable to connect to the server: dial tcp: lookup with AWS EKS

March 28, 2022

If you have received the following error while trying to issue commands to kubectl:


Read More

How to Store Terraform State in AWS S3

March 27, 2022

Storing Terraform states files locally is not recommended. Instead you should use a backend such as as S3 from AWS.


Read More

How to view a Terraform Module’s Output

January 6, 2022

An output in Terraform is a way to view the result of an action that has been performed, or resource that has been created.


Read More

How to get the AWS AccountID in Terraform

December 20, 2021

If you are automating AWS resources in Terraform, then you will want to not hardcode things as much as possible.


Read More

How to Create AWS AppStream resources in Terraform

December 18, 2021

AWS AppStream has finally made its way into the Terraform AWS Provider.


Read More

[Solved] Error acquiring the state lock in Terraform

December 7, 2021

If you have been handed the Acquiring state lock error message about ConditionalCheckFailedException: The conditional request then you have 2 options for fixing it!


Read More

How to add Account Condition to AWS Lambda Permissions in Terraform

December 2, 2021

If you need to lock an AWS Lambda function down to a source account for security reasons (PCI.


Read More

How to AssumeRole in Terraform LocalExec Provisioner Block

December 1, 2021

I needed to execute a Terraform null_resource provisioner (local-exec) block to run an awscli command, but assume a role passed down to it.


Read More

How to Create an AWS Security Group in Terraform - Securing AWS Resources with Terraform Security Groups

November 23, 2021

Security groups are a critical component for securing resources in AWS.


Read More

How to run/execute a program from Terraform

November 17, 2021

If you need to run a local application from your Terraform scripts, you can call out to the provisioner local-exec and issue the command syntax:


Read More

How to fix the Terraform stuck on “Refreshing state…” problem

August 11, 2020

Terraform is a fantastic tool to help automate your infrastructure as code.


Read More