Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
Data blocks in Terraform are used to fetch or compute information for use elsewhere in a Terraform configuration. They allow access to data defined outside of Terraform or data defined by another separate Terraform configuration without making changes to the infrastructure itself. This makes data blocks the correct choice for acquiring information needed throughout the configuration.
Data sources allow data to be fetched or computed for use elsewhere in Terraform configuration. Use of data sources allows a Terraform configuration to build on information defined outside of Terraform, or defined by another separate Terraform configuration.
it's D as you're using infrastructure already created - that's when you use "data". With "resource" you create new infrastructure.
D. data Data blocks in Terraform are used to fetch or compute information for use elsewhere in a Terraform configuration. They allow you to read data from external sources such as an API, a file, or a database and use it to populate variables or other parts of your Terraform configuration. A. provider A provider block is used to configure the provider plugin used in Terraform configuration, it's not related to data fetching or computation B. resource A resource block is used to create and manage infrastructure resources, it's not related to data fetching or computation C. local A local block is used to define variables that are only used within the module in which they are defined and not exposed as outputs. It's not related to data fetching or computation. It's important to understand that data blocks do not make changes to the infrastructure, they are only used to fetch or compute data.
D - data
The data block is used in Terraform to fetch or compute information from a given data source, and make that information available for use elsewhere in the Terraform configuration. This data can come from a variety of sources, including cloud provider APIs, databases, and other external systems.
Definitely not A, It's D as Infra is done already, Data is used to compute
D is the correct answer !
D. data, a data source