Exam Vault Associate 002 All QuestionsBrowse all questions from this exam
Question 58

You manage two Vault dusters: “vaultduster1.acme.corp” and “vaultduster2.acme.corp”. You want to write a secret to the first Vaultcluster vaultcluster1.acme.corp and run vault kv put secret/foo value=‘bar’. The command times out and the error references the Vault cluster, “vaultcluster2.acme.corp”.

You run the command again with the following address flag:

vault kv put -address=‘https://vaultcluster1.acme.corp’ secret/foo value=‘bar’

The command completes successfully. You find that the terminal session defines the environment variable VAULT_ADDR=‘https://vaultcluster2.acxe.corp:8200’

Why was the second attempt successful?

    Correct Answer: C

    The second attempt was successful because flags take precedence over environment variables. When you specify the -address flag in the command, it overrides the value set in the VAULT_ADDR environment variable, directing the command to the correct Vault cluster.

Discussion
daz_rekkaOption: C

Flags always take precedence over Environment Variables https://developer.hashicorp.com/vault/docs/commands#environment-variables