HashiCorp Certified: Terraform Associate — Question 346

Which provider authentication method prevents credentials from being stored in the state file?

Answer options

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.