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?
In the context of the example given in the question:
data "aws_ami" "ubuntu" {
most_recent = true
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["099720109477"] # Canonical
}
resource "aws_instance" "web" {
ami = data.aws_ami.ubuntu.id
instance_type = "t2.micro"
tags = {
Name = "HelloWorld"
}
}
C is correct answer.
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance
upvoted 6 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Jaro3000
Highly Voted 2 years, 5 months agoBere
Highly Voted 1 year, 3 months agoNi33
Most Recent 1 year, 6 months agoPower123
1 year, 7 months ago0ptimus
2 years, 2 months agoAhmad_Terraform
2 years, 4 months agoEltooth
2 years, 5 months ago