Documentation ¶
Overview ¶
Vax is a Golang AWS credentials provider using the Hashicorp Vault AWS secret engine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewVaultProviderCredentials ¶
func NewVaultProviderCredentials(enginePath string, roleName string) *credentials.Credentials
An extra shortcut to avoid needing to import credentials into your source file or call nested functions. Call this to return a new Credentials object using the VaultProvider.
Types ¶
type VaultProvider ¶
type VaultProvider struct { // The full Vault API path to the STS credentials endpoint. StsCredsPath string // The TTL of the STS credentials in the form of a Go duration string. TTL string // The `vault.Client` object used to interact with Vault. VaultClient *vault.Client // compose with credentials.Expiry to get free IsExpired() credentials.Expiry // contains filtered or unexported fields }
The VaultProvider object implements the AWS SDK `credentials.Provider` interface. Use the `NewVaultProvider` function to construct the object with default settings, or if you need to configure the `vault.Client` object, TTL, or path yourself, you can build the object by hand.
func NewVaultProvider ¶
func NewVaultProvider(enginePath string, roleName string) *VaultProvider
Creates a new VaultProvider. Supply the path where the AWS secrets engine is mounted as well as the role name to fetch from. The VaultProvider is initialized with a default client, which uses the VAULT_ADDR and VAULT_TOKEN environment variables to configure itself. This also sets a default TTL of 30 minutes for the credentials' lifetime.
func (*VaultProvider) Retrieve ¶
func (vp *VaultProvider) Retrieve() (credentials.Value, error)
Implements the Retrieve() function for the AWS SDK credentials.Provider interface.