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,38 @@
1
+ // Copyright 2016-2018, 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
+ message Alias {
22
+ message Spec {
23
+ string name = 1; // The previous name of the resource. If none is provided, we will use the current name.
24
+ string type = 2; // The previous type of the resource. If none is provided, we will use the current resoource type.
25
+ string stack = 3; // The previous stack of the resource. If not set, the current stack of the resource is used.
26
+ string project = 4; // The previous project of the resource. If not set, the current project of the resource is used.
27
+
28
+ // The previous parent of the resource. If not set, the current parent of the resource is used.
29
+ oneof parent {
30
+ string parentUrn = 5; // The urn of the previous parent.
31
+ bool noParent = 6; // Used to indicate the resource previously had no parent. If false this property is ignored.
32
+ }
33
+ }
34
+ oneof alias {
35
+ string urn = 1; // The previous urn to alias to.
36
+ Spec spec = 2; // An alias specification.
37
+ }
38
+ }
@@ -0,0 +1,293 @@
1
+ // Copyright 2016-2018, 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 "pulumi/plugin.proto";
18
+ import "google/protobuf/empty.proto";
19
+ import "google/protobuf/struct.proto";
20
+
21
+ package pulumirpc;
22
+
23
+ option go_package = "github.com/pulumi/pulumi/sdk/v3/proto/go;pulumirpc";
24
+
25
+ // Analyzer provides a pluggable interface for checking resource definitions against some number of
26
+ // resource policies. It is intentionally open-ended, allowing for implementations that check
27
+ // everything from raw resource definitions to entire projects/stacks/snapshots for arbitrary
28
+ // issues -- style, policy, correctness, security, and so on.
29
+ service Analyzer {
30
+ // Analyze analyzes a single resource object, and returns any errors that it finds.
31
+ // Called with the "inputs" to the resource, before it is updated.
32
+ rpc Analyze(AnalyzeRequest) returns (AnalyzeResponse) {}
33
+ // AnalyzeStack analyzes all resources within a stack, at the end of a successful
34
+ // preview or update. The provided resources are the "outputs", after any mutations
35
+ // have taken place.
36
+ rpc AnalyzeStack(AnalyzeStackRequest) returns (AnalyzeResponse) {}
37
+ // Remediate optionally transforms a single resource object. This effectively rewrites
38
+ // a single resource object's properties instead of using what was generated by the program.
39
+ rpc Remediate(AnalyzeRequest) returns (RemediateResponse) {}
40
+ // GetAnalyzerInfo returns metadata about the analyzer (e.g., list of policies contained).
41
+ rpc GetAnalyzerInfo(google.protobuf.Empty) returns (AnalyzerInfo) {}
42
+ // GetPluginInfo returns generic information about this plugin, like its version.
43
+ rpc GetPluginInfo(google.protobuf.Empty) returns (PluginInfo) {}
44
+ // Configure configures the analyzer, passing configuration properties for each policy.
45
+ rpc Configure(ConfigureAnalyzerRequest) returns (google.protobuf.Empty) {}
46
+
47
+ // `Handshake` is the first call made by the engine to an analyzer. It is used to pass the engine's address to the
48
+ // analyzer so that it may establish its own connections back, and to establish protocol configuration that will be
49
+ // used to communicate between the two parties.
50
+ rpc Handshake(AnalyzerHandshakeRequest) returns (AnalyzerHandshakeResponse) {}
51
+
52
+ // `ConfigureStack` is always called if the engine is using the analyzer to analyze resources in a specific stack.
53
+ // This method is not always called, for example if the engine is just booting the analyzer up to call
54
+ // GetAnalyzerInfo.
55
+ rpc ConfigureStack(AnalyzerStackConfigureRequest) returns (AnalyzerStackConfigureResponse) {}
56
+
57
+ // Cancel signals the analyzer to gracefully shut down and abort any ongoing analysis operations.
58
+ // Operations aborted in this way will return an error. Since Cancel is advisory and non-blocking,
59
+ // it is up to the host to decide how long to wait after Cancel is called before (e.g.)
60
+ // hard-closing any gRPC connection.
61
+ rpc Cancel(google.protobuf.Empty) returns (google.protobuf.Empty) {}
62
+ }
63
+
64
+ // `AnalyzerStackConfigureRequest` is the message for the stack configuration of the stack being analyzed.
65
+ message AnalyzerStackConfigureRequest {
66
+ // The stack name being analyzed.
67
+ string stack = 1;
68
+ // The project name of the stack being analyzed.
69
+ string project = 2;
70
+ // The organization name of the stack being analyzed.
71
+ string organization = 3;
72
+ // True if this is a preview/dry run.
73
+ bool dry_run = 4;
74
+
75
+ reserved 5; // This was used to send stack config as property values.
76
+
77
+ // A list of configuration keys whose values should be treated as secrets.
78
+ repeated string config_secret_keys = 6;
79
+ // The configuration of the stack being analyzed.
80
+ map<string, string> config = 7;
81
+
82
+ // Tags for the current stack.
83
+ map<string, string> tags = 8;
84
+ }
85
+
86
+ // `AnalyzerStackConfigureResponse` is the type of responses sent by a [](pulumirpc.Analyzer.ConfigureStack) call.
87
+ message AnalyzerStackConfigureResponse {
88
+ }
89
+
90
+ // `AnalyzerHandshakeRequest` is the type of requests sent as part of a [](pulumirpc.Analyzer.Handshake) call.
91
+ message AnalyzerHandshakeRequest {
92
+ // The gRPC address of the engine handshaking with the analyzer. At a minimum, this address will expose an instance
93
+ // of the [](pulumirpc.Engine) service.
94
+ string engine_address = 1;
95
+
96
+ // A *root directory* where the analyzer's binary, `PulumiPolicy.yaml`, or other identifying source code is located.
97
+ // In the event that the analyzer is *not* being booted by the engine (e.g. in the case that the engine has been
98
+ // asked to attach to an existing running analyzer instance via a host/port number), this field will be empty.
99
+ optional string root_directory = 2;
100
+
101
+ // A *program directory* in which the analyzer should execute. This is generally a subdirectory of the root
102
+ // directory, though this is not required. In the event that the analyzer is *not* being booted by the engine (e.g.
103
+ // in the case that the engine has been asked to attach to an existing running analyzer instance via a host/port
104
+ // number), this field will be empty.
105
+ optional string program_directory = 3;
106
+ }
107
+
108
+ // `AnalyzerHandshakeResponse` is the type of responses sent by a [](pulumirpc.Analyzer.Handshake) call.
109
+ message AnalyzerHandshakeResponse {
110
+ }
111
+
112
+ message AnalyzeRequest {
113
+ string type = 1; // the type token of the resource.
114
+ google.protobuf.Struct properties = 2; // the full properties to use for validation.
115
+ string urn = 3; // the URN of the resource.
116
+ string name = 4; // the name for the resource's URN.
117
+ AnalyzerResourceOptions options = 5; // the resource options.
118
+ AnalyzerProviderResource provider = 6; // the resource's provider.
119
+ }
120
+
121
+ // AnalyzerResource defines the view of a Pulumi-managed resource as sent to Analyzers. The properties
122
+ // of the resource are specific to the type of analysis being performed. See the Analyzer
123
+ // service definition for more information.
124
+ message AnalyzerResource {
125
+ string type = 1; // the type token of the resource.
126
+ google.protobuf.Struct properties = 2; // the full properties to use for validation.
127
+ string urn = 3; // the URN of the resource.
128
+ string name = 4; // the name for the resource's URN.
129
+ AnalyzerResourceOptions options = 5; // the resource options.
130
+ AnalyzerProviderResource provider = 6; // the resource's provider.
131
+ string parent = 7; // an optional parent URN that this child resource belongs to.
132
+ repeated string dependencies = 8; // a list of URNs that this resource depends on.
133
+ map<string, AnalyzerPropertyDependencies> propertyDependencies = 9; // a map from property keys to the dependencies of the property.
134
+ }
135
+
136
+ // AnalyzerResourceOptions defines the options associated with a resource.
137
+ message AnalyzerResourceOptions {
138
+ // CustomTimeouts allows a user to be able to create a set of custom timeout parameters.
139
+ message CustomTimeouts {
140
+ double create = 1; // The create resource timeout in seconds.
141
+ double update = 2; // The update resource timeout in seconds.
142
+ double delete = 3; // The delete resource timeout in seconds.
143
+ }
144
+
145
+ bool protect = 1; // true if the resource should be marked protected.
146
+ repeated string ignoreChanges = 2; // a list of property names to ignore during changes.
147
+ bool deleteBeforeReplace = 3; // true if this resource should be deleted before replacement.
148
+ bool deleteBeforeReplaceDefined = 4; // true if the deleteBeforeReplace property should be treated as defined even if it is false.
149
+ repeated string additionalSecretOutputs = 5; // a list of output properties that should also be treated as secret, in addition to ones we detect.
150
+ repeated string aliases = 6; // a list of additional URNs that shoud be considered the same.
151
+ CustomTimeouts customTimeouts = 7; // a config block that will be used to configure timeouts for CRUD operations.
152
+ string parent = 8; // an optional parent URN that this child resource belongs to.
153
+ }
154
+
155
+ // AnalyzerProviderResource provides information about a resource's provider.
156
+ message AnalyzerProviderResource {
157
+ string type = 1; // the type token of the resource.
158
+ google.protobuf.Struct properties = 2; // the full properties to use for validation.
159
+ string urn = 3; // the URN of the resource.
160
+ string name = 4; // the name for the resource's URN.
161
+ }
162
+
163
+ // AnalyzerPropertyDependencies describes the resources that a particular property depends on.
164
+ message AnalyzerPropertyDependencies {
165
+ repeated string urns = 1; // A list of URNs this property depends on.
166
+ }
167
+
168
+ message AnalyzeStackRequest {
169
+ repeated AnalyzerResource resources = 1;
170
+ }
171
+
172
+ message AnalyzeResponse {
173
+ repeated AnalyzeDiagnostic diagnostics = 2; // information about policy violations.
174
+ repeated PolicyNotApplicable not_applicable = 3; // information about policies that were not applicable.
175
+ }
176
+
177
+ // EnforcementLevel indicates the severity of a policy violation.
178
+ enum EnforcementLevel {
179
+ ADVISORY = 0; // Displayed to users, but does not block deployment.
180
+ MANDATORY = 1; // Stops deployment, cannot be overridden.
181
+ DISABLED = 2; // Disabled policies do not run during a deployment.
182
+ REMEDIATE = 3; // Remediated policies actually fixes problems instead of issuing diagnostics.
183
+ }
184
+
185
+ message AnalyzeDiagnostic {
186
+ string policyName = 1; // Name of the violated policy.
187
+ string policyPackName = 2; // Name of the policy pack the policy is in.
188
+ string policyPackVersion = 3; // Version of the policy pack.
189
+ string description = 4; // Description of policy rule. e.g., "encryption enabled."
190
+ string message = 5; // Message to display on policy violation, e.g., remediation steps.
191
+
192
+ // Keywords/terms to associate with a policy, e.g., "cost". This was unused by the engine and policy SDKs.
193
+ reserved 6;
194
+ reserved "tags";
195
+
196
+ EnforcementLevel enforcementLevel = 7; // Enforcement level of the policy violation.
197
+ string urn = 8; // URN of the resource that violates the policy.
198
+ PolicySeverity severity = 9; // Severity of the policy violation.
199
+ }
200
+
201
+ // Remediation is a single resource remediation result.
202
+ message Remediation {
203
+ string policyName = 1; // Name of the policy that performed the remediation.
204
+ string policyPackName = 2; // Name of the policy pack the transform is in.
205
+ string policyPackVersion = 3; // Version of the policy pack.
206
+ string description = 4; // Description of transform rule. e.g., "auto-tag resources."
207
+ google.protobuf.Struct properties = 5; // the transformed properties to use.
208
+ string diagnostic = 6; // an optional warning diagnostic to emit, if a transform failed.
209
+ }
210
+
211
+ // RemediateResponse contains a sequence of remediations applied, in order.
212
+ message RemediateResponse {
213
+ repeated Remediation remediations = 1; // the list of remediations that were applied.
214
+ repeated PolicyNotApplicable not_applicable = 2; // information about policies that were not applicable.
215
+ }
216
+
217
+ // AnalyzerInfo provides metadata about a PolicyPack inside an analyzer.
218
+ message AnalyzerInfo {
219
+ string name = 1; // Name of the PolicyPack.
220
+ string displayName = 2; // Pretty name for the PolicyPack.
221
+ repeated PolicyInfo policies = 3; // Metadata about policies contained in PolicyPack.
222
+ string version = 4; // Version of the Policy Pack.
223
+ bool supportsConfig = 5; // Whether the Policy Pack supports config.
224
+ map<string, PolicyConfig> initialConfig = 6; // Map of policy name to config.
225
+ string description = 7; // Description of the policy pack.
226
+ string readme = 8; // README text for the policy pack.
227
+ string provider = 9; // Cloud provider/platform associated with the policy pack.
228
+ repeated string tags = 10; // Tags for this policy pack.
229
+ string repository = 11; // A URL to the repository where the policy pack is defined.
230
+ }
231
+
232
+ // PolicyInfo provides metadata about a policy within a Policy Pack.
233
+ message PolicyInfo {
234
+ string name = 1; // Name of the policy.
235
+ string displayName = 2; // Pretty name for the policy.
236
+ string description = 3; // Description of policy rule. e.g., "encryption enabled."
237
+ string message = 4; // Message to display on policy violation, e.g., remediation steps.
238
+ EnforcementLevel enforcementLevel = 5; // Severity of the policy violation.
239
+ PolicyConfigSchema configSchema = 6; // Config schema for the policy.
240
+ PolicyType policy_type = 7; // Type of the policy.
241
+ PolicySeverity severity = 8; // Severity of the policy.
242
+ PolicyComplianceFramework framework = 9; // Compliance framework that this policy belongs to.
243
+ repeated string tags = 10; // Tags associated with the policy.
244
+ string remediation_steps = 11; // A description of the steps to take to remediate a policy violation.
245
+ string url = 12; // A URL to more information about the policy.
246
+ }
247
+
248
+ // PolicyConfigSchema provides the schema for a policy's configuration.
249
+ message PolicyConfigSchema {
250
+ google.protobuf.Struct properties = 1; // JSON schema for each property.
251
+ repeated string required = 2; // Required properties.
252
+ }
253
+
254
+ // PolicyConfig provides configuration for a policy.
255
+ message PolicyConfig {
256
+ EnforcementLevel enforcementLevel = 1; // Enforcement level of the policy.
257
+ google.protobuf.Struct properties = 2; // Configuration properties of the policy.
258
+ }
259
+
260
+ // ConfigureAnalyzerRequest provides configuration information to the analyzer.
261
+ message ConfigureAnalyzerRequest {
262
+ map<string, PolicyConfig> policyConfig = 1; // Map of policy name to config.
263
+ }
264
+
265
+ // PolicyComplianceFramework provides information about the compliance framework that a policy belongs to.
266
+ message PolicyComplianceFramework {
267
+ string name = 1; // The compliance framework name.
268
+ string version = 2; // The compliance framework version.
269
+ string reference = 3; // The compliance framework reference.
270
+ string specification = 4; // The compliance framework specification.
271
+ }
272
+
273
+ // PolicyType indicates the type of a policy.
274
+ enum PolicyType {
275
+ POLICY_TYPE_UNKNOWN = 0; // Unknown policy type.
276
+ POLICY_TYPE_RESOURCE = 1; // A policy that validates a resource.
277
+ POLICY_TYPE_STACK = 2; // A policy that validates a stack.
278
+ }
279
+
280
+ // PolicyNotApplicable describes a policy that was not applicable, including an optional reason why.
281
+ message PolicyNotApplicable {
282
+ string policy_name = 1; // The name of the policy that was not applicable.
283
+ string reason = 2; // An optional reason why the policy was not applicable.
284
+ }
285
+
286
+ // PolicySeverity indicates the severity of a policy.
287
+ enum PolicySeverity {
288
+ POLICY_SEVERITY_UNSPECIFIED = 0; // Unspecified severity.
289
+ POLICY_SEVERITY_LOW = 1; // Low severity.
290
+ POLICY_SEVERITY_MEDIUM = 2; // Medium severity.
291
+ POLICY_SEVERITY_HIGH = 3; // High severity.
292
+ POLICY_SEVERITY_CRITICAL = 4; // Critical severity.
293
+ }
@@ -0,0 +1,44 @@
1
+ // Copyright 2016-2023, 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
+ // Callbacks is a service for invoking functions in one runtime from other processes.
22
+ service Callbacks {
23
+ // Invoke invokes a given callback, identified by its token.
24
+ rpc Invoke(CallbackInvokeRequest) returns (CallbackInvokeResponse) {}
25
+ }
26
+
27
+ message Callback {
28
+ // the gRPC target of the callback service.
29
+ string target = 1;
30
+ // the service specific unique token for this callback.
31
+ string token = 2;
32
+ }
33
+
34
+ message CallbackInvokeRequest {
35
+ // the token for the callback.
36
+ string token = 1;
37
+ // the serialized protobuf message of the arguments for this callback.
38
+ bytes request = 2;
39
+ }
40
+
41
+ message CallbackInvokeResponse {
42
+ // the serialized protobuf message of the response for this callback.
43
+ bytes response = 1;
44
+ }
@@ -0,0 +1,89 @@
1
+ // Copyright 2016-2023, 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.codegen;
18
+
19
+ option go_package = "github.com/pulumi/pulumi/sdk/v3/proto/go/codegen";
20
+
21
+ // Pos represents a single position in a source file, by addressing the start byte of a unicode character
22
+ // encoded in UTF-8.
23
+ message Pos {
24
+ // Line is the source code line where this position points. Lines are counted starting at 1 and
25
+ // incremented for each newline character encountered.
26
+ int64 line = 1;
27
+
28
+ // Column is the source code column where this position points, in unicode characters, with counting
29
+ // starting at 1.
30
+ //
31
+ // Column counts characters as they appear visually, so for example a latin letter with a combining
32
+ // diacritic mark counts as one character. This is intended for rendering visual markers against source
33
+ // code in contexts where these diacritics would be rendered in a single character cell. Technically
34
+ // speaking, Column is counting grapheme clusters as used in unicode normalization.
35
+ int64 column = 2;
36
+
37
+ // Byte is the byte offset into the file where the indicated character begins. This is a zero-based offset
38
+ // to the first byte of the first UTF-8 codepoint sequence in the character, and thus gives a position
39
+ // that can be resolved _without_ awareness of Unicode characters.
40
+ int64 byte = 3;
41
+ }
42
+
43
+ // Range represents a span of characters between two positions in a source file.
44
+ message Range {
45
+ // Filename is the name of the file into which this range's positions point.
46
+ string filename = 1;
47
+
48
+ // Start and End represent the bounds of this range. Start is inclusive and End is exclusive.
49
+ Pos start = 2;
50
+ Pos end = 3;
51
+ }
52
+
53
+ // DiagnosticSeverity is the severity level of a diagnostic message.
54
+ enum DiagnosticSeverity {
55
+ // DIAG_INVALID is the invalid zero value of DiagnosticSeverity
56
+ DIAG_INVALID = 0;
57
+ // DIAG_ERROR indicates that the problem reported by a diagnostic prevents
58
+ // further progress in parsing and/or evaluating the subject.
59
+ DIAG_ERROR = 1;
60
+ // DIAG_WARNING indicates that the problem reported by a diagnostic warrants
61
+ // user attention but does not prevent further progress. It is most
62
+ // commonly used for showing deprecation notices.
63
+ DIAG_WARNING = 2;
64
+ }
65
+
66
+ // Diagnostic represents information to be presented to a user about an error or anomaly in parsing or evaluating configuration.
67
+ message Diagnostic {
68
+ DiagnosticSeverity severity = 1;
69
+
70
+ // Summary and Detail contain the English-language description of the
71
+ // problem. Summary is a terse description of the general problem and
72
+ // detail is a more elaborate, often-multi-sentence description of
73
+ // the problem and what might be done to solve it.
74
+ string summary = 2;
75
+ string detail = 3;
76
+
77
+ // Subject and Context are both source ranges relating to the diagnostic.
78
+ //
79
+ // Subject is a tight range referring to exactly the construct that
80
+ // is problematic, while Context is an optional broader range (which should
81
+ // fully contain Subject) that ought to be shown around Subject when
82
+ // generating isolated source-code snippets in diagnostic messages.
83
+ // If Context is nil, the Subject is also the Context.
84
+ //
85
+ // Some diagnostics have no source ranges at all. If Context is set then
86
+ // Subject should always also be set.
87
+ Range subject = 4;
88
+ Range context = 5;
89
+ }
@@ -0,0 +1,51 @@
1
+ // Copyright 2016-2023, 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 codegen;
18
+
19
+ option go_package = "github.com/pulumi/pulumi/sdk/v3/proto/go/codegen";
20
+
21
+ // Loader is a service for getting schemas from the Pulumi engine for use in code generators and other tools.
22
+ // This is currently unstable and experimental.
23
+ service Loader {
24
+ // GetSchema tries to find a schema for the given package and version.
25
+ rpc GetSchema(GetSchemaRequest) returns (GetSchemaResponse) {}
26
+ }
27
+
28
+ // Parameterization specifies the name, version, and value for a parameterized package.
29
+ message Parameterization {
30
+ string name = 1; // the parameterized package name.
31
+ string version = 2; // the parameterized package version.
32
+ bytes value = 3; // the parameter value for the parameterized package.
33
+ }
34
+
35
+ // GetSchemaRequest allows the engine to return a schema for a given package and version.
36
+ message GetSchemaRequest {
37
+ // the package name for the schema being requested.
38
+ string package = 1;
39
+ // the version for the schema being requested, must be a valid semver or empty.
40
+ string version = 2;
41
+ // the optional download url for the schema being requested.
42
+ string download_url = 3;
43
+ // the parameterization for the schema being requested, can be empty.
44
+ Parameterization parameterization = 4;
45
+ }
46
+
47
+ // GetSchemaResponse returns the schema data for the requested package.
48
+ message GetSchemaResponse {
49
+ // the JSON encoded schema.
50
+ bytes schema = 1;
51
+ }
@@ -0,0 +1,74 @@
1
+ // Copyright 2016-2023, 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 codegen;
18
+
19
+ option go_package = "github.com/pulumi/pulumi/sdk/v3/proto/go/codegen";
20
+
21
+ // Mapper is a service for getting mappings from other ecosystems to Pulumi.
22
+ // This is currently unstable and experimental.
23
+
24
+ // Mapper provides methods for retrieving mappings that describe how to map names in some source "provider" (e.g. a
25
+ // Terraform provider, if we are converting from Terraform) to names in appropriate Pulumi packages. So when converting
26
+ // a Terraform program containing code like `resource "aws_s3_bucket" "b" {}`, for instance, we need to know (among
27
+ // other things) that the `aws_s3_bucket` Terraform resource type corresponds to the Pulumi type `aws:s3/bucket:Bucket`,
28
+ // and thus lives in the `aws` package. This is the kind of information that a Mapper provides.
29
+ service Mapper {
30
+ // `GetMapping` returns any available mapping data for the given source provider name (so again, this is e.g. the
31
+ // name of a Terraform provider if converting from Terraform). Callers may pass "hints" that describe a Pulumi
32
+ // package that is expected to provide the mapping and satisfy the request, which implementations may use to
33
+ // optimise their efforts to return the best possible mapping. If no matching mapping exists, implementations should
34
+ // return an empty byte array result.
35
+ rpc GetMapping(GetMappingRequest) returns (GetMappingResponse) {}
36
+ }
37
+
38
+
39
+ // `GetMappingRequest` is the type of requests sent as part of a [](codegen.Mapper.GetMapping) call.
40
+ message GetMappingRequest {
41
+ // The name of the source provider (e.g. the Terraform provider name if a Terraform program is being converted) for
42
+ // which a mapping into Pulumi should be returned.
43
+ string provider = 1;
44
+
45
+ // The name of the Pulumi plugin that is expected to provide the mapping. If left empty, will be defaulted to the
46
+ // source provider name.
47
+ string pulumi_provider = 2;
48
+
49
+ // An optional parameterization that should be used on the named plugin before asking it for mappings.
50
+ MapperParameterizationHint parameterization_hint = 3;
51
+ }
52
+
53
+ // `MapperPackageParameterizationHint` is the type of hints that may be passed to [](codegen.Mapper.GetMapping) when it
54
+ // is expected that a parameterized provider plugin is the most likely source of a mapping. E.g. in the case of a
55
+ // dynamically bridged Terraform provider, callers may wish to express that a mapping is most likely offered by the
56
+ // "terraform-provider" plugin, but only when it is parameterized with the appropriate Terraform provider information.
57
+ message MapperParameterizationHint {
58
+ // The package name expected once parameterization has been applied.
59
+ string name = 1;
60
+
61
+ // The package version expected once parameterization has been applied.
62
+ string version = 2;
63
+
64
+ // The parameter value to send to the provider plugin as part of parameterization.
65
+ bytes value = 3;
66
+ }
67
+
68
+ // `GetMappingResponse` is the type of responses sent by [](codegen.Mapper.GetMapping) calls.
69
+ message GetMappingResponse {
70
+ // Conversion-plugin-specific mapping data. For a Terraform conversion, for instance, this is expected to be a piece
71
+ // of data that maps Terraform names (e.g. resource types) to Pulumi names (e.g. Pulumi resource types). In many
72
+ // cases this byte array will be a string of encoded JSON, but no specific format is required.
73
+ bytes data = 1;
74
+ }