I'm currently deploying a ktor app in google cloud. I am using google cloud secret-manager to store secrets across my project. I've been wondering how best to inject these variables into a ktor app. We've considered either calling the secret-manager during CI/CD and inject the env variables into the build. However we'd prefer not to give our ci/cd access to google cloud secrets. For quarkus we found this , however I've yet to find something similar to ktor. Is there any way to inject these variables in KTOR?
a
AdamW
04/18/2024, 10:25 AM
Wouldn’t using the Quarkus extension also require you to permit your pipeline to read secrets? Or does it evaluate properties lazily at runtime?
j
Jørund Amsen
04/18/2024, 10:35 AM
The quarkus dependency injects it runtime, not buildtime
But to answer your question, there isn’t anything specifically for Ktor. The least invasive option is to use/keep using the GCP client, though Hoplite is great.
j
Jørund Amsen
04/18/2024, 10:52 AM
That looks very relevant! Do you have any examples using ktor and hoplite?
a
AdamW
04/18/2024, 11:03 AM
Not sure, I simply have the bare minimum in my Ktor config, and everything I need on the application side is in a Hoplite config 👍