A data source is shown in the exhibit below.
How do you reference the id attribute of this data source?
}
data.aws_ami.web.id
aws_ami.web.id
web.id
data.web.id
Detailed Explanation:
Rationale for Correct Answer: In Terraform, data sources are referenced using the format:data. < DATA_SOURCE_TYPE > . < NAME > . < ATTRIBUTE >
In this case:
Data source type = aws_ami
Name = web
Attribute = id
Therefore, the correct reference is:
This follows Terraform syntax for accessing attributes from data sources, which is a key concept in configuration authoring.
Analysis of Incorrect Options (Distractors):
B. aws_ami.web.id Incorrect because this format is used for resources, not data sources.
C. web.id Incorrect because it omits both the data prefix and the resource type.
D. data.web.id Incorrect because it is missing the data source type (aws_ami).
Key Concept: Proper referencing of data sources using data. < type > . < name > . < attribute > syntax.
Submit