TF-004 Use Terraform outside the core workflow Practice Question
Exhibit
Refer to the exhibit.
```
$ terraform plan
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
~ update in-place
- destroy
Terraform will perform the following actions:
# aws_instance.web will be created
+ resource "aws_instance" "web" {
+ ami = "ami-0c55b159cbfafe1f0"
+ instance_type = "t2.micro"
+ tags = {
+ "Name" = "WebServer"
}
}
# aws_security_group.web_sg will be updated in-place
~ resource "aws_security_group" "web_sg" {
id = "sg-12345678"
~ name = "web_sg_old" -> "web_sg_new"
~ tags = {
"Name" = "Web SG"
}
}
# aws_eip.web_eip will be destroyed
- resource "aws_eip" "web_eip" {
id = "eipalloc-12345678"
domain = "vpc"
}
Plan: 1 to add, 1 to change, 1 to destroy.
```Based on the exhibit, what will happen to the existing Elastic IP (aws_eip.web_eip) when this plan is applied?
⚠ Common exam trap
HashiCorp often tests the misconception that removing a resource from configuration leaves it unchanged in the cloud, but Terraform's default behavior is to destroy any resource not present in the configuration, unless lifecycle rules or `removed` blocks are used.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
It will be destroyed
The Terraform configuration shows that the `aws_eip.web_eip` resource is no longer defined in the configuration after the plan is applied. Terraform will detect that the resource exists in the state but is absent from the configuration, and by default, it will destroy the Elastic IP to reconcile the state with the configuration. This is standard Terraform behavior for resources removed from `.tf` files.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
It will remain unchanged
Why it's wrong here
The '-' symbol in a Terraform plan explicitly indicates a destructive action, not an absence of change. If the 'elastic' resource were to remain unchanged, it would either not appear in the plan output at all, or it would be explicitly marked as 'no changes' if a refresh occurred without configuration modifications. Therefore, 'unchanged' is incorrect as the '-' symbol denotes a significant alteration.
- ✗
It will be updated in-place
Why it's wrong here
Terraform uses the '~' symbol to denote an in-place update, where attributes of an existing resource are modified without requiring its destruction and recreation. Since the exhibit clearly shows a '-' symbol for the 'elastic' resource, it signifies a different action than an in-place modification. Thus, the resource will not be updated in-place, but rather undergo a more drastic change.
- ✗
It will be created
Why it's wrong here
The '+' symbol is the specific indicator in a Terraform plan output that a new resource will be provisioned in the target infrastructure. The presence of a '-' symbol for the 'elastic' resource, as shown in the exhibit, directly contradicts the action of creation. Therefore, the resource will not be created, as the plan indicates an existing resource will be acted upon destructively.
- ✓
It will be destroyed
Why this is correct
The '-' symbol in a Terraform plan output unambiguously signifies that the associated resource will be destroyed or removed from the managed infrastructure. This action typically occurs when a resource is removed from the Terraform configuration, or when a change to its attributes necessitates its replacement (destroy and then create). Consequently, the existing 'elastic' resource will be destroyed as indicated by this symbol.
Go deeper
Related to this question
About these practice questions
This TF-004 question is part of Courseiva's 428-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This TF-004 practice question is part of Courseiva's free HashiCorp certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the TF-004 exam.