HashiCorp Certified: Terraform Associate — Question 346
Which provider authentication method prevents credentials from being stored in the state file?
Answer options
- A. Using environment variables
- B. Specifying the login credentials in the provider block
- C. Setting credentials as Terraform variables
- D. None of the above
Correct answer: A
Explanation
Using environment variables is the correct method as it keeps sensitive credentials out of the state file, thereby enhancing security. Specifying credentials in the provider block or as Terraform variables can lead to sensitive information being stored in the state file, which is not ideal. Therefore, options B and C are not secure alternatives.