Question 1easymultiple choice
Read the full Read, generate and modify configuration explanation →TF-003 Read, generate and modify configuration • Complete Question Bank
Complete TF-003 Read, generate and modify configuration question bank — all 0 questions with answers and detailed explanations.
Refer to the exhibit.
```hcl
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
tags = {
Name = "WebServer"
}
}
```Refer to the exhibit.
```hcl
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
}
resource "aws_eip" "ip" {
instance = aws_instance.web.id
}
output "public_ip" {
value = aws_eip.ip.public_ip
}
```
A user runs `terraform apply` and gets: Error: Invalid index on aws_eip.ip, in the 'instance' argument. The resource aws_instance.web has not been created yet.Drag steps to the numbered slots on the right, or tap a step then tap a slot.
Drag a concept onto its matching description — or click a concept then click the description.
"hello"
42
true
["a", "b"]
{"key" = "value"}
resource "aws_instance" "web" {
ami = "ami-abc123"
instance_type = "t2.micro"
tags = {
Name = "web-server"
}
lifecycle {
create_before_destroy = true
}
}variable "subnet_ids" {
type = list(string)
default = ["subnet-1", "subnet-2"]
}
resource "aws_instance" "app" {
count = length(var.subnet_ids)
subnet_id = var.subnet_ids[count.index]
ami = "ami-xyz"
instance_type = "t2.micro"
}output "instance_ip" {
value = aws_instance.web.public_ip
}Refer to the exhibit.
```
$ terraform plan
...
# aws_instance.example will be updated in-place
~ resource "aws_instance" "example" {
id = "i-0abcd1234"
~ instance_type = "t2.micro" -> "t2.small"
tags = {
"Name" = "example"
}
}
```