When using Terraform to deploy resources into Azure, which scenarios are true regarding state files? (Choose two.)
A.
When you change a Terraform-managed resource via the Azure Cloud Console, Terraform updates the state file to reflect the change during the next plan or apply
B.
Changing resources via the Azure Cloud Console records the change in the current state file
C.
When you change a resource via the Azure Cloud Console, Terraform records the changes in a new state file
D.
Changing resources via the Azure Cloud Console does not update current state file
Refer to an earlier question #98. Answer should be A and D. I honestly suggest anyone who is not that knowledgeable (like me) to not be over-confident and mislead others. Thank you.
Yes if you refer to an earlier question #19. Answer should be AD only.
LOL I hope you didn't look up Q19.
Okay, reasons I'm not sure about A:
- you change a Terraform-managed resource via the Azure Cloud Console,
- when you run Terraform plan or apply, Terraform will first do a refresh and update the metadata to what you've changed in cloud console. BUT Terraform will subsequently start applying what's in the config file and revert the change you've made via cloud console. Finally it updates the state file with what's in terraform config.
oh look i cleared my own doubt - reason why it's A:
terraform plan or terraform apply without approval is basically a terraform state refresh. State file will be updated with the changes made on cloud console.
Only D is the correct one, Terraform will never update the state file to reflect changes that occurred in the environment manually (outside Terraform), it will do the opposity, if the your code is not updated accordingly with what was manually changed, Terraform will bring your environment back to what it is in the state file.
A. It is not correct, terraform plan doesn't reflect the changes, it only shows the changes to you when you run terraform apply it reflects the change.
B. When you do manual change in resource, Terraform doesn't imply changes automatically
C. Terraform never creates a new state file for the new changes and it uses the existing one unless you don't specify a different backend.
D. Correct. You can only update tfstate file with either terraform apply (suggested) or terraform apply -refresh-only (not suggested though).
Option A has probably typo issue, terraform plan shouldn't be in there.
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.
Jas14
Highly Voted 1 year, 1 month agoMattt
Most Recent 2 months agoogerber
6 months, 2 weeks agodankositzke
9 months agoAkaAka4
6 months, 4 weeks agoazurebot123
6 months, 1 week agoazurebot123
6 months, 1 week agoSpandrop
11 months, 1 week agoTronko86
1 year agonuridgsn
1 year, 4 months agoDevoteamAnalytix
1 year, 4 months ago