add addrs for action invocation

pull/37305/head
Daniel Schmidt 11 months ago
parent f7b176b59c
commit 016daf647e

@ -6,6 +6,8 @@ package addrs
import (
"fmt"
"strings"
"github.com/hashicorp/terraform/internal/tfdiags"
)
// Action is an address for an action block within configuration, which
@ -327,3 +329,22 @@ func (a ConfigAction) UniqueKey() UniqueKey {
type configActionKey string
func (k configActionKey) uniqueKeySigil() {}
// ActionInvocation describes the invocation of an action as part of a plan / apply.
type ActionInvocation struct {
TriggeringResource AbsResourceInstance
Action AbsActionInstance
TriggerIndex int
// TriggerBlockSourceRange is the location of the action_trigger block
// within the resources lifecyclye block that triggered this action.
TriggerBlockSourceRange *tfdiags.SourceRange
// ActionReferenceSourceRange is the location of the action reference
// in the actions list within the action_trigger block.
ActionReferenceSourceRange *tfdiags.SourceRange
}
func (a ActionInvocation) String() string {
return fmt.Sprintf("%s.%d.%s", a.TriggeringResource.String(), a.TriggerIndex, a.Action.String())
}

Loading…
Cancel
Save