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:
data.aws_ami.web.id
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.
[Reference: Terraform Objective Domain: Read, Generate, and Modify Configurations, , , , , , ]
Submit