pulumi-language-ruby 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +39 -0
  4. data/Rakefile +8 -0
  5. data/exe/pulumi-language-ruby +39 -0
  6. data/lib/ruby_pulumi/generated/pulumi/alias_pb.rb +16 -0
  7. data/lib/ruby_pulumi/generated/pulumi/analyzer_pb.rb +43 -0
  8. data/lib/ruby_pulumi/generated/pulumi/analyzer_services_pb.rb +69 -0
  9. data/lib/ruby_pulumi/generated/pulumi/callback_pb.rb +17 -0
  10. data/lib/ruby_pulumi/generated/pulumi/callback_services_pb.rb +39 -0
  11. data/lib/ruby_pulumi/generated/pulumi/codegen/hcl_pb.rb +20 -0
  12. data/lib/ruby_pulumi/generated/pulumi/codegen/loader_pb.rb +17 -0
  13. data/lib/ruby_pulumi/generated/pulumi/codegen/loader_services_pb.rb +40 -0
  14. data/lib/ruby_pulumi/generated/pulumi/codegen/mapper_pb.rb +17 -0
  15. data/lib/ruby_pulumi/generated/pulumi/codegen/mapper_services_pb.rb +50 -0
  16. data/lib/ruby_pulumi/generated/pulumi/converter_pb.rb +21 -0
  17. data/lib/ruby_pulumi/generated/pulumi/converter_services_pb.rb +42 -0
  18. data/lib/ruby_pulumi/generated/pulumi/engine_pb.rb +26 -0
  19. data/lib/ruby_pulumi/generated/pulumi/engine_services_pb.rb +51 -0
  20. data/lib/ruby_pulumi/generated/pulumi/errors_pb.rb +17 -0
  21. data/lib/ruby_pulumi/generated/pulumi/events_pb.rb +17 -0
  22. data/lib/ruby_pulumi/generated/pulumi/events_services_pb.rb +45 -0
  23. data/lib/ruby_pulumi/generated/pulumi/language_pb.rb +55 -0
  24. data/lib/ruby_pulumi/generated/pulumi/language_services_pb.rb +121 -0
  25. data/lib/ruby_pulumi/generated/pulumi/plugin_pb.rb +19 -0
  26. data/lib/ruby_pulumi/generated/pulumi/provider_pb.rb +66 -0
  27. data/lib/ruby_pulumi/generated/pulumi/provider_services_pb.rb +232 -0
  28. data/lib/ruby_pulumi/generated/pulumi/resource_pb.rb +51 -0
  29. data/lib/ruby_pulumi/generated/pulumi/resource_services_pb.rb +64 -0
  30. data/lib/ruby_pulumi/generated/pulumi/resource_status_pb.rb +23 -0
  31. data/lib/ruby_pulumi/generated/pulumi/resource_status_services_pb.rb +44 -0
  32. data/lib/ruby_pulumi/generated/pulumi/source_pb.rb +17 -0
  33. data/lib/ruby_pulumi/generated/pulumi/testing/language_pb.rb +24 -0
  34. data/lib/ruby_pulumi/generated/pulumi/testing/language_services_pb.rb +47 -0
  35. data/lib/ruby_pulumi/language_host.rb +46 -0
  36. data/lib/ruby_pulumi/pulumi.rb +2 -0
  37. data/lib/ruby_pulumi/resource.rb +24 -0
  38. data/lib/ruby_pulumi/runtime.rb +7 -0
  39. data/pulumi/alias.proto +38 -0
  40. data/pulumi/analyzer.proto +293 -0
  41. data/pulumi/callback.proto +44 -0
  42. data/pulumi/codegen/hcl.proto +89 -0
  43. data/pulumi/codegen/loader.proto +51 -0
  44. data/pulumi/codegen/mapper.proto +74 -0
  45. data/pulumi/converter.proto +94 -0
  46. data/pulumi/engine.proto +113 -0
  47. data/pulumi/errors.proto +38 -0
  48. data/pulumi/events.proto +39 -0
  49. data/pulumi/language.proto +653 -0
  50. data/pulumi/plugin.proto +66 -0
  51. data/pulumi/provider.proto +1227 -0
  52. data/pulumi/resource.proto +394 -0
  53. data/pulumi/resource_status.proto +172 -0
  54. data/pulumi/source.proto +36 -0
  55. data/pulumi/testing/language.proto +106 -0
  56. data/sig/pulumi/language/ruby.rbs +8 -0
  57. metadata +125 -0
