https://pulumi.com logo
#general
Title
# general
m

most-state-94104

11/13/2022, 7:08 PM
Hello 👋 my team uses uses GitHub-Flow for branch management, with a single main branch which is sequentially deployed to the different pulumi stacks once feature branches are merged in. I’m investigating how to best implement feature flags. I couldn’t see any examples online so I created a demo repo using a very simple AWS python project consisting of only buckets. I was hoping for some feedback before I share with my team (and perhaps more widely if people think it would be helpful 🙂 )
b

billowy-army-68599

11/14/2022, 5:52 PM
I think this looks pretty good so far! any specific questions you might have?
m

most-state-94104

11/15/2022, 9:48 AM
Hey lee thanks for looking into this. I’ll split questions to make it easier to reply
Are there any resources about using feature flags with pulumi that I might have missed?
Are the stack config files the best place to toggle feature flags?
feature flags need to be managed carefully and can clutter code. Do you use feature flags in your pulumi projects or not worth the bother?
If the stack config files is the best place to toggle feature flags, am I calling them in the best way?
I’m thinking of writing GitHub action to flag obsolete feature flags which are enabled in prod. Should I parse the yaml config files or can I somehow use the pulumi outputs?
And Any other recommendations you might have about implementing feature flags with pulumi (or the demo itself)
b

billowy-army-68599

11/15/2022, 2:33 PM
Are there any resources about using feature flags with pulumi that I might have missed?
not that I’m aware!
Are the stack config files the best place to toggle feature flags?
yes i think this is a valid strategy! You can also read feature flags using SDKs (because you can use standard code, which is a nice benefit!) from feature flag providers like launchdarkly, but your strategy is straightforward and well implemented
feature flags need to be managed carefully and can clutter code. Do you use feature flags in your pulumi projects or not worth the bother?
We use a third party feature flag provider for the Pulumi service
If the stack config files is the best place to toggle feature flags, am I calling them in the best way?
I think at the moment you’re using the feature flags as inputs. You could also just have boolean flags:
Copy code
if (config.feature_enabled) {
  // do something 
}
but what you have now looks great!
I’m thinking of writing GitHub action to flag obsolete feature flags which are enabled in prod. Should I parse the yaml config files or can I somehow use the pulumi outputs?
You could use automation API for this! Our pulumi github action uses this, and you can read and set config values programmtically
m

most-state-94104

11/15/2022, 4:25 PM
Thanks Lee this is really helpful (and reassuring 🙂 ) I’ll have a look about using the Automation API to flag (and perhaps set) the feature flags. Have a good evening!
Hey @billowy-army-68599 I wrote up a blog about implementing feature flags and updated the github repo. I was wondering if you could have a look when you have a chance and give me any feedback?
Hello @billowy-army-68599 I wrote a blog about implementing feature flags with pulumi and included you in the acknowledgements, let me know if you would prefer me to remove your name 🙂
b

billowy-army-68599

01/29/2023, 4:05 PM
Not at all, thanks so much ❤️