You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
terraform/internal/stacks/stackaddrs/targetable.go

28 lines
839 B

// Copyright IBM Corp. 2014, 2026
// SPDX-License-Identifier: BUSL-1.1
package stackaddrs
import (
"github.com/hashicorp/terraform/internal/addrs"
)
// Targetable is the stacks analog to [addrs.Targetable], representing something
// that can be "targeted" inside a stack configuration.
type Targetable interface {
targetableSigil()
}
// ComponentTargetable is an adapter type that makes everything that's
// targetable in the main Terraform language also targetable through a
// component instance when in a stack configuration.
//
// To represent targeting an entire component, place [addrs.RootModuleInstance]
// in field Item to describe targeting the component's root module.
type ComponentTargetable[T addrs.Targetable] struct {
Component AbsComponentInstance
Item T
}
func (ComponentTargetable[T]) targetableSigil() {}