@@ -0,0 +1,394 @@
1
+ // Copyright 2016-2022, Pulumi Corporation.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ import "google/protobuf/empty.proto";
18
+ import "google/protobuf/struct.proto";
19
+ import "pulumi/provider.proto";
20
+ import "pulumi/alias.proto";
21
+ import "pulumi/source.proto";
22
+ import "pulumi/callback.proto";
23
+
24
+ package pulumirpc;
25
+
26
+ option go_package = "github.com/pulumi/pulumi/sdk/v3/proto/go;pulumirpc";
27
+
28
+ // ResourceMonitor is the interface a source uses to talk back to the planning monitor orchestrating the execution.
29
+ service ResourceMonitor {
30
+ rpc SupportsFeature(SupportsFeatureRequest) returns (SupportsFeatureResponse) {}
31
+ rpc Invoke(ResourceInvokeRequest) returns (InvokeResponse) {}
32
+ rpc Call(ResourceCallRequest) returns (CallResponse) {}
33
+ rpc ReadResource(ReadResourceRequest) returns (ReadResourceResponse) {}
34
+ rpc RegisterResource(RegisterResourceRequest) returns (RegisterResourceResponse) {}
35
+ rpc RegisterResourceOutputs(RegisterResourceOutputsRequest) returns (google.protobuf.Empty) {}
36
+
37
+ // Register a resource transform for the stack
38
+ rpc RegisterStackTransform(Callback) returns (google.protobuf.Empty) {}
39
+ // Register an invoke transform for the stack
40
+ rpc RegisterStackInvokeTransform(Callback) returns (google.protobuf.Empty) {}
41
+
42
+ // Register a resource hook that can be called by the engine during certain
43
+ // steps of a resource's lifecycle.
44
+ rpc RegisterResourceHook(RegisterResourceHookRequest) returns (google.protobuf.Empty) {}
45
+
46
+ // Register an error hook that can be called by the engine when an operation fails and is retryable.
47
+ //
48
+ // Error hooks are a separate type of hook to other life cycle hooks as they have different inputs and outputs.
49
+ rpc RegisterErrorHook(RegisterErrorHookRequest) returns (google.protobuf.Empty) {}
50
+
51
+ // Registers a package and allocates a packageRef. The same package can be registered multiple times in Pulumi.
52
+ // Multiple requests are idempotent and guaranteed to return the same result.
53
+ rpc RegisterPackage(RegisterPackageRequest) returns (RegisterPackageResponse) {}
54
+
55
+ // SignalAndWaitForShutdown lets the resource monitor know that no more
56
+ // events will be generated. This call blocks until the resource monitor is
57
+ // finished, which will happen once all the steps have executed. This allows
58
+ // the language runtime to stay running and handle callback requests, even
59
+ // after the user program has completed. Runtime SDKs should call this after
60
+ // executing the user's program. This can only be called once.
61
+ rpc SignalAndWaitForShutdown(google.protobuf.Empty) returns (google.protobuf.Empty) {}
62
+ }
63
+
64
+ // SupportsFeatureRequest allows a client to test if the resource monitor supports a certain feature, which it may use
65
+ // to control the format or types of messages it sends.
66
+ message SupportsFeatureRequest {
67
+ string id = 1; // the ID of the feature to test support for.
68
+ }
69
+
70
+ message SupportsFeatureResponse {
71
+ bool hasSupport = 1; // true when the resource monitor supports this feature.
72
+ }
73
+
74
+ // There is a clear distinction here between the "properties" bag sent across the wire as part of these RPCs and
75
+ // properties that exist on Pulumi resources as projected into the target language. It is important to call out that the
76
+ // properties here are in the format that a provider will expect. This is to say that they are usually in camel case.
77
+ // If a language wants to project properties in a format *other* than camel-case, it is the job of the language to
78
+ // ensure that the properties are translated into camel case before invoking an RPC.
79
+
80
+ // ReadResourceRequest contains enough information to uniquely qualify and read a resource's state.
81
+ message ReadResourceRequest {
82
+ string id = 1; // the ID of the resource to read.
83
+ string type = 2; // the type of the resource object.
84
+ string name = 3; // the name, for URN purposes, of the object.
85
+ string parent = 4; // an optional parent URN that this child resource belongs to.
86
+ google.protobuf.Struct properties = 5; // optional state sufficient to uniquely identify the resource.
87
+ repeated string dependencies = 6; // a list of URNs that this read depends on, as observed by the language host.
88
+ string provider = 7; // an optional reference to the provider to use for this read.
89
+ string version = 8; // the version of the provider to use when servicing this request.
90
+ bool acceptSecrets = 9; // when true operations should return secrets as strongly typed.
91
+ repeated string additionalSecretOutputs = 10; // a list of output properties that should also be treated as secret, in addition to ones we detect.
92
+
93
+ // We used to declare an alias field here, but nothing ever used it. But to ensure we don't confuse any
94
+ // old plugins/monitors making sure that field doesn't get reused.
95
+ reserved "aliases";
96
+ reserved 11;
97
+
98
+ bool acceptResources = 12; // when true operations should return resource references as strongly typed.
99
+ string pluginDownloadURL = 13; // the server url of the provider to use when servicing this request.
100
+ map<string, bytes> pluginChecksums = 15; // a map of checksums of the provider to use when servicing this request.
101
+
102
+ SourcePosition sourcePosition = 14; // the optional source position of the user code that initiated the read.
103
+ StackTrace stackTrace = 17; // the optional stack trace at the time of the request.
104
+ string parentStackTraceHandle = 18; // the optional parent stack trace handle for the request. Supports stitching stack traces across plugins.
105
+
106
+ string packageRef = 16; // a reference from RegisterPackageRequest.
107
+ }
108
+
109
+ // ReadResourceResponse contains the result of reading a resource's state.
110
+ message ReadResourceResponse {
111
+ string urn = 1; // the URN for this resource.
112
+ google.protobuf.Struct properties = 2; // the state of the resource read from the live environment.
113
+ }
114
+
115
+ // RegisterResourceRequest contains information about a resource object that was newly allocated.
116
+ message RegisterResourceRequest {
117
+ // PropertyDependencies describes the resources that a particular property depends on.
118
+ message PropertyDependencies {
119
+ repeated string urns = 1; // A list of URNs this property depends on.
120
+ }
121
+ // CustomTimeouts allows a user to be able to create a set of custom timeout parameters.
122
+ message CustomTimeouts {
123
+ string create = 1; // The create resource timeout represented as a string e.g. 5m.
124
+ string update = 2; // The update resource timeout represented as a string e.g. 5m.
125
+ string delete = 3; // The delete resource timeout represented as a string e.g. 5m.
126
+ }
127
+
128
+ string type = 1; // the type of the object allocated.
129
+ string name = 2; // the name, for URN purposes, of the object.
130
+ string parent = 3; // an optional parent URN that this child resource belongs to.
131
+ bool custom = 4; // true if the resource is a custom, managed by a plugin's CRUD operations.
132
+ google.protobuf.Struct object = 5; // an object produced by the interpreter/source.
133
+ optional bool protect = 6; // true if the resource should be marked protected.
134
+ repeated string dependencies = 7; // a list of URNs that this resource depends on, as observed by the language host.
135
+ string provider = 8; // an optional reference to the provider to manage this resource's CRUD operations.
136
+ map<string, PropertyDependencies> propertyDependencies = 9; // a map from property keys to the dependencies of the property.
137
+ bool deleteBeforeReplace = 10; // true if this resource should be deleted before replacement.
138
+ string version = 11; // the version of the provider to use when servicing this request.
139
+ repeated string ignoreChanges = 12; // a list of property selectors to ignore during updates.
140
+ bool acceptSecrets = 13; // when true operations should return secrets as strongly typed.
141
+ repeated string additionalSecretOutputs = 14; // a list of output properties that should also be treated as secret, in addition to ones we detect.
142
+ repeated string aliasURNs = 15; // a list of additional URNs that should be considered the same.
143
+ string importId = 16; // if set, this resource's state should be imported from the given ID.
144
+ CustomTimeouts customTimeouts = 17; // ability to pass a custom Timeout block.
145
+ bool deleteBeforeReplaceDefined = 18; // true if the deleteBeforeReplace property should be treated as defined even if it is false.
146
+ bool supportsPartialValues = 19; // true if the request is from an SDK that supports partially-known properties during preview.
147
+ bool remote = 20; // true if the resource is a plugin-managed component resource.
148
+ bool acceptResources = 21; // when true operations should return resource references as strongly typed.
149
+ map<string, string> providers = 22; // an optional reference to the provider map to manage this resource's CRUD operations.
150
+ repeated string replaceOnChanges = 23; // a list of properties that if changed should force a replacement.
151
+ string pluginDownloadURL = 24; // the server URL of the provider to use when servicing this request.
152
+ map<string, bytes> pluginChecksums = 30; // a map of checksums expected for the provider plugin.
153
+ optional bool retainOnDelete = 25; // if true the engine will not call the resource providers delete method for this resource.
154
+ repeated Alias aliases = 26; // a list of additional aliases that should be considered the same.
155
+ string deletedWith = 27; // if set the engine will not call the resource providers delete method for this resource when specified resource is deleted.
156
+ repeated string replace_with = 38; // if set the engine will replace this resource when any of the specified resources are replaced.
157
+ google.protobuf.Value replacement_trigger = 39; // if set, the engine will diff this with the last recorded value, and trigger a replace if they are not equal.
158
+
159
+ // Indicates that alias specs are specified correctly according to the spec.
160
+ // Older versions of the Node.js SDK did not send alias specs correctly.
161
+ // If this is not set to true and the engine detects the request is from the
162
+ // Node.js runtime, the engine will transform incorrect alias specs into
163
+ // correct ones.
164
+ // Other SDKs that are correctly specifying alias specs could set this to
165
+ // true, but it's not necessary.
166
+ bool aliasSpecs = 28;
167
+
168
+ SourcePosition sourcePosition = 29; // the optional source position of the user code that initiated the register.
169
+ StackTrace stackTrace = 35; // the optional stack trace at the time of the request.
170
+ string parentStackTraceHandle = 36; // the optional parent stack trace handle for the request. Supports stitching stack traces across plugins.
171
+
172
+ repeated Callback transforms = 31; // a list of transforms to apply to the resource before registering it.
173
+ bool supportsResultReporting = 32; // true if the request is from an SDK that supports the result field in the response.
174
+
175
+ string packageRef = 33; // a reference from RegisterPackageRequest.
176
+
177
+ message ResourceHooksBinding {
178
+ repeated string before_create = 1;
179
+ repeated string after_create = 2;
180
+ repeated string before_update = 3;
181
+ repeated string after_update = 4;
182
+ repeated string before_delete = 5;
183
+ repeated string after_delete = 6;
184
+ repeated string on_error = 7;
185
+ }
186
+
187
+ // The resource hooks that should run at certain points in the resource's lifecycle.
188
+ optional ResourceHooksBinding hooks = 34;
189
+ repeated string hideDiffs = 37;
190
+ map<string, string> envVarMappings = 41; // environment variable remappings for provider resources (NEW_KEY -> OLD_KEY)
191
+ }
192
+
193
+ enum Result {
194
+ SUCCESS = 0;
195
+ FAIL = 1;
196
+ SKIP = 2;
197
+ }
198
+
199
+ // RegisterResourceResponse is returned by the engine after a resource has finished being initialized. It includes the
200
+ // auto-assigned URN, the provider-assigned ID, and any other properties initialized by the engine.
201
+ message RegisterResourceResponse {
202
+ // PropertyDependencies describes the resources that a particular property depends on.
203
+ message PropertyDependencies {
204
+ repeated string urns = 1; // A list of URNs this property depends on.
205
+ }
206
+
207
+ string urn = 1; // the URN assigned by the engine.
208
+ string id = 2; // the unique ID assigned by the provider.
209
+ google.protobuf.Struct object = 3; // the resulting object properties, including provider defaults.
210
+ bool stable = 4; // if true, the object's state is stable and may be trusted not to change.
211
+ repeated string stables = 5; // an optional list of guaranteed-stable properties.
212
+ map<string, PropertyDependencies> propertyDependencies = 6; // a map from property keys to the dependencies of the property.
213
+ Result result = 7; // the reason, whether the resource registration was successful, failed, or skipped.
214
+ }
215
+
216
+ // RegisterResourceOutputsRequest adds extra resource outputs created by the program after registration has occurred.
217
+ message RegisterResourceOutputsRequest {
218
+ string urn = 1; // the URN for the resource to attach output properties to.
219
+ google.protobuf.Struct outputs = 2; // additional output properties to add to the existing resource.
220
+ }
221
+
222
+ message ResourceInvokeRequest {
223
+ string tok = 1; // the function token to invoke.
224
+ google.protobuf.Struct args = 2; // the arguments for the function invocation.
225
+ string provider = 3; // an optional reference to the provider version to use for this invoke.
226
+ string version = 4; // the version of the provider to use when servicing this request.
227
+ bool acceptResources = 5; // when true operations should return resource references as strongly typed.
228
+ string pluginDownloadURL = 6; // an optional reference to the provider url to use for this invoke.
229
+ map<string, bytes> pluginChecksums = 8; // a map of checksums expected for the provider plugin.
230
+
231
+ SourcePosition sourcePosition = 7; // the optional source position of the user code that initiated the invoke.
232
+ StackTrace stackTrace = 10; // the optional stack trace at the time of the request.
233
+ string parentStackTraceHandle = 11; // the optional parent stack trace handle for the request. Supports stitching stack traces across plugins.
234
+
235
+ string packageRef = 9; // a reference from RegisterPackageRequest.
236
+ }
237
+
238
+ message ResourceCallRequest {
239
+ // ArgumentDependencies describes the resources that a particular argument depends on.
240
+ message ArgumentDependencies {
241
+ repeated string urns = 1; // A list of URNs this argument depends on.
242
+ }
243
+
244
+ string tok = 1; // the function token to invoke.
245
+ google.protobuf.Struct args = 2; // the arguments for the function invocation.
246
+ map<string, ArgumentDependencies> argDependencies = 3; // a map from argument keys to the dependencies of the argument.
247
+ string provider = 4; // an optional reference to the provider to use for this invoke.
248
+ string version = 5; // the version of the provider to use when servicing this request.
249
+ string pluginDownloadURL = 13; // the pluginDownloadURL of the provider to use when servicing this request.
250
+ map<string, bytes> pluginChecksums = 16; // a map of checksums of the provider to use when servicing this request.
251
+
252
+ // We used to send CallRequest for both provider calls and monitor calls, despite them being different.
253
+ // We've now split them but need to make sure we don't confuse any old plugins/monitors making sure those
254
+ // fields don't get reused.
255
+ reserved 6, 7, 8, 9, 10, 11, 12, 14;
256
+ reserved "project", "stack", "config", "configSecretKeys", "dryRun", "parallel", "monitorEndpoint", "organization";
257
+
258
+ SourcePosition sourcePosition = 15; // the optional source position of the user code that initiated the call.
259
+ StackTrace stackTrace = 18; // the optional stack trace at the time of the request.
260
+ string parentStackTraceHandle = 19; // the optional parent stack trace handle for the request. Supports stitching stack traces across plugins.
261
+
262
+ string packageRef = 17; // a reference from RegisterPackageRequest.
263
+ }
264
+
265
+ // TransformResourceOptions is a subset of all resource options that are relevant to transforms.
266
+ message TransformResourceOptions {
267
+ repeated string depends_on = 1;
268
+ optional bool protect = 2;
269
+ repeated string ignore_changes = 3;
270
+ repeated string replace_on_changes = 4;
271
+ string version = 5;
272
+ repeated Alias aliases = 6;
273
+ string provider = 7;
274
+ RegisterResourceRequest.CustomTimeouts custom_timeouts = 8;
275
+ string plugin_download_url = 9;
276
+ optional bool retain_on_delete = 10;
277
+ string deleted_with = 11;
278
+ optional bool delete_before_replace = 12;
279
+ repeated string additional_secret_outputs = 13;
280
+ map<string, string> providers = 14;
281
+ map<string, bytes> plugin_checksums = 15;
282
+ RegisterResourceRequest.ResourceHooksBinding hooks = 16;
283
+ string import = 17;
284
+ repeated string hide_diff = 18;
285
+ repeated string replace_with = 19;
286
+ google.protobuf.Value replacement_trigger = 20;
287
+ }
288
+
289
+ message TransformRequest {
290
+ string type = 1; // the type of the resource.
291
+ string name = 2; // the name of the resource.
292
+ bool custom = 3; // true if the resource is a custom resource, else it's a component resource.
293
+ string parent = 4; // the parent of the resource, this can't be changed by the transform.
294
+ google.protobuf.Struct properties = 5; // the input properties of the resource.
295
+ TransformResourceOptions options = 6; // the options for the resource.
296
+ }
297
+
298
+ message TransformResponse {
299
+ google.protobuf.Struct properties = 1; // the transformed input properties.
300
+ TransformResourceOptions options = 2; // the options for the resource.
301
+ }
302
+
303
+ // TransformInvokeRequest is the request object for the TransformInvoke RPC.
304
+ message TransformInvokeRequest {
305
+ string token = 1; // the token for the invoke request.
306
+ google.protobuf.Struct args = 2; // the input args of the resource.
307
+ TransformInvokeOptions options = 3; // the options for the resource.
308
+ }
309
+
310
+ // TransformInvokeResponse is the response object for the TransformInvoke RPC.
311
+ message TransformInvokeResponse {
312
+ google.protobuf.Struct args = 1; // the transformed input args.
313
+ TransformInvokeOptions options = 2; // the options for the resource.
314
+ }
315
+
316
+ // TransformInvokeOptions is a subset of all invoke options that are relevant to transforms.
317
+ message TransformInvokeOptions {
318
+ string provider = 1;
319
+ string plugin_download_url = 2;
320
+ string version = 3;
321
+ map<string, bytes> plugin_checksums = 4;
322
+ }
323
+
324
+ // ResourceHookRequest is the request object for resource hook callbacks in CallbackInvokeRequest.
325
+ message ResourceHookRequest {
326
+ string urn = 1; // the urn of the resource for which the hook is called.
327
+ string id = 2; // the optional urn of the resource for which the hook is called.
328
+ string name = 3; // the name of the resource for which the hook is called.
329
+ string type = 4; // the type of the resource for which the hook is called.
330
+ google.protobuf.Struct new_inputs = 5; // the optional checked new inputs of the resource.
331
+ google.protobuf.Struct old_inputs = 6; // the optional checked old inputs of the resource.
332
+ google.protobuf.Struct new_outputs = 7; // the optional new outputs of the resource.
333
+ google.protobuf.Struct old_outputs = 8; // the optional old outputs of the resource.
334
+ }
335
+
336
+ // ResourceHookResponse is the response object for resource hook callbacks in CallbackInvokeResponse.
337
+ message ResourceHookResponse {
338
+ string error = 1; // an optional error message to return from the hook.
339
+ }
340
+
341
+ // ErrorHookRequest is the request object for error hook callbacks in CallbackInvokeRequest.
342
+ message ErrorHookRequest {
343
+ string urn = 1; // the urn of the resource for which the hook is called.
344
+ string id = 2; // the optional urn of the resource for which the hook is called.
345
+ string name = 3; // the name of the resource for which the hook is called.
346
+ string type = 4; // the type of the resource for which the hook is called.
347
+ google.protobuf.Struct new_inputs = 5; // the optional checked new inputs of the resource.
348
+ google.protobuf.Struct old_inputs = 6; // the optional checked old inputs of the resource.
349
+ google.protobuf.Struct old_outputs = 7; // the optional old outputs of the resource.
350
+ string failed_operation = 8; // the operation that failed (create, read, update, or delete).
351
+ repeated string errors = 9; // the errors that have been seen so far (newest-first).
352
+ }
353
+
354
+ // ErrorHookResponse is the response object for error hook callbacks in CallbackInvokeResponse.
355
+ message ErrorHookResponse {
356
+ string error = 1; // an optional error message to return from the hook.
357
+ bool retry = 2; // whether we should retry the operation.
358
+ }
359
+
360
+ message RegisterPackageRequest {
361
+ string name = 1; // the plugin name.
362
+ string version = 2; // the plugin version.
363
+ string download_url = 3; // the optional plugin download url.
364
+ map<string, bytes> checksums = 4; // the optional plugin checksums.
365
+ Parameterization parameterization = 5; // the optional parameterization for this package.
366
+ }
367
+
368
+ message RegisterPackageResponse {
369
+ // The UUID package reference for this registered package.
370
+ //
371
+ // Lifecycle methods accept this reference in the 'packageRef' field.
372
+ string ref = 1;
373
+ }
374
+
375
+ message Parameterization {
376
+ string name = 1; // the parameterized package name.
377
+ string version = 2; // the parameterized package version.
378
+ bytes value = 3; // the parameter value for the parameterized package.
379
+ }
380
+
381
+ message RegisterResourceHookRequest {
382
+ // The name of the hook. Must be unique within a program, registering the
383
+ // same name twice is an error.
384
+ string name = 1;
385
+ Callback callback = 2; // the callback that the engine can call to run the hook.
386
+ bool on_dry_run = 3; // whether to run the hook on dry runs.
387
+ }
388
+
389
+ message RegisterErrorHookRequest {
390
+ // The name of the hook. Must be unique within a program, registering the
391
+ // same name twice is an error.
392
+ string name = 1;
393
+ Callback callback = 2; // the callback that the engine can call to run the hook.
394
+ }
@@ -0,0 +1,172 @@
1
+ // Copyright 2025, Pulumi Corporation.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ import "google/protobuf/struct.proto";
18
+ import "pulumi/provider.proto";
19
+
20
+ package pulumirpc;
21
+
22
+ option go_package = "github.com/pulumi/pulumi/sdk/v3/proto/go;pulumirpc";
23
+
24
+ // ResourceStatus is an interface that can be called from a resource provider to update status about a resource.
25
+ service ResourceStatus {
26
+ // `PublishViewSteps` is used to publish a series of steps for a view resource.
27
+ // Views can be materialized via create and update steps, and more complex
28
+ // changes, such as replacements, can be modeled as a series of steps.
29
+ // The engine does not actually apply these steps, but rather flows them through
30
+ // the engine such that the view resources are written to state and the view
31
+ // resources are displayed in the UI.
32
+ rpc PublishViewSteps(PublishViewStepsRequest) returns (PublishViewStepsResponse) {}
33
+ }
34
+
35
+ // `PublishViewStepsRequest` is the type of requests sent as part of a
36
+ // [](pulumirpc.ResourceStatus.PublishViewSteps) call.
37
+ message PublishViewStepsRequest {
38
+ // The service context token.
39
+ string token = 1;
40
+
41
+ // The steps to publish.
42
+ repeated ViewStep steps = 2;
43
+ }
44
+
45
+ // `PublishViewStepsResponse` is the type of responses sent as part of a
46
+ // [](pulumirpc.ResourceStatus.PublishViewSteps) call.
47
+ message PublishViewStepsResponse {
48
+ }
49
+
50
+ // `ViewStep` represents a deployment operation step for a view resource.
51
+ message ViewStep {
52
+ // Represents the kind of operation performed by a step.
53
+ enum Op {
54
+ // An unspecified operation.
55
+ UNSPECIFIED = 0;
56
+
57
+ // Nothing to do.
58
+ SAME = 1;
59
+
60
+ // Creating a new resource.
61
+ CREATE = 2;
62
+
63
+ // Updating an existing resource.
64
+ UPDATE = 3;
65
+
66
+ // Deleting an existing resource.
67
+ DELETE = 4;
68
+
69
+ // Replacing a resource with a new one.
70
+ REPLACE = 5;
71
+
72
+ // Creating a new resource for a replacement.
73
+ CREATE_REPLACEMENT = 6;
74
+
75
+ // Deleting an existing resource after replacement.
76
+ DELETE_REPLACED = 7;
77
+
78
+ // Reading an existing resource.
79
+ READ = 8;
80
+
81
+ // Reading an existing resource for a replacement.
82
+ READ_REPLACEMENT = 9;
83
+
84
+ // Refreshing an existing resource.
85
+ REFRESH = 10;
86
+
87
+ // Removing a resource that was read.
88
+ READ_DISCARD = 11;
89
+
90
+ // Discarding a read resource that was replaced.
91
+ DISCARD_REPLACED = 12;
92
+
93
+ // Removing a pending replace resource.
94
+ REMOVE_PENDING_REPLACE = 13;
95
+
96
+ // Import an existing resource.
97
+ IMPORT = 14;
98
+
99
+ // Replace an existing resource.
100
+ IMPORT_REPLACEMENT = 15;
101
+ }
102
+
103
+ // Status is returned when an error has occurred during a resource provider operation.
104
+ // It indicates whether the operation could be rolled back cleanly (OK). If not, it
105
+ // means the resource was left in an indeterminate state.
106
+ enum Status {
107
+ OK = 0;
108
+ PARTIAL_FAILURE = 1;
109
+ UNKNOWN = 2;
110
+ }
111
+
112
+ // The status of the operation.
113
+ Status status = 1;
114
+
115
+ // An optional error message indicating the operation failed.
116
+ string error = 2;
117
+
118
+ // The operation being performed.
119
+ Op op = 3;
120
+
121
+ // The type of the view resource.
122
+ string type = 4;
123
+
124
+ // The name of the view resource.
125
+ string name = 5;
126
+
127
+ // The state of the view resource before performing the step.
128
+ ViewStepState old = 6;
129
+
130
+ // The state of the view resource after performing the step.
131
+ ViewStepState new = 7;
132
+
133
+ // The keys causing a replacement (only applicable for "create" and "replace" ops).
134
+ repeated string keys = 8;
135
+
136
+ // The keys that changed with this step.
137
+ repeated string diffs = 9;
138
+
139
+ // A detailed diff is a map from [property paths](property-paths) to [](pulumirpc.PropertyDiff)s,
140
+ // which describe the kind of change that occurred to the property located at that path.
141
+ map<string, PropertyDiff> detailed_diff = 10;
142
+
143
+ // Whether the detailed diff is present.
144
+ bool has_detailed_diff = 11;
145
+ }
146
+
147
+ // `ViewStepState` represents the state of a view resource.
148
+ message ViewStepState {
149
+ // The type of the view resource.
150
+ string type = 1;
151
+
152
+ // The name of the view resource.
153
+ string name = 2;
154
+
155
+ // An optional type of the parent view resource. By default, a view resource will
156
+ // be a child of the owning resource, but views can be nested within other views,
157
+ // as long as they're all under the same owner. Both parent_type and parent_name
158
+ // must be set together.
159
+ string parent_type = 3;
160
+
161
+ // An optional name of the parent view resource. By default, a view resource will
162
+ // be a child of the owning resource, but views can be nested within other views,
163
+ // as long as they're all under the same owner. Both parent_type and parent_name
164
+ // must be set together.
165
+ string parent_name = 4;
166
+
167
+ // The view resource's inputs.
168
+ google.protobuf.Struct inputs = 5;
169
+
170
+ // The view resource's outputs.
171
+ google.protobuf.Struct outputs = 6;
172
+ }
@@ -0,0 +1,36 @@
1
+ // Copyright 2016-2022, Pulumi Corporation.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package pulumirpc;
18
+
19
+ option go_package = "github.com/pulumi/pulumi/sdk/v3/proto/go;pulumirpc";
20
+
21
+ // A SourcePosition represents a position in a source file.
22
+ message SourcePosition {
23
+ string uri = 1; // The URI of the file. Currently only the file scheme with an absolute path is supported.
24
+ int32 line = 2; // The line in the file
25
+ int32 column = 3; // The column in the line
26
+ }
27
+
28
+ // A StackFrame represents a single stack frame.
29
+ message StackFrame {
30
+ SourcePosition pc = 1; // The position of the frame's program counter. Optional.
31
+ }
32
+
33
+ // A StackTrace represents the frames on the stack at the point of an RPC call.
34
+ message StackTrace {
35
+ repeated StackFrame frames = 1; // The frames on the stack.
36
+ }