nerdexam
HashiCorp

TA-002-P · Question #289

What is the best and easiest way for Terraform to read and write secrets from HashiCorp Vault?

The correct answer is A. Vault provider. The Vault provider is the native Terraform integration for reading and writing secrets from HashiCorp Vault, requiring minimal configuration compared to any alternative approach.

Understand Terraform basics

Question

What is the best and easiest way for Terraform to read and write secrets from HashiCorp Vault?

Options

  • AVault provider
  • BAPI access using the AppRole auth method
  • Cintegration with a tool like Jenkins
  • DCLI access from the same machine running Terraform

How the community answered

(59 responses)
  • A
    88% (52)
  • B
    3% (2)
  • C
    2% (1)
  • D
    7% (4)

Why each option

The Vault provider is the native Terraform integration for reading and writing secrets from HashiCorp Vault, requiring minimal configuration compared to any alternative approach.

AVault providerCorrect

The Vault provider is a purpose-built Terraform provider that reads and writes secrets directly within HCL configuration by exposing Vault paths as data sources and resources. It handles authentication using supported Vault auth methods natively, making it the simplest and most idiomatic approach without requiring external tooling or manual scripting.

BAPI access using the AppRole auth method

Using raw API calls with the AppRole auth method requires custom scripting outside Terraform's native workflow and is far more complex than using the provider.

Cintegration with a tool like Jenkins

Integrating a tool like Jenkins adds unnecessary infrastructure dependency just to access secrets and is not a Terraform-native solution.

DCLI access from the same machine running Terraform

CLI access from the same machine is a manual, non-reproducible approach that does not integrate cleanly with Terraform's declarative and automated model.

Concept tested: Terraform HashiCorp Vault provider for secrets management

Source: https://registry.terraform.io/providers/hashicorp/vault/latest/docs

Topics

#Terraform Providers#HashiCorp Vault#Secrets Management#Integration

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice