A. State file - its updated during the refresh
B. Configuration file -
C. Credentials - required to get onto the cloud
D. Cloud provider - required to carry out the refresh of whats in the cloud vs whats in state.
the answer has to be B, as per docs, it's checking remote objects and update the state file, it needs to process the creds to connect, the cloud provider to check objects and the state to update.
"The terraform refresh command reads the current settings from all managed remote objects and updates the Terraform state to match."
When running terraform refresh, Terraform updates the state file by querying the cloud provider using the appropriate credentials to check the actual state of the infrastructure. However, the configuration file (the .tf files) is not processed during a refresh. Terraform is only concerned with updating the state to match the real-world infrastructure, not applying changes from the configuration.
Refresh command will update the remote state file to match the current configuration. So configuration file won’t change anything. State file and credentials and cloud providers will associate with the refresh action
The question is outdated as this command is deprecated by Terraform, and they also recommend against using it because it provides no opportunity to review the effects of the operation before updating the state.
The answer is C. Credentials.
When you run terraform refresh, Terraform will read the state file and the configuration file, but it will not read the credentials. This is because the credentials are used to connect to the cloud provider, and Terraform does not need to connect to the cloud provider to refresh the state file.
Refresh is about ensuring the state file reflects real world objects: it's not bringing the state file in line with your configuration, it's bringing it into line with the real thing
Agree with B. Only confiugration file not processed for provisioning infra. Provider & credential need login to infra & state file will overwrite new config current infra
he configuration file is not processed during terraform refresh. The configuration file is only used during the terraform apply or terraform plan commands to determine the desired state of the infrastructure. terraform refresh does not make any changes to the infrastructure, it only updates the state file to reflect the current state of the resources in the cloud provider.
The terraform refresh command does not create new resources or modify existing resources. It only updates the state to reflect the current configuration. If you want to create new resources or modify existing resources, you need to use the terraform apply command.
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.
wangchung
Highly Voted 2 years, 6 months agocloudcuckooland
Highly Voted 2 years, 6 months agofasaleAkshay
Most Recent 2 months agoshubhamlonkar
4 months, 3 weeks agoMolly1994
5 months, 3 weeks agoravk2321
8 months, 2 weeks agoJayanth
1 year, 3 months agoBusi57
1 year, 4 months agoBusi57
1 year, 4 months agocdechery
1 year, 4 months agoIbrahim2023
1 year, 4 months agoHMthyl
1 year, 4 months agoconnecttozee
1 year, 7 months agoSilentMilli
1 year, 8 months agoMal_8
1 year, 9 months agoInformationOverload
1 year, 10 months agoFatoch
2 years agoyogishrb2020
2 years, 1 month ago