prepor / github-pulumi

MIT License
8 stars 9 forks source link

Improve support for Pulumi config overrides #6

Closed EronWright closed 1 year ago

EronWright commented 4 years ago

I pass Pulumi config overrides as additional arguments. Unfortunately I'm not able to use environment variables in those arguments.

The workaround is to use the github actions templating syntax (e.g. ${{ secrets.GCP_PROJECT }}) but this is inconvenient, e.g. when working with derived values such as image names.

My suggestion is to expand environment variables in args. A related suggestion would be to provide a first-class DSL for config overrides.

Old:

 - uses: prepor/github-pulumi@master
   with:
     args: >
       up
       --config "gcp:project=${{ secrets.GCP_PROJECT }}"
       --config "image=gcr.io/${{ secrets.GCP_PROJECT }}/example/image:${{ github.sha }}"

New:

 - uses: prepor/github-pulumi@master
   with:
     args: up
     config:
       gcp:project: $GCP_PROJECT
       image: gcr.io/$GCP_PROJECT/example/image:${{ github.sha }}
prepor commented 4 years ago

1) About env vars. Github Actions Expressions allow using environment variables via env in the same way as secrets, don't they? Doesn't it solve the problem of "derived values"?

2) About config parts. It takes us to a way of replicating pulumi's CLI as YAML. There are could be other desired options ("target"?) and also important that it'll add to this tiny wrapper around pulumi some additional interface knowledge, which could be deprecated, removed or have differences between versions. I would like to avoid it :)

But at the same time, I think it's ok to have some general purpose "CLI-args AS YAML" DSL which would be converted to args without knowledge about any particular options. If you know a library which implements it — let me know! Or maybe we can make such a library.