+1 to dynamic providers.
We also have an issue tracking adding stateful actions to programs:
https://github.com/pulumi/pulumi/issues/127
Idea being that for some simple things (like run this code once on update, but then just use the saved state) we can have something easier to work with and lighter-weight than dynamic providers.