-
Spin up a local keycloak instance:
make setupIt will take a few seconds for keycloak to become healthy.
-
Run
make init-local. This will:- override the S3 backend with a file backend
- rename
imports.tftoimports.tf.disabled - create
local-test.auto.tfvarsto point opentofu at the local keycloak instance
-
Run
tofu planortofu apply, etc. -
When you're done, run
make init-remote. This will undo the changes introduced bymake init-local. -
To tear down your local Keycloak instance:
make teardownThis will stop the containers, destroy the postgres backing store, and erase your local
terraform.tfstate*files.
Note that if you are applying this configuration against a fresh keycloak instance, you will need to run the following steps to bootstrap the environment:
tofu apply -var first_broker_login_flow='first broker login' -target keycloak_realm.moc
tofu apply -var first_broker_login_flow='first broker login'
tofu apply
The apply workflow (.github/workflows/apply.yaml) applies this
configuration on pushes to main. It authenticates to Keycloak using GitHub
Actions' OIDC identity (using federated client authentication).