nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #241

When you use a backend that requires authentication, it is best practice to:

The correct answer is C. Use environment variables to configure authentication credentials outside of your Terraform. Best practice is to avoid hardcoding sensitive credentials in Terraform configurations or storing them in version control. Instead, credentials should be managed via environment variables, CLI authentication helpers, or secret managers (e.g., Vault).

Implement and Maintain State

Question

When you use a backend that requires authentication, it is best practice to:

Options

  • ARun all of your Terraform commands on a shared server or container.
  • BConfigure the authentication credentials in your Terraform configuration files, and store them in a
  • CUse environment variables to configure authentication credentials outside of your Terraform
  • DNone of the above.

How the community answered

(35 responses)
  • A
    9% (3)
  • B
    3% (1)
  • C
    83% (29)
  • D
    6% (2)

Explanation

Best practice is to avoid hardcoding sensitive credentials in Terraform configurations or storing them in version control. Instead, credentials should be managed via environment variables, CLI authentication helpers, or secret managers (e.g., Vault).

Topics

#backend authentication#environment variables#credentials security#secrets management

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice