Skip to content

Commit 79d3bec

Browse files
authored
Update proto files (#310)
Update proto files to the latest published from pulumi to get access to new protocol features such as invoke transforms. (Similar to #233).
1 parent 13e3994 commit 79d3bec

File tree

3 files changed

+68
-20
lines changed

3 files changed

+68
-20
lines changed

proto/pulumi/language.proto

+3
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ message RuntimeOptionPrompt {
171171
RuntimeOptionType promptType = 1;
172172
string stringValue = 2;
173173
int32 int32Value = 3;
174+
string displayName = 4;
174175
}
175176

176177
string key = 1;
@@ -205,6 +206,8 @@ message GenerateProgramRequest {
205206
map<string, string> source = 1;
206207
// The target of a codegen.LoaderServer to use for loading schemas.
207208
string loader_target = 2;
209+
// if PCL binding should be strict or not.
210+
bool strict = 3;
208211
}
209212

210213
message GenerateProgramResponse {

proto/pulumi/provider.proto

+20-6
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ service ResourceProvider {
3737
//
3838
// Parameterize should work the same for both the `ParametersArgs` input and the `ParametersValue` input. Either way
3939
// should return the sub-package name and version (which for `ParametersValue` should match the given input).
40-
//
40+
//
4141
// For extension resources their CRUD operations will include the version of which sub-package they correspond to.
4242
rpc Parameterize(ParameterizeRequest) returns (ParameterizeResponse) {}
4343

@@ -116,7 +116,7 @@ message ParameterizeRequest {
116116
// The sub-package version for this sub-schema parameterization.
117117
string version = 2;
118118
// The embedded value from the sub-package.
119-
google.protobuf.Value value = 3;
119+
bytes value = 3;
120120
}
121121

122122
oneof parameters {
@@ -229,7 +229,15 @@ message CallResponse {
229229
message CheckRequest {
230230
string urn = 1; // the Pulumi URN for this resource.
231231
google.protobuf.Struct olds = 2; // the old Pulumi inputs for this resource, if any.
232-
google.protobuf.Struct news = 3; // the new Pulumi inputs for this resource.
232+
233+
// the new Pulumi inputs for this resource.
234+
//
235+
// Note that if the user specifies the ignoreChanges resource option, the value of news passed
236+
// to the provider here may differ from the values written in the program source. It will be pre-processed by
237+
// replacing every ignoreChanges property by a matching value from the old inputs stored in the state.
238+
//
239+
// See also: https://www.pulumi.com/docs/concepts/options/ignorechanges/
240+
google.protobuf.Struct news = 3;
233241

234242
// We used to send sequenceNumber but that has been replaced by randomSeed.
235243
reserved 4;
@@ -252,7 +260,10 @@ message DiffRequest {
252260
string id = 1; // the ID of the resource to diff.
253261
string urn = 2; // the Pulumi URN for this resource.
254262
google.protobuf.Struct olds = 3; // the old output values of resource to diff.
255-
google.protobuf.Struct news = 4; // the new input values of resource to diff.
263+
264+
// the new input values of resource to diff, copied from CheckResponse.inputs.
265+
google.protobuf.Struct news = 4;
266+
256267
repeated string ignoreChanges = 5; // a set of property paths that should be treated as unchanged.
257268
google.protobuf.Struct old_inputs = 6; // the old input values of the resource to diff.
258269
}
@@ -351,7 +362,10 @@ message UpdateRequest {
351362
string id = 1; // the ID of the resource to update.
352363
string urn = 2; // the Pulumi URN for this resource.
353364
google.protobuf.Struct olds = 3; // the old values of provider inputs for the resource to update.
354-
google.protobuf.Struct news = 4; // the new values of provider inputs for the resource to update.
365+
366+
// the new values of provider inputs for the resource to update, copied from CheckResponse.inputs.
367+
google.protobuf.Struct news = 4;
368+
355369
double timeout = 5; // the update request timeout represented in seconds.
356370
repeated string ignoreChanges = 6; // a set of property paths that should be treated as unchanged.
357371
bool preview = 7; // true if this is a preview and the provider should not actually create the resource.
@@ -488,4 +502,4 @@ message GetMappingsResponse {
488502
// the provider keys this provider can supply mappings for. For example the Pulumi provider "terraform-template"
489503
// would return ["template"] for this.
490504
repeated string providers = 1;
491-
}
505+
}

proto/pulumi/resource.proto

+45-14
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ service ResourceMonitor {
3535
rpc RegisterResource(RegisterResourceRequest) returns (RegisterResourceResponse) {}
3636
rpc RegisterResourceOutputs(RegisterResourceOutputsRequest) returns (google.protobuf.Empty) {}
3737

38+
// Register a resource transform for the stack
3839
rpc RegisterStackTransform(Callback) returns (google.protobuf.Empty) {}
40+
// Register an invoke transform for the stack
41+
rpc RegisterStackInvokeTransform(Callback) returns (google.protobuf.Empty) {}
3942

40-
rpc RegisterProvider(RegisterProviderRequest) returns (RegisterProviderResponse) {}
43+
rpc RegisterPackage(RegisterPackageRequest) returns (RegisterPackageResponse) {}
4144
}
4245

4346
// SupportsFeatureRequest allows a client to test if the resource monitor supports a certain feature, which it may use
@@ -79,6 +82,8 @@ message ReadResourceRequest {
7982
map<string, bytes> pluginChecksums = 15; // a map of checksums of the provider to use when servicing this request.
8083

8184
SourcePosition sourcePosition = 14; // the optional source position of the user code that initiated the read.
85+
86+
string packageRef = 16; // a reference from RegisterProviderRequest.
8287
}
8388

8489
// ReadResourceResponse contains the result of reading a resource's state.
@@ -142,6 +147,8 @@ message RegisterResourceRequest {
142147

143148
repeated Callback transforms = 31; // a list of transforms to apply to the resource before registering it.
144149
bool supportsResultReporting = 32; // true if the request is from an SDK that supports the result field in the response.
150+
151+
string packageRef = 33; // a reference from RegisterProviderRequest.
145152
}
146153

147154
enum Result {
@@ -183,6 +190,8 @@ message ResourceInvokeRequest {
183190
map<string, bytes> pluginChecksums = 8; // a map of checksums expected for the provider plugin.
184191

185192
SourcePosition sourcePosition = 7; // the optional source position of the user code that initiated the invoke.
193+
194+
string packageRef = 9; // a reference from RegisterProviderRequest.
186195
}
187196

188197
message ResourceCallRequest {
@@ -206,6 +215,7 @@ message ResourceCallRequest {
206215
reserved "project", "stack", "config", "configSecretKeys", "dryRun", "parallel", "monitorEndpoint", "organization";
207216

208217
SourcePosition sourcePosition = 15; // the optional source position of the user code that initiated the call.
218+
string packageRef = 17; // a reference from RegisterProviderRequest.
209219
}
210220

211221
// TransformResourceOptions is a subset of all resource options that are relevant to transforms.
@@ -241,21 +251,42 @@ message TransformResponse {
241251
TransformResourceOptions options = 2; // the options for the resource.
242252
}
243253

244-
message RegisterProviderRequest {
245-
string name = 1;
246-
string version = 2;
247-
string plugin_download_url = 3;
254+
// TransformInvokeRequest is the request object for the TransformInvoke RPC.
255+
message TransformInvokeRequest {
256+
string token = 1; // the token for the invoke request.
257+
google.protobuf.Struct args = 2; // the input args of the resource.
258+
TransformInvokeOptions options = 3; // the options for the resource.
259+
}
260+
261+
// TransformInvokeResponse is the response object for the TransformInvoke RPC.
262+
message TransformInvokeResponse {
263+
google.protobuf.Struct args = 1; // the transformed input args.
264+
TransformInvokeOptions options = 2; // the options for the resource.
265+
}
266+
267+
// TransformInvokeOptions is a subset of all invoke options that are relevant to transforms.
268+
message TransformInvokeOptions {
269+
string provider = 1;
270+
string plugin_download_url = 2;
271+
string version = 3;
248272
map<string, bytes> plugin_checksums = 4;
249-
ProviderParameter parameter = 5;
250273
}
251274

252-
message RegisterProviderResponse {
253-
// The UUID package reference for this registered provider package.
254-
string ref = 1;
275+
message RegisterPackageRequest {
276+
string name = 1; // the plugin name.
277+
string version = 2; // the plugin version.
278+
string download_url = 3; // the optional plugin download url.
279+
map<string, bytes> checksums = 4; // the optional plugin checksums.
280+
Parameterization parameterization = 5; // the optional parameterization for this package.
255281
}
256282

257-
message ProviderParameter {
258-
string name = 1;
259-
string version = 2;
260-
google.protobuf.Value value = 3;
261-
}
283+
message RegisterPackageResponse {
284+
// The UUID package reference for this registered package.
285+
string ref = 1;
286+
}
287+
288+
message Parameterization {
289+
string name = 1; // the parameterized package name.
290+
string version = 2; // the parameterized package version.
291+
bytes value = 3; // the parameter value for the parameterized package.
292+
}

0 commit comments

Comments
 (0)