When creating a provider, and `DryRun` is `true`, ...
# general
a
When creating a provider, and
DryRun
is
true
, in this guide, https://www.pulumi.com/docs/iac/extending-pulumi/build-a-provider/ in the example code, it returns empty state in the
Update
function, and only
ID
defined in the
Create
function. But theres no more explanation around what to return when
DryRun
is
true
, only that you have to return early. Is there some more explanation somewhere on this?
e
DryRun means that it's currently running
pulumi preview
so you shouldn't do any actual resource operations. The example as given works, but its not optimal because it means all outputs will be unknown at preview time, even those that aren't being changed. Unfortunately I don't know if it's possible to support partial unknowns in the go provider SDK. Hopefully someone else can chime in on that.
a
I could also define the content in the return, as its given in the argument ? or only in create arguments, maybe not update arguments?
e
both I think, generally in Update you know the old outputs and so can just mark the ones that might change from the new input as unknown. But that's all using the raw grpc protocol, I don't know how the Go provider framework deals with those partial known/unknown cases.
here is the provider im working on, could you give suggestions?
e
That diff looks ok to me, as long as your early returning when DryRun is set
again I don't know the details of how the go provider framework works here, so someone might have better info than me, but returning partial results like that is probably better than empty results