API: Consider io.Reader/Writer instead of string when input/output may be large #321
Labels
thinking
More thinking or discussion needed before deciding on a course of action.
Milestone
Another "consider" issue to figure out before v1.0.0, though this one is fairly well approachable via experimentation.
Certain tfexec functions take the whole state as input or return it as output, currently:
func (tf *Terraform) Show(ctx context.Context, opts ...ShowOption) (*tfjson.State, error)
func (tf *Terraform) ShowStateFile(ctx context.Context, statePath string, opts ...ShowOption) (*tfjson.State, error)
func (tf *Terraform) StatePull(ctx context.Context, opts ...StatePullOption) (string, error)
The state being sometimes returned as
*tfjson.State
and other times as astring
, our first goal here should be to make the return type consistent.Other functions whose return values may be very large include:
func (tf *Terraform) Graph(ctx context.Context, opts ...GraphOption) (string, error)
func (tf *Terraform) ProvidersSchema(ctx context.Context) (*tfjson.ProviderSchemas, error)
func (tf *Terraform) Validate(ctx context.Context) (*tfjson.ValidateOutput, error)
We should investigate, and preferably add tests for, the possibility that very large inputs or outputs to these functions could cause problems. Return types should be adjusted accordingly.
The text was updated successfully, but these errors were encountered: