Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure out GCP secrets integration with Cloud Run #91

Open
gilcrest opened this issue Apr 18, 2022 · 3 comments
Open

Figure out GCP secrets integration with Cloud Run #91

gilcrest opened this issue Apr 18, 2022 · 3 comments
Assignees
Labels

Comments

@gilcrest
Copy link
Owner

Instead of setting secrets (encryption key, db username/password) through environment variables in GCP. Figure out how to integrate with GCP's Secrets Manager and Cloud Run. I believe it's pretty straightforward, actually, and should get to this soon as it's important.

@gilcrest gilcrest self-assigned this Apr 18, 2022
@REPTILEHAUS
Copy link

Its super simple, just ensure that the default service account has secret accessor privs --role="roles/secretmanager.secretAccessor"

If cloudrun is like app engine then the SA is injected at runtime and always available, you can detect if its in a GCP env by looking for process.env.GCLOUD_PROJECT.

@REPTILEHAUS
Copy link

using gcloud and you can specify a different service acc if you need to like the below:

gcloud secrets versions access latest --secret="my-secret" \ --impersonate-service-account="PROJECTID@XXXXXX.iam.gserviceaccount.com" \ --project="xxxxxx" > ./secret.key

My Go is a bit rusty, looking for something like this to kick start me in the right direction, but i gotta make use of a Mongo instance, is it much work to migrate from postgres to mongodb ?

@gilcrest
Copy link
Owner Author

Thanks! Unfortunately I've never used Mongo, so so can't really comment...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants