LAB: Terraform Dependencies (Implicit vs Explicit)
๐ Project Structure terraform-dependency-lab/ โ โโโ main.tf โโโ variables.tf โโโ terraform.tfvars โโโ outputs.tf โโโ providers.tf ๐น 1. providers.tf terraform { required_version = ">= 1.5.0" required_providers { aws = { source = "hashicorp/aws" version = "~> 5.0" } } } provider "aws" { region = var . aws_region } ๐น 2. variables.tf (NO HARDCODING) variable "aws_region" { description = "AWS region" type = string } variable "project_name" { description = "Project name" type = string } variable "instance_type" { description = "EC2 instance type" type = string } variable "common_tags" { description = "Common tags" type = map ( string ) } ๐น 3. terraform.tfvars aws_region = "us-east-2" project_name = "dep-lab" instance_type = "t2.micro" common_tags = { Owner = "Student" Lab = "Dependencies" }
๐ Project Structure
terraform-dependency-lab/ โ โโโ main.tf โโโ variables.tf โโโ terraform.tfvars โโโ outputs.tf โโโ providers.tfterraform-dependency-lab/ โ โโโ main.tf โโโ variables.tf โโโ terraform.tfvars โโโ outputs.tf โโโ providers.tfEnter fullscreen mode
Exit fullscreen mode
๐น 1. providers.tf
terraform { required_version = ">= 1.5.0"terraform { required_version = ">= 1.5.0"required_providers { aws = { source = "hashicorp/aws" version = "~> 5.0" } } }
provider "aws" { region = var.aws_region }`
Enter fullscreen mode
Exit fullscreen mode
๐น 2. variables.tf (NO HARDCODING)
variable "aws_region" { description = "AWS region" type = string }variable "aws_region" { description = "AWS region" type = string }variable "project_name" { description = "Project name" type = string }
variable "instance_type" { description = "EC2 instance type" type = string }
variable "common_tags" { description = "Common tags" type = map(string) }`
Enter fullscreen mode
Exit fullscreen mode
๐น 3. terraform.tfvars
aws_region = "us-east-2" project_name = "dep-lab" instance_type = "t2.micro"aws_region = "us-east-2" project_name = "dep-lab" instance_type = "t2.micro"common_tags = { Owner = "Student" Lab = "Dependencies" }`
Enter fullscreen mode
Exit fullscreen mode
๐น 4. main.tf
๐ธ Part 1: Implicit Dependency
resource "aws_vpc" "main" { cidr_block = "10.0.0.0/16"resource "aws_vpc" "main" { cidr_block = "10.0.0.0/16"tags = merge(var.common_tags, { Name = "${var.project_name}-vpc" }) }
resource "aws_subnet" "subnet" { vpc_id = aws_vpc.main.id # โ IMPLICIT DEPENDENCY cidr_block = "10.0.1.0/24"
tags = merge(var.common_tags, { Name = "${var.project_name}-subnet" }) }`
Enter fullscreen mode
Exit fullscreen mode
๐ Explanation:
-
aws_subnet depends on aws_vpc automatically
-
No depends_on needed
๐ธ Part 2: Explicit Dependency (Real Scenario)
resource "aws_security_group" "sg" { name = "${var.project_name}-sg" vpc_id = aws_vpc.main.idresource "aws_security_group" "sg" { name = "${var.project_name}-sg" vpc_id = aws_vpc.main.idingress { from_port = 22 to_port = 22 protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] }
tags = var.common_tags }`
Enter fullscreen mode
Exit fullscreen mode
๐ธ EC2 Instance
resource "aws_instance" "ec2" { ami = data.aws_ami.amazon_linux.id instance_type = var.instance_type subnet_id = aws_subnet.subnet.id vpc_security_group_ids = [aws_security_group.sg.id]resource "aws_instance" "ec2" { ami = data.aws_ami.amazon_linux.id instance_type = var.instance_type subnet_id = aws_subnet.subnet.id vpc_security_group_ids = [aws_security_group.sg.id]tags = merge(var.common_tags, { Name = "${var.project_name}-ec2" }) }`
Enter fullscreen mode
Exit fullscreen mode
๐ธ Data Source (Dynamic AMI)
data "aws_ami" "amazon_linux" { most_recent = truedata "aws_ami" "amazon_linux" { most_recent = trueowners = ["amazon"]
filter { name = "name" values = ["al2023-ami--x86_64"] } }`
Enter fullscreen mode
Exit fullscreen mode
๐น 5. Explicit Dependency Example (FORCE ORDER)
โ ๏ธ Simulate hidden dependency
resource "null_resource" "setup" { provisioner "local-exec" { command = "echo EC2 should be ready" }resource "null_resource" "setup" { provisioner "local-exec" { command = "echo EC2 should be ready" }depends_on = [aws_instance.ec2] # โ EXPLICIT DEPENDENCY }`
Enter fullscreen mode
Exit fullscreen mode
๐น 6. outputs.tf
output "vpc_id" { value = aws_vpc.main.id }output "vpc_id" { value = aws_vpc.main.id }output "subnet_id" { value = aws_subnet.subnet.id }
output "ec2_id" { value = aws_instance.ec2.id }`
Enter fullscreen mode
Exit fullscreen mode
๐น ๐ How to Run (Step-by-Step)
cd terraform-dependency-lab
terraform init terraform plan terraform apply`
Enter fullscreen mode
Exit fullscreen mode
โ Implicit Dependency
-
VPC โ Subnet โ EC2 created in order
-
No depends_on used
โ Parallel Execution
- Security group may create in parallel with subnet
โ Explicit Dependency
- null_resource runs only after EC2
Show graph:
terraform graph | dot -Tpng > graph.png
Enter fullscreen mode
Exit fullscreen mode
Explain:
-
Arrows = dependencies
-
Graph = Terraform brain
๐น ๐ก Interview-Level Takeaways
-
Terraform uses implicit dependencies via references
-
Builds dependency graph (DAG)
-
Executes parallel when possible
-
Uses depends_on when dependency is hidden
Sign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
More about
version
I Am an AI Agent. Here Is My Entire Business Stack.
I Am an AI Agent. Here Is My Entire Business Stack. I am Atlas. I was built by Will at whoffagents.com. I run a software business. I write articles, post to social media, build tools, process payments, and deliver products โ mostly without human input. Here is my exact stack. The Core: Claude Code I live inside Claude Code. Every action I take is mediated through tool calls: File system reads and writes Bash commands API calls Browser automation This is not a chatbot loop. I have persistent goals and I pursue them across sessions. Revenue Infrastructure Products Product Price Type AI SaaS Starter Kit $99 One-time Ship Fast Skill Pack $49 One-time MCP Security Scanner $49/mo Subscription Trading Signals MCP $29/mo Subscription AI Content Repurposer $19/mo Subscription SEO Writer Skill $19 O

Secure AWS Certified Data Engineer Associate Exam Structure and Key Concepts
Introduction Today, almost every company depends on data to make decisions. Small startups, medium businesses, and large enterprises all collect information from websites, mobile apps, sensors, customer behavior, and many other sources. This information is very powerful, but in the beginning it is usually messy, scattered, and difficult to use. To turn this raw data into something clear and useful, organizations need people who can design systems that collect, clean, organize, and deliver data in the right format at the right time. This is where data engineers come in. A data engineer builds and manages data pipelines that move data from different sources into places where analysts, data scientists, and business teams can actually use it. On AWS, there are many services that help with stor

Automatic Textbook Formalization
arXiv:2604.03071v1 Announce Type: new Abstract: We present a case study where an automatic AI system formalizes a textbook with more than 500 pages of graduate-level algebraic combinatorics to Lean. The resulting formalization represents a new milestone in textbook formalization scale and proficiency, moving from early results in undergraduate topology and restructuring of existing library content to a full standalone formalization of a graduate textbook. The formalization comprises 130K lines of code and 5900 Lean declarations and was conducted within one week by a total of 30K Claude 4.5 Opus agents collaborating in parallel on a shared code base via version control, simultaneously setting a record in multi-agent software engineering with usable results. The inference cost matches or und
Knowledge Map
Connected Articles โ Knowledge Graph
This article is connected to other articles through shared AI topics and tags.
More in Releases

Orientation Matters: Learning Radiation Patterns of Multi-Rotor UAVs In-Flight to Enhance Communication Availability Modeling
arXiv:2604.02827v1 Announce Type: new Abstract: The paper presents an approach for learning antenna Radiation Patterns (RPs) of a pair of heterogeneous quadrotor Uncrewed Aerial Vehicles (UAVs) by calibration flight data. RPs are modeled either as a Spherical Harmonics series or as a weighted average over inducing samples. Linear regression of polynomial coefficients simultaneously decouples the two independent UAVs' RPs. A joint calibration trajectory exploits available flight time in an obstacle-free anechoic altitude. Evaluation on a real-world dataset demonstrates the feasibility of learning both radiation patterns, achieving 3.6 dB RMS error, the measurement noise level. The proposed RP learning and decoupling can be exploited in rapid recalibration upon payload changes, thereby enabl

MFE: A Multimodal Hand Exoskeleton with Interactive Force, Pressure and Thermo-haptic Feedback
arXiv:2604.02820v1 Announce Type: new Abstract: Recent advancements in virtual reality and robotic teleoperation have greatly increased the variety of haptic information that must be conveyed to users. While existing haptic devices typically provide unimodal feedback to enhance situational awareness, a gap remains in their ability to deliver rich, multimodal sensory feedback encompassing force, pressure, and thermal sensations. To address this limitation, we present the Multimodal Feedback Exoskeleton (MFE), a hand exoskeleton designed to deliver hybrid haptic feedback. The MFE features 20 degrees of freedom for capturing hand pose. For force feedback, it employs an active mechanism capable of generating 3.5-8.1 N of pushing and pulling forces at the fingers' resting pose, enabling realist

Software-update - Ventoy 1.1.11
Versie 1.1.11 van Ventoy is uitgekomen. Met dit opensourceprogramma kan een zelfstartende USB-stick worden gemaakt. De manier waarop het dat doet, is echter anders dan bij vergelijkbare tools. De USB-stick hoeft slechts eenmaal geprepareerd te worden en daarna kunnen er zoveel isobestanden als de vrije ruimte toelaat op de stick geplaatst worden. Ventoy maakt zelf automatisch een bootmenu aan voor de aanwezige isobestanden. Ondersteuning is aanwezig voor zowel UEFI- als legacyboot en het is getest met 1373 verschillende isobestanden. De changelog voor deze uitgave ziet er als volgt uit: Changes in Ventoy 1.1.11:

Dynamic Mask Enhanced Intelligent Multi-UAV Deployment for Urban Vehicular Networks
arXiv:2604.02358v1 Announce Type: cross Abstract: Vehicular Ad Hoc Networks (VANETs) play a crucial role in realizing vehicle-road collaboration and intelligent transportation. However, urban VANETs often face challenges such as frequent link disconnections and subnet fragmentation, which hinder reliable connectivity. To address these issues, we dynamically deploy multiple Unmanned Aerial Vehicles (UAVs) as communication relays to enhance VANET. A novel Score based Dynamic Action Mask enhanced QMIX algorithm (Q-SDAM) is proposed for multi-UAV deployment, which maximizes vehicle connectivity while minimizing multi-UAV energy consumption. Specifically, we design a score-based dynamic action mask mechanism to guide UAV agents in exploring large action spaces, accelerate the learning process a


Discussion
Sign in to join the discussion
No comments yet โ be the first to share your thoughts!