namecheap / node-vault-client

A Vault Client implemented in pure javascript for HashiCorp Vault
Apache License 2.0
22 stars 21 forks source link

Small example using AWS #9

Closed ImreC closed 2 years ago

ImreC commented 4 years ago

Hey,

Would it be possible to add a small example on how to use this client with AWS? I am probably just confused, but can't really get it to work. Thanks!

vzholudev commented 4 years ago

We use this package inside https://github.com/namecheap/nc-vault-env you can take a look inside

StyleT commented 4 years ago

Hi! I think you need to pass the following params:

const vaultClient = VaultClient.boot('main', {
    api: { url: 'https://vault.example.com:8200/' },
    auth: { 
        type: 'iam', 
        mount: "path/to/auth/mount/in/vault",
        config: { 
            role: "my_awesome_api", //This is a name of the role in Vault
            iam_server_id_header_value: "XXX" //Same as you used during Vault role config
        } 
    },
});