From my understanding, I should be able to mount a secret file to a Google Cloud Run service and be able to read the file later on. However, I keep getting an error: [Error: EISDIR: illegal operation on a directory, read]. I've already tried changing the service account to have the Secret Manager Secret Accessor permission, but that didn't work either
Any pointers for how I could solve this?
Example of how I'm going about this:
<< in Google Cloud Run Service setup: set Secrets mount path to "/run/secrets/mySecret"
<< in config file that has path to secret
{
mySecretPath: "/run/secrets/mySecret"
}
<< file reading function
import {readFile} from 'fs/promise'
async function readMySecret(path) {
return await readFile(path, {
encoding: "utf8"
}
}