mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-24 16:10:46 -06:00
cb2e9119aa
Signed-off-by: namgyalangmo <75657887+namgyalangmo@users.noreply.github.com>
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
// Copyright (c) The OpenTofu Authors
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
// Copyright (c) 2023 HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package instances
|
|
|
|
import (
|
|
"github.com/zclconf/go-cty/cty"
|
|
)
|
|
|
|
// RepetitionData represents the values available to identify individual
|
|
// repetitions of a particular object.
|
|
//
|
|
// This corresponds to the each.key, each.value, and count.index symbols in
|
|
// the configuration language.
|
|
type RepetitionData struct {
|
|
// CountIndex is the value for count.index, or cty.NilVal if evaluating
|
|
// in a context where the "count" argument is not active.
|
|
//
|
|
// For correct operation, this should always be of type cty.Number if not
|
|
// nil.
|
|
CountIndex cty.Value
|
|
|
|
// EachKey and EachValue are the values for each.key and each.value
|
|
// respectively, or cty.NilVal if evaluating in a context where the
|
|
// "for_each" argument is not active. These must either both be set
|
|
// or neither set.
|
|
//
|
|
// For correct operation, EachKey must always be either of type cty.String
|
|
// or cty.Number if not nil.
|
|
EachKey, EachValue cty.Value
|
|
}
|