Skip to content

Commit 04d0535

Browse files
authored
updates to remove unlinked (#953)
1 parent 080daac commit 04d0535

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

content/terraform-plugin-framework/v1.16.x/docs/plugin/framework/actions/implementation.mdx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ func (a *DoSomethingAction) Metadata(ctx context.Context, req action.MetadataReq
4444

4545
The [`action.Action` interface `Schema` method](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-framework/action#Action.Schema) defines a [schema](/terraform/plugin/framework/handling-data/schemas) describing what data is available in the action configuration. An action itself does not have output data that can be referenced by other parts of a Terraform configuration.
4646

47-
### Unlinked action
47+
### Action
4848

49-
An unlinked action is an action type that cannot make changes to state, which can be defined by using the [`schema.UnlinkedSchema`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-framework/action/schema#UnlinkedSchema) type in the `Schema` field:
49+
An action can be defined by using the [`schema.Schema`](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-framework/action/schema#Schema) type in the `Schema` field:
5050

5151
```go
5252
func (a *DoSomethingAction) Schema(ctx context.Context, req action.SchemaRequest, resp *action.SchemaResponse) {
53-
resp.Schema = schema.UnlinkedSchema{
53+
resp.Schema = schema.Schema{
5454
Attributes: map[string]schema.Attribute{
5555
"required_string": schema.StringAttribute{
5656
Required: true,
@@ -63,7 +63,7 @@ func (a *DoSomethingAction) Schema(ctx context.Context, req action.SchemaRequest
6363
}
6464
```
6565

66-
Unlinked actions can only return diagnostics and progress messages (during [`Invoke`](#invoke-method)). Unlinked actions still participate in planning operations
66+
Actions can only return diagnostics and progress messages (during [`Invoke`](#invoke-method)). Actions still participate in planning operations
6767
via [`ModifyPlan`](#modifyplan-method), which can be used as an "online" validation for the action configuration.
6868

6969

@@ -173,7 +173,7 @@ type DoThingActionModel struct {
173173
}
174174

175175
func (e *DoThingAction) Schema(ctx context.Context, req action.SchemaRequest, resp *action.SchemaResponse) {
176-
resp.Schema = schema.UnlinkedSchema{
176+
resp.Schema = schema.Schema{
177177
Attributes: map[string]schema.Attribute{
178178
"name": schema.StringAttribute{
179179
Description: "Name of the thing to do something to.",
@@ -337,9 +337,7 @@ func (d DoThingAction) ValidateConfig(ctx context.Context, req action.ValidateCo
337337
## ModifyPlan method
338338

339339
Actions have a limited ability to participate in the planning process of Terraform, which is facilitated by the `PlanAction` RPC. As actions do not have any output data that can be consumed by
340-
other parts of the Terraform configuration, the only impact an action can have on the plan is by returning diagnostics, like performing validation that requires API client access.
341-
342-
Action types that can modify resource state will be able to plan whatever changes are needed during the `PlanAction` RPC. These action types are not available in Terraform 1.14, but are planned for future releases.
340+
other parts of the Terraform configuration, the only impact an action can have on the plan is by returning diagnostics, like performing validation that requires API client access. Actions are currently not able to propose resource state modifications during the plan, but future work is planned to support this.
343341

344342
Actions can participate in the planning operation of Terraform by implementing the [`action.ActionWithModifyPlan` interface](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-framework/action#ActionWithModifyPlan). For example:
345343

content/terraform-plugin-framework/v1.16.x/docs/plugin/framework/actions/index.mdx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,7 @@ can use actions to express workflows that don't strictly fit into typical [CRUD
1919
such as disaster recovery or ad-hoc maintenance. Actions can be invoked directly with the Terraform CLI or with
2020
a trigger in a plan/apply workflow.
2121

22-
## Action types
23-
24-
Each action in a provider has a statically defined action type in the [schema](/terraform/plugin/framework/actions/implementation#schema-method), which informs Terraform how the action can be used
25-
by the practitioner and what effect the action can have on [resource state](/terraform/plugin/framework/handling-data/terraform-concepts#state).
26-
Currently, the only available action type is:
27-
28-
- [Unlinked](/terraform/plugin/framework/actions/implementation#unlinked-action) - An action type that cannot cause changes to state.
29-
30-
Action types that can modify resource state are not available in Terraform 1.14, but are planned for future releases.
22+
Actions are currently not able to modify resource state, but future work is planned to support this.
3123

3224
## Implementation
3325

0 commit comments

Comments
 (0)