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

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: MPL-2.0
     3  
     4  package instances
     5  
     6  import (
     7  	"github.com/zclconf/go-cty/cty"
     8  )
     9  
    10  // RepetitionData represents the values available to identify individual
    11  // repetitions of a particular object.
    12  //
    13  // This corresponds to the each.key, each.value, and count.index symbols in
    14  // the configuration language.
    15  type RepetitionData struct {
    16  	// CountIndex is the value for count.index, or cty.NilVal if evaluating
    17  	// in a context where the "count" argument is not active.
    18  	//
    19  	// For correct operation, this should always be of type cty.Number if not
    20  	// nil.
    21  	CountIndex cty.Value
    22  
    23  	// EachKey and EachValue are the values for each.key and each.value
    24  	// respectively, or cty.NilVal if evaluating in a context where the
    25  	// "for_each" argument is not active. These must either both be set
    26  	// or neither set.
    27  	//
    28  	// For correct operation, EachKey must always be either of type cty.String
    29  	// or cty.Number if not nil.
    30  	EachKey, EachValue cty.Value
    31  }