HCVA0-003 practice question 8 of 35

You need to connect to and manage a new HCP Vault cluster using the Vault CLI on your laptop. What environment variables should you set to establish connectivity?

Full set: 285 questions
Answer options
A: VAULT_CLIENT_KEY=, VAULT_TOKEN=
B: VAULT_NAMESPACE=root, VAULT_REDIRECT_ADDR=
C: VAULT_ADDR=https://:8200, VAULT_NAMESPACE=admin Correct answer
D: VAULT_TOKEN=, VAULT_CLUSTER_ADDR=https://:8200
Correct Answer:
C. VAULT_ADDR=https://:8200, VAULT_NAMESPACE=admin
Explanation

To connect the Vault CLI to a HashiCorp Cloud Platform (HCP) Vault cluster, you must specify the cluster's public address and the correct administrative namespace. The VAULTADDR environment variable is used to set the cluster's URL, which typically listens on port 8200. HCP Vault provisions a default namespace named admin for all user-level administrative tasks. Therefore, the VAULTNAMESPACE variable must be set to admin to target this namespace for management operations. These two variables correctly configure the CLI's connection target.

Why Incorrect

A. This option is missing the VAULTADDR variable, which is mandatory for the CLI to know which Vault server to contact.
B. VAULTNAMESPACE=root is incorrect for managing an HCP cluster, as admin is the designated namespace. VAULTREDIRECTADDR is a server-side configuration for UI logins, not a client-side CLI variable.
D. VAULTCLUSTERADDR is a server-side configuration parameter used for communication between Vault nodes within a cluster, not for client connections. Clients must use VAULTADDR.

References

1. HashiCorp Developer Documentation, "Get Started with HCP Vault": This official tutorial explicitly instructs users to set these two environment variables for CLI access. It states, "All HCP Vault clusters are created with a default namespace called admin." and provides the commands: export VAULTADDR= and export VAULTNAMESPACE=admin.

Source: HashiCorp, "Connect to the HCP Vault cluster", Get Started with HCP Vault, Section: "Configure the Vault environment variables". (developer.hashicorp.com/vault/tutorials/hcp/hcp-vault-get-started#configure-the-vault-environment-variables)

2. HashiCorp Developer Documentation, "Vault Commands (CLI) - Environment Variables": This document lists the environment variables recognized by the Vault CLI. It defines VAULTADDR as the address of the Vault server and VAULTNAMESPACE as the namespace to use for the request. It does not list VAULTCLUSTERADDR as a client-side variable.

Source: HashiCorp, "Environment Variables", Vault Commands (CLI). (developer.hashicorp.com/vault/docs/commands#environment-variables)

3. HashiCorp Developer Documentation, "Vault Agent - Configuration": The documentation for Vault Agent, another Vault client, clarifies the distinction between vault.address (equivalent to VAULTADDR) for client connections and clusteraddr for server-to-server communication, reinforcing that clients use the former.

Source: HashiCorp, "Vault Agent Configuration", Vault Agent. (developer.hashicorp.com/vault/docs/agent/configuration#vault)

Scroll to Top