-
Notifications
You must be signed in to change notification settings - Fork 71
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
Allow Pulumi config vars to be dynamically set #8
Conversation
ziahamza
commented
Feb 16, 2019
- This PR allows pulumi vars to be automatically set from environment variables passed by Github Action
- Setting a secret in GH such as "PULUMI_CONFIG_XYZ=20" would set pulumi config XYZ to be 20
Is there a specific scenario that this PR enables? On the surface this approach seems like it is a step in the wrong direction. (Though perhaps I'm just unaware of when you'd want to do this.) Configuration changes are stored in the By introducing any sort of dynamism here, you can standup a stack where the configuration isn't tied to the source code. And could lead to difficulties when trying to revert changes or rollback to a previous version. (Not that we would want to explicitly prevent that, it's just something we'd want to avoid enabling without a compelling reason.) As far as the code is concerned, this only allows you to specify a single configuration value, and not pass |
I 100% agree for staging / prod environments to live as a checked in file. But this PR gives rise to support of dynamic review links. Basically, when its a user branch, goal is to create a brand new branch specific pulumi environment to test the PR in isolation. With end goal being: https://devcenter.heroku.com/articles/github-integration-review-apps |
Gotcha. Yes, that's definitely something that's come up before, and is something we'd like to support! Though I'm still not sure just having the ability to set dynamic config is sufficient. Since you'd need to first run Could you write up a short document for how you would expect a Pulumi-based integration app to work? That would make it easier to understand the specific changes we'd need to make, and think through the various scenarios. (As well asallow other folk like me to pitch in.) For example, when do you think you'd need to run I hope this doesn't come across as unhelpful. I do definitely want to work with you to add this feature. But we should understand how we expect the full flow to work first, before adding individual features. (Since if we find out later that they aren't sufficient, or unnecessary, it will be harder to remove them without breaking people later.) |
I second this ticket here since it was closed. I am not sure of the terminology here, but whatever pulumi creates, lets call it Set of Resources should be driving the stack and not the other way around as it currently is. Creating these resources, should either use an existing stack or create a new one. Don't me wrong, stacks are useful to have pre-defined environments. But that shouldn't be a requirement. Also, I don't think |
A scenario in support of this is a github action with a step that builds a docker image (with the |
Thank you for the pull request, but I'm going to close this out for now. The entry point script has moved over here, and moreover this approach is a little dangerous to use. As far as supporting this overall feature -- setting config vars dynamically to enable review apps and things -- it is something we will get to. But like I mentioned, it is tricky to do right. (And can easily lead to outages and things if you rely on it for production stacks.) I can report I have successfully configured CI/CD systems to use Pulumi in a review app like fashion using CircleCI and GitLab. So hopefully we'll have an example of how to do this as safely as possible using GitHub Actions soon. Usually the trick revolves around using Anyways, if you watch updates to this repo, you will be notified as we make changes to our Pulumi x GitHub Actions support as it evolves. Hopefully we will get to a point where we have an existing action/template that automatically does the work for managing Pulumi stacks along with the lifecycle of a pull request, etc. |