vault-provider-examples

module
v0.0.0-...-a4aa88a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2024 License: GPL-3.0

README

Vault Provider Examples

Setup

To run the examples you will need to have a Vault server running as well as the MySQL database. I have included a docker-compose.yml file which will start the Vault server and the MySQL database. To start the services run the following command:

docker-compose up -d

Now that the services are running, we need to set up the configuration on Vault. To do this we need to run the following steps:

  1. Run Terraform against the Vault Docker container to set up the initial configuration:
cd terraform/env && terraform init && terraform apply
  1. Now run the example application to set up the database and the Vault secrets:
cd cmd/database && go build -o db-example && ./db-example
  1. Now the example is running you can watch the logs to see the application running. The logs will show that the Vault lease is being renewed every 15 seconds. We would increase this time in a production environment.

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