# Vault Dynamic Secrets Tutorial Issues

**URL:** <https://discuss.hashicorp.com/t/vault-dynamic-secrets-tutorial-issues/26585>\
**Category:** Vault\
**Tags:** vault\
**Created:** [July 9, 2021, 9:15pm UTC](https://discuss.hashicorp.com/t/vault-dynamic-secrets-tutorial-issues/26585 "2021-07-09T21:15:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cw00dw0rd](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/cw00dw0rd/32/20657_2.png) [@cw00dw0rd](https://discuss.hashicorp.com/u/cw00dw0rd)\
**Post date:** [July 9, 2021, 9:15pm UTC](https://discuss.hashicorp.com/t/vault-dynamic-secrets-tutorial-issues/26585/1 "2021-07-09T21:15:09Z")

</div>

I am a Vault newcomer and a Windows user _gasp_. I am going through the tutorial and get stuck on the Dynamic Secrets page as the policy command doesn’t work in my Windows Powershell.

```auto

vault write aws/roles/my-role \
        credential_type=iam_user \
        policy_document=-<<EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1426528957000",
      "Effect": "Allow",
      "Action": [
        "ec2:*"
      ],
      "Resource": [
        "*"
      ]
    }
  ]
}
EOF

```

I attempted to instead use an hcl policy file but apparently wasn’t formatting it correctly(I guess the supplied policy is not in hcl format either?)

Can anyone suggest a solution for this? I would also recommend this section of the tutorial be updated to use an hcl policy as that would be a more system-agnostic approach.

---

<div class="post-metadata">

**Author:** ![jeffsanicola](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jeffsanicola/32/18651_2.png) [@jeffsanicola](https://discuss.hashicorp.com/u/jeffsanicola)\
**Post date:** [July 12, 2021, 2:04am UTC](https://discuss.hashicorp.com/t/vault-dynamic-secrets-tutorial-issues/26585/2 "2021-07-12T02:04:00Z")

</div>

PowerShell doesn’t support the `<<EOF` notation, but rather uses its own syntax for multiline variables like this:

```auto
$test=@'
Test
Test
'@

```

You should be able to modify your command to the following to get it to work (note that I haven’t tested this):

```auto
vault write aws/roles/my-role \
        credential_type=iam_user \
        policy_document=@”
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1426528957000",
      "Effect": "Allow",
      "Action": [
        "ec2:*"
      ],
      "Resource": [
        "*"
      ]
    }
  ]
}
“@

```

---

<div class="post-metadata">

**Author:** ![Tomish](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/tomish/32/24872_2.png) [@Tomish](https://discuss.hashicorp.com/u/Tomish)\
**Post date:** [January 4, 2022, 1:03pm UTC](https://discuss.hashicorp.com/t/vault-dynamic-secrets-tutorial-issues/26585/3 "2022-01-04T13:03:27Z")

</div>

I also encountered this error and the above solution did not work in my case where I was using PowerShell. To solve this problem, I wrote the contents of the Json in a file and I used the path of the Json file as an argument adding an @ in front of it.

**Json file :**

```auto
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1426528957000",
      "Effect": "Allow",
      "Action": [
        "ec2:*"
      ],
      "Resource": [
        "*"
      ]
    }
  ]
}

```

**Powershell command :**

```auto
vault write aws/roles/my-role credential_type=iam_user policy_document=@"C:\path\to\the\file.json"

```
