0Pricing
Terraform Infrastructure as Code · Lesson

Querying Data with Data Sources

Utilize data sources to fetch information about existing infrastructure or external services, allowing for more dynamic and adaptive configurations.

What are Data Sources?

In Terraform, we often need to reference existing infrastructure or external data that isn't managed by our current configuration.

This is where Data Sources come in! They allow your Terraform configuration to fetch information about resources that have already been provisioned or external services.

Data Sources vs. Resources

It's important to distinguish data sources from resources.

  • Resources define infrastructure that Terraform will create, update, or delete.
  • Data Sources only fetch information about existing infrastructure or data. They do not create or modify anything.

Think of them as read-only queries for your infrastructure.

All lessons in this course

  1. Querying Data with Data Sources
  2. Local and Remote Exec Provisioners
  3. Null Resources and Triggers
  4. Using External Data and Templates
← Back to Terraform Infrastructure as Code