github.com/terramate-io/tf@v0.0.0-20230830114523-fce866b4dfcd/addrs/for_each_attr.go (about)

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: MPL-2.0
     3  
     4  package addrs
     5  
     6  // ForEachAttr is the address of an attribute referencing the current "for_each" object in
     7  // the interpolation scope, addressed using the "each" keyword, ex. "each.key" and "each.value"
     8  type ForEachAttr struct {
     9  	referenceable
    10  	Name string
    11  }
    12  
    13  func (f ForEachAttr) String() string {
    14  	return "each." + f.Name
    15  }
    16  
    17  func (f ForEachAttr) UniqueKey() UniqueKey {
    18  	return f // A ForEachAttr is its own UniqueKey
    19  }
    20  
    21  func (f ForEachAttr) uniqueKeySigil() {}