Expose Action Invocation conversion to Proto publicly

pull/38245/head
Mutahhir Hayat 3 months ago committed by Daniel Schmidt
parent f14581f27a
commit 547473364c

@ -26,8 +26,10 @@ import (
"github.com/hashicorp/terraform/version"
)
const tfplanFormatVersion = 3
const tfplanFilename = "tfplan"
const (
tfplanFormatVersion = 3
tfplanFilename = "tfplan"
)
// ---------------------------------------------------------------------------
// This file deals with the internal structure of the "tfplan" sub-file within
@ -410,7 +412,6 @@ func ActionFromProto(rawAction planproto.Action) (plans.Action, error) {
default:
return plans.NoOp, fmt.Errorf("invalid change action %s", rawAction)
}
}
func changeFromTfplan(rawChange *planproto.Change) (*plans.ChangeSrc, error) {
@ -1448,3 +1449,12 @@ func actionInvocationToTfPlan(action *plans.ActionInvocationInstanceSrc) (*planp
return ret, nil
}
// ActionInvocationToProto encodes an action invocation from its internal
// representation into the protobuf representation for persistence.
//
// This is a public wrapper around actionInvocationToTfPlan for use by
// external packages like stackplan.
func ActionInvocationToProto(action *plans.ActionInvocationInstanceSrc) (*planproto.ActionInvocationInstance, error) {
return actionInvocationToTfPlan(action)
}

Loading…
Cancel
Save