Are Environment Variables Unavailable to Shared Components in GCP and How to Best Manage Their Secrets?

This topic was automatically generated from Slack. You can find the original thread here.

I have a shared component that will make a call to GCP. Do I understand correctly that environment variables are not available to shared components? If that’s correct, what is the best practice for managing secrets for them?

That’s right. You should create a prop for it, then whoever is configuring it can set the prop value to process.env.foo.

Or if it’s for the account connection specifically, then using the google_cloud app prop might also be a better way to accomplish what you’re trying to do.

What’s the use case for the env var?

It’s the same as it would be in a step: To make a secret available to that component. The extra friction to define a property and then pass the same environment variable every time that shared component is utilized seems unnecessary.