Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ require (
github.com/hashicorp/go-memdb v1.3.5
github.com/hashicorp/go-version v1.7.0
github.com/hashicorp/terraform-json v0.26.0
github.com/hashicorp/terraform-plugin-framework v1.16.0-beta.1.0.20250821123331-51dc6877ded6
github.com/hashicorp/terraform-plugin-framework v1.16.0-beta.1.0.20250915220419-1b972ed93a1b
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0
github.com/hashicorp/terraform-plugin-framework-nettypes v0.3.0
github.com/hashicorp/terraform-plugin-framework-timeouts v0.5.0
github.com/hashicorp/terraform-plugin-framework-timetypes v0.5.0
github.com/hashicorp/terraform-plugin-framework-validators v0.18.0
github.com/hashicorp/terraform-plugin-go v0.29.0-beta.1
github.com/hashicorp/terraform-plugin-mux v0.20.0
github.com/hashicorp/terraform-plugin-go v0.29.0-beta.1.0.20250915194700-c3810b1245c0
github.com/hashicorp/terraform-plugin-mux v0.21.0-alpha.1.0.20250915212024-d1e230c1fcf3
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0
github.com/hashicorp/terraform-plugin-testing v1.13.3
github.com/zclconf/go-cty v1.17.0
github.com/hashicorp/terraform-plugin-testing v1.13.2
github.com/zclconf/go-cty v1.16.3
)

