This is an example Terraform implementation of a Keycloak Vault integration.
The project refers to a medium post on this topic.
This version is compatible with Quarkus, for Keyloak on Wildfly see here
You need to set the following entry in /etc/hosts
or C:\Windows\System32\drivers\etc\hosts
.
127.0.0.1 keycloak
This change should be done on the operating system that the end-user's browser is running on (when using WSL the change needs to be done on windows system).
The keycloak name resolution for the backend (vault->keycloak) is done through the docker service name.
Install make. Ex for debian-like systems:
sudo apt install make
Alternatively check the Makefile
and manually run the commands.
For example to run the stack in the foreground and display all logs in the standard output, instead of make up
you can use:
docker-compose up
Use makefile:
make [help | up | down | init | provision | deprovision | destroy | shell]
- Start the local environment (Docker)
make up
- Initialize Terraform
make init
- Apply the Terraform configuration
make provision
- Shutdown the local environment (Docker)
make down
Command | Description |
---|---|
up | start docker container |
down | stop docker container |
init | terraform init |
provision | terraform apply |
deprovision | terraform destroy |
destroy | terraform destroy and remove all terraform related files/states |
shell | open a shell with terraform binary |