Add a self reference to CallRequest and ConstructRequest - #533
Conversation
|
|
||
| public sealed class ConstructRequest | ||
| { | ||
| public ProviderResource? Provider { get; init; } |
There was a problem hiding this comment.
Arguably this should be non-nullable and throw with a message like "self provider references aren't supported update your pulumi CLI", that would match how we handle other cases like this that depend on engine support.
| private string? engineAddress; | ||
| // More recent versions of the engine send URN and ID of the provider to `Configure`. With that we can construct | ||
| // a `DependencyProviderResource` to use in `Construct` and `Call` to refer to the provider itself. | ||
| private string? providerSelfReference; |
There was a problem hiding this comment.
There's no value in sending a ProviderResource to any of the normal CRUD methods, but maybe we should send the URN for logging reasons? That would allow you to log a message to the provider resource, while performing a Create/Update for another resource.
|
The change assists with this particular issue but is it worth to keep this internal?
If URN+ID can be hydrated to a provider reference why not make sure it is accessible in code. That'd be a bit more orthogonal. |
Part of pulumi/pulumi#18823
This adds a new
ProviderResourceproperty toCallRequestandConstructRequestthat the runtime fills in with aDependencyProviderResourceif the engine told us our URN and ID inConfigure.