How are data sources used in Terraform?
问题 The Terraform Data Sources documentation tells me what a data source is, but I do not quite understand it. Can somebody give me a use case of data source? What is the difference between it and configuring something using variables? 回答1: Data sources can be used for a number of reasons; but their goal is to do something and then give you data . Let's take the example from their documentation: # Find the latest available AMI that is tagged with Component = web data "aws_ami" "web" { filter {