303 β€” Data Sources

Intermediate

Query existing infrastructure and external data that wasn't created by your Terraform configuration.

Learning Objectives

1
Understand the difference between resources and data sources
2
Query local and external data
3
Use data source outputs in resources
4
Filter and transform data
Step 1

Set up the lesson directory

Create a directory to explore data sources.

Commands to Run

mkdir -p ~/terraform-practice/lesson-303
cd ~/terraform-practice/lesson-303

What This Does

Data sources read information but don't create or manage infrastructure. They're read-only queries.

Expected Outcome

You're in the lesson-303 directory.

Pro Tips

  • 1
    Data sources use 'data' blocks, not 'resource' blocks
Was this step helpful?

All Steps (0 / 8 completed)