Skip to content

Commit 153ac1f

Browse files
committed
documentation updates
1 parent 22d91e8 commit 153ac1f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

echoprovider/server.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ func NewProviderServer() func() (tfprotov6.ProviderServer, error) {
4545
// echoProviderServer is a lightweight protocol version 6 provider server that saves data from the provider configuration (which is considered ephemeral)
4646
// and then stores that data into state during ApplyResourceChange.
4747
//
48-
// As provider configuration is ephemeral, it's possible for the data to change between plan and apply. As a result of this, during plan, this provider
49-
// will check if the provider config data is different than prior state, and if so, will set the PlannedState to contain an unknown value. If the prior state
50-
// matches the provider config data, the plan will not propose any changes.
48+
// As provider configuration is ephemeral, it's possible for the data to change between plan and apply. As a result of this, the echo provider
49+
// will never propose new changes after it has been created, making it immutable (during plan, echo will always use prior state for it's plan,
50+
// regardless of what the provider configuration is set to). This prevents the managed resource from continuously proposing new planned changes
51+
// if the ephemeral data changes.
5152
type echoProviderServer struct {
5253
// The value of the "data" attribute during provider configuration. Will be directly echoed to the echo.data attribute.
5354
providerConfigData tftypes.Value
@@ -274,7 +275,7 @@ func (e *echoProviderServer) PlanResourceChange(ctx context.Context, req *tfprot
274275
}, nil
275276
}
276277

277-
// If the provider config data has changed or we are creating, mark data as unknown in the plan.
278+
// If we are creating, mark data as unknown in the plan.
278279
//
279280
// We can't set the proposed new state to the provider config data because it could change between plan/apply (provider config is ephemeral).
280281
unknownVal := tftypes.NewValue(echoTestSchema.ValueType(), map[string]tftypes.Value{

0 commit comments

Comments
 (0)