Skip to content

Commit 36bf5f5

Browse files
SBGoodsaustinvalle
andauthored
all: Initial ephemeral resource type implementations (#257)
* Update `terraform-plugin-go` dependency to `SBGoods/ephemeral-resources` branch * Implement ephemeral resources in `tf5muxserver`, `tf6muxserver`, `tf6to5server`, and `tf5to6server`. * Remove `State` field from `RenewEphemeralResource` RPC response and rename `PriorState` request fields to `State`. * update mux to use latest plugin go with optional interfaces * remove `config` from renew request * remove state from close/renew + add deferrals * Update `terraform-plugin-go` dependency * Run `go mod tidy` * Add changelog entry * Upgrade `terraform-plugin-go` dependency to `v0.25.0` --------- Co-authored-by: Austin Valle <[email protected]>
1 parent 107b2f9 commit 36bf5f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3524
-129
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
kind: FEATURES
2+
body: 'all: Upgrade protocol versions to support ephemeral resource types'
3+
time: 2024-10-28T16:49:44.46102-04:00
4+
custom:
5+
Issue: "257"

go.mod

+9-9
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@ toolchain go1.22.7
66

77
require (
88
github.com/google/go-cmp v0.6.0
9-
github.com/hashicorp/terraform-plugin-go v0.24.0
9+
github.com/hashicorp/terraform-plugin-go v0.25.0
1010
github.com/hashicorp/terraform-plugin-log v0.9.0
11-
google.golang.org/grpc v1.66.2
11+
google.golang.org/grpc v1.67.1
1212
)
1313

1414
require (
1515
github.com/fatih/color v1.13.0 // indirect
1616
github.com/golang/protobuf v1.5.4 // indirect
1717
github.com/hashicorp/go-hclog v1.5.0 // indirect
18-
github.com/hashicorp/go-plugin v1.6.1 // indirect
18+
github.com/hashicorp/go-plugin v1.6.2 // indirect
1919
github.com/hashicorp/go-uuid v1.0.3 // indirect
2020
github.com/hashicorp/terraform-registry-address v0.2.3 // indirect
2121
github.com/hashicorp/terraform-svchost v0.1.1 // indirect
2222
github.com/hashicorp/yamux v0.1.1 // indirect
2323
github.com/mattn/go-colorable v0.1.12 // indirect
24-
github.com/mattn/go-isatty v0.0.14 // indirect
24+
github.com/mattn/go-isatty v0.0.17 // indirect
2525
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
2626
github.com/oklog/run v1.0.0 // indirect
2727
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
2828
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
29-
golang.org/x/net v0.26.0 // indirect
30-
golang.org/x/sys v0.21.0 // indirect
31-
golang.org/x/text v0.16.0 // indirect
32-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 // indirect
33-
google.golang.org/protobuf v1.34.2 // indirect
29+
golang.org/x/net v0.28.0 // indirect
30+
golang.org/x/sys v0.24.0 // indirect
31+
golang.org/x/text v0.17.0 // indirect
32+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
33+
google.golang.org/protobuf v1.35.1 // indirect
3434
)

go.sum

+21-18
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
1111
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
1212
github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=
1313
github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
14-
github.com/hashicorp/go-plugin v1.6.1 h1:P7MR2UP6gNKGPp+y7EZw2kOiq4IR9WiqLvp0XOsVdwI=
15-
github.com/hashicorp/go-plugin v1.6.1/go.mod h1:XPHFku2tFo3o3QKFgSYo+cghcUhw1NA1hZyMK0PWAw0=
14+
github.com/hashicorp/go-plugin v1.6.2 h1:zdGAEd0V1lCaU0u+MxWQhtSDQmahpkwOun8U8EiRVog=
15+
github.com/hashicorp/go-plugin v1.6.2/go.mod h1:CkgLQ5CZqNmdL9U9JzM532t8ZiYQ35+pj3b1FD37R0Q=
1616
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
1717
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
18-
github.com/hashicorp/terraform-plugin-go v0.24.0 h1:2WpHhginCdVhFIrWHxDEg6RBn3YaWzR2o6qUeIEat2U=
19-
github.com/hashicorp/terraform-plugin-go v0.24.0/go.mod h1:tUQ53lAsOyYSckFGEefGC5C8BAaO0ENqzFd3bQeuYQg=
18+
github.com/hashicorp/terraform-plugin-go v0.25.0 h1:oi13cx7xXA6QciMcpcFi/rwA974rdTxjqEhXJjbAyks=
19+
github.com/hashicorp/terraform-plugin-go v0.25.0/go.mod h1:+SYagMYadJP86Kvn+TGeV+ofr/R3g4/If0O5sO96MVw=
2020
github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0=
2121
github.com/hashicorp/terraform-plugin-log v0.9.0/go.mod h1:rKL8egZQ/eXSyDqzLUuwUYLVdlYeamldAHSxjUFADow=
2222
github.com/hashicorp/terraform-registry-address v0.2.3 h1:2TAiKJ1A3MAkZlH1YI/aTVcLZRu7JseiXNRHbOAyoTI=
@@ -31,38 +31,41 @@ github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope
3131
github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
3232
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
3333
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
34-
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
3534
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
35+
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
36+
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
3637
github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU=
3738
github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8=
3839
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
3940
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
4041
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
4142
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
4243
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
43-
github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s=
4444
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
45+
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
46+
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
4547
github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8=
4648
github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok=
4749
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
4850
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
49-
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
50-
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
51+
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
52+
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
5153
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
5254
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
5355
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5456
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5557
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
56-
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
57-
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
58-
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
59-
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
60-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117 h1:1GBuWVLM/KMVUv1t1En5Gs+gFZCNd360GGb4sSxtrhU=
61-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240604185151-ef581f913117/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0=
62-
google.golang.org/grpc v1.66.2 h1:3QdXkuq3Bkh7w+ywLdLvM56cmGvQHUMZpiCzt6Rqaoo=
63-
google.golang.org/grpc v1.66.2/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y=
64-
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
65-
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
58+
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
59+
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
60+
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
61+
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
62+
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
63+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs=
64+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
65+
google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E=
66+
google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
67+
google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA=
68+
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
6669
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
6770
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
6871
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

internal/tf5testserver/tf5testserver.go

+44
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ type TestServer struct {
1818

1919
CallFunctionCalled map[string]bool
2020

21+
CloseEphemeralResourceCalled map[string]bool
22+
2123
ConfigureProviderCalled bool
2224
ConfigureProviderResponse *tfprotov5.ConfigureProviderResponse
2325

@@ -34,6 +36,8 @@ type TestServer struct {
3436

3537
MoveResourceStateCalled map[string]bool
3638

39+
OpenEphemeralResourceCalled map[string]bool
40+
3741
PlanResourceChangeCalled map[string]bool
3842

3943
PrepareProviderConfigCalled bool
@@ -43,11 +47,15 @@ type TestServer struct {
4347

4448
ReadResourceCalled map[string]bool
4549

50+
RenewEphemeralResourceCalled map[string]bool
51+
4652
StopProviderCalled bool
4753
StopProviderResponse *tfprotov5.StopProviderResponse
4854

4955
UpgradeResourceStateCalled map[string]bool
5056

57+
ValidateEphemeralResourceConfigCalled map[string]bool
58+
5159
ValidateDataSourceConfigCalled map[string]bool
5260

5361
ValidateResourceTypeConfigCalled map[string]bool
@@ -75,6 +83,15 @@ func (s *TestServer) CallFunction(_ context.Context, req *tfprotov5.CallFunction
7583
return nil, nil
7684
}
7785

86+
func (s *TestServer) CloseEphemeralResource(ctx context.Context, req *tfprotov5.CloseEphemeralResourceRequest) (*tfprotov5.CloseEphemeralResourceResponse, error) {
87+
if s.CloseEphemeralResourceCalled == nil {
88+
s.CloseEphemeralResourceCalled = make(map[string]bool)
89+
}
90+
91+
s.CloseEphemeralResourceCalled[req.TypeName] = true
92+
return nil, nil
93+
}
94+
7895
func (s *TestServer) ConfigureProvider(_ context.Context, _ *tfprotov5.ConfigureProviderRequest) (*tfprotov5.ConfigureProviderResponse, error) {
7996
s.ConfigureProviderCalled = true
8097

@@ -137,6 +154,15 @@ func (s *TestServer) MoveResourceState(_ context.Context, req *tfprotov5.MoveRes
137154
return nil, nil
138155
}
139156

157+
func (s *TestServer) OpenEphemeralResource(_ context.Context, req *tfprotov5.OpenEphemeralResourceRequest) (*tfprotov5.OpenEphemeralResourceResponse, error) {
158+
if s.OpenEphemeralResourceCalled == nil {
159+
s.OpenEphemeralResourceCalled = make(map[string]bool)
160+
}
161+
162+
s.OpenEphemeralResourceCalled[req.TypeName] = true
163+
return nil, nil
164+
}
165+
140166
func (s *TestServer) PlanResourceChange(_ context.Context, req *tfprotov5.PlanResourceChangeRequest) (*tfprotov5.PlanResourceChangeResponse, error) {
141167
if s.PlanResourceChangeCalled == nil {
142168
s.PlanResourceChangeCalled = make(map[string]bool)
@@ -164,6 +190,15 @@ func (s *TestServer) ReadResource(_ context.Context, req *tfprotov5.ReadResource
164190
return nil, nil
165191
}
166192

193+
func (s *TestServer) RenewEphemeralResource(_ context.Context, req *tfprotov5.RenewEphemeralResourceRequest) (*tfprotov5.RenewEphemeralResourceResponse, error) {
194+
if s.RenewEphemeralResourceCalled == nil {
195+
s.RenewEphemeralResourceCalled = make(map[string]bool)
196+
}
197+
198+
s.RenewEphemeralResourceCalled[req.TypeName] = true
199+
return nil, nil
200+
}
201+
167202
func (s *TestServer) StopProvider(_ context.Context, _ *tfprotov5.StopProviderRequest) (*tfprotov5.StopProviderResponse, error) {
168203
s.StopProviderCalled = true
169204

@@ -183,6 +218,15 @@ func (s *TestServer) UpgradeResourceState(_ context.Context, req *tfprotov5.Upgr
183218
return nil, nil
184219
}
185220

221+
func (s *TestServer) ValidateEphemeralResourceConfig(_ context.Context, req *tfprotov5.ValidateEphemeralResourceConfigRequest) (*tfprotov5.ValidateEphemeralResourceConfigResponse, error) {
222+
if s.ValidateEphemeralResourceConfigCalled == nil {
223+
s.ValidateEphemeralResourceConfigCalled = make(map[string]bool)
224+
}
225+
226+
s.ValidateEphemeralResourceConfigCalled[req.TypeName] = true
227+
return nil, nil
228+
}
229+
186230
func (s *TestServer) ValidateDataSourceConfig(_ context.Context, req *tfprotov5.ValidateDataSourceConfigRequest) (*tfprotov5.ValidateDataSourceConfigResponse, error) {
187231
if s.ValidateDataSourceConfigCalled == nil {
188232
s.ValidateDataSourceConfigCalled = make(map[string]bool)

internal/tf6testserver/tf6testserver.go

+44
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ type TestServer struct {
1818

1919
CallFunctionCalled map[string]bool
2020

21+
CloseEphemeralResourceCalled map[string]bool
22+
2123
ConfigureProviderCalled bool
2224
ConfigureProviderResponse *tfprotov6.ConfigureProviderResponse
2325

@@ -34,19 +36,25 @@ type TestServer struct {
3436

3537
MoveResourceStateCalled map[string]bool
3638

39+
OpenEphemeralResourceCalled map[string]bool
40+
3741
PlanResourceChangeCalled map[string]bool
3842

3943
ReadDataSourceCalled map[string]bool
4044

4145
ReadResourceCalled map[string]bool
4246

47+
RenewEphemeralResourceCalled map[string]bool
48+
4349
StopProviderCalled bool
4450
StopProviderResponse *tfprotov6.StopProviderResponse
4551

4652
UpgradeResourceStateCalled map[string]bool
4753

4854
ValidateDataResourceConfigCalled map[string]bool
4955

56+
ValidateEphemeralResourceConfigCalled map[string]bool
57+
5058
ValidateProviderConfigCalled bool
5159
ValidateProviderConfigResponse *tfprotov6.ValidateProviderConfigResponse
5260

@@ -75,6 +83,15 @@ func (s *TestServer) CallFunction(_ context.Context, req *tfprotov6.CallFunction
7583
return nil, nil
7684
}
7785

86+
func (s *TestServer) CloseEphemeralResource(ctx context.Context, req *tfprotov6.CloseEphemeralResourceRequest) (*tfprotov6.CloseEphemeralResourceResponse, error) {
87+
if s.CloseEphemeralResourceCalled == nil {
88+
s.CloseEphemeralResourceCalled = make(map[string]bool)
89+
}
90+
91+
s.CloseEphemeralResourceCalled[req.TypeName] = true
92+
return nil, nil
93+
}
94+
7895
func (s *TestServer) ConfigureProvider(_ context.Context, _ *tfprotov6.ConfigureProviderRequest) (*tfprotov6.ConfigureProviderResponse, error) {
7996
s.ConfigureProviderCalled = true
8097

@@ -137,6 +154,15 @@ func (s *TestServer) MoveResourceState(_ context.Context, req *tfprotov6.MoveRes
137154
return nil, nil
138155
}
139156

157+
func (s *TestServer) OpenEphemeralResource(_ context.Context, req *tfprotov6.OpenEphemeralResourceRequest) (*tfprotov6.OpenEphemeralResourceResponse, error) {
158+
if s.OpenEphemeralResourceCalled == nil {
159+
s.OpenEphemeralResourceCalled = make(map[string]bool)
160+
}
161+
162+
s.OpenEphemeralResourceCalled[req.TypeName] = true
163+
return nil, nil
164+
}
165+
140166
func (s *TestServer) PlanResourceChange(_ context.Context, req *tfprotov6.PlanResourceChangeRequest) (*tfprotov6.PlanResourceChangeResponse, error) {
141167
if s.PlanResourceChangeCalled == nil {
142168
s.PlanResourceChangeCalled = make(map[string]bool)
@@ -164,6 +190,15 @@ func (s *TestServer) ReadResource(_ context.Context, req *tfprotov6.ReadResource
164190
return nil, nil
165191
}
166192

193+
func (s *TestServer) RenewEphemeralResource(_ context.Context, req *tfprotov6.RenewEphemeralResourceRequest) (*tfprotov6.RenewEphemeralResourceResponse, error) {
194+
if s.RenewEphemeralResourceCalled == nil {
195+
s.RenewEphemeralResourceCalled = make(map[string]bool)
196+
}
197+
198+
s.RenewEphemeralResourceCalled[req.TypeName] = true
199+
return nil, nil
200+
}
201+
167202
func (s *TestServer) StopProvider(_ context.Context, _ *tfprotov6.StopProviderRequest) (*tfprotov6.StopProviderResponse, error) {
168203
s.StopProviderCalled = true
169204

@@ -183,6 +218,15 @@ func (s *TestServer) UpgradeResourceState(_ context.Context, req *tfprotov6.Upgr
183218
return nil, nil
184219
}
185220

221+
func (s *TestServer) ValidateEphemeralResourceConfig(_ context.Context, req *tfprotov6.ValidateEphemeralResourceConfigRequest) (*tfprotov6.ValidateEphemeralResourceConfigResponse, error) {
222+
if s.ValidateEphemeralResourceConfigCalled == nil {
223+
s.ValidateEphemeralResourceConfigCalled = make(map[string]bool)
224+
}
225+
226+
s.ValidateEphemeralResourceConfigCalled[req.TypeName] = true
227+
return nil, nil
228+
}
229+
186230
func (s *TestServer) ValidateDataResourceConfig(_ context.Context, req *tfprotov6.ValidateDataResourceConfigRequest) (*tfprotov6.ValidateDataResourceConfigResponse, error) {
187231
if s.ValidateDataResourceConfigCalled == nil {
188232
s.ValidateDataResourceConfigCalled = make(map[string]bool)

0 commit comments

Comments
 (0)