Skip to main content

Command Palette

Search for a command to run...

[Draft] Module 1:Infrastructure as Code (IaC) with Terraform

Updated
2 min read
S
Welcome to my reMomentum Lab!!! Following a dedicated period of family care, I am currently on a return to work journey calling it reMomentum focused on mastering the modern data and AI landscape. Lab part- with an aim to become Data platform Engineer who understands HPC. Documenting my technical evolution and return to industry through deep dives into Data Engineering and Cloud Architecture. This log serves as a transparent, technical record of my pursuit of the Terraform → CKA → Nvidia Software Stack trifecta. My focus is on building resilient, cost-effective infrastructure and production-grade ML pipelines, bridging the gap between raw data engineering and operational excellence.

Explain what IaC is

Create Terraform Infrastructure with Docker

To deploy infrastructure with Terraform:

  • Scope - Identify the infrastructure for your project.

  • Author - Write the configuration for your infrastructure.

  • Initialize - Install the plugins Terraform needs to manage the infrastructure.

  • Plan - Preview the changes Terraform will make to match your configuration.

  • Apply - Make the planned changes.

In the "Code Editor" tab, open the terraform.tf file.

This file includes the terraform block, which defines the provider and Terraform versions you will use with this project.

  required_providers {
    docker = {
      source  = "kreuzwerker/docker"
      version = "~> 3.0.2"
    }
  }
  required_version = "~> 1.7"
}

Next, open main.tf and copy and paste the following configuration.


copy
``` provider "docker" {}

resource "docker_image" "nginx" {
  name         = "docker.mirror.hashicorp.services/nginx:latest"
  keep_locally = false
}

resource "docker_container" "nginx" {
  image = docker_image.nginx.image_id
  name  = "tutorial"
  ports {
    internal = 80
    external = 8000
  }
}```

In the "Terminal" tab, initialize the project, which downloads a plugin that allows Terraform to interact with Docker.


copy
terraform init
Provision the NGINX server container with apply. When Terraform asks you to confirm, type yes and press ENTER.


copy
terraform apply
Verify NGINX instance
Run docker ps to view the NGINX container running in Docker via Terraform.


copy
docker ps
Destroy resources
To stop the container and destroy the resources created in this tutorial, run terraform destroy. When Terraform asks you to confirm, type yes and press ENTER.


copy
terraform destroy
You have now provisioned and destroyed an NGINX webserver with Terraform.

More from this blog

When AI Audited My Thesis: The Retrospective Clicked in a Missing Puzzle Piece

That original work was the high-stakes catalyst that pushed me toward Big Data Analytics. But while the code itself was a massive undertaking, the academic writing now feels incredibly superficial. It highlighted the final insights, completely burying the fragmented, manually stitched data pipelines and architectural heavy lifting that made those insights possible. Here is what the thesis failed to tell you, viewed through the lens of a modern data professional.

Feb 27, 202612 min read37
When AI Audited My Thesis: The Retrospective Clicked in a Missing Puzzle Piece
R

reMomentum Labs

6 posts

Srilakshmi Sripathi's strategic initiative established Jan 2026; a pivot towards HPC, AI Infrastructure, Platform engineering in the Data 3.0 era. From Kubernetes to Agentic AI, an honest, production-focused log of building resilient systems and reaching peak technical velocity.