Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 327


You have been working in a Cloud provider account that is shared with other team members. You previously used Terraform to create a load balancer that is listening on port 80. After some application changes, you updated the Terraform code to change the port to 443.

You run terraform plan and see that the execution plan shows the port changing from 80 to 443 like you intended, and step away to grab some coffee.

In the meantime, another team member manually changes the load balancer port to 443 through the Cloud provider console before you get back to your desk.

What will happen when you terraform apply upon returning to your desk?

Show Answer
Correct Answer: CD

When you run terraform apply, Terraform will detect that the load balancer's port is already set to 443 as per the desired state defined in your updated configuration. Since the actual state matches the desired state, Terraform will not make any changes to the load balancer itself. Instead, it will simply update the state file to reflect the accurate representation of the current infrastructure state.

Discussion

5 comments
Sign in to comment
irusharulzOption: C
May 28, 2024

It's not making any changes load balancer. Since the load balancer now listening in port 443. No need to update the load balancer. but State file will be modified according to that

TheShantymanOption: C
May 31, 2024

C is the correct answer. Terraform will see that no changes need to be made as the load balancer now matches the local configuration. It will then update the state files to reflect the new remote configuration.

Edward2021Option: C
Jun 3, 2024

C is the correct answer

artyartycmsOption: C
Jun 14, 2024

C is correct

irusharulzOption: C
Jun 21, 2024

C is the correct answer