mirror of
https://github.com/hashicorp/terraform.git
synced 2026-03-21 18:10:30 -04:00
27 lines
839 B
Go
27 lines
839 B
Go
// 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() {}
|