The -refresh-only flag tells Terraform to skip the resource creation and update steps and only update the state file with the current state of resources in the cloud provider. This means that Terraform will not reference the resource definitions in the configuration files, since it is not applying any changes to the cloud provider based on those definitions.
this command is depreciated seemingly because of credentials. Kinda indicates that it touches the credentials doesn't it.... I'm going with C
Warning: This command is deprecated, because its default behavior is unsafe if you have misconfigured credentials for any of your providers. See below for more information and recommended alternatives.
https://developer.hashicorp.com/terraform/cli/commands/refresh
Basic english. Credentials is not related to this feature as it is required for every options in terraform. For this option, all the other three are referred internally
The -refresh-only flag ensures that Terraform only performs a refresh of the state without making changes to the infrastructure. During the refresh, Terraform compares the current state of the infrastructure with the resource definitions in the configuration files to identify any differences.
The -refresh-only flag is used to refresh the state of resources without making any changes. It ensures that Terraform has the latest information about the existing resources in the cloud, but it doesn't involve credentials or make any modifications to the resources. Credentials are typically required during resource provisioning or modifications, not during a refresh operation.
A. Credentials
When running terraform apply -refresh-only, Terraform does not reference credentials. The -refresh-only flag is used to perform a refresh of the state without making any changes to the actual resources in the cloud provider. During this operation, Terraform retrieves the current state of the resources from the cloud provider, updates the state file with the latest information, but it does not perform any actions that require credentials (e.g., creating, modifying, or deleting resources).
The -refresh-only flag is useful when you want to synchronize Terraform's understanding of the resources with the real state in the cloud provider without performing any destructive actions. It allows you to update the state file with the latest resource information without making any changes to the infrastructure.
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.
kiran15789
Highly Voted 1 year, 6 months agoAlandt
Most Recent 10 months agoalen995454
10 months, 1 week agoBalki
11 months agoAlbion
11 months, 2 weeks agoTronko86
1 year agoPaul_white
1 year, 3 months agoOleg_gol
1 year, 6 months ago