require (
Expand All @@ -34,7 +34,7 @@ require (
github.com/hashicorp/go-hclog v1.6.3 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.3 // indirect
github.com/hashicorp/go-plugin v1.7.0 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
Expand All @@ -43,29 +43,29 @@ require (
github.com/hashicorp/logutils v1.0.0 // indirect
github.com/hashicorp/terraform-exec v0.23.0 // indirect
github.com/hashicorp/terraform-plugin-log v0.9.0 // indirect
github.com/hashicorp/terraform-registry-address v0.3.0 // indirect
github.com/hashicorp/terraform-registry-address v0.4.0 // indirect
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/hashicorp/yamux v0.1.2 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/mod v0.25.0 // indirect
golang.org/x/net v0.41.0 // indirect
golang.org/x/sync v0.15.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/text v0.26.0 // indirect
golang.org/x/tools v0.33.0 // indirect
golang.org/x/crypto v0.41.0 // indirect
golang.org/x/mod v0.26.0 // indirect
golang.org/x/net v0.43.0 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/text v0.28.0 // indirect
golang.org/x/tools v0.35.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect
google.golang.org/grpc v1.74.2 // indirect
google.golang.org/protobuf v1.36.6 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250707201910-8d1bb00bc6a7 // indirect
google.golang.org/grpc v1.75.1 // indirect
google.golang.org/protobuf v1.36.9 // indirect
)
116 changes: 60 additions & 56 deletions go.sum

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ import (
"github.com/hashicorp/terraform-plugin-framework/path"
)

var _ action.Action = &UnlinkedAction{}
var _ action.ActionWithModifyPlan = &UnlinkedAction{}
var _ action.Action = &ModifyFileAction{}
var _ action.ActionWithModifyPlan = &ModifyFileAction{}

func NewUnlinkedAction() action.Action {
return &UnlinkedAction{}
func NewModifyAction() action.Action {
return &ModifyFileAction{}
}

type UnlinkedAction struct{}
type ModifyFileAction struct{}

func (u *UnlinkedAction) Schema(ctx context.Context, req action.SchemaRequest, resp *action.SchemaResponse) {
resp.Schema = schema.UnlinkedSchema{
func (u *ModifyFileAction) Schema(ctx context.Context, req action.SchemaRequest, resp *action.SchemaResponse) {
resp.Schema = schema.Schema{
Attributes: map[string]schema.Attribute{
"filename": schema.StringAttribute{
Required: true,
Expand All @@ -38,11 +38,11 @@ func (u *UnlinkedAction) Schema(ctx context.Context, req action.SchemaRequest, r
}
}

func (u *UnlinkedAction) Metadata(ctx context.Context, req action.MetadataRequest, resp *action.MetadataResponse) {
resp.TypeName = req.ProviderTypeName + "_unlinked_action"
func (u *ModifyFileAction) Metadata(ctx context.Context, req action.MetadataRequest, resp *action.MetadataResponse) {
resp.TypeName = req.ProviderTypeName + "_modify_file_action"
}

func (u *UnlinkedAction) ModifyPlan(ctx context.Context, req action.ModifyPlanRequest, resp *action.ModifyPlanResponse) {
func (u *ModifyFileAction) ModifyPlan(ctx context.Context, req action.ModifyPlanRequest, resp *action.ModifyPlanResponse) {
if req.Config.Raw.IsNull() {
return
}
Expand All @@ -61,9 +61,9 @@ func (u *UnlinkedAction) ModifyPlan(ctx context.Context, req action.ModifyPlanRe
}
}

func (u *UnlinkedAction) Invoke(ctx context.Context, req action.InvokeRequest, resp *action.InvokeResponse) {
func (u *ModifyFileAction) Invoke(ctx context.Context, req action.InvokeRequest, resp *action.InvokeResponse) {
resp.SendProgress = func(event action.InvokeProgressEvent) {
event.Message = "starting provider defined unlinked action"
event.Message = "starting provider defined action"
}

var filename string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/hashicorp/terraform-plugin-testing/tfversion"
)

func TestUnlinkedAction(t *testing.T) {
func TestModifyFileAction(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit 🦸🏻 - The comment in here (and the framework6provider) references unlinked 👀

f := filepath.Join(t.TempDir(), "local_file")
f = strings.ReplaceAll(f, `\`, `\\`)

Expand All @@ -44,12 +44,12 @@ func TestUnlinkedAction(t *testing.T) {
lifecycle {
action_trigger {
events = [before_create]
actions = [action.framework_unlinked_action.file]
actions = [action.framework_modify_file_action.file]
}
}
}

action "framework_unlinked_action" "file" {
action "framework_modify_file_action" "file" {
config {
filename = %[1]q
content = %[2]q
Expand Down Expand Up @@ -77,12 +77,12 @@ func TestUnlinkedAction(t *testing.T) {
lifecycle {
action_trigger {
events = [before_create]
actions = [action.framework_unlinked_action.file]
actions = [action.framework_modify_file_action.file]
}
}
}

action "framework_unlinked_action" "file" {
action "framework_modify_file_action" "file" {
config {
filename = %[1]q
content = "updated test data"
Expand Down Expand Up @@ -110,12 +110,12 @@ func TestUnlinkedAction(t *testing.T) {
lifecycle {
action_trigger {
events = [after_update] # action triggers after update
actions = [action.framework_unlinked_action.file]
actions = [action.framework_modify_file_action.file]
}
}
}

action "framework_unlinked_action" "file" {
action "framework_modify_file_action" "file" {
config {
filename = %[1]q
content = "updated test data"
Expand Down Expand Up @@ -143,12 +143,12 @@ func TestUnlinkedAction(t *testing.T) {
lifecycle {
action_trigger {
events = [after_update]
actions = [action.framework_unlinked_action.file]
actions = [action.framework_modify_file_action.file]
}
}
}

action "framework_unlinked_action" "file" {
action "framework_modify_file_action" "file" {
config {
filename = %[1]q
content = %[2]q
Expand Down
2 changes: 1 addition & 1 deletion internal/framework5provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (p *testProvider) ListResources(_ context.Context) []func() list.ListResour

func (p *testProvider) Actions(ctx context.Context) []func() action.Action {
return []func() action.Action{
NewUnlinkedAction,
NewModifyAction,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ import (
"github.com/hashicorp/terraform-plugin-framework/path"
)

var _ action.Action = &UnlinkedAction{}
var _ action.ActionWithModifyPlan = &UnlinkedAction{}
var _ action.Action = &ModifyFileAction{}
var _ action.ActionWithModifyPlan = &ModifyFileAction{}

func NewUnlinkedAction() action.Action {
return &UnlinkedAction{}
func NewModifyFileAction() action.Action {
return &ModifyFileAction{}
}

type UnlinkedAction struct{}
type ModifyFileAction struct{}

func (u *UnlinkedAction) Schema(ctx context.Context, req action.SchemaRequest, resp *action.SchemaResponse) {
resp.Schema = schema.UnlinkedSchema{
func (u *ModifyFileAction) Schema(ctx context.Context, req action.SchemaRequest, resp *action.SchemaResponse) {
resp.Schema = schema.Schema{
Attributes: map[string]schema.Attribute{
"filename": schema.StringAttribute{
Required: true,
Expand All @@ -38,11 +38,11 @@ func (u *UnlinkedAction) Schema(ctx context.Context, req action.SchemaRequest, r
}
}

func (u *UnlinkedAction) Metadata(ctx context.Context, req action.MetadataRequest, resp *action.MetadataResponse) {
resp.TypeName = req.ProviderTypeName + "_unlinked_action"
func (u *ModifyFileAction) Metadata(ctx context.Context, req action.MetadataRequest, resp *action.MetadataResponse) {
resp.TypeName = req.ProviderTypeName + "_modify_file_action"
}

func (u *UnlinkedAction) ModifyPlan(ctx context.Context, req action.ModifyPlanRequest, resp *action.ModifyPlanResponse) {
func (u *ModifyFileAction) ModifyPlan(ctx context.Context, req action.ModifyPlanRequest, resp *action.ModifyPlanResponse) {
if req.Config.Raw.IsNull() {
return
}
Expand All @@ -61,9 +61,9 @@ func (u *UnlinkedAction) ModifyPlan(ctx context.Context, req action.ModifyPlanRe
}
}

func (u *UnlinkedAction) Invoke(ctx context.Context, req action.InvokeRequest, resp *action.InvokeResponse) {
func (u *ModifyFileAction) Invoke(ctx context.Context, req action.InvokeRequest, resp *action.InvokeResponse) {
resp.SendProgress = func(event action.InvokeProgressEvent) {
event.Message = "starting provider defined unlinked action"
event.Message = "starting provider defined action"
}

var filename string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/hashicorp/terraform-plugin-testing/tfversion"
)

func TestUnlinkedAction(t *testing.T) {
func TestModifyFileAction(t *testing.T) {
f := filepath.Join(t.TempDir(), "local_file")
f = strings.ReplaceAll(f, `\`, `\\`)

Expand All @@ -44,12 +44,12 @@ func TestUnlinkedAction(t *testing.T) {
lifecycle {
action_trigger {
events = [before_create]
actions = [action.framework_unlinked_action.file]
actions = [action.framework_modify_file_action.file]
}
}
}

action "framework_unlinked_action" "file" {
action "framework_modify_file_action" "file" {
config {
filename = %[1]q
content = %[2]q
Expand Down Expand Up @@ -77,12 +77,12 @@ func TestUnlinkedAction(t *testing.T) {
lifecycle {
action_trigger {
events = [before_create]
actions = [action.framework_unlinked_action.file]
actions = [action.framework_modify_file_action.file]
}
}
}

action "framework_unlinked_action" "file" {
action "framework_modify_file_action" "file" {
config {
filename = %[1]q
content = "updated test data"
Expand Down Expand Up @@ -110,12 +110,12 @@ func TestUnlinkedAction(t *testing.T) {
lifecycle {
action_trigger {
events = [after_update] # action triggers after update
actions = [action.framework_unlinked_action.file]
actions = [action.framework_modify_file_action.file]
}
}
}

action "framework_unlinked_action" "file" {
action "framework_modify_file_action" "file" {
config {
filename = %[1]q
content = "updated test data"
Expand Down Expand Up @@ -143,12 +143,12 @@ func TestUnlinkedAction(t *testing.T) {
lifecycle {
action_trigger {
events = [after_update]
actions = [action.framework_unlinked_action.file]
actions = [action.framework_modify_file_action.file]
}
}
}

action "framework_unlinked_action" "file" {
action "framework_modify_file_action" "file" {
config {
filename = %[1]q
content = %[2]q
Expand Down
2 changes: 1 addition & 1 deletion internal/framework6provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (p *testProvider) EphemeralResources(ctx context.Context) []func() ephemera

func (p *testProvider) Actions(ctx context.Context) []func() action.Action {
return []func() action.Action{
NewUnlinkedAction,
NewModifyFileAction,
}
}

Expand Down
Loading