Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

HashiCorp HCVA0-003 Exam - Topic 2 Question 22 Discussion

Posted by Johnetta on Jun 18, 2026 at 01:38 AM

Using the Vault CLI, there are several ways to create a new policy. Select the valid commands (Select three)

Suggested Answer: A, C, D

Comprehensive and Detailed in Depth

Vault provides multiple valid ways to create a policy via the CLI using the vault policy write command. The HashiCorp Vault documentation states: 'To write a policy, use the vault policy write command.' The valid methods are:

A: 'vault policy write my-policy - << EOF ... EOF uses heredoc syntax to inline policy content, which Vault accepts directly.'

C: 'vault policy write my-policy /tmp/policy.hcl writes a policy from a file, a standard method per the docs: 'The policy can be read from a file or piped from stdin.''

D: 'cat user.hcl | vault policy write my-policy - pipes policy content from a file via stdin, another documented approach: 'You can pipe the policy content to the command using -.''

Option B, vault policy create, is invalid as no such command exists---only vault policy write is used. Thus, A, C, and D are correct.


HashiCorp Vault Documentation - Policies: Write a Policy

Get Premium HCVA0-003 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
18 comments · newest first
GA
Galen 1 month ago
Same here, I practiced this before.
IL
Ilona 2 months ago
I feel confident about my choices.
GL
Glendora 2 months ago
This question is tricky but interesting!
GA
Galen 2 months ago
D is clever, using cat to pipe the file.
IL
Ilona 2 months ago
Right, "write" is the right command for policies.
GL
Glendora 2 months ago
B seems wrong, it should be "write" not "create".
GA
Galen 2 months ago
C makes sense too, using a file.
IL
Ilona 3 months ago
I agree, A is definitely valid.
GL
Glendora 3 months ago
I think A, C, and D are correct.
TR
Trinidad 3 months ago
Definitely A, C, and D!
GA
Galen 3 months ago
Wait, can you really use cat like that? Sounds odd.
ID
Idella 3 months ago
No way, B is not a valid command!
DE
Desmond 3 months ago
I think B is also valid, right?
ME
Meaghan 4 months ago
A, C, and D are valid commands.
LA
Lashunda 4 months ago
Option D sounds familiar too, but I can't recall if using "cat" like that is standard for Vault CLI commands.
HI
Hildegarde 4 months ago
I remember practicing with option C, and it seems correct because it specifies the policy file directly.
RO
Ronald 4 months ago
I'm not too sure about option B; I feel like "create" isn't the right command for writing a policy.
LA
Latricia 4 months ago
I think option A is definitely valid since it uses the correct syntax for writing a policy directly in the CLI.
0/2000 characters

Save Cancel