Hello :wave: my team uses uses <GitHub-Flow> for b...
# general
m
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
I think this looks pretty good so far! any specific questions you might have?
m
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
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
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
Not at all, thanks so much ❤️