@@ -24,16 +24,12 @@ type ActionServer interface {
24
24
ValidateActionConfig (context.Context , * ValidateActionConfigRequest ) (* ValidateActionConfigResponse , error )
25
25
26
26
// PlanAction is called when Terraform is attempting to
27
- // calculate a plan for an action. Depending on the type defined in
28
- // the action schema, Terraform may also pass the plan of linked resources
29
- // that the action can modify or return unmodified to influence Terraform's plan.
27
+ // calculate a plan for an action.
30
28
PlanAction (context.Context , * PlanActionRequest ) (* PlanActionResponse , error )
31
29
32
30
// InvokeAction is called when Terraform wants to execute the logic of an action.
33
- // Depending on the type defined in the action schema, Terraform may also pass the
34
- // state of linked resources. The provider runs the logic of the action, reporting progress
35
- // events as desired, then sends a final complete event that has the linked resource's resulting
36
- // state and identity.
31
+ // The provider runs the logic of the action, reporting progress
32
+ // events as desired, then sends a final complete event.
37
33
//
38
34
// If an error occurs, the provider sends a complete event with the relevant diagnostics.
39
35
InvokeAction (context.Context , * InvokeActionRequest ) (* InvokeActionServerStream , error )
@@ -57,30 +53,6 @@ type ValidateActionConfigRequest struct {
57
53
// from knowing the value at request time. Any attributes not directly
58
54
// set in the configuration will be null.
59
55
Config * DynamicValue
60
-
61
- // LinkedResources contains the configuration data of the managed resource types that are linked to this action.
62
- //
63
- // - If the action schema type is Unlinked, this field will be empty.
64
- LinkedResources []* LinkedResourceConfig
65
- }
66
-
67
- // LinkedResourceConfig represents linked resource config data used in the ValidateActionConfig RPC.
68
- type LinkedResourceConfig struct {
69
- // TypeName is the type of linked resource Terraform is validating.
70
- TypeName string
71
-
72
- // Config is the configuration the user supplied for the linked resource. See
73
- // the documentation on `DynamicValue` for more information about
74
- // safely accessing the configuration.
75
- //
76
- // The configuration is represented as a tftypes.Object, with each
77
- // attribute and nested block getting its own key and value.
78
- //
79
- // This configuration may contain unknown values if a user uses
80
- // interpolation or other functionality that would prevent Terraform
81
- // from knowing the value at request time. Any attributes not directly
82
- // set in the configuration will be null.
83
- Config * DynamicValue
84
56
}
85
57
86
58
// ValidateActionConfigResponse is the response from the provider about
@@ -98,11 +70,6 @@ type PlanActionRequest struct {
98
70
// ActionType is the name of the action being called.
99
71
ActionType string
100
72
101
- // LinkedResources contains the data of the managed resource types that are linked to this action.
102
- //
103
- // - If the action schema type is Unlinked, this field will be empty.
104
- LinkedResources []* ProposedLinkedResource
105
-
106
73
// Config is the configuration the user supplied for the action. See
107
74
// the documentation on `DynamicValue` for more information about
108
75
// safely accessing the configuration.
@@ -113,43 +80,9 @@ type PlanActionRequest struct {
113
80
ClientCapabilities * PlanActionClientCapabilities
114
81
}
115
82
116
- // ProposedLinkedResource represents linked resource data before PlanAction is called.
117
- type ProposedLinkedResource struct {
118
- // PriorState is the state of the linked resource before the plan is applied,
119
- // represented as a `DynamicValue`. See the documentation for
120
- // `DynamicValue` for information about safely accessing the state.
121
- PriorState * DynamicValue
122
-
123
- // PlannedState is the latest indication of what the state for the
124
- // linked resource should be after apply, represented as a `DynamicValue`.
125
- // See the documentation for `DynamicValue` for information about safely
126
- // accessing the planned state.
127
- //
128
- // Since PlannedState is the most recent plan for the linked resource, it could
129
- // be the result of an RPC call to PlanResourceChange or an RPC call to PlanAction
130
- // for a predecessor action
131
- PlannedState * DynamicValue
132
-
133
- // Config is the configuration the user supplied for the linked resource. See
134
- // the documentation on `DynamicValue` for more information about
135
- // safely accessing the configuration.
136
- Config * DynamicValue
137
-
138
- // PriorIdentity is the identity of the resource before the plan is
139
- // applied, represented as a `ResourceIdentityData`.
140
- PriorIdentity * ResourceIdentityData
141
- }
142
-
143
- // PlanActionResponse is the response from the provider when planning an action. If the action
144
- // has linked resources, it will contain any modifications made to the planned state or identity.
83
+ // PlanActionResponse is the response from the provider when planning an action.
145
84
type PlanActionResponse struct {
146
- // LinkedResources contains the provider modified data of the managed resource types that are linked to this action.
147
- //
148
- // This field is not currently in-use, but future action schema types will use this field to plan modifications of state data for linked resources.
149
- LinkedResources []* PlannedLinkedResource
150
-
151
- // Diagnostics report errors or warnings related to plannning the action and calculating
152
- // the planned state of the requested linked resources. Returning an empty slice
85
+ // Diagnostics report errors or warnings related to planning the action. Returning an empty slice
153
86
// indicates a successful validation with no warnings or errors generated.
154
87
Diagnostics []* Diagnostic
155
88
@@ -158,61 +91,20 @@ type PlanActionResponse struct {
158
91
Deferred * Deferred
159
92
}
160
93
161
- // PlannedLinkedResource represents linked resource data that was planned during PlanAction and returned.
162
- type PlannedLinkedResource struct {
163
- // PlannedState is the provider's indication of what the state for the
164
- // linked resource should be after apply, represented as a `DynamicValue`. See
165
- // the documentation for `DynamicValue` for information about safely
166
- // creating the `DynamicValue`.
167
- PlannedState * DynamicValue
168
-
169
- // PlannedIdentity is the provider's indication of what the identity for the
170
- // linked resource should be after apply, represented as a `ResourceIdentityData`
171
- PlannedIdentity * ResourceIdentityData
172
- }
173
-
174
94
// InvokeActionRequest is the request Terraform sends when it wants to execute
175
95
// the logic of an action.
176
96
type InvokeActionRequest struct {
177
97
// ActionType is the name of the action being called.
178
98
ActionType string
179
99
180
- // LinkedResources contains the data of the managed resource types that are linked to this action.
181
- //
182
- // - If the action schema type is Unlinked, this field will be empty.
183
- LinkedResources []* InvokeLinkedResource
184
-
185
100
// Config is the configuration the user supplied for the action. See
186
101
// the documentation on `DynamicValue` for more information about
187
102
// safely accessing the configuration.
188
103
Config * DynamicValue
189
- }
190
-
191
- // InvokeLinkedResource represents linked resource data before InvokeAction is called.
192
- type InvokeLinkedResource struct {
193
- // PriorState is the state of the linked resource before changes are applied,
194
- // represented as a `DynamicValue`. See the documentation for
195
- // `DynamicValue` for information about safely accessing the state.
196
- PriorState * DynamicValue
197
-
198
- // PlannedState is the latest indication of what the state for the
199
- // linked resource should look like after changes are applied, represented
200
- // as a `DynamicValue`. See the documentation for `DynamicValue` for
201
- // information about safely accessing the planned state.
202
- //
203
- // Since PlannedState is the most recent state for the linked resource, it could
204
- // be the result of an RPC call to ApplyResourceChange or an RPC call to InvokeAction
205
- // for a predecessor action.
206
- PlannedState * DynamicValue
207
104
208
- // Config is the configuration the user supplied for the linked resource. See
209
- // the documentation on `DynamicValue` for more information about
210
- // safely accessing the configuration.
211
- Config * DynamicValue
212
-
213
- // PlannedIdentity is Terraform's plan for what the linked resource identity should
214
- // look like after the changes are applied, represented as a `ResourceIdentityData`.
215
- PlannedIdentity * ResourceIdentityData
105
+ // ClientCapabilities defines optionally supported protocol features for the
106
+ // InvokeAction RPC, such as forward-compatible Terraform behavior changes.
107
+ ClientCapabilities * InvokeActionClientCapabilities
216
108
}
217
109
218
110
// InvokeActionServerStream represents a streaming response to an
@@ -222,8 +114,8 @@ type InvokeLinkedResource struct {
222
114
type InvokeActionServerStream struct {
223
115
// Events is the iterator that the provider can stream progress messages back to Terraform
224
116
// as the action is executing. Once the provider has completed the action invocation, the provider must
225
- // respond with a completed event with the new linked resource state or diagnostics explaining why
226
- // the action failed.
117
+ // respond with a completed event. If the action failed, the completed event must contain
118
+ // diagnostics explaining why the action failed.
227
119
Events iter.Seq [InvokeActionEvent ]
228
120
}
229
121
@@ -255,42 +147,13 @@ type ProgressInvokeActionEventType struct {
255
147
256
148
func (a ProgressInvokeActionEventType ) isInvokeActionEventType () {}
257
149
258
- // CompletedInvokeActionEventType represents the final completed event, along with all of the linked resource
259
- // data modified by the provider or diagnostics about an action invocation failure.
150
+ // CompletedInvokeActionEventType represents the final completed event, along with
151
+ // potential diagnostics about an action invocation failure.
260
152
type CompletedInvokeActionEventType struct {
261
- // LinkedResources contains the provider modified data of the managed resource types that are linked to this action.
262
- //
263
- // This field is not currently in-use, but future action schema types will use this field to modify state data for linked resources.
264
- LinkedResources []* NewLinkedResource
265
-
266
153
// Diagnostics report errors or warnings related to invoking an action.
267
154
// Returning an empty slice indicates a successful invocation with no warnings
268
155
// or errors generated.
269
156
Diagnostics []* Diagnostic
270
157
}
271
158
272
159
func (a CompletedInvokeActionEventType ) isInvokeActionEventType () {}
273
-
274
- // NewLinkedResource represents linked resource data that was changed during InvokeAction and returned.
275
- //
276
- // Depending on how the action was invoked, the modified state data will either be immediately recorded in
277
- // state or reconcicled in a future terraform apply operation.
278
- type NewLinkedResource struct {
279
- // NewState is the provider's understanding of what the linked resource's
280
- // state is after changes are applied, represented as a `DynamicValue`.
281
- // See the documentation for `DynamicValue` for information about
282
- // safely creating the `DynamicValue`.
283
- //
284
- // Any attribute, whether computed or not, that has a known value in
285
- // the PlannedState in the InvokeActionRequest must be preserved
286
- // exactly as it was in NewState.
287
- NewState * DynamicValue
288
-
289
- // NewIdentity is the provider's understanding of what the linked resource's
290
- // identity is after changes are applied, represented as a `ResourceIdentityData`.
291
- NewIdentity * ResourceIdentityData
292
-
293
- // RequiresReplace can only be set if diagnostics are returned for the action and indicate
294
- // the linked resource must be replaced as a result of the action invocation error.
295
- RequiresReplace bool
296
- }
0 commit comments