codeamp / circuit

CodeAmp API. Built with Golang, GraphQL, GORM and Socket-IO
Apache License 2.0
21 stars 6 forks source link

Inject artifacts from infra component extensions as env vars #466

Open drshrey opened 5 years ago

drshrey commented 5 years ago

For plugins like Postgres, it'd be great to set a standard of env var keys that map to the credentials outputted from the extension. Since the user already has to do this, we should figure out an automated process so :

  1. The user does not have to manually inject those environment variables.
  2. A standard is defined such that any extension leveraging this resource uses the exact same key names. This reduces the burden of learning for a new engineer and things like key rotation become easier as well.
joecabezas commented 5 years ago

I would suggest to prefix these artifacts in order to prevent collisions, if the artifact is named DATABASE_USER will conflict with ENV_VAR for rails, luckily actual name is just DB_NAME, but a clear prefix would be nice like CODEAMP_POSTGRES_DATABASE_USER that will prevent any collision

also, in order to use this without modify code, I would like to declare ENV_VARS with the value of those artifacts, like

name: DATABASE_USER value: $CODEAMP_POSTGRES_DATABASE_USER

and the value get copied from the artifact, thanks for the support!