nerdexam
HashiCorp

TA-002-P · Question #46

Examine the following Terraform configuration, which uses the data source for an AWS AMI. What value should you enter for the ami argument in the AWS instance resource?

The correct answer is C. data.aws_ami.ubuntu.id. resource "aws_instance" "web" { ami = data.aws_ami.ubuntu.id https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance

Read, generate, and modify configuration

Question

Examine the following Terraform configuration, which uses the data source for an AWS AMI. What value should you enter for the ami argument in the AWS instance resource?

Exhibit

TA-002-P question #46 exhibit

Options

  • Aaws_ami.ubuntu
  • Bdata.aws_ami.ubuntu
  • Cdata.aws_ami.ubuntu.id
  • Daws_ami.ubuntu.id

How the community answered

(29 responses)
  • A
    7% (2)
  • C
    90% (26)
  • D
    3% (1)

Explanation

resource "aws_instance" "web" { ami = data.aws_ami.ubuntu.id https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance

Topics

#Terraform data sources#Resource referencing#Terraform syntax#AWS AMI

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice