Create and Differentiate Resource and Data Configurations

Most providers in Terraform are composed of resources and data sources. Data sources are existing resources or information available from the provider for use within the configuration.

Data sources

Data sources are simply sources of information that we can retrieve from a provider. For example, maybe we want to retrieve an AMI ID for a specific version of Ubuntu in the AWS us-east-1 region. Or, perhaps we need to get the VNet ID where we’ll deploy some Azure virtual machines. Those are two examples of a data source.

Get hands-on with 1200+ tech skills courses.